I have a bot written with the help of bot framework v4
. The bot is integrated with Microsoft Teams. I want to send a welcome message to the user when the user insta
I'm not sure of a way to force a ConversationUpdate
to be sent in the way you're attempting to. Instead, I'd just throw something like this in OnMessageAsync()
:
if (turnContext.Activity.Text == "fakeConversationUpdate")
{
var fakeTurnContext = new TurnContext(turnContext.Adapter, MessageFactory.Text(string.Empty));
fakeTurnContext.Activity.AsConversationUpdateActivity();
fakeTurnContext.Activity.Type = ActivityTypes.ConversationUpdate;
fakeTurnContext.Activity.MembersAdded = new List<ChannelAccount>()
{
new ChannelAccount()
{
Id = "fakeUserId",
Name = "fakeUserName"
}
};
await OnConversationUpdateActivityAsync(new DelegatingTurnContext<IConversationUpdateActivity>(fakeTurnContext), cancellationToken);
}
Then to debug, you just write "fakeConversationUpdate" (which you can change/customize) to the bot in chat and it will send your fakeTurnContext
(which you can change/customize) through OnConversationUpdateActivityAsync()