diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-14 12:47:57 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-14 12:47:57 -0400 |
commit | 661e4c9935aeb8760dafc7ced4bbec6cc356a033 (patch) | |
tree | bb4c12bdef067d203f100e13e05ccb705b299834 /src/lib/common/util/Arg.ts | |
parent | eaf592b72eb5b1d66aa2bde5151a8947570a506c (diff) | |
download | tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.gz tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.bz2 tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.zip |
remove the war crimes that I previously committed
- Remove custom typings and replace with declaration merging
- Fix the typings for args
- Replace all discord-api-types imports with discord.js imports
- Fix discord.js breaking changes
Diffstat (limited to 'src/lib/common/util/Arg.ts')
-rw-r--r-- | src/lib/common/util/Arg.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/common/util/Arg.ts b/src/lib/common/util/Arg.ts index 01d3b0b..51d8065 100644 --- a/src/lib/common/util/Arg.ts +++ b/src/lib/common/util/Arg.ts @@ -1,4 +1,10 @@ -import { type BaseBushArgumentType, type BushArgumentType, type BushArgumentTypeCaster, type BushSlashMessage } from '#lib'; +import { + type BaseBushArgumentType, + type BushArgumentType, + type BushArgumentTypeCaster, + type CommandMessage, + type SlashMessage +} from '#lib'; import { Argument, type Flag, type ParsedValuePredicate } from 'discord-akairo'; import { type Message } from 'discord.js'; @@ -12,10 +18,10 @@ export class Arg { * @param message - Message that called the command. * @param phrase - Phrase to process. */ - public static async cast<T extends ATC>(type: T, message: Message | BushSlashMessage, phrase: string): Promise<ATCR<T>>; - public static async cast<T extends KBAT>(type: T, message: Message | BushSlashMessage, phrase: string): Promise<BAT[T]>; - public static async cast(type: AT | ATC, message: Message | BushSlashMessage, phrase: string): Promise<any>; - public static async cast(type: ATC | AT, message: Message | BushSlashMessage, phrase: string): Promise<any> { + public static async cast<T extends ATC>(type: T, message: CommandMessage | SlashMessage, phrase: string): Promise<ATCR<T>>; + public static async cast<T extends KBAT>(type: T, message: CommandMessage | SlashMessage, phrase: string): Promise<BAT[T]>; + public static async cast(type: AT | ATC, message: CommandMessage | SlashMessage, phrase: string): Promise<any>; + public static async cast(type: ATC | AT, message: CommandMessage | SlashMessage, phrase: string): Promise<any> { return Argument.cast(type as any, client.commandHandler.resolver, message as Message, phrase); } |