From 55299b25c5a52bddbd2d2987943aa590b6400dc6 Mon Sep 17 00:00:00 2001 From: EQUENOS <50338932+EQUENOS@users.noreply.github.com> Date: Fri, 3 Nov 2023 18:44:07 +0300 Subject: [PATCH] fix: unintended breaking change (handling `guild_ids=[]`) --- disnake/ext/commands/interaction_bot_base.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/disnake/ext/commands/interaction_bot_base.py b/disnake/ext/commands/interaction_bot_base.py index 5f4bb7e5e3..b2868f53dc 100644 --- a/disnake/ext/commands/interaction_bot_base.py +++ b/disnake/ext/commands/interaction_bot_base.py @@ -258,7 +258,8 @@ def command_sync_flags(self) -> CommandSyncFlags: @property def all_app_commands(self) -> MappingProxyType[AppCmdIndex, InvokableApplicationCommand]: """MappingProxyType[:class:`AppCmdIndex`, :class:`InvokableApplicationCommand`]: - A mapping proxy with all application commands the bot has.""" + A mapping proxy with all application commands the bot has. + """ return MappingProxyType(self._all_app_commands) @property @@ -357,11 +358,8 @@ def add_app_command(self, app_command: InvokableApplicationCommand) -> None: "not an instance of SubCommand or SubCommandGroup" ) - if app_command.guild_ids is None: - # if test_guilds are specified then we add the same command for each test guild - guild_ids = (None,) if self._test_guilds is None else self._test_guilds - else: - guild_ids = app_command.guild_ids + test_guilds = (None,) if self._test_guilds is None else self._test_guilds + guild_ids = app_command.guild_ids or test_guilds for guild_id in guild_ids: cmd_index = AppCmdIndex(