mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-06 14:20:38 +02:00
add alias systeme create , remove and list
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
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;
|
||||
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: '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] });
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
const weather = require('weather');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'weather',
|
||||
description: 'Affiche les informations météorologiques d\'une ville',
|
||||
async execute(message, args) {
|
||||
if (!args.length) {
|
||||
return message.channel.send('Veuillez fournir une ville.');
|
||||
}
|
||||
|
||||
const city = args.join(' ');
|
||||
const woeid = await weather.find({ search: city, degreeType: 'C' });
|
||||
|
||||
if (!woeid || woeid.length === 0) {
|
||||
return message.channel.send('Ville non trouvée.');
|
||||
}
|
||||
|
||||
const weatherData = await weather.get({ search: woeid[0].title, degreeType: 'C' });
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(`🌤️ Météo pour ${weatherData.location.name}`)
|
||||
.setDescription(`Température: ${weatherData.current.temperature}°C`)
|
||||
.addFields(
|
||||
{ name: '🌦️ Conditions', value: weatherData.current.skytext, inline: true },
|
||||
{ name: '💨 Vent', value: weatherData.current.winddisplay, inline: true },
|
||||
{ name: '💧 Humidité', value: weatherData.current.humidity, inline: true }
|
||||
)
|
||||
.setFooter('Informations météorologiques fournies par Weather.com');
|
||||
|
||||
|
||||
message.channel.send({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user