microsoft-teamsazure-bot-service

Bot does not work with one-to-one chat messages in Microsoft Teams


We created a Custom App with Azure Bot that catches input from users (with RSC and without mentioning) and returns an Adaptive Card. The bot works well in Channels but it does not work in one to one chats. We also debugged the Bot and we do not get a hit when a user types in a chat but we do get a hit when the message is posted in a channel.

We did extend the app permissions by going into Teams Admin Center -> Mange Apps -> Clicked the App -> Permissions -> Review and approved the permissions. Then assigned the app to the proper users for testing.

Nothing seems to be working.

This is the manifest of the app.

enter image description here

We also created an App Registration for the Bot in Azure and added these API Permissions.

enter image description here

Then in Teams Admin Center we consented to all these permissions as your reply indicated. Still, the Bot receives only messages posted in Channels and not between users on one-to-one chats.

enter image description here


Solution

  • Based on the comments history in the OP, it's clear the main challenge is in a 'group chat' scenario - in that specific case, the bot isn't receiving the message. For this, see the following doc: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/channel-and-group-conversations?tabs=dotnet

    Specifically:

    Bots in a group or channel only receive messages when they're mentioned @botname. They don't receive any other messages sent to the conversation. The bot must be @mentioned directly. Your bot doesn't receive a message when the team or channel is mentioned, or when someone replies to a message from your bot without @mentioning it.

    The "Note" section just below this is important as well though:

    RSC for all chat messages is available only in public developer preview.

    and also

    Using resource-specific consent (RSC), bots can receive all channel messages in teams that it's installed in without being @mentioned. For more information, see receive all channel messages with RSC.