Browse Source

Fix fallback_to_global not working with context menus

Fix #8167
pull/8172/head
Rapptz 3 years ago
parent
commit
b8ddb17b14
  1. 3
      discord/app_commands/tree.py

3
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

Loading…
Cancel
Save