Adam Guy
Adam Guy

Reputation: 1

Trying to make a bot that sends a message for specific user ids

So I'm trying to make a bot that sends a message when somebody with a specific user id sends a message, but when I use it, it ends up spamming the message for every other user id, excluding the specific one. Here's my code.

@client.event 
async def on_message(message): 
  if message.author.id != 206883079837450241:
    await message.channel.send('example') 

Upvotes: 0

Views: 40

Answers (1)

12944qwerty
12944qwerty

Reputation: 2017

Switch the != with ==. != passes True only if the message's author is not yours. == does the opposite.

Upvotes: 2

Related Questions