Answer the question
In order to leave comments, you need to log in
The bot should send a message to the chat when someone clicked on an emoji, how to do it?
I have been tormenting for an hour over the bot, it is necessary that when someone clicks on an emoji, it sends a message about this to a separate channel. Below is the code and it doesn't work.
here is my code:
@bot.event
async def on_reaction_add(reaction, user):
Channel = bot.get_channel(930870896107860031)
if reaction.message.channel.id == Channel:
if reaction.emoji == "\U0001F4B5":
my_channel = bot.get_channel(931423249210966056)
await my_channel.send("аааа")
Answer the question
In order to leave comments, you need to log in
on_reaction_add
called only when a message was sent while the bot was running (roughly)
https://discordpy.readthedocs.io/en/async/api.html...
Better use on_raw_reaction_add
https://discordpy.readthedocs.io/en/latest/ api.htm...
In the case of a on_raw_reaction_add(payload)
channel id, it is in payload.channel_id
Well, and such a condition is unlikely to work, you are trying to compare an object of the Channel class with a number. If you compare id - then compare ID, you do not need to get a channel in this case
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question