japandotorg / Seina-Cogs

My public cogs for red.
https://seina-cogs.readthedocs.io/en/latest/
Other
13 stars 18 forks source link

[Captcha] Exception on join/leave #53

Open DJTOMATO opened 2 months ago

DJTOMATO commented 2 months ago

This error happens on a daily basis, can't tell if it's when a user leaves, or joins as i've seen it in both cases.


[2024-06-25 16:40:40] [ERROR] discord.client: Ignoring exception in on_member_join
 Traceback (most recent call last):
   File "/home/glas/redenv/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
     await coro(*args, **kwargs)
   File "/mnt/hdd/data/lenabot/cogs/CogManager/cogs/captcha/core.py", line 279, in on_member_join
     await self._captchas[member.id].delete()
   File "/home/glas/redenv/lib/python3.11/site-packages/discord/message.py", line 859, in delete
     await self._state.http.delete_message(self.channel.id, self.id)
   File "/home/glas/redenv/lib/python3.11/site-packages/discord/http.py", line 741, in request
     raise NotFound(response, data)
 discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

 [2024-06-25 16:54:52] [INFO] red.vrt.levelup.models: Creating backup of the config

 [2024-06-25 16:58:30] [ERROR] discord.client: Ignoring exception in on_raw_member_remove
 Traceback (most recent call last):
   File "/home/glas/redenv/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
     await coro(*args, **kwargs)
   File "/mnt/hdd/data/lenabot/cogs/CogManager/cogs/captcha/core.py", line 307, in on_raw_member_remove
     await self._captchas[member.id].delete()
           ~~~~~~~~~~~~~~^^^^^^^^^^^
 KeyError: 1254853289594458226
 [2024-06-25 16:58:40] [ERROR] discord.client: Ignoring exception in on_member_join
 Traceback (most recent call last):
   File "/home/glas/redenv/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
     await coro(*args, **kwargs)
   File "/mnt/hdd/data/lenabot/cogs/CogManager/cogs/captcha/core.py", line 276, in on_member_join
     for user_try in self._user_tries[member.id]:
                     ~~~~~~~~~~~~~~~~^^^^^^^^^^^
 KeyError: 1254853289594458226```