From d182857040e7c6031dd2415f560a0209ee2a6ab2 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 23 Feb 2022 18:20:57 -0500 Subject: docs(BushClientUtil): add missing documentation --- src/lib/extensions/discord-akairo/BushClientUtil.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 9903140..36dc396 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -906,12 +906,22 @@ export class BushClientUtil extends ClientUtil { }); } + /** + * Asset multiple statements at a time. + * @param args + */ public assertAll(...args: any[]): void { for (let i = 0; i < args.length; i++) { assert(args[i], `assertAll index ${i} failed`); } } + /** + * Casts a string to a duration and reason for slash commands. + * @param arg The argument received. + * @param message The message that triggered the command. + * @returns The casted argument. + */ public async castDurationContent( arg: string | ParsedDuration | null, message: BushMessage | BushSlashMessage @@ -921,6 +931,13 @@ export class BushClientUtil extends ClientUtil { return { duration: res?.duration ?? 0, content: res?.content ?? '' }; } + /** + * Casts a string to a the specified argument type. + * @param type The type of the argument to cast to. + * @param arg The argument received. + * @param message The message that triggered the command. + * @returns The casted argument. + */ public async cast( type: T, arg: BaseBushArgumentType[T] | string, -- cgit