From a62e778b6dde36ed957cb09dc20c61920fc0f1a0 Mon Sep 17 00:00:00 2001 From: *x1 Date: Wed, 29 May 2024 00:09:27 +0200 Subject: [PATCH] Update : finatilation des commandes ban, kick, mute --- commands/gestion/ban.js | 10 +++++----- commands/gestion/kick.js | 6 +++--- commands/gestion/mute.js | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/commands/gestion/ban.js b/commands/gestion/ban.js index 952f9ca..95fca6b 100644 --- a/commands/gestion/ban.js +++ b/commands/gestion/ban.js @@ -5,7 +5,7 @@ module.exports = { aliases: ['ban'], description: 'permet de ban un membre', emote: '⏱️', - utilisation: '<@membre|membreId> ', + utilisation: '<@membre> ', permission: 0, async execute(message, args, client) { @@ -22,8 +22,8 @@ module.exports = { ], allowedMentions: { repliedUser: false } }); } - const member = message.mentions.members.first()?.id || args[0]; - if (member.length < 1 && !member) { + let member = message.mentions.members.first() // || message.guild.members.get(args[0]); + if (!member) { return message.reply({ embeds: [ new EmbedBuilder() @@ -49,7 +49,7 @@ module.exports = { }); } - let reponse = '' + let reponse member.ban({ reason: motif }) .then(async () => { const btn = new ButtonBuilder() @@ -66,7 +66,7 @@ module.exports = { .setColor(await embedColor(message.author.id, message.guild.id)) .setTimestamp() .setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() }) - reponse = message.reply({ embeds: [embed], components: [row], allowedMentions: { repliedUser: false } }); + reponse = await message.reply({ embeds: [embed], components: [row], allowedMentions: { repliedUser: false } }); }) const filter = i => i.customId === 'mp' && i.user.id === message.author.id; diff --git a/commands/gestion/kick.js b/commands/gestion/kick.js index d299f0c..92c2d0a 100644 --- a/commands/gestion/kick.js +++ b/commands/gestion/kick.js @@ -5,7 +5,7 @@ module.exports = { aliases: ['kick'], description: 'permet d\'expulser un membre', emote: '⏱️', - utilisation: '<@membre|membreId> ', + utilisation: '<@membre> ', permission: 0, async execute(message, args, client) { @@ -22,8 +22,8 @@ module.exports = { ], allowedMentions: { repliedUser: false } }); } - const member = message.mentions.members.first()?.id || args[0]; - if (member.length < 1 && !member) { + let member = message.mentions.members.first() //|| message.guild.members.get(args[0]); + if (!member) { return message.reply({ embeds: [ new EmbedBuilder() diff --git a/commands/gestion/mute.js b/commands/gestion/mute.js index 51c3173..15e4c24 100644 --- a/commands/gestion/mute.js +++ b/commands/gestion/mute.js @@ -5,7 +5,7 @@ module.exports = { aliases: ['timeout'], description: 'permet de mute un membre', emote: '⏱️', - utilisation: '<@membre|membreId> ', + utilisation: '<@membre> ', permission: 0, async execute(message, args, client) { @@ -36,8 +36,8 @@ module.exports = { }); } - const member = message.mentions.members.first()?.id || args[0]; - if (member.length < 1 && !member) { + let member = message.mentions.members.first() //|| message.guild.members.get(args[0]) + if (!member) { return message.reply({ embeds: [ new EmbedBuilder() @@ -91,8 +91,8 @@ module.exports = { .addComponents(btn); const embed = new EmbedBuilder() - .setTitle('Membre expulser !') - .setDescription('Vous avez expulser: <@' + member + '>\nMotif: `' + motif + '`') + .setTitle('Membre mute !') + .setDescription('Vous avez mute: <@' + member + '>\nTemps: `' + time + '`min\nMotif: `' + motif + '`') .setColor(await embedColor(message.author.id, message.guild.id)) .setTimestamp() .setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })