mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 23:36:35 +02:00
correction quel que probleme , wl system , owner system + permssion system
This commit is contained in:
@@ -11,7 +11,7 @@ module.exports = {
|
||||
try {
|
||||
const APIKEY = '1e59407044fd6d842180610a8c423aa4';
|
||||
const city = args[0];
|
||||
|
||||
const randomColor = Math.floor(Math.random() * 16777215).toString(16);
|
||||
if (!city) {
|
||||
return message.channel.send('Veuillez fournir une ville.');
|
||||
}
|
||||
@@ -22,13 +22,21 @@ module.exports = {
|
||||
const cityName = weatherData.name;
|
||||
const temperature = weatherData.main.temp;
|
||||
const weatherDescription = weatherData.weather[0].description;
|
||||
const humidity = weatherData.main.humidity;
|
||||
const pressure = weatherData.main.pressure;
|
||||
const windSpeed = weatherData.wind.speed;
|
||||
const windDirection = weatherData.wind.deg;
|
||||
const visibility = weatherData.visibility;
|
||||
const feelsLike = weatherData.main.feels_like;
|
||||
const weatherIcon = weatherData.weather[0].icon;
|
||||
|
||||
const Embed = new Discord.MessageEmbed()
|
||||
const Embed = new Discord.EmbedBuilder()
|
||||
.setTitle(`Meteo à ${cityName}`)
|
||||
.setDescription(`🌡・Temperature: ${temperature}°C\n⛅・Temps: ${weatherDescription}`)
|
||||
.setDescription(`🌡・Temperature: ${temperature}°C\n⛅・Temps: ${weatherDescription}\n💧・Humidité: ${humidity}%\n📊・Pression: ${pressure} hPa\n💨・Vitesse du vent: ${windSpeed} m/s\n🧭・Direction du vent: ${windDirection}°\n👁️🗨️・Visibilité: ${visibility} m\n🌡️・Sensation de température: ${feelsLike}°C`)
|
||||
.setTimestamp()
|
||||
.setColor('RANDOM') // Discord.js uses 'RANDOM' for random colors
|
||||
.setFooter({text: message.client.user.username, iconURL: message.client.user.displayAvatarURL({dynamic: true})});
|
||||
.setColor(`#${randomColor}`)
|
||||
.setFooter({text: message.client.user.username, iconURL: message.client.user.displayAvatarURL({dynamic: true})})
|
||||
.setThumbnail(`http://openweathermap.org/img/wn/${weatherIcon}.png`);
|
||||
|
||||
await message.channel.send({ embeds: [Embed] });
|
||||
} catch(e) {
|
||||
|
||||
Reference in New Issue
Block a user