openweathermap nighbot

Asked Oct 25, 2022·2 replies·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Hello, i am newb at this stuff.

how to make a request?, when specified !weather $(city) - will show a specific city, and with just !weather, it will show a given city, for example London.
I managed to achieve this(or i got help):

$(eval M=Math.round;if($(query) == `){c=London} else {c=$(query)`}; E=$(urlfetch json https://api.openweathermap.org/data/2.5/weather?q=${c}&APPID=e37f25f76c5129d6…);Погода ${E.name}: ${E.weather[0].description}, температура ${M(E.main.temp)}°C (ощущается как ${M(E.main.feels_like)}°C), ветер ${M(E.wind.deg)}° со скоростью ${M(E.wind.speed)}м/с, относительная влажность воздуха ${M(E.main.humidity)}%.; )

2 replies