I'm currently trying to send a proactive message with my Microsoft Teams bot by using the following example code that I see online:
var address =
{
channelId: 'msteams',
user: { id: userId },
channelData: {
tenant: {
id: tenantId
}
},
bot:
{
id: appId,
name: appName
},
serviceUrl: session.message.address.serviceUrl,
useAuth: true
}
var msg = new builder.Message().address(address);
msg.text('Hello, this is a notification');
bot.send(msg);
The only change made is that I use TeamsMessage instead of a regular Message because I get errors saying that Message isn't a class which has also confused me. The problem when I run the code is that it tells me that my bot doesn't have a function named 'send'. My bot extends the TeamsActivityHandler class. My question is how do I fix this issue?