From a69778db3ff74c9e96099e66ca1d752b35429b67 Mon Sep 17 00:00:00 2001 From: Nathaniel Wood Date: Tue, 8 Oct 2024 10:16:29 -0600 Subject: [PATCH] Update: Some small little changes --- src/commands/moderation/clear.js | 29 ++++++++------------------- src/slashCommands/moderation/clear.js | 6 ++++++ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/commands/moderation/clear.js b/src/commands/moderation/clear.js index 02c3b50..a8d6a73 100644 --- a/src/commands/moderation/clear.js +++ b/src/commands/moderation/clear.js @@ -32,7 +32,7 @@ module.exports = class extends Command { const amount = parseInt(args[0]); const channel = message.channel; - if (isNaN(amount) === true || !amount || amount < 0 || amount > 200) + if (isNaN(amount) === true || !amount || amount < 0 || amount > 200) { return message.channel.sendCustom({ embeds: [ new MessageEmbed() @@ -47,28 +47,15 @@ module.exports = class extends Command { .setColor(message.guild.me.displayHexColor), ], }); - - if (!channel.permissionsFor(message.guild.me).has(["MANAGE_MESSAGES"])) - return message.channel.sendCustom({ - embeds: [ - new MessageEmbed() - .setAuthor( - `${message.author.tag}`, - message.author.displayAvatarURL({ dynamic: true }) - ) - .setTitle(`${fail} Clear Error`) - .setDescription( - `Please make sure I have the **Manage Messages** Permission!` - ) - .setTimestamp() - .setFooter({ text: `${process.env.AUTH_DOMAIN}` }) - .setColor(message.guild.me.displayHexColor), - ], - }); + } let reason = args.slice(1).join(" "); - if (!reason) reason = "None"; - if (reason.length > 1024) reason = reason.slice(0, 1021) + "..."; + if (!reason) { + reason = "None"; + } + if (reason.length > 1024) { + reason = reason.slice(0, 1021) + "..."; + } await message.delete(); diff --git a/src/slashCommands/moderation/clear.js b/src/slashCommands/moderation/clear.js index 6995be9..d2bbc46 100644 --- a/src/slashCommands/moderation/clear.js +++ b/src/slashCommands/moderation/clear.js @@ -29,6 +29,12 @@ module.exports = { const amount = interaction.options.getInteger("amount"); const channel = interaction.channel; const reason = interaction.options.getString("reason"); + if (!reason) { + reason = "None"; + } + if (reason.length > 1024) { + reason = reason.slice(0, 1021) + "..."; + } if (amount < 0 || amount > 200) { let invalidamount = new MessageEmbed()