From a672455ca94cd85315974cb291a54b99e0d1f709 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 12 Mar 2022 08:39:57 -0500 Subject: [PATCH] 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 --- discord/app_commands/tree.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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