3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

weather country

This commit is contained in:
reality 2015-01-28 07:22:32 +00:00
parent c87c4312ad
commit 79a607ba1b

View File

@ -20,7 +20,7 @@ var weather = function(dbot) {
'json': true
}, function(err, response, body) {
if(!err && body && _.has(body, 'cod') && body.cod === 200) {
event.reply('['+body.name+']' + ' Condition: ' + body.weather[0].description + ' | Temp: ' + Math.round(body.main.temp) + 'C/'+Math.round(body.main.temp* 9 / 5 + 32)+'F | Humidity: ' + body.main.humidity + '% | Wind Speed: ' + body.wind.speed + 'KM/H');
event.reply('['+body.name+', '+body.sys.country+']' + ' Condition: ' + body.weather[0].description + ' | Temp: ' + Math.round(body.main.temp) + 'C/'+Math.round(body.main.temp* 9 / 5 + 32)+'F | Humidity: ' + body.main.humidity + '% | Wind Speed: ' + body.wind.speed + 'KM/H');
} else {
event.reply('There is no weather in ' + city);
}