New Slack Apps require 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.
Alternatively, you could migrate to slack-ruby-bot-server. Note that this requires more infrastructure to support the OAuth flow.
- Setup a new
slack-ruby-bot-server
project, following the guidelines. - Copy over the
SlackRubyBot::Commands::Base
orSlackRubyBot::Bot
concrete classes from yourslack-ruby-bot
project into the new project. If you used a sample app, copy them into thecommands
folder 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.