diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClient.ts | 6 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushCommand.ts | 11 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 9 |
3 files changed, 22 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 { /** diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 68393c4..1d7f81e 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -21,6 +21,10 @@ interface bushColors { black: '#000000'; orange: '#E86100'; } + +('<:verifiedbot1:700325427998097449>'); +(''); + export class BushConstants { public static emojis = { success: '<:checkmark:837109864101707807>', @@ -99,6 +103,11 @@ export class BushConstants { } }; + public static regex = { + snowflake: /\d{15,21}/gim, + discordEmoji: /<a?:[a-zA-Z0-9_]+:\d{15,21}>/gim + }; + /** A bunch of mappings */ public static mappings = { guilds: { |