errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.13k stars 615 forks source link

Slack backend: no longer allows for creating user tokens, channels.create fails on bot token #1440

Closed mkj28 closed 10 months ago

mkj28 commented 4 years ago

I am...

I am running...

Issue description

Not sure how to phrase the ask here, maybe support a way to create channels on one of the currently Slack-supported methods?

Slack no longer allows for creating user tokens

with bot token getting:

  File "/usr/local/lib/python3.7/site-packages/errbot/backends/slack.py", line 1129, in create
    self._bot.api_call('channels.create', data={'name': self.name})
  File "/usr/local/lib/python3.7/site-packages/errbot/backends/slack.py", line 333, in api_call
    error=response['error'])
errbot.backends.slack.SlackAPIResponseError: Slack API call to channels.create failed: not_allowed_token_type

Steps to reproduce

  1. Create a classic app with legacy bot token per https://github.com/errbotio/errbot/issues/1402#issuecomment-663332878
  2. Try creating new room with:
    room = self.query_room("testroom")
    room.create()

    it fails with errbot.backends.slack.SlackAPIResponseError: Slack API call to channels.create failed: not_allowed_token_type

Additional info

If you have any more information, please specify it here.

nzlosh commented 4 years ago

The Slack API has deprecated calls channels.*. A pull request has been created to update errbot to call the new Slack API equivalent functions https://github.com/errbotio/errbot/pull/1438. You could test the PR with your bot token to see if it resolves the issue for you.