mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
add rolebutton
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = {
|
||||
aliases: ['botconfig'],
|
||||
category: 'gestion',
|
||||
emote: '🤖',
|
||||
utilisation: '+botconfig',
|
||||
utilisation: 'botconfig',
|
||||
|
||||
async execute(message, args, client) {
|
||||
const bot = client.user;
|
||||
|
||||
@@ -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
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user