#onReactionAdd event Throws errors

1 messages · Page 1 of 1 (latest)

unreal tapir
#

Explanation of the Situation:
I'm listening for reactionEvents for a specific emoji however like so:

@interactions.listen(
    event_name = interactions.events.MessageReactionAdd)
    async def OnEmojiReaction(self, reactionEvent : interactions.events.MessageReactionAdd):
            if reactionEvent.reaction.emoji == SomeEmoji:
                do something 

This works. Thats not the issue however I get constant errors of missing permissions that litter up my console.. I've tried putting the content of the function in a try and catching any exception but it doesn't fix it

lament flaxBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

unreal tapir
#
future: <Task finished name='Task-10112337' coro=<ReactionEvents._on_raw_message_reaction_add() done, defined at /home/container/.local/lib/python3.11/site-packages/interactions/api/events/processors/reaction_events.py:66> exception=HTTPException: 403|Forbidden || Missing Access>
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/events/processors/reaction_events.py", line 68, in _on_raw_message_reaction_add
    await self._handle_message_reaction_change(event, add=True)
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/events/processors/reaction_events.py", line 56, in _handle_message_reaction_change
    message = await self.cache.fetch_message(event.data.get("channel_id"), event.data.get("message_id"))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/client/smart_cache.py", line 385, in fetch_message
    data = await self._client.http.get_message(channel_id, message_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_requests/messages.py", line 96, in get_message
    result = await self.request(
             ^^^^^^^^^^^^^^^^^^^
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 450, in request
    await self._raise_exception(response, route, result)
  File "/home/container/.local/lib/python3.11/site-packages/interactions/api/http/http_client.py", line 466, in _raise_exception
    raise Forbidden(response, response_data=result, route=route)```
#

Ive tried catching specific errors like so:

    # some code 
  except(interactions.errors.HttpException, interactions.errors.Forbidden ...)```
#

but it still throws these exceptions

#

again for clarity my code works it does whatever the function tells it to do with no issues but for some weird reason I get these random error messages

#

I've tried limiting it to messages sent only by the bot and reactions placed on said messages but end result is the same thing

sleek panther
#

The error isn't coming from your code. Per the traceback; for some reason the bot is forbidden from fetching the associated message

#

Hence why you can't handle it with try-except. The bot is just logging something went wrong processing it