Forum Discussion
yashgandhi
Oct 03, 2024Copper Contributor
How to get list of channels and members in teams bot
Hi, I’m working on building a Microsoft Teams bot and came across the TeamsInfo.getTeamChannels(turnContext, teamId) method in the BotBuilder SDK. Could you help clarify how it works? Speci...
- Oct 09, 2024The TeamsInfo.GetPagedMembersAsync(turnContext) method can be used in various activities, not just in onConversationUpdate. This method is designed to fetch a paginated list of members from a one-on-one, group, or team conversation. It is not limited to being set up in onConversationUpdate.
You can indeed utilize it in the onMessage handler or any other activity handler. When you pass the context received to GetPagedMembersAsync, it will provide the full list of members that are part of the team, not just the members involved in the specific conversation. This method is particularly useful for handling large teams, as it supports pagination to manage the retrieval of members efficiently.
Meghana-MSFT
Microsoft
yashgandhi - Could you please refer the below doc and sample.
yashgandhi
Oct 04, 2024Copper Contributor
Sorry it's not helpful ... everywhere docs are linked mostly incomplete and has no relevant info
I already mentioned i used that `turncontext` and u can see i received a response too but its has undefined as value also how to generate context token for teams rsc permissions .If you can provide me specific code or some snippet which i can follow else i am already fed up with Microsoft clueless support
I already mentioned i used that `turncontext` and u can see i received a response too but its has undefined as value also how to generate context token for teams rsc permissions .If you can provide me specific code or some snippet which i can follow else i am already fed up with Microsoft clueless support
- Meghana-MSFTOct 04, 2024Microsoft
yashgandhi - Approach to get the list of channels in a team is mentioned here in this section https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=dotnet#get-the-list-of-channels-in-a-team. The name of the default General channel is returned as
null
, are you getting undefined for general channel.Could you please let us know your RSC permission requirement, meanwhile we have few sample which use RSC.
Microsoft-Teams-Samples/samples/graph-rsc at main · OfficeDev/Microsoft-Teams-Samples (github.com)
- yashgandhiOct 05, 2024Copper ContributorYes channel name i changed to general 2 still it is returning undefined
Also i want to get list of channels proactive so i dont have turncontext. and when i generate token with rsc context it not work- yashgandhiOct 05, 2024Copper ContributorAfter lot of debugging the app u shared as an exmaple and the app i created have some difference in generated tokens. The toke i generated is missing in jwt token `roles:[Group.Selected]` now u know what could be i am missing so its not working ?