aboutsummaryrefslogtreecommitdiff
path: root/src/arguments/roleWithDuation.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-30 13:12:16 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-30 13:12:16 -0400
commit22009ec8da37fc2cd235d0b0c987a0fe45a69e27 (patch)
tree69a47217fb1f28cdcbec9622ac8c8252848eb595 /src/arguments/roleWithDuation.ts
parent8d819519b4376441ca156b6146600382a319a0ba (diff)
downloadtanzanite-22009ec8da37fc2cd235d0b0c987a0fe45a69e27.tar.gz
tanzanite-22009ec8da37fc2cd235d0b0c987a0fe45a69e27.tar.bz2
tanzanite-22009ec8da37fc2cd235d0b0c987a0fe45a69e27.zip
need to make commit early
Diffstat (limited to 'src/arguments/roleWithDuation.ts')
-rw-r--r--src/arguments/roleWithDuation.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts
index 423e7df..de83ccf 100644
--- a/src/arguments/roleWithDuation.ts
+++ b/src/arguments/roleWithDuation.ts
@@ -4,10 +4,11 @@ export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async (
message,
phrase
): Promise<{ duration: number; role: string | null } | null> => {
- const { duration, contentWithoutTime } = client.util.parseDuration(phrase);
+ // eslint-disable-next-line prefer-const
+ let { duration, contentWithoutTime } = client.util.parseDuration(phrase);
if (contentWithoutTime === null || contentWithoutTime === undefined) return null;
+ if (contentWithoutTime[0] === ' ') contentWithoutTime = contentWithoutTime.replace(' ', '');
const role = await util.arg.cast('role', client.commandHandler.resolver, message, contentWithoutTime);
- console.debug(['role'], [role], [contentWithoutTime]);
if (!role) return null;
return { duration, role };
};