Check the global scope when dispatching context menus

This commit is contained in:
Arthur 2022-03-11 00:51:14 +01:00 committed by GitHub
parent f09f0ea8ca
commit 8502978649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))