pycord icon indicating copy to clipboard operation
pycord copied to clipboard

get_desynced_commands() fix not working

Open Revnoplex opened this issue 4 years ago • 5 comments

Summary

this issue was apparently fixed in one of the latest commits but the same error occurs

Reproduction Steps

create a bot that uses sync_commands()

Minimal Reproducible Code

@commands.Cog.listener()
    async def on_connect(self):
        print(f"Logged on as\033[1;92m {self.client.user}")
        await self.client.register_commands()

Expected Results

load commands correctly and expect the following line: cmd_vals = [val.get(opt, MISSING) for val in as_dict[check] if check in as_dict] to not error

Actual Results

the line still give the following error: KeyError: 'options' full traceback: Ignoring exception in on_connect Traceback (most recent call last): File "/bot-directory/venv/lib/python3.10/site-packages/discord/client.py", line 352, in _run_event await coro(*args, **kwargs) File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 1040, in on_connect await self.sync_commands() File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 552, in sync_commands registered_guild_commands[guild_id] = await self.register_commands( File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 419, in register_commands desynced = await self.get_desynced_commands(guild_id=guild_id) File "/bot-directory/venv/lib/python3.10/site-packages/discord/bot.py", line 285, in get_desynced_commands cmd_vals = [val.get(opt, MISSING) for val in as_dict[check] if check in as_dict] KeyError: 'options'

Intents

defaults, members, presences

System Information

  • Python v3.10.1-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b4
  • aiohttp v3.8.1
  • system info: Linux 5.13.0-27-generic #29~20.04.1-Ubuntu SMP Fri Jan 14 00:32:30 UTC 2022

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.
  • [X] I have removed my token from display, if visible.

Additional Context

this appears to possibly be a something different and not a duplicate.

update: possibly a duplicate due to the other simular issue being re-opened

Revnoplex avatar Feb 04 '22 22:02 Revnoplex

Can repro on v2.0.0b4 Debian 11.

Miolus avatar Feb 05 '22 10:02 Miolus

Seems like beta 4 release fixed this.

Miolus avatar Feb 12 '22 20:02 Miolus

Also can be reproduced on v2.0.0b4 Ubuntu 18.04 LTS.

rohitp30 avatar Feb 14 '22 21:02 rohitp30

this error no longer occurs for me on the latest commit

Revnoplex avatar Feb 14 '22 23:02 Revnoplex

this is confirmed to be fixed in #941

Revnoplex avatar Feb 16 '22 00:02 Revnoplex