I am writing a discord bot. I have the following code:
@client.event
async def on_reaction_add(reaction, user):
print("on_reaction_add called")
@client.event
async def on_reaction_remove(reaction, user):
print("on_reaction_remove called")
# same problem if I remove this part
@client.event
async def on_raw_reaction_remove(payload):
print("on_raw_reaction_remove called")
However, if I start the bot and react to a event, then remove the reaction again, I see:
on_reaction_add called
on_raw_reaction_remove called
As you can see, on_reaction_remove
is never called. I must have the correct permissions since on_reaction_add()
works properly. This also means the message must be in the message cache, since otherwise on_reaction_add
would not work either. on_raw_reaction_remove
is still called, so it must have properly detected that I removed a reaction.
Note that even if I don't include the on_raw_reaction_remove
event I get the same problem.
Is there a problem with my code, is this a problem with discord.py or is there something I am not understanding?