Slack event for when a bot authorization is removed - slack

I'm building a Slack app that works across workspaces. I'm using the app_uninstalled event to update my database when a workspace uninstalls the app, but I can't figure out how to handle when a user removes the bot authorization from the app Settings page.
When this happens, the app is effectively uninstalled, but I need my app to get notified when this happens. I've tried the tokens_revoked event, but it's not being sent.
The short course: I'd like my app to get notified when the trash can icon (in the image down there) is clicked. Thank you!

As far as I've worked with the slack events APIs, tokens_revoked is the method which is triggered when a user clicks the trash-bin you are talking about and confirms the action. I've just confirmed it a few minutes ago as I'm also facing a similar (not same) issue.

Related

Teams freezes when user clicks on "task/invoke" button

We have a published app in the Teams App Store.
Our app supports task module.
It worked just fine but about a month ago we started to receive reports from our costumers that when they are trying to open a task module, teams app just freezes.
This is how i understand task module requests work, in 4 steps:
1. User clicks on the button with data {"msteams": {"type": "task/fetch"}}`,
2. Teams sends request with this data to the bot.
3. Bot handles the data.
4. Bot replies with the appropriate url to render.
So we tested what happens when we click on the task/fetch button.
First of all we saw an error in the teams console:
TaskModuleLaunchService: launchTaskModuleByInvoke failed: "could not find app definition for app 00000000-0000-0000-0000-000000000000" where *00000000-0000-0000-0000-000000000000* is out appID.
And we don't receive any requests from the teams on the bot's side. So basically we have an issue on the step #1.
Unfortunately, we couldn't reproduce this on our devices, using the same card with the exact same button.
How can we fix this? Any help would be appreciated.
Thanks in advance.

Navigate User from slack channel to app home tab

I am working on a slack app that can be installed in any channel. It is possible or is there any slack method that allows you to open the slack app home tab from the channel. I mean a method that can navigate the user from the channel to the slack app home-tab
Send a slack message to users with #appname. For example "Click here to open the #ACME Dashboard" (assuming "ACME Dashboard" is the name of your app). #ACME Dashboard will turn into a clickable link that jumps to the app home page. It'll also add the app for users that haven't already added the app.
At least, this worked for me in limited testing with myself and one other person, so I hope it works for you. I haven't tried to figure it out, but I'm sure there's a way to send the '#app name' as part of a message from the API.

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.

Slack Events API / RTM: New app installed realtime notification

Is it possible to get a slack event or real time message indicating that a new app was installed in a workspace? I can figure out apps which use "bot users" by listening for team_join event. But how can i find out in near realtime about apps installed that don't have a bot user. My use case is to present something to the user when a new app is installed (as soon as possible. I can find out apps from team logs but thats not realtime).
What you're doing with the team_join event is basically all you can do. And that's going to rely on either the app having a bot user, or it being a workspace app (https://api.slack.com/slack-apps-preview), which creates an app user.
Other than that, nothing is exposed in the Events API around app installation. The other alternative is to connect up via the RTM API and watch for the bot_added and commands_changed events. That should catch most apps.

Adding Facebook Messenger channel trigger a JS bug in the "My Bots" page

I've tried to add a Facebook Messenger channel to one of my bots. I've entered e app/page ID, app secret and page token of my FB app and page (that, BTW, I use in another bot).
Everything checked out: after hitting "Resubmit" in https://facebook.botframework.com/Dev, I got the success message
Credentials have been validated.
However, when clicking on
"I'm done configuring Facebook Messenger"
button and going back to my bot page, everything between the Bot Framework Preview and the 'contact us' footer is gone.
I did some debugging and found that in all.js?v=121 the code should be updated to if (aa && aa.length>0) to account for HtmlLink without <a> tag.
Any ideas if there are workarounds?
Thanks!
We had this problem two days ago, but have since resolved it. If it's not resolved for you, let us know as your scenario might be different.

Resources