Skip to content

Commit 779dda4

Browse files
authoredJan 11, 2023
fix(ApplicationCommandRegistry): context menu command matching went wrong (#590)
1 parent 00ea824 commit 779dda4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/lib/utils/application-commands/ApplicationCommandRegistry.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ export class ApplicationCommandRegistry {
237237
if (apiCall.type === InternalRegistryAPIType.ChatInput && entry.type !== ApplicationCommandType.ChatInput) return false;
238238
// If the command is a context menu command, we need to check if the entry is a context menu command of the same type
239239
if (apiCall.type === InternalRegistryAPIType.ContextMenu) {
240+
// If its a chat input command, it doesn't match
240241
if (entry.type === ApplicationCommandType.ChatInput) return false;
241-
return apiCall.builtData.type === entry.type;
242+
// Check the command type (must match)
243+
if (apiCall.builtData.type !== entry.type) return false;
242244
}
243245

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

0 commit comments

Comments
 (0)
Please sign in to comment.