Kreusada / Kreusada-Cogs

Cogs for Red-DiscordBot
https://kreusadacogs.readthedocs.io/en/latest/
MIT License
30 stars 18 forks source link

[VoteChannel] Errors in on_message listener #182

Closed Kreusada closed 2 years ago

Kreusada commented 3 years ago

Cog

VoteChannel

Details

A problem with caching resulted in KeyError. There are also errors with channel.permissions_for.

Traceback details (if applicable)

Sep 06 15:08:56 ubuntu python[132525]: Traceback (most recent call last):
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
Sep 06 15:08:56 ubuntu python[132525]:     await coro(*args, **kwargs)
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/.local/share/Red-DiscordBot/data/kreusada/cogs/CogManager/cogs/votechannel/vote.py", line 150, in on_message_without_command
Sep 06 15:08:56 ubuntu python[132525]:     channel_perms = message.channel.permissions_for(message.guild)
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/channel.py", line 147, in permissions_for
Sep 06 15:08:56 ubuntu python[132525]:     base = super().permissions_for(member)
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/abc.py", line 525, in permissions_for
Sep 06 15:08:56 ubuntu python[132525]:     if overwrite.type == 'role' and roles.has(overwrite.id):
Sep 06 15:08:56 ubuntu python[132525]: AttributeError: 'dict' object has no attribute 'has'
Sep 06 15:08:56 ubuntu python[132525]: Ignoring exception in on_message_without_command
Sep 06 15:08:56 ubuntu python[132525]: Traceback (most recent call last):
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/redenv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
Sep 06 15:08:56 ubuntu python[132525]:     await coro(*args, **kwargs)
Sep 06 15:08:56 ubuntu python[132525]:   File "/home/ubuntu/.local/share/Red-DiscordBot/data/kreusada/cogs/CogManager/cogs/votechannel/vote.py", line 163, in on_message_without_command
Sep 06 15:08:56 ubuntu python[132525]:     settings = self.cache[message.channel.id]
Sep 06 15:08:56 ubuntu python[132525]: KeyError: 319066667315494934
Kreusada commented 2 years ago

I won't be fixing this.

dannymichel commented 2 years ago

I won't be fixing this.

should we delete the cog?