I'm starting to developp a bot for microsoft teams using microsoft bot builder sdk v4 and the extension for teams (v4 - beta1) in typescript (node.js), and I want to test him. For that, in local, I've dowloaded the bot framework emulator v4. I would try, for the begining, to make a simple echo bot, but with proactive answer, like that :
'''javascript
const teamsContext = TeamsContext.from(context);
const convRef = TurnContext.getConversationReference(context.activity);
const tenantId = teamsContext.tenant.id;
var text = "You said : " + context.activity.text + "\n memberId : " + context.activity.from.id + "\n memberName : " + context.activity.from.name +
"\n channelId : " + context.activity.channelId;
const members = adapter.getConversationMembers(context);
await adapter.createConversation(convRef, async (newContext) => {
await newContext.sendActivity(text + "\n" + JSON.stringify(members));
});
'''
But, when I try it on the emulator, I obtain this error : [onTurnError]: TypeError: Cannot read property 'tenant' of undefined. I suppose that the general context cannot be "translate" in a teams context because of the emulateur. Is it possible to test the bot without deploy it, like custom http request, or should I to deploy it ?