Removed weather
This commit is contained in:
parent
9cb76393d7
commit
14f770d587
2 changed files with 0 additions and 38 deletions
|
@ -1,37 +0,0 @@
|
|||
const { Command } = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { openweatherAPI } = require('../../config.json');
|
||||
module.exports = class WeatherCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'weather',
|
||||
group: 'fun',
|
||||
memberName: 'weather',
|
||||
description: `Choose the city you want to know the weather`,
|
||||
args: [
|
||||
{
|
||||
key: 'city',
|
||||
prompt: 'city',
|
||||
type: 'string',
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, { city }) {
|
||||
const { body } = await snekfetch.get(`https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&APPID=${openweatherAPI}`);
|
||||
if (!body.main.temp) {
|
||||
return message.say(`No results found for **${city}**`);
|
||||
}
|
||||
const weatherEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setTitle(body.name + ' current weather')
|
||||
.setDescription(body.main.temp + '°c')
|
||||
.addField('Temp min', body.main.temp_min + '°c')
|
||||
.addField('Temp max', body.main.temp_max + '°c')
|
||||
|
||||
|
||||
message.say(weatherEmbed);
|
||||
}
|
||||
};
|
|
@ -5,5 +5,4 @@
|
|||
"botID": "ID of the bot",
|
||||
"statsChannel": "ID of the channel that the bot are going to post its stats",
|
||||
"supportServer": "Invite link for the support server of the bot",
|
||||
"openweatherAPI": "open weather api key"
|
||||
}
|
Loading…
Reference in a new issue