Reputation: 13
I want to have my discord bot respond every time a specific user sends a message in the chat. The code runs but nothing happens when that user sends a message.
This is what I have tried so far:
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.author.id == '546474118711869440':
await message.channel.send('shhhhh')
Upvotes: 0
Views: 2504
Reputation: 101
It's in a string. You have to put the user id as an int, so no quotes.
if message.author.id == 546474118711869440:
await message.channel.send('shhhhh')
Upvotes: 1