dairy
dairy

Reputation: 181

discord.py: bot doesn't recognize author

enter image description here

When I type !gamer in a channel, this is what the bot responds with

enter image description here

Although my username is Dairy#6166. To confirm that this is message.author, I had the program print message.author when the code ran:

enter image description here

Yet the bot still doesn't recognize me and says that I'm not Dairy.

Upvotes: 1

Views: 295

Answers (2)

Milad Sayadamooz
Milad Sayadamooz

Reputation: 11

You must use message.author.name instead of message.author in your condition phrase.

Upvotes: 1

LoahL
LoahL

Reputation: 2613

The problem with your code is that message.author returns a member object (docs on member object) which, if converted to a string (which is done when you print it) returns the name. So you need to check message.author.name == "Dairy#6166" instead of message.author == "Dairy#6166"

Also for future questions you might be asking on stackoverflow, please don't just screenshot your code, but copy and paste it to the question.

Upvotes: 1

Related Questions