Browse Source

Fix some context menu commands not being registered in guild contexts

This happened when there weren't any application commands due to a typo
stemming from a copy paste error.

Fixes #7650
pull/7662/head
Rapptz 3 years ago
parent
commit
a672455ca9
  1. 3
      discord/app_commands/tree.py

3
discord/app_commands/tree.py

@ -481,7 +481,8 @@ class CommandTree(Generic[ClientT]):
try: try:
commands = self._guild_commands[guild.id] commands = self._guild_commands[guild.id]
except KeyError: except KeyError:
return [cmd for ((_, g, _), cmd) in self._context_menus.items() if g is None] guild_id = guild.id
return [cmd for ((_, g, _), cmd) in self._context_menus.items() if g == guild_id]
else: else:
base: List[Union[Command, Group, ContextMenu]] = list(commands.values()) base: List[Union[Command, Group, ContextMenu]] = list(commands.values())
guild_id = guild.id guild_id = guild.id

Loading…
Cancel
Save