Skip to content

Commit 6ea8345

Browse files
committed
fix: set fallback description for chat input commands if none provided
1 parent 13cffbd commit 6ea8345

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/commandkit/src/app/handlers/AppCommandHandler.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
ApplicationCommandType,
23
AutocompleteInteraction,
34
Awaitable,
45
Collection,
@@ -679,7 +680,7 @@ export class AppCommandHandler {
679680
data: {
680681
command: {
681682
name: command.name,
682-
description: `${command.name} commands`,
683+
description: `${command.name} command`,
683684
type: 1,
684685
},
685686
},
@@ -697,6 +698,13 @@ export class AppCommandHandler {
697698
);
698699
}
699700

701+
if (
702+
commandFileData.command.type === ApplicationCommandType.ChatInput &&
703+
!commandFileData.command.description
704+
) {
705+
commandFileData.command.description = `${command.name} command`;
706+
}
707+
700708
let handlerCount = 0;
701709

702710
for (const [key, propValidator] of Object.entries(commandDataSchema) as [

0 commit comments

Comments
 (0)