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
This commit is contained in:
Rapptz 2022-03-12 08:39:57 -05:00
parent d68f2db7cb
commit a672455ca9

View File

@ -481,7 +481,8 @@ class CommandTree(Generic[ClientT]):
try:
commands = self._guild_commands[guild.id]
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:
base: List[Union[Command, Group, ContextMenu]] = list(commands.values())
guild_id = guild.id