From 5cd7cb7bf2410d2a7187aa8aaebcfc2e9ae28761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DedShot=E2=84=A2=239195?= Date: Wed, 20 May 2020 22:24:44 -0400 Subject: [PATCH] isNaN() instead of Number.isNaN() --- src/commands/slowmode.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/slowmode.ts b/src/commands/slowmode.ts index 33807c5..b85bbad 100644 --- a/src/commands/slowmode.ts +++ b/src/commands/slowmode.ts @@ -17,8 +17,9 @@ export default class Slowmode extends Command { try { if (!args[0]) return this.error(message.channel, 'This command requires an argument.'); - const [length, unit]: Array = args[0].match(/[a-z]+|[^a-z]+/gi); - if (Number.isNaN(Number(length))) return this.error(message.channel, 'Could not determine the slowmode time.'); + const [length, unit] = args[0].match(/[a-z]+|[^a-z]+/gi); + // eslint-disable-next-line no-restricted-globals + if (isNaN(length as unknown as number)) return this.error(message.channel, 'Could not determine the slowmode time.'); const momentSeconds: number = moment.duration(length, unit as unitOfTime.Base || 's').asSeconds(); if (momentSeconds > 21600 || momentSeconds < 0) return this.error(message.channel, 'Slowmode must be between 0 seconds and 6 hours.');