Open gugglegum opened 6 years ago
Instead of throwing an exception, I think it would be better to check periodically (using a react loop timer) if the bot is still online and re-connect automatically. To detect disconnections, we can use ping/pong messages specified in the Slack RTM protocol. https://api.slack.com/rtm Section "Ping and Pong"
I am busy at the moment so any help will be very welcome 😃
This is likely due to this change, maybe it was acting as a keepalive.
RTM API Presence is now only available via subscription. As of January 2018, presence_change events are not dispatched without presence subscriptions established with presence_sub. Relatedly, current user presence status is no longer communicated in rtm.start.
https://api.slack.com/docs/presence-and-status#presence
I've used this bot for a while and only recently would it disconnect frequently :(
The bot loses connection sometimes and does nothing with it. In slack chat (web-)application slackbot user just become with gray circle (offline). But the script continues to run, need to be killed and restarted. Isn't there a way to force the bot to check is connection alive and throw an exception if not?
The code (excepting code of commands and config):