New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update get_translated_payload method in ManagementFeature #230
base: master
Are you sure you want to change the base?
Conversation
I don't know why this function was require. |
The function signature doesn't indicate that this should be necessary. Can you explain why you thought this change was necessary (and ideally include any supporting errors or other info you can about what lead you towards this fix)? |
It errors, but now that I look properly into source code, it has to do with how it works for hybrid commands. |
I see. Part of how this code works might need to be rewritten to make it support both cases, I haven't really used hybrid commands so I guess I've never run into this. I imagined there might be some need to refine and update the sync procedure anyway since it deviates from how the discord.py public API intends for the sake of better diagnostics, so I'll probably need to make some kind of test harness to make sure I'm not missing things when maintaining it. |
I am looking tree.sync function, it looks same. |
@Gorialis fyi, this issue is only present in the (currently experimental) feature/user_apps branch of discord.py. This is caused by a change in PR for the feature: Rapptz/discord.py#9760 |
Given the information provided, this PR doesn't work on master but rather on user apps branch, this PR will only apply in such case for when that branch merges in master.
Change has been merged in master, jishaku's sync command no longer works with Master Branch |
Can confirm: May 07 23:24:59 contabo-vps python[1054883]: ret = await coro(*args, **kwargs)
May 07 23:24:59 contabo-vps python[1054883]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 23:24:59 contabo-vps python[1054883]: File "/home/jdjg/JDBot/.venv/lib/python3.11/site-packages/jishaku/features/management.py", line 246, in jsk_sync
May 07 23:24:59 contabo-vps python[1054883]: payload = [command.to_dict() for command in slash_commands]
May 07 23:24:59 contabo-vps python[1054883]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 23:24:59 contabo-vps python[1054883]: File "/home/jdjg/JDBot/.venv/lib/python3.11/site-packages/jishaku/features/management.py", line 246, in <listcomp>
May 07 23:24:59 contabo-vps python[1054883]: payload = [command.to_dict() for command in slash_commands]
May 07 23:24:59 contabo-vps python[1054883]: ^^^^^^^^^^^^^^^^^
May 07 23:24:59 contabo-vps python[1054883]: TypeError: Command.to_dict() missing 1 required positional argument: 'tree' |
Because this change still hasn't hit PyPI release, this PR can't be merged until it is ensured that this change doesn't break users who aren't on master branch. |
It could handle the error? If this gets merged, it will error for dpy <2.4 users anyways. |
Rationale
The function requires the bot's tree for working accordingly. Not ready for merging in master but rather once user apps merges with the main branch.
Summary of changes made
It adds bot.tree as parameter for the function
Checklist