From 4bc1de0cbf55a67503dc87bb2ffbb331045a9b46 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Wed, 22 Jul 2020 03:28:46 -0700 Subject: fix: if clear amount equal or over 100, round down to 99 --- src/commands/moderation/clear.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/commands') diff --git a/src/commands/moderation/clear.ts b/src/commands/moderation/clear.ts index c306231..c162ac4 100644 --- a/src/commands/moderation/clear.ts +++ b/src/commands/moderation/clear.ts @@ -35,6 +35,10 @@ module.exports = class ClearModeration extends Command { } //@ts-ignore this is not promise based async run(msg: CommandoMessage, { deleteAmount }: any) { + if (deleteAmount >= 100) { + deleteAmount == 100; + msg.author.send(`Due to Discord API limitations, your request has been rounded down to **100**. ${emoji.random()}`) + } if (msg.member.hasPermission('MANAGE_MESSAGES')) { if (!deleteAmount) { return msg.reply('You haven\'t specified an amount of messages which should be deleted. ' + emoji.random()).then(deleteNotificationMessage => { -- cgit v1.2.3