diff options
Diffstat (limited to 'src/arguments')
-rw-r--r-- | src/arguments/abbreviatedNumber.ts | 2 | ||||
-rw-r--r-- | src/arguments/contentWithDuration.ts | 2 | ||||
-rw-r--r-- | src/arguments/discordEmoji.ts | 2 | ||||
-rw-r--r-- | src/arguments/duration.ts | 2 | ||||
-rw-r--r-- | src/arguments/durationSeconds.ts | 2 | ||||
-rw-r--r-- | src/arguments/globalUser.ts | 2 | ||||
-rw-r--r-- | src/arguments/permission.ts | 2 | ||||
-rw-r--r-- | src/arguments/roleWithDuration.ts | 2 | ||||
-rw-r--r-- | src/arguments/snowflake.ts | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/src/arguments/abbreviatedNumber.ts b/src/arguments/abbreviatedNumber.ts index 4dae2ff..3a447d7 100644 --- a/src/arguments/abbreviatedNumber.ts +++ b/src/arguments/abbreviatedNumber.ts @@ -1,7 +1,7 @@ import { type BushArgumentTypeCaster } from '#lib'; import numeral from 'numeral'; -export const abbreviatedNumberTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { +export const abbreviatedNumber: BushArgumentTypeCaster = (_, phrase): number | null => { if (!phrase) return null; const num = numeral(phrase?.toLowerCase()).value(); diff --git a/src/arguments/contentWithDuration.ts b/src/arguments/contentWithDuration.ts index 9bebaef..a9a7c23 100644 --- a/src/arguments/contentWithDuration.ts +++ b/src/arguments/contentWithDuration.ts @@ -1,6 +1,6 @@ import { type BushArgumentTypeCaster } from '#lib'; -export const contentWithDurationTypeCaster: BushArgumentTypeCaster = async ( +export const contentWithDuration: BushArgumentTypeCaster = async ( _, phrase ): Promise<{ duration: number | null; contentWithoutTime: string | null }> => { diff --git a/src/arguments/discordEmoji.ts b/src/arguments/discordEmoji.ts index 6fb971a..8648f7f 100644 --- a/src/arguments/discordEmoji.ts +++ b/src/arguments/discordEmoji.ts @@ -1,7 +1,7 @@ import { type BushArgumentTypeCaster } from '#lib'; import { type Snowflake } from 'discord-api-types'; -export const discordEmojiTypeCaster: BushArgumentTypeCaster = (_, phrase): { name: string; id: Snowflake } | null => { +export const discordEmoji: BushArgumentTypeCaster = (_, phrase): { name: string; id: Snowflake } | null => { if (!phrase) return null; const validEmoji: RegExpExecArray | null = client.consts.regex.discordEmoji.exec(phrase); if (!validEmoji || !validEmoji.groups) return null; diff --git a/src/arguments/duration.ts b/src/arguments/duration.ts index e369ddd..9cb1d03 100644 --- a/src/arguments/duration.ts +++ b/src/arguments/duration.ts @@ -1,5 +1,5 @@ import { type BushArgumentTypeCaster } from '#lib'; -export const durationTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { +export const duration: BushArgumentTypeCaster = (_, phrase): number | null => { return client.util.parseDuration(phrase).duration; }; diff --git a/src/arguments/durationSeconds.ts b/src/arguments/durationSeconds.ts index 78be1ce..8cbfa21 100644 --- a/src/arguments/durationSeconds.ts +++ b/src/arguments/durationSeconds.ts @@ -1,6 +1,6 @@ import { type BushArgumentTypeCaster } from '#lib'; -export const durationSecondsTypeCaster: BushArgumentTypeCaster = (_, phrase): number | null => { +export const durationSeconds: BushArgumentTypeCaster = (_, phrase): number | null => { phrase += 's'; return client.util.parseDuration(phrase).duration; }; diff --git a/src/arguments/globalUser.ts b/src/arguments/globalUser.ts index 344fe78..081eabf 100644 --- a/src/arguments/globalUser.ts +++ b/src/arguments/globalUser.ts @@ -1,7 +1,7 @@ import { BushUser, type BushArgumentTypeCaster } from '#lib'; // resolve non-cached users -export const globalUserTypeCaster: BushArgumentTypeCaster = async (_, phrase): Promise<BushUser | null> => { +export const globalUser: BushArgumentTypeCaster = async (_, phrase): Promise<BushUser | null> => { return client.users.cache.has(phrase) ? client.users.cache.get(`${phrase}`) ?? null : await client.users.fetch(`${phrase}`).catch(() => null); diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index 4f335dc..36c8fcb 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -1,7 +1,7 @@ import { type BushArgumentTypeCaster } from '#lib'; import { Permissions } from 'discord.js'; -export const permissionTypeCaster: BushArgumentTypeCaster = (_, phrase) => { +export const permission: BushArgumentTypeCaster = (_, phrase) => { if (!phrase) return null; phrase = phrase.toUpperCase().replace(/ /g, '_'); if (!Reflect.has(Permissions.FLAGS, phrase)) { diff --git a/src/arguments/roleWithDuration.ts b/src/arguments/roleWithDuration.ts index 455ad76..9bf4bb2 100644 --- a/src/arguments/roleWithDuration.ts +++ b/src/arguments/roleWithDuration.ts @@ -1,6 +1,6 @@ import { type BushArgumentTypeCaster } from '#lib'; -export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async ( +export const roleWithDuration: BushArgumentTypeCaster = async ( message, phrase ): Promise<{ duration: number | null; role: string | null } | null> => { diff --git a/src/arguments/snowflake.ts b/src/arguments/snowflake.ts index 03d78c2..455ed63 100644 --- a/src/arguments/snowflake.ts +++ b/src/arguments/snowflake.ts @@ -1,7 +1,7 @@ import { type BushArgumentTypeCaster } from '#lib'; import { type Snowflake } from 'discord.js'; -export const snowflakeTypeCaster: BushArgumentTypeCaster = (_, phrase): Snowflake | null => { +export const snowflake: BushArgumentTypeCaster = (_, phrase): Snowflake | null => { if (!phrase) return null; if (client.consts.regex.snowflake.test(phrase)) return phrase; return null; |