add rolebutton

This commit is contained in:
VALOU3336
2024-03-01 12:05:29 +01:00
parent 7ff8c0237f
commit 2b9c5efa33
20 changed files with 189 additions and 30 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = {
aliases: ['botconfig'],
category: 'gestion',
emote: '🤖',
utilisation: '+botconfig',
utilisation: 'botconfig',
async execute(message, args, client) {
const bot = client.user;
+1 -1
View File
@@ -108,7 +108,7 @@ module.exports = {
let description = `Sélectionnez une catégorie parmi les options ci-dessous pour obtenir de l'aide sur les commandes correspondantes.\n Il y a ${totalCommands} commandes disponibles\n\n`;
for (const [category, commands] of Object.entries(categories)) {
description += `**Catégorie ${category}**\n`;
description += `**Catégorie ${category}** (${commands.length})\n`;
description += commands.length > 0 ? '> ' + commands.map(command => `\`${command.name}\``).join(', ') : '> Aucune commande dans cette catégorie';
description += '\n\n';
}
+16 -13
View File
@@ -1,6 +1,12 @@
const weather = require('weather');
const Weather = require('weather');
const { EmbedBuilder } = require('discord.js');
const appID = '';
const appCode = '';
const weather = new Weather({
appID,
appCode
});
module.exports = {
name: 'weather',
description: 'Affiche les informations météorologiques d\'une ville',
@@ -8,19 +14,16 @@ module.exports = {
emote: '☀️',
utilisation: 'weather [ville]',
async execute(message, args) {
if (!args.length) {
return message.channel.send('Veuillez fournir une ville.');
if (args.length < 2) {
return message.channel.send('Veuillez fournir une ville et un pays.');
}
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 city = args[0];
const country = args[1];
const weatherData = await weather.now(`${city}, ${country}`).then((results) => {
console.log(results);
});
const embed = new EmbedBuilder()
.setTitle(`🌤️ Météo pour ${weatherData.location.name}`)
.setDescription(`Température: ${weatherData.current.temperature}°C`)