Limiting Teams Bot with RSC permission to a specific channel

Nishant 5 Reputation points
2024-10-24T19:28:20.83+00:00

Hello,

We have used Teams RSC permissions logic to avoid the need of calling the Teams bot (Based on Microsoft Bot SDK framework) with the @ handler.

The sample mentioned here was referred for getting this to work! https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-receive-channel-messages-withRSC/csharp

Now what we realise is that when the bot is installed to a Team with RSC permission, it can read all the message from all the channel of the Team and as an effect it is able to respond to all the channels when there is a post. Our requirement is, here we wanted to avoid this as we have multiple channels in a Team which are kept for different purposes. We want the bot to only answer to the channel that we intent to.

Currently it is unclear how to fetch the channels details dynamically where the bot application is installed, and use this detail to filter out those channels while bot is responding.

Is there any recommendation to fit our requirement where we wanted to limit the bot to respond to the channel only it is intended to in the RSC context?

Thank you,

N

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.