Forum Discussion
TeamId is not always filled in OnTeamsMembersAddedAsync
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
Firstly, we have to add our application in to channel, and please add any member to the team, now you you will hit the "OnTeamsMembersAddedAsync" method. Now you will receive the teamsid in the ChannelData.
Could you please have a look on below sreenshot.
- YvanBOct 23, 2020Copper Contributor
Thanks for your answer,
I already get the teamsId from the channelData and my issue is not that I can't get the teamsId.
My issue is that sometimes , when the method OnTeamsMembersAddedAsync is called, I don't have the teamsId in the channelData.
It is hard to reproduce the issue. However what I know is that it can only happen when I install the bot to a channel.