From 99cd423efbaf4da9c5d1c7bf23061d933eb99d18 Mon Sep 17 00:00:00 2001 From: Haruka <96925398+nakoyasha@users.noreply.github.com> Date: Thu, 5 Sep 2024 00:26:08 +0300 Subject: [PATCH] fix crashing on canary when searching slash commands (#2844) --- src/api/Commands/index.ts | 2 ++ src/api/Commands/types.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/api/Commands/index.ts b/src/api/Commands/index.ts index ef4db171c..5e3fc8f4d 100644 --- a/src/api/Commands/index.ts +++ b/src/api/Commands/index.ts @@ -138,6 +138,8 @@ export function registerCommand(command: C, plugin: string) { throw new Error(`Command '${command.name}' already exists.`); command.isVencordCommand = true; + command.untranslatedName ??= command.name; + command.untranslatedDescription ??= command.description; command.id ??= `-${BUILT_IN.length + 1}`; command.applicationId ??= "-1"; // BUILT_IN; command.type ??= ApplicationCommandType.CHAT_INPUT; diff --git a/src/api/Commands/types.ts b/src/api/Commands/types.ts index bd349e250..70b73775a 100644 --- a/src/api/Commands/types.ts +++ b/src/api/Commands/types.ts @@ -93,8 +93,10 @@ export interface Command { isVencordCommand?: boolean; name: string; + untranslatedName?: string; displayName?: string; description: string; + untranslatedDescription?: string; displayDescription?: string; options?: Option[];