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.');