Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to capture replies to a bot's message in a Microsoft Teams Channel without mentioning the bot? #1355

Open
purvasanap2001 opened this issue Aug 1, 2024 · 10 comments
Assignees

Comments

@purvasanap2001
Copy link

I have developed a message extension bot app for Microsoft Teams and I want to capture replies to a message posted by the bot in a Teams channel without requiring users to mention the bot directly.
I am using Node.js and TypeScript for my bot.
The bot is registered in the azure portal.
I want to capture replies to this message without users needing to mention the bot. How can I achieve this?

I have gone through document. As mentioned in it, I cannot see the ChannelMessage.Read.Group and ChatMessage.Read.Chat permissions in both the application and the delegate permissions in azure portal. I have tried using ChannelMessage.Read.All and ChatMessage.Read.All, but it is not working. https://techcommunity.microsoft.com/t5/teams-developer/how-to-capture-replies-to-a-bot-s-message-in-a-microsoft-teams/m-p/4199233/highlight/true#M10455
Could you please provide further guidance on how to resolve this issue?

Any guidance or examples would be greatly appreciated!

@Nivedipa-MSFT
Copy link
Contributor

Nivedipa-MSFT commented Aug 2, 2024

@purvasanap2001 - Thanks for reporting your issue. You have to add ChannelMessage.Read.Group and ChatMessage.Read.Chat permissions in app manifest not in azure portal.

image

Please follow the steps to capture replies to a bot's message in a Microsoft Teams Channel without mentioning the bot in the documentation below: Receive all conversation messages

please let us know if you have any further query here?

@purvasanap2001
Copy link
Author

purvasanap2001 commented Aug 2, 2024

@Nivedipa-MSFT , I added the necessary configuration to the manifest.json file and uploaded the manifest to the channel. However, it is not working. When I attempt to send a reply without mentioning the bot, it does not trigger the onMessageActivity method.

"webApplicationInfo": {
     "id": [BOT_ID],
     "resource": "https://Anystring"
 },
 "authorization": {
     "permissions": {
         "resourceSpecific": [
             {
                 "type": "Application",
                 "name": "ChannelMessage.Read.Group"
             },
             {
                 "type": "Application",
                 "name": "ChatMessage.Read.Chat"
             }
         ]
     }
 }

@purvasanap2001
Copy link
Author

@Nivedipa-MSFT can you please update on this?

@purvasanap2001
Copy link
Author

@sayali-MSFT, can you please help on this?

@Nivedipa-MSFT
Copy link
Contributor

@purvasanap2001 - Could you please verify the id and resource fields in the webApplicationInfo section are correctly configured? The id should be the bot's ID, and the resource should be a valid URL.

@purvasanap2001
Copy link
Author

@Nivedipa-MSFT , Could you please help me understand what the valid URL should be? According to the documentation the webApplicationInfo.resource can be any string.

@purvasanap2001
Copy link
Author

@Nivedipa-MSFT /@sayali-MSFT, Please help on the above query.

@Nivedipa-MSFT
Copy link
Contributor

@purvasanap2001 - Yes, you are correct. The webApplicationInfo.resource can be any string.
We have tested bot-receive-channel-messages-withRSC sample and it's working fine at our end.
We are able to capture replies to this message without users needing to mention the bot and it does trigger the onMessageActivity method.

Video:

RSC_Recording.mp4

Could you please test bot-receive-channel-messages-withRSC sample and check again?

@purvasanap2001
Copy link
Author

@Nivedipa-MSFT , I encountered this issue because I uploaded a new manifest without removing the previous app, which prevented the new manifest from overriding the old one. After removing the previous app and then uploading the new manifest, everything worked as expected.

@Nivedipa-MSFT
Copy link
Contributor

@purvasanap2001 - Glad to hear that it's working for you. Could you please share your valuable feedback via Microsoft Teams Developer Community Response Feedback link?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants