I can't seem to test if the message.channel is equal to so and so. I try printing the message.channel and it comes as "buffer_check" but if I try:
if message.channel == "buffer_check":
it always runs the else statement.
How would I check if the message is on a certain channel?
current code without client.run: https://hastebin.com/vedulawinu.py
you used = instead of ==, = is for assignments, while == is for comparison
No, I used the right symbol. I just made a small example for perspective on this issue.
python is a dynamically typed language. When things aren't working as you expect, try inspecting the types of the objects you are trying to compare, e.g. by printing them or using pdb
You might also find some of these resources useful for familiarizing yourself with python:
https://automatetheboringstuff.com/ (for complete beginners to programming)
https://learnxinyminutes.com/docs/python3/ (for people who know programming already)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
see also: http://www.codeabbey.com/ (exercises for beginners)
got it working by making it str(message.channel)
Most helpful comment
python is a dynamically typed language. When things aren't working as you expect, try inspecting the types of the objects you are trying to compare, e.g. by printing them or using pdb
You might also find some of these resources useful for familiarizing yourself with python:
https://automatetheboringstuff.com/ (for complete beginners to programming)
https://learnxinyminutes.com/docs/python3/ (for people who know programming already)
https://docs.python.org/3/tutorial/ (official tutorial)
http://python.swaroopch.com/ (useful book)
see also: http://www.codeabbey.com/ (exercises for beginners)