Microsoft bot framework tip: mind the mentions


As you know, the Microsoft bot framework is mutli-channel, therefore, when users start talking to a bot from Teams, they may mention it in order to interact with your bot.

So far so good but you should mind the mention as it it sent to your bot on the form:

<at>bot name</at>

meaning that if you leave it “as is” and if you’re using LUIS behind the scenes, your bot will suddenly misunderstand a lot of things. Therefore, make sure to remove the mentions as your first coding action:

activity.Text = Regex.Replace(activity.Text, "<at>.*</at>", "", RegexOptions.IgnoreCase).Trim();

Happy coding!


About Stephane Eyskens

Office 365, Azure PaaS and SharePoint platform expert
This entry was posted in Azure and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s