5

I have created a bot using Bot framework V4 and hosted in Teams.

My bot is available for all the users in the organization.

I want to know if someone blocked the bot.

Is there any API or any event from the bot to know the user ID if the Bot has been blocked?

Thanks in Advance

Dana V
  • 1,327
  • 1
  • 5
  • 10
Krishna089
  • 101
  • 20

1 Answers1

0

I'm still testing this, so not sure if it really works, but I think if the user has uninstalled an app, then trying to get the "conversation members" will fail, whereas it would succeed otherwise. Code is something like this (C#):

ConnectorClient connector = new ConnectorClient(new Uri(serviceUrl), appId, appSecret);

MicrosoftAppCredentials.TrustServiceUrl(serviceUrl);

var members = connector.Conversations.GetConversationMembersAsync(userConversationId).Result;

That might only work if they're -uninstalled- the app though, versus -blocked- the bot, but it's easy enough to test (I won't have a chance today though).

Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24