snekfetch

This commit is contained in:
Daniel Odendahl Jr
2017-05-15 03:31:13 +00:00
parent d1148a0966
commit 87c0646233
40 changed files with 236 additions and 210 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const { Command } = require('discord.js-commando');
const request = require('superagent');
const snekfetch = require('snekfetch');
module.exports = class CatCommand extends Command {
constructor(client) {
@@ -17,7 +17,7 @@ module.exports = class CatCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
try {
const { body } = await request
const { body } = await snekfetch
.get('http://random.cat/meow');
return msg.channel.send({ files: [body.file] })
.catch(err => msg.say(err));
+2 -2
View File
@@ -1,5 +1,5 @@
const { Command } = require('discord.js-commando');
const request = require('superagent');
const snekfetch = require('snekfetch');
module.exports = class DogCommand extends Command {
constructor(client) {
@@ -16,7 +16,7 @@ module.exports = class DogCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
return msg.say('This Command requires the `Attach Files` Permission.');
try {
const { body } = await request
const { body } = await snekfetch
.get('https://random.dog/woof.json');
return msg.channel.send({ files: [body.url] })
.catch(err => msg.say(err));