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.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts
index 0127a59..3f79aeb 100644
--- a/src/lib/extensions/discord-akairo/BushCommand.ts
+++ b/src/lib/extensions/discord-akairo/BushCommand.ts
@@ -78,7 +78,7 @@ export interface BushArgumentOptions extends BaseBushArgumentOptions {
type?: BushArgumentType;
}
export interface CustomBushArgumentOptions extends BaseBushArgumentOptions {
- type?: ArgumentTypeCaster | (string | string[])[] | RegExp | string;
+ customType?: ArgumentTypeCaster | (string | string[])[] | RegExp | string;
}
export interface BushCommandOptions extends CommandOptions {
@@ -122,6 +122,11 @@ export class BushCommand extends Command {
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'];
+ });
+ }
}
public exec(message: BushMessage, args: any): any;