summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
author8cy <[email protected]>2020-07-22 03:28:46 -0700
committer8cy <[email protected]>2020-07-22 03:28:46 -0700
commit4bc1de0cbf55a67503dc87bb2ffbb331045a9b46 (patch)
tree6c14c736de86546e5da6758ac5b8edcddd6501ed /src/commands
parentimprovement: user tag instead of username (diff)
downloaddep-core-4bc1de0cbf55a67503dc87bb2ffbb331045a9b46.tar.xz
dep-core-4bc1de0cbf55a67503dc87bb2ffbb331045a9b46.zip
fix: if clear amount equal or over 100, round down to 99legacy-discord.js-base
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/moderation/clear.ts4
1 files changed, 4 insertions, 0 deletions
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 => {