Microsoft Teams Bot not sending message Edit/Delete events to bot messaging endpoint - botframework

I set up an app using the App Studio within Teams and enabled a bot.
I set up the Messaging endpoint for the bot and am able to receive message and conversationUpdate events from the Teams client. This all works fine.
However, if I then edit a message in the Teams client, the messaging endpoint does not receive the text of the edited message at the messaging endpoint.
Similarly, if I delete a message, I do not receive an event indicating that a message has been deleted.
I'm wondering:
Is this expected behavior?
Is there somewhere these events have to be configured in order to receive them?
Is there an alternate way to integrate with Teams/BotFramework in order to receive these events?
Thanks!

Related

Azure Bot messaging endpoint does not get teamMemberRemoved event when the Bot App is removed from Teams

I created an Azure Bot and set the Messaging Endpoint to my web-app, which is not hosted on Azure.
I created a deploy package zip as a Teams App to be deployed on Teams and use my bot.
My messaging endpoint gets the ConversationUpdate events with membersAdded type when the customer adds my bot to Teams, and when users are added. The events are sent to the Messaging Endpoint configured in my bot.
When the customer deletes the App from Teams I do not get any event to the messaging endpoint.
According to https://techcommunity.microsoft.com/t5/microsoft-teams/which-event-fired-when-someone-uninstall-your-app-in-microsoft/m-p/1610299 I expected to get an event with type teamMemberRemoved to the bot messaging endpoint.
I need to know the Teams App was removed so I can clean up resources on my end, and indicate in my UI to the customer that the bot is no longer configured for his Teams team.
I tried adding and removing the App from my Teams account a few times but never got the expected event to the messaging endpoint.
How can I know that my App was uninstalled on a Teams team?
If you just want to know when the App is getting added or remove you can use OnInstallationUpdateAsync, here you will get the type installationUpdate and action as remove when it gets uninstalled.
I tried with onConversationUpdateAsync as well and got the request as . Please confirm once if you are handling it property,

Microsoft Teams no install event - can't send welcome message

Up until this Friday, MS Teams would always send a conversationUpdate event payload to our bot messaging endpoint whenever a user installed our app in Teams.
This stopped happening suddenly and now we only get a message when an app is added to a Team scope and not just personal scope.
Given that: how do we know to send a Welcome message via our bot to a user that installed our app if we receive no message, no payload. Nothing hits our bot messaging endpoint.

How to get a welcome message on teams even before user sends any message

I have deployed my bot on teams channel.
I would like to send a welcome message to a new user even before user sends a message to the bot.
can we achieve this for teams channel?
If yes, which event can be used to get that user is accessing bot for the first time.
You can use the ConversationUpdate event ActivityTypes.ConversationUpdate // in c#
When a bot is installed, your bot receives a conversationUpdate event. You can then send a proactive message to the user. Could you please try sending a proactive message and let us know if you face any issues?
The conversationUpdate event with the membersAdded object in the payload is sent when either a bot is added to a team or a new user is added to a team where a bot has been added. It is always a good practice to send a welcome message introducing the bot to all the users. Ensure that your bot responds to the conversationUpdate message, with the teamsAddMembers eventType in the channelData object. Also, keep in mind that the memberAdded ID is the bot's App ID itself, because the same event is sent when a user is added to a team.
Hope this helps.

How to make Slack Bot not respond to all the messages in the private group?

I want my bot to respond only if anyone mentions its name like #mybot.
How to achieve this?
For that you need to use the Events API and subscribe to the event app_metion.
That way your app will receive all message that directly mention your bot with #mybot.
Those messages will be sent as request from Slack to the endpoint provided for receiving events.

How do I receive only the messages that are direct messages to my bot user?

I have successfully setup my slack bot app, have enabled events etc. I want to receive any direct messages that the members of my slack team send to my bot. For this, I have only enabled Bot Events and No Team Events like below
However, I do not get any event on my webhook on this setting.
If I enable message.im event under Team Events, then I start getting events. But then, I get every message that the user (who has installed the app) sends to any other user in the team.
How do I get only the messages that are sent to my bot user?
Update 1
Based on this SO question I created a private channel with the bot user. Even then, the messages in the private channel do not arrive in my webhook with the above event subscriptions.
Update 2
After reinstalling the app, it seems to be working fine. I have only used it for few minutes after the reinstall so far. I will keep posting here how it goes. It would still be interesting to know what went wrong where.
It is normal behavior that your script receives all messages (for every channel your bot is a member of), not only the messages sent directly to your bot. At this time you can not filter further in the event configuration. So you need to filter out any unwanted message in your script handling the event.
See also this answer.

Resources