Gorialis / jishaku

A debugging and testing cog for discord.py rewrite bots.
https://jishaku.readthedocs.io/en/latest/
MIT License
532 stars 172 forks source link

jsk sync command broken on dpy master #233

Open Ken-Miles opened 1 month ago

Ken-Miles commented 1 month ago

Summary

The sync command is broken when using the master version of discord.py (and soon discord.py 2.4).

Reproduction steps

Use the master branch of discord.py: discord.py @ git+https://github.com/Rapptz/discord.py@08b138cc71fea5594c068082ee565a05cde2c7fa

Attempt to sync

Expected results

The syncing of my command tree

Actual results

The sync command errors, giving the following traceback:

Ignoring exception in command jishaku sync:
Traceback (most recent call last):
  File "/home/me/bot/.venv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/j/bot/.venv/lib/python3.11/site-packages/jishaku/features/management.py", line 242, in jsk_sync
    payload = [command.to_dict() for command in slash_commands]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/j/bot/.venv/lib/python3.11/site-packages/jishaku/features/management.py", line 242, in <listcomp>
    payload = [command.to_dict() for command in slash_commands]
               ^^^^^^^^^^^^^^^^^
TypeError: Command.to_dict() missing 1 required positional argument: 'tree'

Checklist

System information

JSK 2.5.2 discord.py @ git+https://github.com/Rapptz/discord.py@08b138cc71fea5594c068082ee565a05cde2c7fa

Ken-Miles commented 1 month ago

Right after posting this, I found a PR that supposedly fixes this: https://github.com/Gorialis/jishaku/pull/230

munishkhatri720 commented 1 month ago

Same issue here

Traceback (most recent call last):
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\discord\ext\commands\core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\jishaku\features\management.py", line 242, in jsk_sync
    payload = [command.to_dict() for command in slash_commands]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\jishaku\features\management.py", line 242, in <listcomp>
    payload = [command.to_dict() for command in slash_commands]
               ^^^^^^^^^^^^^^^^^
TypeError: Group.to_dict() missing 1 required positional argument: 'tree'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\jishaku\features\invocation.py", line 168, in jsk_debug
    await alt_ctx.command.invoke(alt_ctx)
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\discord\ext\commands\core.py", line 1650, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\discord\ext\commands\core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\Hade Manager\venv\Lib\site-packages\discord\ext\commands\core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: Group.to_dict() missing 1 required positional argument: 'tree'