aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushCommand.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushCommand.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts
index 0266b1d..9f91905 100644
--- a/src/lib/extensions/discord-akairo/BushCommand.ts
+++ b/src/lib/extensions/discord-akairo/BushCommand.ts
@@ -164,21 +164,21 @@ export class BushCommand extends Command {
public completelyHide: boolean;
public constructor(id: string, options?: BushCommandOptions) {
+ if (options.args && typeof options.args !== 'function') {
+ options.args.forEach((_, index: number) => {
+ if ('customType' in options.args[index]) {
+ // @ts-expect-error: shut
+ if (!options.args[index]['type']) options.args[index]['type'] = options.args[index]['customType'];
+ delete options.args[index]['customType'];
+ }
+ });
+ }
super(id, options);
- options.category;
this.options = options;
this.hidden = options.hidden || false;
this.restrictedChannels = options.restrictedChannels;
this.restrictedGuilds = options.restrictedGuilds;
this.completelyHide = options.completelyHide;
- if (options.args && typeof options.args !== 'function') {
- options.args.forEach((arg: BushArgumentOptions | CustomBushArgumentOptions) => {
- if (arg['customType']) {
- arg['type'] = arg['customType'];
- delete arg['customType'];
- }
- });
- }
}
public override exec(message: BushMessage, args: any): any;