Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification of MIGRATION.md #278

Closed
mr-exz opened this issue Jun 6, 2021 · 8 comments
Closed

Clarification of MIGRATION.md #278

mr-exz opened this issue Jun 6, 2021 · 8 comments

Comments

@mr-exz
Copy link

mr-exz commented Jun 6, 2021

As i understood from MIGRATION.md we have to migration application to OAuth but from Slack documentation they still allow create classic apps but they ask migrate app (bot) to granular permissions and thats it. In the bottom of that page they allow create classic app https://api.slack.com/legacy/oauth#flow.
https://api.slack.com/apps?new_classic_app=1

So recently i created new test classic app (bot) got api token xoxb- and migrated to granular permissions so all warnings disappear.

So my questions:

  • slack-ruby-bot will continue be developed ? (i will ask Slack because for me it is still not clear is that ok with xoxb tokens and without URL redirect, for me was much useful to use opened connection to Slack)
  • in case if i would still need migrate to slack-ruby-bot-server, how i can save current flow without additional nice features )
    • bot just have connection to slack
    • listen everything in channels
    • reply on messages @mybot help
@dblock
Copy link
Collaborator

dblock commented Jun 7, 2021

  • slack-ruby-bot will continue be developed ? (i will ask Slack because for me it is still not clear is that ok with xoxb tokens and without URL redirect, for me was much useful to use opened connection to Slack)

It will for as long as Slack supports RTM apps in any form or shape. I have half a dozen bots using it with hundreds of paying customers, and haven't had the energy to migrate them all, yet.

  • in case if i would still need migrate to slack-ruby-bot-server, how i can save current flow without additional nice features )
    • bot just have connection to slack

This is no longer necessary because events are sent by Slack to your bot. So there's no "connection" anymore. If you don't want 1-click "add to slack" install type of thing that is available to the public, you can probably just remove that functionality from your own bot. It would definitely be useful to have a way to do this more easily, too, PRs welcome.

    • listen everything in channels

If you set the right permissions (I am not sure exactly what permissions you need to listen to everything) it will just work.

    • reply on messages @mybot help

There's no no-pain solution here, but I tried to minimize the work required by writing https://github.com/slack-ruby/slack-ruby-bot-server-events-app-mentions which is sort of very close to the functionality of the slack-ruby-bot alone. It does reply to mentions.

See https://code.dblock.org/2020/11/30/migrating-classic-slack-ruby-bots-to-granular-permissions.html for lots of detail.

I'll close this, but feel free to add more questions!

@dblock dblock closed this as completed Jun 7, 2021
@mr-exz
Copy link
Author

mr-exz commented Jun 7, 2021

Got answer from Slack support.
Answer:

If you createed a classic app, get it working, then migrate to a granular app (and it all works), then you will be all set and won't need to do anything else !
In short, if you get your app working as a granular app, you will be as future proofed as you can be.

Basically flow will to migrate from really legacy bots:

  1. create classic app
  2. add bot features
  3. migrate to granular permissions
  4. add in workspace
  5. set xoxb- token for SLACK_API_TOKEN variable
  6. success

@dblock
Copy link
Collaborator

dblock commented Jun 7, 2021

@mr-exz I am confused why you'd want to do this and not create an app with granular permissions in the first place?

@mr-exz
Copy link
Author

mr-exz commented Jun 7, 2021

@dblock that is good question, when i create granular directly i got error about bad token not_allowed_token_type

@dblock
Copy link
Collaborator

dblock commented Jun 8, 2021

@dblock that is good question, when i create granular directly i got error about bad token not_allowed_token_type

Oh I see. You can't start an RTM client unless you have a legacy RTM token, even with granular permissions. Still, feels like you should just not be doing RTM at all.

@mr-exz
Copy link
Author

mr-exz commented Jun 8, 2021

it require many changes in application, so i need more time, thx for clarification will create separate task for myself to migrate from RTM

@mr-exz
Copy link
Author

mr-exz commented Jun 10, 2021

Answer from Slack Support
RTM is only available with Classic Apps, not New Apps so you won't be able to upgrade it to the latest granular permissions:

https://api.slack.com/rtm

We don't have plans to deprecate Classic Apps at this stage (no time frame) so you can still use them for now. However it is possible that this could change (you would receive a warning to then update before this happened though).

We recommend moving to Socket Mode if possible:

https://api.slack.com/apis/connections/socket

You can see a list of events that are supported in Socket Mode (Events API) vs RTM below. Anything not listed as Events API but shows as RTM is not possible with Socket Mode.

https://api.slack.com/events

@dblock
Copy link
Collaborator

dblock commented Jun 10, 2021

Oh socket mode is yet another thing! I opened slack-ruby/slack-ruby-bot-server#141 for that if anyone wants to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants