I'm trying to implement Proactive Messaging with a MS Teams bot. According to the docs i have to get a conversationReference
before sending any message to the user so I implemented the onMembersAdded
event listener as follows:
class TeamsBot extends TeamsActivityHandler {
constructor() {
super();
this.onConversationUpdate(async (context, next) => {
this.addConversationReference(context);
});
this.onMembersAdded(async (context, next) => {
const membersAdded = context.activity.membersAdded;
for (let cnt = 0; cnt < membersAdded.length; cnt++) {
if (membersAdded[cnt].id !== context.activity.recipient.id) {
this.addConversationReference(context);
}
}
await next();
});
}
The problem is that I get notified only of the user that is installing the app even tough my Team (and channel) has plenty of members:
How do I get conversation references for every team member once the bot is installed?