Lanbot_Music/commands/music/purge.js

20 lines
516 B
JavaScript
Raw Normal View History

2022-04-03 04:34:37 +02:00
module.exports = {
name: 'purge',
aliases: ['purge'],
utilisation: '{prefix}purge',
voiceChannel: false,
async execute(client, message, args) {
if (isNaN(args[0]) || (args[0] < 1 || args[0] > 100)) return message.reply('Il faut spécifier un **nombre** entre 1 et 100 !');
const messages = await message.channel.messages.fetch({
limit: Math.min(args[0], 100),
before: message.id,
});
message.delete();
await message.channel.bulkDelete(messages);
},
};