fix(commands): fill new required properties

required and tested for 247207
closes #81
This commit is contained in:
amsyarasyiq 2024-09-06 21:41:20 +08:00
parent 4b94b7fd9c
commit 32afc78e0a
2 changed files with 4 additions and 0 deletions

View file

@ -54,7 +54,9 @@ export function registerCommand(command: BunnyApplicationCommand): () => void {
command.type ??= ApplicationCommandType.CHAT; command.type ??= ApplicationCommandType.CHAT;
command.inputType = ApplicationCommandInputType.BUILT_IN; command.inputType = ApplicationCommandInputType.BUILT_IN;
command.displayName ??= command.name; command.displayName ??= command.name;
command.untranslatedName ??= command.name;
command.displayDescription ??= command.description; command.displayDescription ??= command.description;
command.untranslatedDescription ??= command.description;
if (command.options) for (const opt of command.options) { if (command.options) for (const opt of command.options) {
opt.displayName ??= opt.name; opt.displayName ??= opt.name;

View file

@ -15,6 +15,8 @@ export interface ApplicationCommand {
applicationId?: string; applicationId?: string;
displayName?: string; displayName?: string;
displayDescription?: string; displayDescription?: string;
untranslatedDescription?: string;
untranslatedName?: string;
inputType?: ApplicationCommandInputType; inputType?: ApplicationCommandInputType;
type?: ApplicationCommandType; type?: ApplicationCommandType;
__bunny?: { __bunny?: {