include useragent in headers

This commit is contained in:
Emily 2021-02-26 13:17:20 +11:00
parent 493a9bce10
commit f7adf1a865

View file

@ -39,7 +39,7 @@ module.exports = class {
}
message.channel.sendTyping();
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`)
fetch(`https://api.openweathermap.org/data/2.5/weather?q=${city + countryCode}&appid=${client.config.keys.weather}`, { headers: { 'User-Agent': client.config.userAgent }})
.then(res => res.json())
.then(json => {
if (json.cod >= 200 && json.cod <= 299) {