Browse Source

Check the global scope when dispatching context menus

pull/7631/head
Arthur 3 years ago
committed by GitHub
parent
commit
8502978649
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/app_commands/tree.py

2
discord/app_commands/tree.py

@ -672,7 +672,7 @@ class CommandTree(Generic[ClientT]):
async def _call_context_menu(self, interaction: Interaction, data: ApplicationCommandInteractionData, type: int):
name = data['name']
guild_id = interaction.guild_id
ctx_menu = self._context_menus.get((name, guild_id, type))
ctx_menu = self._context_menus.get((name, guild_id, type)) or self._context_menus.get((name, None, type))
if ctx_menu is None:
raise CommandNotFound(name, [], AppCommandType(type))

Loading…
Cancel
Save