fix: Another blind spot of command sync algorithm #1108#1129
fix: Another blind spot of command sync algorithm #1108#1129koshakkkq wants to merge 3 commits intoDisnakeDev:masterfrom
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.
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() |
| for guild_id, cmds in guild_cmds.items(): | ||
| for guild_id in guild_ids_to_check: | ||
| current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {}) | ||
| cmds = guild_cmds.get(guild_id, {}) |
There was a problem hiding this comment.
| 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.
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 lintpdm pyrightWe 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