Skip to content

Commit b041cdf

Browse files
chore: remove other parts of command sync
1 parent e824ed8 commit b041cdf

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

disnake/ext/commands/interaction_bot_base.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -860,15 +860,11 @@ async def _sync_application_commands(self) -> None:
860860
# Sort all invokable commands between guild IDs:
861861
global_cmds, guild_cmds = self._ordered_unsynced_commands(self._test_guilds)
862862

863-
if global_cmds is not None and self._command_sync.global_commands:
863+
if global_cmds is not None:
864864
# Update global commands first
865865
diff = _app_commands_diff(
866866
global_cmds, self._connection._global_application_commands.values()
867867
)
868-
if not self._command_sync.allow_command_deletion:
869-
# because allow_command_deletion is disabled, we want to never delete a command, so we move the delete commands to no_changes
870-
diff["no_changes"] += diff["delete"]
871-
diff["delete"].clear()
872868
update_required = bool(diff["upsert"]) or bool(diff["edit"]) or bool(diff["delete"])
873869

874870
# Show the difference
@@ -889,14 +885,10 @@ async def _sync_application_commands(self) -> None:
889885
# Same process but for each specified guild individually.
890886
# Notice that we're not doing this for every single guild for optimisation purposes.
891887
# See the note in :meth:`_cache_application_commands` about guild app commands.
892-
if guild_cmds is not None and self._command_sync.guild_commands:
888+
if guild_cmds is not None:
893889
for guild_id, cmds in guild_cmds.items():
894890
current_guild_cmds = self._connection._guild_application_commands.get(guild_id, {})
895891
diff = _app_commands_diff(cmds, current_guild_cmds.values())
896-
if not self._command_sync.allow_command_deletion:
897-
# because allow_command_deletion is disabled, we want to never delete a command, so we move the delete commands to no_changes
898-
diff["no_changes"] += diff["delete"]
899-
diff["delete"].clear()
900892
update_required = bool(diff["upsert"]) or bool(diff["edit"]) or bool(diff["delete"])
901893

902894
# Show diff

0 commit comments

Comments
 (0)