The new Slack Events API is fantastic, allowing you to ditch sockets and create bots over HTTP. However, these bots are lazy, never appearing “active” in Slack. Well it’s time to get those bots off the couch!
The only way for your bot to appear active in Slack currently is to connect over the Realtime Messaging API (RTM). You see, nobody puts the Events API in a corner.
Ok, we didn’t exactly “fix it”, it’s a bit of a stop gap for now until there’s an official solution from Slack. If you’re running on Beep Boop, you just need to drop in a module called beepboop-slapp-presence-polyfill like so:
You’ll also need to enable “Multi-Team Socket Mode” on your Beep Boop Project.
Behind the scenes this creates an RTM socket connection for each team that is essentially ignored, but provides us with an “active” status for our bot.