slack-ruby / slack-ruby-bot

The easiest way to write a Slack bot in Ruby.
MIT License
1.12k stars 187 forks source link

Migration to non-legacy bots #252

Closed dblock closed 4 years ago

dblock commented 4 years ago

The rtm integration is now legacy. See #251. What do we need to do to un-legacy a slack-ruby-bot?

voscarmv commented 4 years ago

I've prepared this google document to illustrate the trouble I ran into when trying to get a New Slack App to work with my Stackbot project

The document contains the sequence of steps I took to try to communicate with the new Slack API using my project. My Stackbot works fine with a Classic Slack App. However, it returns an error message when trying to communicate with a New Slack App.

There is some documentation for migrating classic apps apparently. However, it's beyond my skill set, and I probably won't have the time right now to go through the learning curve. I hope the information I've posted here at least helps as a starting point.

Cheers!

dblock commented 4 years ago

Thanks, this step-by-step guide explains clearly the issue in https://github.com/slack-ruby/slack-ruby-bot/issues/241. The newer bots require that you install them via oauth, which is what https://github.com/slack-ruby/slack-ruby-bot-server is about (which uses this library).

dblock commented 4 years ago

@voscarmv You can turn your bot project into one of those bots with a "add to slack" button fairly easily, then you don't have to do any of the token work by hand.

voscarmv commented 4 years ago

@dblock I'll check it out, thanks!

wasabigeek commented 4 years ago

Based on what I can tell from slack-ruby-server, the new OAuth token can be used as a drop-in replacement for the classic token, and it's valid till manually revoked (no refresh)? So the quick approach might be to ~migrate via Slack's UI and~ do the OAuth process manually to obtain the token, and then use that as SLACK_API_TOKEN 🤣

If we want to support the OAuth flow in this repo, then that means the user must:

On our end, maybe:

@dblock Is this what you were thinking of? Or was it something more along the lines of "how do I migrate from this to slack-ruby-server"?

dblock commented 4 years ago

@dblock Is this what you were thinking of? Or was it something more along the lines of "how do I migrate from this to slack-ruby-server"?

I think the latter, and/or some clarification in README to what people are supposed to do. One option is use slack-ruby-bot-server, another is roll out your own oauth (for which we don't have an example).