scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 395 forks source link

Slack channels.*, groups.*, im.*, & mpim.* APIs will stop working on Feb 24, 2021 #220

Open adibendahan opened 4 years ago

adibendahan commented 4 years ago

os/slacker uses im.open and it will stop working on Feb 24, 2021 according to this Slack announcement

Today we are announcing the deprecation of the methods that preceded the Conversations API (channels., groups., im., & mpim.). On February 24th, 2021 these methods will retire and cease functioning.

In order to continue support for this bot, replace the usage of os/slacker with official python-slackclient.

adibendahan commented 4 years ago

I can try to do it myself if there's demand for it. Hit the +1 if you're interested.

scottsue commented 4 years ago

Not exactly too sure if this is related. However I'm starting to see these errors, there were no issues with this last week so I suspect that Slack may have changed things on their side?

failed to handle message say hi to me with plugin "direct_hello" Traceback (most recent call last): File "/home/apps/chatops/rosie/lib/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler func(Message(self._client, msg), args) File "/home/apps/chatops/rosie/lib/slackbot/plugins/hello.py", line 63, in direct_hello message.direct_reply("Here you are") File "/home/apps/chatops/rosie/lib/slackbot/dispatcher.py", line 185, in wrapped return func(self, text, a, kw) File "/home/apps/chatops/rosie/lib/slackbot/dispatcher.py", line 274, in direct_reply channel_id = self._client.open_dm_channel(self._get_user_id()) File "/home/apps/chatops/rosie/lib/slackbot/slackclient.py", line 156, in open_dm_channel return self.webapi.im.open(user_id).body["channel"]["id"] File "/usr/local/lib/python3.6/site-packages/slacker/init.py", line 617, in open return self.post('im.open', data={'user': user}) File "/usr/local/lib/python3.6/site-packages/slacker/init.py", line 126, in post api, kwargs File "/usr/local/lib/python3.6/site-packages/slacker/init.py", line 102, in _request raise Error(response.error) slacker.Error: method_deprecated

scottsue commented 4 years ago

Just further to my comment above, it looks like there was an issue on the Slack side, things are working as usual now

dephekt commented 3 years ago

@adibendahan Did you get started on this migration already? If so and if you need some help, I'd be happy to pitch in. I have a bot I rely on that is built around slackbot and would love to avoid having to abandon my current project and find some other solution.

Edit: Disregard that. After further investigation it looks like this project has been superseded by the official Slack Bolt Python project, so I don't think it's worth the effort maintaining a community supported clone (which probably explains why no one is jumping at the opportunity to maintain slacker or slackbot). For anyone that needs this functionality, have a look at Bolt Python. It uses similar concepts like having decorators over handler functions to take actions on events or messages and is officially supported.

nhiguchi-stb commented 3 years ago

Today, my app using slackbot also stopped working...

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler
    func(Message(self._client, msg), *args)
slacker.Error: method_deprecated
mzanrosso commented 3 years ago

Today, my app using slackbot also stopped working...

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler
    func(Message(self._client, msg), *args)
slacker.Error: method_deprecated

me too...

[ERROR] - 2021-02-27 21:41:27,103 -     slackbot.dispatcher - : failed to handle message help with plugin "help" in /root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slackbot/dispatcher.py:57
Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler
    func(Message(self._client, msg), *args)
  File "/usr/src/slackbot/lib/plugins/basics.py", line 45, in help
    message.direct_reply(helpmessage)
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slackbot/dispatcher.py", line 185, in wrapped
    return func(self, text, *a, **kw)
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slackbot/dispatcher.py", line 274, in direct_reply
    channel_id = self._client.open_dm_channel(self._get_user_id())
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slackbot/slackclient.py", line 156, in open_dm_channel
    return self.webapi.im.open(user_id).body["channel"]["id"]
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slacker/__init__.py", line 617, in open
    return self.post('im.open', data={'user': user})
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slacker/__init__.py", line 124, in post
    return self._request(
  File "/root/.local/share/virtualenvs/slackbot-D-S5LRy0/lib/python3.8/site-packages/slacker/__init__.py", line 102, in _request
    raise Error(response.error)
slacker.Error: method_deprecated