mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
9bd39c69ca
sinon il y a pleins de truc comme les anti raid , des coorectif ect
63 lines
2.4 KiB
JavaScript
63 lines
2.4 KiB
JavaScript
const { EmbedBuilder } = require('discord.js');
|
|
const fetch = require('node-fetch');
|
|
module.exports = {
|
|
name: 'botconfig',
|
|
description: 'Affiche la configuration du bot',
|
|
aliases: ['botconfig'],
|
|
category: 'gestion',
|
|
emote: '🤖',
|
|
utilisation: 'botconfig',
|
|
|
|
async execute(message, args, client) {
|
|
const bot = client.user;
|
|
const presenceStatus = bot.presence.status;
|
|
const axios = require('axios');
|
|
const response = await fetch(`https://discord.com/api/users/${bot.id}`, {
|
|
method: 'GET',
|
|
headers: {
|
|
Authorization: `Bot ${message.client.token}`
|
|
}
|
|
});
|
|
const data = await response.json();
|
|
|
|
if (!data.banner) {
|
|
return message.reply('Cet utilisateur n\'a pas de bannière.');
|
|
}
|
|
|
|
const format = data.banner.startsWith('a_') ? 'gif' : 'png';
|
|
|
|
const bannerURL = `https://cdn.discordapp.com/banners/${bot.id}/${data.banner}.${format}?size=2048`;
|
|
let presenceEmoji = '';
|
|
switch (presenceStatus) {
|
|
case 'online':
|
|
presenceEmoji = '🟢';
|
|
break;
|
|
case 'idle':
|
|
presenceEmoji = '🟡';
|
|
break;
|
|
case 'dnd':
|
|
presenceEmoji = '🔴';
|
|
break;
|
|
case 'invisible':
|
|
presenceEmoji = '⚪';
|
|
break;
|
|
default:
|
|
presenceEmoji = '⚪';
|
|
break;
|
|
}
|
|
const embed = new EmbedBuilder()
|
|
.setTitle('Configuration du bot')
|
|
.addFields(
|
|
{ name: 'Nom du bot', value: bot.username || 'Inconnu' },
|
|
{ name: 'ID du bot', value: bot.id || 'Inconnu'},
|
|
{ name: ' ', value: `[URL du profil](${bot.displayAvatarURL({ dynamic: true })})`},
|
|
{ name: ' ', value: `[URL de la banniere](${bannerURL})`},
|
|
{ name: 'Présence', value: `${presenceEmoji}`},
|
|
{ name: 'Statut', value: bot.presence.activities[0] && bot.presence.activities[0].state ? bot.presence.activities[0].state : 'Aucun statut'}
|
|
)
|
|
.setThumbnail(bot.displayAvatarURL({ dynamic: true }))
|
|
.setFooter({ text: 'Informations sur le bot', iconURL: bot.displayAvatarURL({dynamic: true})});
|
|
|
|
message.channel.send({ embeds: [embed] });
|
|
},
|
|
}; |