Forum Discussion

yashgandhi's avatar
yashgandhi
Copper Contributor
Oct 03, 2024

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...
  • Meghana-MSFT's avatar
    Meghana-MSFT
    Oct 09, 2024
    The 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.

Resources