Files
gestion/commands/moderation/baninfo.js
T
VALOU3336 9bd39c69ca grand commit que tutur attend ( marche pas le raidmode en dev)
sinon il y a pleins de truc comme les anti raid , des coorectif ect
2024-04-22 18:30:33 +02:00

30 lines
1.0 KiB
JavaScript

const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'baninfo',
description: 'Affiche les informations d\'un utilisateur bannie',
emote: '🚫',
utilisation: 'baninfo [id]',
category: 'gestion',
async execute(message, args, client) {
const userIdToCheck = args[0];
const bans = await message.guild.bans.fetch();
const ban = bans.find(ban => ban.user.id === userIdToCheck);
if (!ban) {
return message.reply('Cet utilisateur n\'est pas dans la liste des bannis.');
}
const banner = ban.executor;
const reason = ban.reason || 'Raison non disponible';
const banDate = ban.createdAt;
const embed = new EmbedBuilder()
.setTitle(`Informations sur l'utilisateur ${ban.user.tag}`)
.setDescription(`**Raison: **\`${reason}\`\n**Bannie par: **${banner ? banner.tag : 'Inconnu'}\n**Date: **${banDate}`)
.setColor('#0099ff');
message.channel.send({ embeds: [embed] });
},
};