From c9926d7de38c69efa68dcb459d30febeac9f8edb Mon Sep 17 00:00:00 2001 From: Keyemail Date: Wed, 15 May 2024 21:20:51 -0700 Subject: [PATCH] Fixed Up Issues --- commands/moderation/clear.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/moderation/clear.js b/commands/moderation/clear.js index 3d388d4..04243c3 100644 --- a/commands/moderation/clear.js +++ b/commands/moderation/clear.js @@ -10,14 +10,13 @@ module.exports = { data: new SlashCommandBuilder() .setName('clear') .setDescription('Clears a certain amount of text!') - .addNumberOption(option => + .addIntegerOption(option => option.setName('amount') .setDescription('Set the amount to clear!') + .setMinValue(1) .setRequired(true)), async execute(interaction) { - const amount = interaction.options.getNumber('amount'); - - if(amount <= 0) return interaction.reply({ content: "<:xmark:1238963594758979736> This is not a valid number!", ephemeral: true }); + const amount = interaction.options.getInteger('amount'); if(!interaction.member.permissions.has(PermissionsBitField.Flags.ManageMessages)) return interaction.reply({ content: "<:xmark:1238963594758979736> You dont have permission to use this command", ephemeral: true }); @@ -28,7 +27,7 @@ module.exports = { console.log(informationStatus + `Cleared ${amount} amount of text in #${interaction.channel.name} with id of ${interaction.channel.id}`); await wait(6_000); - await interaction.deleteReply(); + await interaction.deleteReply(); } catch (error) { await interaction.reply({ content: "Sorry! Could not execute the clear command. Something went wrong", ephemeral: true }); console.log(errorStatus + "Something went wrong while trying to clear messages! Debug information is below.");