Is there any event for bot that I can use every time it is added?

Copper Contributor

OnConversationUpdateActivityAsync / OnTeamsMembersAddedAsync .. It looks like this event is only triggered very first time..which means, in order to invoke this event again, I need to register the bot with new ID every time to see that event...So this is kinda inconvenient in development stage...

 

Is there any event that is triggered every time when the bot is added(even under same id)? 

 

Thanks, 

 

14 Replies
I noticed something like "OnInstallationUpdateActivityAsync" ..it sounds like this would trigger every time the bot is added...however, when I tried this, it wasn't triggered at all....hum.

Here is something I found on Internet.

 

--------------------------

clearab commented on Jan 17, 2020 •
A couple of things to add here:

The conversationUpdate event is sent in slightly different instances depending on context:

For a 1:1 conversation between the bot and a user (personal scope) the event is only sent the very first time the bot is installed. Technically, it is sent when the conversation is created between the bot and the user. If the user uninstalls the bot, this conversation is not deleted, so if the user then re-installs the bot the event is not sent.
For Group Chats and Channels the event will be sent each time the bot is installed. This is because each time the bot is uninstalled from this context, it is actually completely removed from the conversation, so an uninstall triggers the event.
An important distinction - the event is sent on a "best effort" basis. It is not 100% guaranteed to be sent, and is definitely not 100% guaranteed to be received. Outages and transient issues can affect the send (but they should be exceedingly rare).

---------------

 

So If I understood correctly, it sounds like this guy is saying that if the bot was installed under Team Channel, that conversationUpdate event is triggered.

 

Well..here is my manifest of my bot.

 

"bots": [
{
"botId": ...,
"scopes": [
"team",
"personal"
]
}
],

 

So my bot should support team and personal scope..so I tried to install my bot under team channel...and ..then reinstalled..however, conversationUpdate wasn't triggered. Somehow my understanding wasn't correct??

 

Only thing I am able to see is that the conversationUpdate event is triggered ONLY the bot is fully registered again with new guid....

 

 

Hi @firstteam, The teamMemberAdded event is sent to your bot if the bot is added to a conversation first time . If you want to reinstall the app first uninstall the existing app from team then again install the app into a team then you will get teamMemberAdded event.

BTW..Wow..Amazing...one that I've created bots(there are several due to testing)...I CANNOT find any interface that I could remove them... I went to admin page as well.....I don't see anything that I could remove the existing bots that I've created for testing..WOW...Is there any way I could remove possibly remove the bots I've created??

Hi @firstteam, Please go through this to remove apps in teams. 

 

That's not what I am asking.... I know how to uninstall the app. Under App Studio, there is Bot Management button. I don't see a way to delete option. I would like to clean this up, means I would like to remove some bots ...How do I do that?

Hi @firstteam, It's not possible to delete or uninstall a bot in teams. If you want you have to delete the app from azure portal. Go to Bot Management --> Existing bot registration --> Select the bot which you want to delete and click on App registration portal hyper link as shown in the below highlighted text in image and delete the bot from azure portal. 

Mamatha-MSFT_0-1621263071545.png

 

 

Ok. Thanks. BTW, I deleted some..however, I guess it takes time to propagate that info then??
When I clicked the Bot Management, I still see the bots that I've deleted in the dropdown list...So I guess it may take time to reflect. Am I correct?
Thanks. This really makes me crazy. Yes..once I re-installed then, ..then I see this event was triggered..However, at some point, for some reasons, I have no idea...this event wasn't triggered.... it is like random behavior...it is really killing me.
Just FYI,..never mind...that event just started triggering again...I have no idea. Nothing changed. Not sure what made this work again...Who knows at some point it wouldn't trigger??..Anyway..just FYI.

Hi @firstteam, Because of the cache issue it may not trigger the event some times. And make sure to uninstall all the previously installed apps with that Bot Id or App ID.  

Yes, I always make sure to uninstall every app that associated with that bot id because that is easier. The thing is that as you probably know, uninstalling is way easier than deleting and creating new bot(with new guid) every time for testing..I'll keep eye on it though. Thanks,

Ok...I think I found out y. Well..that cache could be an issue as well..However, one thing I noticed that.... even if you uninstalled the bot, the chat bot still is there under Chat section. So...if you ever blocked it for whatever reason testing, then...when you resinstalled the app, the event won't be triggered because that bot was basically blocked. So...you have to make sure that the bot under Chat should be unblocked. Ok. here is a question. I don't see there is a delete option under Chat...or uninstall...there is hide, but I don't think that would work..I guess that is just UI thing... Is there any way to make a sort of automatic way that I can unblock the bot whenever I uninstalled the app? Obviously, I could create new bot(new guid), but that is not my option at this point.
Thanks,

Hi @firstteam, Currently there is no option to block a bot in specific chat.