-
Notifications
You must be signed in to change notification settings - Fork 138
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
fix: Another blind spot of command sync algorithm #1108 #1129
base: master
Are you sure you want to change the base?
Conversation
guild_ids_to_check = set(guild_cmds.keys()) | ||
for guild_id in self._connection._guild_application_commands.keys(): | ||
guild_ids_to_check.add(guild_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified a bit:
guild_ids_to_check = set(guild_cmds.keys()) | |
for guild_id in self._connection._guild_application_commands.keys(): | |
guild_ids_to_check.add(guild_id) | |
guild_ids_to_check = guild_cmds.keys() | self._connection._guild_application_commands.keys() |
current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {}) | ||
cmds = guild_cmds.get(guild_id, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmds = guild_cmds.get(guild_id, {}) | |
cmds = guild_cmds.get(guild_id, []) |
Thanks for the PR - the two comments above are just for code style, in terms of functionality there are more quirks here that need to be ironed out, though. Manually registering commands is supported through I'm unsure if this is solvable without a more general refactor, and #1107 touches the same areas of the code as this PR, so it might be wise to see how that turns out first. |
@@ -0,0 +1 @@ | |||
Make message_command check both local and synchronized guild_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR fixes multiple things, not only the message_command
decorator. I think it'd be better to say which bug has been fixed.
Summary
Fix of Another blind spot of command sync algorithm #1108
Checklist
pdm lint
pdm pyright
We need to check ids from both guild_cmds and self._connection._guild_application_commands.keys(), otherwise on deletion, we cant find any ids in local commands, and cycle doesnt procceed any values