fullstackpython.com icon indicating copy to clipboard operation
fullstackpython.com copied to clipboard

Slackbot "working" but not responding to messages

Open vism2889 opened this issue 7 years ago • 4 comments

Hey Matt! Grateful for the tutorial, and have gotten everything "working" up until the end when i try to actually interact with the bot. At that point it doesn't respond to anything. I'm using python 3.5.0 and have copied and pasted your code exactly and followed the steps of the tutorial from start to finish (except for the bot_token and bot_id which i have swapped with my own) to ensure correctness. Even get the "StarterBot connected and running" message in my terminal after running the script. Thanks for your time!

vism2889 avatar May 02 '17 23:05 vism2889

i tried to mess around with some code, and i think the environment variable was the issue for some reason, after fiddling i got this Traceback:

Traceback (most recent call last): File "morgstarterbot.py", line 10, in AT_BOT = "<@" + BOT_ID + ">" TypeError: Can't convert 'NoneType' object to str implicitly

After the fact i replaced the environment variables with the actual TOKEN and ID and it has since been working like shown near the end of your tutorial. I guess my question at this point is, am i forgetting something when setting up the virtualenv. Thanks again for your time!

vism2889 avatar May 02 '17 23:05 vism2889

hey @vism2889 I haven't tested this code with Python 3.5, however I'm wondering about the BOT_ID. is the value properly set when your bot is running?

mattmakai avatar May 03 '17 00:05 mattmakai

I've changed the code this way: AT_BOT = "<@" + str(BOT_ID) + ">"

aweher avatar Nov 20 '17 13:11 aweher

does that work though? if your BOT_ID is None, that's a problem

mattmakai avatar Nov 20 '17 15:11 mattmakai