Skip to content

Commit

Permalink
fix(ApplicationCommandRegistry): context menu command matching went w…
Browse files Browse the repository at this point in the history
…rong (#590)
  • Loading branch information
vladfrangu committed Jan 11, 2023
1 parent 00ea824 commit 779dda4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ export class ApplicationCommandRegistry {
if (apiCall.type === InternalRegistryAPIType.ChatInput && entry.type !== ApplicationCommandType.ChatInput) return false;
// If the command is a context menu command, we need to check if the entry is a context menu command of the same type
if (apiCall.type === InternalRegistryAPIType.ContextMenu) {
// If its a chat input command, it doesn't match
if (entry.type === ApplicationCommandType.ChatInput) return false;
return apiCall.builtData.type === entry.type;
// Check the command type (must match)
if (apiCall.builtData.type !== entry.type) return false;
}

// Find the command by name or by id hint (mostly useful for context menus)
Expand Down

0 comments on commit 779dda4

Please sign in to comment.