1
votes

I am seeing some odd behavior with some of the initial messages I see when I make first contact with my Azure Bot Service. Bot Service is written in C# and is available in the Bot Directory.

Here's the link to it: https://bots.botframework.com/bot?id=AppServiceDomainChecker

When you chat with it in Facebook Messenger, my initial "Hello"/Welcome message will display twice. If you chat with it on Skype or Microsoft Teams, sometimes the message will play. Sometimes it won't.

The initial run.csx code is here: https://github.com/MattTatoczenko/AppServiceDomainChecker/blob/master/messages/run.csx

The part I am referring to is in the ActivityTypes.ConversationUpdate one, which is supposed to be called when a new member is added to the chat.

Is there anything I can do to be sure this runs once and only once in all channels a user uses to talk with my bot?

1
This is the code used in the run.csx: var newMembers = update.MembersAdded?.Where(t => t.Id != activity.Recipient.Id); This is the default code given with the Basic Template when using the Bot Service. Seems like it checks for the Bot ID and doesn't add it to the members list. Any other suggestions?MattTatoczenko

1 Answers

2
votes

Looking at your code, you seem to be using some outdated code. It looks like the examples that were released in the old version 1. I have no issues so far using the newer way of dealing with this which is much cleaner, a little faster, and easier to use. I suggest you change your message controller to follow the conventions laid out here.