aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions/discord-akairo')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts6
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts11
2 files changed, 13 insertions, 4 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index 3feae96..ee92ded 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -21,8 +21,10 @@ import { exit } from 'process';
import readline from 'readline';
import { Sequelize } from 'sequelize';
import { contentWithDurationTypeCaster } from '../../../arguments/contentWithDuration';
+import { discordEmojiTypeCaster } from '../../../arguments/discordEmoji';
import { durationTypeCaster } from '../../../arguments/duration';
import { permissionTypeCaster } from '../../../arguments/permission';
+import { snowflakeTypeCaster } from '../../../arguments/snowflake';
import { UpdateCacheTask } from '../../../tasks/updateCache';
import { ActivePunishment } from '../../models/ActivePunishment';
import { Global } from '../../models/Global';
@@ -250,7 +252,9 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
this.commandHandler.resolver.addTypes({
duration: durationTypeCaster,
contentWithDuration: contentWithDurationTypeCaster,
- permission: permissionTypeCaster
+ permission: permissionTypeCaster,
+ snowflake: snowflakeTypeCaster,
+ discordEmoji: discordEmojiTypeCaster
});
// loads all the handlers
const loaders = {
diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts
index 0eaa5e0..7ecb679 100644
--- a/src/lib/extensions/discord-akairo/BushCommand.ts
+++ b/src/lib/extensions/discord-akairo/BushCommand.ts
@@ -6,7 +6,7 @@ import { BushClient } from './BushClient';
import { BushCommandHandler } from './BushCommandHandler';
import { BushSlashMessage } from './BushSlashMessage';
-export type BushArgumentType =
+export type BaseBushArgumentType =
| 'string'
| 'lowercase'
| 'uppercase'
@@ -61,7 +61,12 @@ export type BushArgumentType =
| 'listener'
| 'duration'
| 'contentWithDuration'
- | 'permission';
+ | 'permission'
+ | 'snowflake'
+ | 'discordEmoji';
+
+export type BushArgumentType = BaseBushArgumentType | RegExp;
+
interface BaseBushArgumentOptions extends Omit<ArgumentOptions, 'type'> {
id: string;
description?: string;
@@ -116,7 +121,7 @@ export interface BushArgumentOptions extends BaseBushArgumentOptions {
* - `contentWithDuration` tries to parse duration in milliseconds and returns the remaining content with the duration
* removed
*/
- type?: BushArgumentType;
+ type?: BushArgumentType | BaseBushArgumentType[];
}
export interface CustomBushArgumentOptions extends BaseBushArgumentOptions {
/**