From e360798cc60a851c665d17cb0de59bbda819afce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DedShot=E2=84=A2=239195?= Date: Fri, 24 Apr 2020 03:55:31 -0400 Subject: [PATCH] Deleted slowmode.ts because it's in wrong location --- slowmode.ts | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 slowmode.ts diff --git a/slowmode.ts b/slowmode.ts deleted file mode 100644 index 76575a3..0000000 --- a/slowmode.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Message } from 'eris'; -import { Client, Command } from '../class'; - -export default class Slowmode extends Command { - constructor(client: Client) { - super(client); - this.name = 'slowmode'; - this.description = 'Set slowmode to a channel.'; - this.usage = 'slowmode [time] [seconds | minutes | hours]'; - this.permissions = 1; - this.guildOnly = true; - this.enabled = true; - } - - public async run(message: Message, args: string[]) { - try { - if (!args[0]) return message.channel.createMessage(`***${this.client.util.emojis.ERROR} You need to specifiy the slowmode time.***`); - - // @ts-ignore - let time: number = args[0]; - if (isNaN(time)) { - return message.channel.createMessage(`***${this.client.util.emojis.ERROR} The first argument must be a number.***`); - } - - if (args[1]) { - if (args[1] === 'm' || args[1] === 'min'|| args[1] === 'mins' || args[1] === 'minute' || args[1] === 'minutes') time *= 60; - else if (args[1] === 'h' || args[1] === 'hour' || args[1] === 'hours') time = time * 60 * 60; - else time = time; - } - if (time > 21600) return message.channel.createMessage(`***${this.client.util.emojis.ERROR} Maximum slow mode is 6 hours.***`); - // @ts-ignore - return message.channel.edit({ rateLimitPerUser: time }); - } catch (err) { - return this.client.util.handleError(err, message, this); - } - } -}