aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushClientUtil.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClientUtil.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 5ae2ac0..f44c80d 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -513,7 +513,7 @@ export class BushClientUtil extends ClientUtil {
if (!content) return { duration: 0, contentWithoutTime: null };
// eslint-disable-next-line prefer-const
- let duration = null;
+ let duration: number | null = null;
// Try to reduce false positives by requiring a space before the duration, this makes sure it still matches if it is
// in the beginning of the argument
let contentWithoutTime = ` ${content}`;
@@ -522,8 +522,7 @@ export class BushClientUtil extends ClientUtil {
const regex = BushConstants.TimeUnits[unit as keyof typeof BushConstants.TimeUnits].match;
const match = regex.exec(contentWithoutTime);
const value = Number(match?.groups?.[unit]);
- if (!isNaN(value))
- (duration as unknown as number) += value * BushConstants.TimeUnits[unit as keyof typeof BushConstants.TimeUnits].value;
+ if (!isNaN(value)) duration! += value * BushConstants.TimeUnits[unit as keyof typeof BushConstants.TimeUnits].value;
if (remove) contentWithoutTime = contentWithoutTime.replace(regex, '');
}