scarletcafe / jishaku

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

jsk sync command broken on dpy master #233

Closed Ken-Miles closed 6 days ago

Ken-Miles commented 5 months 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 5 months ago

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

munishkhatri720 commented 5 months 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'
bitterteriyaki commented 2 months ago

Any updates on this?

Ken-Miles commented 2 months ago

Still experiencing this issue even with 2.4. Had to make my own sync command until the PR is merged.

scarletcafe commented 2 months ago

235 should have fixed this. Try installing a development version and see if it fixes it.

bitterteriyaki commented 2 months ago

235 should have fixed this. Try installing a development version and see if it fixes it.

Oops, I didn't see that this was fixed on master branch. Everything is working now. When will be there a new release?

scarletcafe commented 6 days ago

Closed by #212