aboutsummaryrefslogtreecommitdiff
path: root/src/arguments
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-30 19:42:10 +0000
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-30 19:42:10 +0000
commitbada2976eed34a2530bc09683d2de17c71c744a8 (patch)
treefe459cebb005dd90d1ae7ed3269a77248f780499 /src/arguments
parentaaef32128f8c8c30254836932805d0745647c646 (diff)
downloadtanzanite-bada2976eed34a2530bc09683d2de17c71c744a8.tar.gz
tanzanite-bada2976eed34a2530bc09683d2de17c71c744a8.tar.bz2
tanzanite-bada2976eed34a2530bc09683d2de17c71c744a8.zip
some fixes + some more error stuff
Diffstat (limited to 'src/arguments')
-rw-r--r--src/arguments/roleWithDuation.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arguments/roleWithDuation.ts b/src/arguments/roleWithDuation.ts
index de83ccf..03a6035 100644
--- a/src/arguments/roleWithDuation.ts
+++ b/src/arguments/roleWithDuation.ts
@@ -7,8 +7,12 @@ export const roleWithDurationTypeCaster: BushArgumentTypeCaster = async (
// 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(' ', '');
+ contentWithoutTime = contentWithoutTime.trim();
const role = await util.arg.cast('role', client.commandHandler.resolver, message, contentWithoutTime);
- if (!role) return null;
+ if (!role) {
+ client.console.debug(contentWithoutTime);
+ client.console.debug(duration);
+ return null;
+ }
return { duration, role };
};