I’m trying to work through the beginner discord bot in Python video/instructional and I’m having a weird error. It seems that the messages from discord are triggering the code, but there is nothing in message.content. So replies based on content in a message doesn’t work.
I think everything else is set up because I can get message.id, and I can have the bot reply as long as it’s not a conditional format based off of the message content.
here’s the portion of the code in question:
async def on_message(message):
msg = message.content
print(msg) #a blank line is printed here
if message.author == client.user:
if message.content.startswith(‘j’): # this conditional will run if there is nothing
print(message.id) #between the apostrophes
quote = get_quote()
if any(word in msg for word in sad_words):
if you have any ideas why the messages are coming through empty, I’d really appreciate it!