PyNerd
PyNerd

Reputation: 61

How to make a discord.py rewrite bot add emojis t its own message

Im trying to make a discord.py rewrite bot add a emoji to its own message but keeps adding emoji to the users message.

here is my code.

@client.event
async def on_message(message):
  if message.author.bot: 
    return
  if message.content.lower() == "hi":
    em=discord.Embed(description=f"Hello, {message.author.name}",color=discord.Colour.red())
    await message.channel.send(embed = em)
    for emoji in ('👋'):
        await message.add_reaction(emoji)

Upvotes: 1

Views: 111

Answers (1)

Ɓukasz KwieciƄski
Ɓukasz KwieciƄski

Reputation: 15689

Because message is the message that the user sent, not the bot.

msg = await message.channel.send(embed=em)
await msg.add_reaction('👋')

Upvotes: 1

Related Questions