diff --git a/commands/gestion/clear.js b/commands/gestion/clear.js new file mode 100644 index 0000000..4ce686b --- /dev/null +++ b/commands/gestion/clear.js @@ -0,0 +1,20 @@ +const { PermissionsBitField} = require("discord.js") +module.exports = { + name: 'clear', + description: 'Clear des messages', + emote: '🗑️', + utilisation: 'clear ', + category: 'gestion', + async execute(message, args, client) { + const amount = parseInt(args[0]) + 1; + if (isNaN(amount)) { + return message.reply('Veuillez entrer un nombre valide'); + } else if (amount <= 1 || amount > 100) { + return message.reply('Vous devez entrer un nombre entre 1 et 99'); + } + await message.reply('🗑️ Clear en cours...'); + await message.channel.bulkDelete(amount, true).catch((err) => { + message.reply('Une erreur est survenue lors du clear'); + }); + }, +}; \ No newline at end of file diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 7bd9b3f..1ee0d58 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -6,7 +6,7 @@ module.exports = { description: 'Kick a member', emote: '🔍', utilisation: 'kick <@member> [reason]', - category: 'utils', + category: 'moderation', async execute(message, args, client) { const member = message.mentions.members.first();