diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-03 11:42:27 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-03 11:42:27 -0500 |
| commit | fd7f8eba960981482fabf350995bf753feebb176 (patch) | |
| tree | 2bd0c85b09a04ecd8e1f20fc409eb4b8a22289a7 /bot/src/commands/rm.js | |
| parent | cf1382d88c5e3298923c8cb243b7bc5751e68b53 (diff) | |
| download | AleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.gz AleeBot-fd7f8eba960981482fabf350995bf753feebb176.tar.bz2 AleeBot-fd7f8eba960981482fabf350995bf753feebb176.zip | |
More commands ported; Almost all 2.x features have been added
Diffstat (limited to 'bot/src/commands/rm.js')
| -rw-r--r-- | bot/src/commands/rm.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bot/src/commands/rm.js b/bot/src/commands/rm.js new file mode 100644 index 0000000..ec6f647 --- /dev/null +++ b/bot/src/commands/rm.js @@ -0,0 +1,21 @@ +import { SlashCommandBuilder, PermissionFlagsBits } from 'discord.js'; + +export default { + data: new SlashCommandBuilder() + .setName('rm') + .setDescription('Purges messages.') + .addNumberOption(option => + option + .setName('amount') + .setDescription('Enter the amount of messages you want to delete.') + .setRequired(true)) + .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages), + async execute(interaction) { + const amount = interaction.options.getNumber('amount'); + + if (amount > 100) return interaction.reply('Put a number less than 100.'); + + return await interaction.channel.bulkDelete(amount) + .then( (messages) => interaction.reply(`Deleted ${messages.size} messages.`)); + } +}; |
