diff --git a/discord/app_commands/tree.py b/discord/app_commands/tree.py index b937fed91..0af423c83 100644 --- a/discord/app_commands/tree.py +++ b/discord/app_commands/tree.py @@ -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