From b8ddb17b141dfa337ea88b90d1e198c9c784fd41 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 20 Jun 2022 06:20:46 -0400 Subject: [PATCH] Fix fallback_to_global not working with context menus Fix #8167 --- discord/app_commands/tree.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/app_commands/tree.py b/discord/app_commands/tree.py index 7aab2c32d..75513f48c 100644 --- a/discord/app_commands/tree.py +++ b/discord/app_commands/tree.py @@ -1058,6 +1058,9 @@ class CommandTree(Generic[ClientT]): name = data['name'] guild_id = _get_as_snowflake(data, 'guild_id') ctx_menu = self._context_menus.get((name, guild_id, type)) + if ctx_menu is None and self.fallback_to_global: + ctx_menu = self._context_menus.get((name, None, type)) + # Pre-fill the cached slot to prevent re-computation interaction._cs_command = ctx_menu