Skip to content

Commit

Permalink
fix: unintended breaking change (handling guild_ids=[])
Browse files Browse the repository at this point in the history
  • Loading branch information
EQUENOS committed Nov 3, 2023
1 parent 9a4d1aa commit 55299b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions disnake/ext/commands/interaction_bot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 55299b2

Please sign in to comment.