Slack Migrations
December 4, 2020 ยท View on GitHub
Migrating Classic Slack Ruby Bots to Granular Permissions
As of December 4th, 2020 Slack no longer accept resubmissions from apps that are not using granular permissions, or so-called "classic apps". On November 18, 2021 Slack will start delisting apps that have not migrated to use granular permissions.
This library implements real-time support for classic apps. You should not be building a new bot with it and use slack-ruby-bot-server-events instead. For a rudimentary bot you can even start with slack-ruby-bot-server-events-app-mentions.
See slack-ruby-bot-server#migrating for help with migrations.
Migrating from Really Old Legacy API Tokens
Slack Apps since around 2018 required authentication via OAuth, returning an access token that should be a drop-in replacement for SLACK_API_TOKEN. As of the time of writing, the tokens never expire, so you could potentially write your own OAuth flow to retrieve the access token separately.
We recommend you migrate to slack-ruby-bot-server that supports the OAuth flow and subsequently to slack-ruby-bot-server-events to handle Slack events with granular permissions.
Migrating to slack-ruby-bot-server
- Setup a new
slack-ruby-bot-serverproject, following the guidelines. - Copy over the
SlackRubyBot::Commands::BaseorSlackRubyBot::Botconcrete classes from yourslack-ruby-botproject into the new project. If you used a sample app, copy them into thecommandsfolder and require it incommands.rb. - Create a Slack Button, setting the redirect URL to your OAuth grant endpoint. In the sample app, this would be
<ROOT_URL>/api/teams. - Run your app and authenticate with the Slack button.
NOTE: By default, other teams would be able to authenticate and connect their workspaces using the same Slack button. If this is not what you want, you would need to prevent it.