mirror of
https://github.com/arthur-pbty/gestion-perso.git
synced 2026-06-03 23:36:35 +02:00
28 lines
911 B
TypeScript
28 lines
911 B
TypeScript
import { Message, EmbedBuilder } from "discord.js";
|
|
|
|
module.exports = {
|
|
aliases: ['allbots'],
|
|
description: 'Affiche tous les bots sur le serveur',
|
|
emote: '🤖',
|
|
utilisation: '',
|
|
permission: 0,
|
|
|
|
async execute(message: Message) {
|
|
if (!message.guild) return message.reply('Cette commande ne peut être utilisée que dans un serveur');
|
|
const bots = message.guild.members.cache.filter(member => member.user.bot);
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setTitle('Liste des bots présents')
|
|
.setColor('#0099ff');
|
|
|
|
if (bots.size > 0) {
|
|
const botList = Array.from(bots.values()).map((bot, index) => `${index + 1} - <@${bot.id}>`).join('\n');
|
|
embed.setDescription(botList);
|
|
embed.setFooter({ text: `Total : ${bots.size}`});
|
|
} else {
|
|
embed.setDescription('Il n\'y a pas de bot sur le serveur');
|
|
}
|
|
|
|
message.channel.send({ embeds: [embed] });
|
|
},
|
|
}; |