Oct 12 2020 02:24 AM
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
Oct 13 2020 01:38 AM
Oct 13 2020 02:22 AM - edited Oct 13 2020 08:42 AM
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
Oct 23 2020 05:13 AM
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.
Oct 23 2020 05:25 AM
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.
Nov 16 2020 03:24 AM
@YvanB :
Hi YvanB,
When ever you don't find the teamsId in the channelData. Can you try re-installing the bot within the team and re-triggering the event, this should fix the issue.