AAA3A-AAA3A / AAA3A-cogs

Many cogs for Red-DiscordBot.
https://aaa3a-cogs.readthedocs.io/en/latest
Other
35 stars 28 forks source link

[Sudo] `AttributeError: 'Context' object has no attribute 'interaction'` on dpy1. #17

Closed batman202012 closed 2 years ago

batman202012 commented 2 years ago

What cog is this bug report for?

Sudo

Describe the bug

Sudo fails to run the command on dpy 1.7 because the check for ctx.interaction is None causes an exception.

If there's an error, paste it here

Sep 21 22:42:13 tpun bash[5652]: Ignoring exception in on_message
Sep 21 22:42:13 tpun bash[5652]: Traceback (most recent call last):
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
Sep 21 22:42:13 tpun bash[5652]:     await coro(*args, **kwargs)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/redbot/core/events.py", line 354, in on_message
Sep 21 22:42:13 tpun bash[5652]:     await bot.process_commands(message)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/redbot/core/bot.py", line 1523, in process_commands
Sep 21 22:42:13 tpun bash[5652]:     await self.invoke(ctx)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
Sep 21 22:42:13 tpun bash[5652]:     await ctx.command.invoke(ctx)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/redbot/core/commands/commands.py", line 818, in invoke
Sep 21 22:42:13 tpun bash[5652]:     if not await self.can_run(ctx, change_permission_state=True):
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/redbot/core/commands/commands.py", line 444, in can_run
Sep 21 22:42:13 tpun bash[5652]:     ret = await super().can_run(ctx)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1087, in can_run
Sep 21 22:42:13 tpun bash[5652]:     return await discord.utils.async_all(predicate(ctx) for predicate in predicates)
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/redenv/lib/python3.9/site-packages/discord/utils.py", line 350, in async_all
Sep 21 22:42:13 tpun bash[5652]:     elem = await elem
Sep 21 22:42:13 tpun bash[5652]:   File "/home/discord/.local/share/Red-DiscordBot/data/tpun/cogs/CogManager/cogs/sudo/sudo.py", line 69, in pred
Sep 21 22:42:13 tpun bash[5652]:     if ctx.command.parent is not None and ctx.command.parent.qualified_name == "Sudo":
Sep 21 22:42:13 tpun bash[5652]: AttributeError: 'Context' object has no attribute 'interaction'
AAA3A-AAA3A commented 2 years ago

Hello, Thanks for reporting it. I will fix tonight. Have a nice day, AAA3A