简体   繁体   中英

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)

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM