Is there any way to get user details whenever user uninstalls bot and bot is installed in personal scope only? - botframework

This is conversationUpdate event with membersRemoved object but that works only in the case when the bot is installed in a group and either the bot or member is removed from the group but I don't receive any callback when the bot is installed in personal scope and is removed later.

Unfortunately, there's no event/information sent on this at all from Teams. There's a new event in the bot framework (latest release) called "InstallationUpdate", which I was hoping would cover this, but that also doesn't send anything, at least not at the moment.

Related

How do you get a notification only teams bot to call the messaging endpoint after initial installation?

We have a notification only teams bot that is live for a number of customers in production.
Most of the time when it is installed it calls our messaging endpoint and updates the conversation ID so we can send teams notifications to our customers, however sometimes it seems to fail to do this for some reason so our systems don’t get a conversation ID.
We tried incrementing the version number of the teams bot and that didn’t seem to help.
Is there some way to get the conversation ID updated after initial installation?
Answer after contacting Microsoft Support is that it is impossible. The best solution is to have a non-notification only bot and then it works as you'd expect.

Teams proactive messages with uninstalled app

I'm trying to build a personal Teams bot which has to send proactive messages regularly. I made it work by storing the conversation when the user installed the app, just like the examples here. Now it works great, but I realized that I keep messaging users that have uninstalled my application. I can't seem to find any event that is triggered when a user uninstalls a personal scoped bot (app).
I tried conversation events, but nothing seems to be triggered for personal scoped bots at least.
I'm using the NodeJs botbuilder SDK.
Open to any suggestions, thanks.
To my knowledge, there is no such event unfortunately. I think you'll just receive a 403 at the moment without much info. This is due to change though - Microsoft just made an announcement about this yesterday in fact. See https://developer.microsoft.com/en-us/office/blogs/best-practices-and-updates-for-bot-lifecycle-events-in-microsoft-teams/ in the paragraph "Changes to post uninstall behavior for bots in personal scope":
Moving forward we’ll also align the post uninstall behavior for bots in the personal scope with the teams and groupChat scopes and you will not be able to send or receive messages after an app has been uninstalled. Your bot will receive a 403 response code to new messages posted by your bot. The 403 response code will have fields telling you the reason behind the it – which is either the app was uninstalled or the bot was blocked. We expect these changes to roll out in the coming few months.

How to send message to all the members of the group on Installing teams bot

I have created a teams bot and had a service written in .NET core to handle events and user's messages to reply accordingly.
When I install a bot in a group, I need to send personal message(one-to-one i.e between bot and the user) to all the members of that group on installation. I am trying to do that in OnConversationUpdateActivityAsync event handler (which gets fired when I install the bot). But in this event I am getting information of the user who is installing the bot, not the other members which are added in that group, also I am not getting any information of the channel(channelId and members etc.) in which the bot is getting installed.
Any different approach or solution will work.
Thanks in Advance.
You haven't said if you want the bot to message the users privately (like 1-1 between the bot and user) or just send each person a personal message inside the group chat, but in both cases, Proactive Messaging is your correct approach. If you want to send a message inside the group chat itself, see this sample.
If you want to send the users messages directly, 1-1, they need to have the bot installed as a personal app already. It's possible to do this automatically, but it's a bit more work, and requires Microsoft Graph. The proactive messaging is a bit different too - you get the list of members as per the previous sample, but see here for how to get the required 1-1 conversation details, and how to send the actual message. This last link also has documentation on how to get started, and some background reading (at the bottom of the page).
#Hilton is correct, You need to specify in which scope you want to notify user 1:1 or directly in Group chat?
App should be installed in user scope if notifying user on installation, You can proactively install the App in User/Group Chat/ team scope using Graph API. To notify users in Teams or Group chat, You can fetch the list of members using List conversation members API, When you install the App using Graph API Bot received converstionUpdate, You can save the conversationReference and use it for proactively notifying.

Microsoft Teams App added or removed from personal scope events missing

I try to write an app for Microsoft Teams which does include a Bot.
The bot should write a welcome message as soon as the app is installed by the user in his personal scope. Additionally I want to be informed when the user uninstalled an app.
There are events when a new user is added/removed to a team (onTeamsMemberAdded/onTeamsMemberRemoved) in which the bot is installed, but is there also something for the personal scope?
onTeamsMemberAdded should deal with personal scope as well, and it will enable you to send a welcome message. However, there is unfortunately no way to get notified when your bot is removed. onTeamsMemberRemoved only applies when your bot is part of a group chat, or channel, and only tells if other users have been removed. This is a missing feature in Teams right now.

Does a bot get notified when it's uninstalled from a tenant?

I'm testing out a bot right now via an uploaded custom (sideloaded) app. I can see that when I add the bot to a team or remove it from a team that I get an activity with a type of conversationUpdate with the bot's ID in the members added or members removed element.
Is there a specific activity or other event that the bot gets when it's removed from the tenant entirely? Do I just have to track all teams the bot was added to?
Teams does not yet have a well-defined concept of being added at the tenant level. We will be adding that in the first half of 2018.
In the meantime, yes, you have to track it on a team-by-team basis I'm afraid.

Resources