add useragent header to commands contacting APIs

This commit is contained in:
Emily 2021-02-26 13:16:47 +11:00
parent aa2d1a99f6
commit 460fccd543
9 changed files with 29 additions and 8 deletions

View file

@ -22,7 +22,7 @@ module.exports = class {
let date = 'xxxx';
if (args[0] && args[0].toLowerCase() === 'daily') date = new Date();
message.channel.sendTyping();
fetch('https://garfield-comics.glitch.me/~SRoMG/?date=' + date)
fetch('https://garfield-comics.glitch.me/~SRoMG/?date=' + date, { headers: { 'User-Agent': client.config.userAgent }})
.then(res => res.json())
.then(json => {
const embed = new client.RichEmbed()