If a message is sent in a channel with autoreacts configured (e.g. #labpics in Homelab) and then very quickly deleted (e.g. in the case of a non-compliant #labpics post, quickly removed by the enforcer cog), the autoreact cog throws an exception when it can't find the message to react to.
To Reproduce
Steps to reproduce the behavior:
Send message in autoreact-configured channel
Delete it very quickly
See exception
Expected behavior
Error is caught and handled.
Screenshots
Additional context
[2023-05-16 09:26:31] [ERROR] discord.client: Ignoring exception in on_message
Traceback (most recent call last):
File "/home/redbot/.local/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "/redbot/data/cogs/CogManager/cogs/autoreact/autoreact.py", line 43, in on_message
await message.add_reaction(reaction)
File "/home/redbot/.local/lib/python3.11/site-packages/discord/message.py", line 1098, in add_reaction
await self._state.http.add_reaction(self.channel.id, self.id, emoji)
File "/home/redbot/.local/lib/python3.11/site-packages/discord/http.py", line 740, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message
Describe the bug
If a message is sent in a channel with autoreacts configured (e.g. #labpics in Homelab) and then very quickly deleted (e.g. in the case of a non-compliant #labpics post, quickly removed by the enforcer cog), the autoreact cog throws an exception when it can't find the message to react to.
To Reproduce Steps to reproduce the behavior:
Expected behavior
Error is caught and handled.
Screenshots
Additional context