Reputation: 51
I have started implementing a microsoft bot and am simple trying to get the bot to echo the member email:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var replyText = $"Echo: {turnContext.Activity.Text}";
var memb = await TeamsInfo.GetMemberAsync(turnContext, turnContext.Activity.From.Id, cancellationToken);
await turnContext.SendActivityAsync(MessageFactory.Text(memb.Email, replyText), cancellationToken);
}
The call to GetMemberAsync() returns "Operation not found" in the bot emulator. I have taken the code as per the microsoft example. The bot works if I take out the call to GetMemberAsync() and echo back a hard coded string.
Can anyone suggest what I may be doing wrong here?
Upvotes: 1
Views: 334
Reputation: 1750
The TeamsInfo.GetMemberAsync method is part of Microsoft Teams bot APIs and It will work only inside the microsoft team (ms team) channel ( teams scoped conversations ). This never work inside the emulator.
Reference :
Upvotes: 2