Skip to content

Commit abee5f1

Browse files
authored
feat(Command): Add category command option
1 parent 802b8fa commit abee5f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/structures/Command.ts

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface CommandOptions {
3939
description?: string;
4040
descriptionLocalizations?: Record<LocaleString, string>;
4141
type: Array<CommandType | keyof typeof CommandType>;
42+
category?: string;
4243
defaultMemberPermissions?: PermissionResolvable;
4344
dmPermission?: boolean;
4445
arguments?: Array<Argument | ArgumentOptions>;
@@ -88,6 +89,7 @@ const validationSchema = z
8889
)
8990
.array()
9091
.nonempty(),
92+
category: z.string().optional(),
9193
defaultMemberPermissions: z.any().optional(),
9294
dmPermission: z.boolean().optional(),
9395
arguments: z.any().array().optional(),
@@ -115,6 +117,7 @@ export class Command {
115117
public description?: string;
116118
public descriptionLocalizations?: Record<LocaleString, string>;
117119
public type: Array<CommandType | keyof typeof CommandType>;
120+
public category?: string;
118121
public defaultMemberPermissions?: PermissionResolvable;
119122
public dmPermission?: boolean;
120123
public arguments?: Array<Argument>;
@@ -155,6 +158,7 @@ export class Command {
155158
});
156159
this.inhibitors = options.inhibitors || Command.defaults?.inhibitors;
157160
this.guildId = options.guildId || Command.defaults?.guildId;
161+
this.category = options.category;
158162
this.cooldown = options.cooldown || Command.defaults?.cooldown;
159163
this.fileName = options.fileName || Command.defaults?.fileName;
160164
this.run = options.run || Command.defaults?.run;

0 commit comments

Comments
 (0)