mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-07 06:45:18 +02:00
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
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
const fetch = require('node-fetch');
|
||||
module.exports = {
|
||||
name: 'botconfig',
|
||||
description: 'Affiche la configuration du bot',
|
||||
@@ -11,8 +11,23 @@ module.exports = {
|
||||
async execute(message, args, client) {
|
||||
const bot = client.user;
|
||||
const presenceStatus = bot.presence.status;
|
||||
let presenceEmoji = '';
|
||||
|
||||
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 = '🟢';
|
||||
@@ -36,6 +51,7 @@ module.exports = {
|
||||
{ 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'}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user