Skip to content

Migrate from slacker to slack-sdk#228

Closed
jacobtruman wants to merge 7 commits into
scrapinghub:developfrom
jacobtruman:develop
Closed

Migrate from slacker to slack-sdk#228
jacobtruman wants to merge 7 commits into
scrapinghub:developfrom
jacobtruman:develop

Conversation

@jacobtruman
Copy link
Copy Markdown

@jacobtruman jacobtruman commented Dec 20, 2021

A newly created legacy bot token fails to authenticate using the older auth method used by the slacker module. The rtm.start method has also been deprecated, so migrated to rtm.connect. The slack-sdk module also provides blocks support.

Resolves #227.
Resolves #210.
Resolves #209.

@amuraru
Copy link
Copy Markdown

amuraru commented Dec 23, 2021

+1

Comment thread requirements.txt
amuraru added a commit to amuraru/slackbot that referenced this pull request Dec 23, 2021
Comment thread slackbot/slackclient.py Outdated
@amuraru
Copy link
Copy Markdown

amuraru commented Dec 23, 2021

@jacobtruman this is promising. I tested it with my own bot and encountered an issue though:

the bot enters an infinite loop due to rtm websocket disconnect:

2021-12-23 19:41:11,009 - slackbot.slackclient - WARNING - reconnected to slack rtm websocket
2021-12-23 19:41:16,020 - slackbot.slackclient - WARNING - lost websocket connection, try to reconnect now

Should we look into using the RTMClient instead?
https://slack.dev/python-slack-sdk/real_time_messaging.html#real-time-messaging-rtm

@jacobtruman
Copy link
Copy Markdown
Author

@jacobtruman this is promising. I tested it with my own bot and encountered an issue though:

the bot enters an infinite loop due to rtm websocket disconnect:

2021-12-23 19:41:11,009 - slackbot.slackclient - WARNING - reconnected to slack rtm websocket
2021-12-23 19:41:16,020 - slackbot.slackclient - WARNING - lost websocket connection, try to reconnect now

Should we look into using the RTMClient instead? https://slack.dev/python-slack-sdk/real_time_messaging.html#real-time-messaging-rtm

@amuraru good catch - is this something easily duplicated, so that I can properly test it?

Comment thread slackbot/slackclient.py
@jacobtruman
Copy link
Copy Markdown
Author

@jacobtruman this is promising. I tested it with my own bot and encountered an issue though:

the bot enters an infinite loop due to rtm websocket disconnect:

2021-12-23 19:41:11,009 - slackbot.slackclient - WARNING - reconnected to slack rtm websocket
2021-12-23 19:41:16,020 - slackbot.slackclient - WARNING - lost websocket connection, try to reconnect now

Should we look into using the RTMClient instead? https://slack.dev/python-slack-sdk/real_time_messaging.html#real-time-messaging-rtm

@amuraru I was able to duplicate this issue and added a ping to the parse user and channel data methods to prevent websocket disconnect. I am looking into implementing using RTMClient, but it looks like it might be a pretty hefty rewrite - I still think it is a good idea and am still experimenting with it.

@jacobtruman
Copy link
Copy Markdown
Author

closing in favor of #229 under feature branch

@jacobtruman jacobtruman closed this Jan 7, 2022
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

Successfully merging this pull request may close these issues.

response or reply with block message? rtm.start response is changing - appears to be a breaking one Any plan to change to rtm.connect() ?

2 participants