aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-23 18:20:57 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-23 18:20:57 -0500
commitd182857040e7c6031dd2415f560a0209ee2a6ab2 (patch)
tree03c5231e3060f38a2f40718ed2ca22829b1b9b7e /src/lib/extensions
parentdae85af0bbc06fcc066723b2595b8355c9ae3c48 (diff)
downloadtanzanite-d182857040e7c6031dd2415f560a0209ee2a6ab2.tar.gz
tanzanite-d182857040e7c6031dd2415f560a0209ee2a6ab2.tar.bz2
tanzanite-d182857040e7c6031dd2415f560a0209ee2a6ab2.zip
docs(BushClientUtil): add missing documentation
Diffstat (limited to 'src/lib/extensions')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts17
1 files changed, 17 insertions, 0 deletions
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<T extends keyof BaseBushArgumentType>(
type: T,
arg: BaseBushArgumentType[T] | string,