Forum Discussion
YvanB
Oct 12, 2020Copper Contributor
TeamId is not always filled in OnTeamsMembersAddedAsync
Hello,
I have developed a bot for teams.
When a user install the bot on one of his channels, I want to save information about the channel (the TeamId and the TenantId)
But when OnTeamsMembersAddedAsync is called, the teamId is not always filled. And when it is missing, I have no way to get it via other properties.
For now, it seems a little random. Sometimes when I install the bot, the TeamId is filled sometimes not.
Is there a better way to "catch" those information ?
Is this a known issue?
Am I doing somethig wrong or ?
Thanks
- Rama-MSFT
Microsoft
- YvanBCopper Contributor
Thanks for the answer,
As there is several ways to get the teamId, I've implemented a method to get this information from the turnContext, teamInfo and the channelAccounts (I take the first non-null one).
Also as the OnConversationUpdateActivityAsync is just taking some information from the turnContext and then call the OnTeamsMembersAddedAsync method, I'm not sure I will get more information from this method.
I tried nonetheless and i've the same issue. The teamid is sometimes not in the turnContext