0
votes

I am trying to react to my bot own messages. But it does not work.

    if args[0] == "solido":
        reaction = "????"
        sent = await ctx.message.channel.send(client.get_channel("795387716967333889"), embed=embed)
       # await message.add_reaction(sent, emoji = "\U0001F44D")
        await ctx.message.add_reaction(reaction)

if I use this type of code, the bot will react to MY message commands. But if i dont use the ctx method the bot will give me this error: NameError: name 'message' is not defined

How could I fix?

1
You want your bot to react under its message and not yours? - Maxsc
Yes, i want the bot react to its message - Marco Chinellato

1 Answers

1
votes

using await sent.add_reaction(reaction) instead of await ctx.message.add_reaction(reaction) should work