mattmakai / slack-starterbot

Python-powered simple starter Slack bot.
https://www.fullstackpython.com/blog/build-first-slack-bot-python.html
MIT License
197 stars 146 forks source link

Connection failed. #10

Open underrtow opened 6 years ago

underrtow commented 6 years ago

I've followed the guide and did all the actions but still recieve an error when trying to run a bot:

Traceback (most recent call last): File "c:\Bot\starterbot\lib\site-packages\slackclient\client.py", line 52, in rtm_connect self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs) File "c:\Bot\starterbot\lib\site-packages\slackclient\server.py", line 85, in rtm_connect raise SlackLoginError(reply=reply) slackclient.server.SlackLoginError Connection failed. Exception traceback printed above.

Any idea?

underrtow commented 6 years ago

Managed to work it around by removing (with_team_state=False):

But now receiving following error:

File "starterbot3.py", line 66, in command, channel = parse_bot_commands(slack_client.rtm_read()) File "c:\Bot\starterbot\lib\site-packages\slackclient\client.py", line 135, in rtm_read json_data = self.server.websocket_safe_read() File "c:\Bot\starterbot\lib\site-packages\slackclient\server.py", line 194, in websocket_safe_read data += "{0}\n".format(self.websocket.recv()) AttributeError: 'NoneType' object has no attribute 'recv'

glenak1911 commented 6 years ago

Did you ensure that you exported the SLACK_BOT_TOKEN environmental variable?

underrtow commented 6 years ago

I've managed to fix it by downgrading Python version - apparently there was some conflict between windows 10 and python 3.6.4 (if I remember well) around TCPIP

glenak1911 commented 6 years ago

Ah, understood. Good to know!