add useragent header to commands contacting APIs
This commit is contained in:
parent
aa2d1a99f6
commit
460fccd543
9 changed files with 29 additions and 8 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue