isNaN() instead of Number.isNaN()

merge-requests/6/head
DedShot™#9195 2020-05-20 22:24:44 -04:00
parent 8316ff53cd
commit 5cd7cb7bf2
1 changed files with 3 additions and 2 deletions

View File

@ -17,8 +17,9 @@ export default class Slowmode extends Command {
try { try {
if (!args[0]) return this.error(message.channel, 'This command requires an argument.'); if (!args[0]) return this.error(message.channel, 'This command requires an argument.');
const [length, unit]: Array<string> = args[0].match(/[a-z]+|[^a-z]+/gi); const [length, unit] = args[0].match(/[a-z]+|[^a-z]+/gi);
if (Number.isNaN(Number(length))) return this.error(message.channel, 'Could not determine the slowmode time.'); // 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(); 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.'); if (momentSeconds > 21600 || momentSeconds < 0) return this.error(message.channel, 'Slowmode must be between 0 seconds and 6 hours.');