forked from Supositware/Haha-Yes
Replaced snekfetch by node-fetch
parent
c652c2b671
commit
b1d278ba2d
@ -1,24 +1,27 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
module.exports = class RandoCatCommand extends Command {
|
||||
const fetch = require('node-fetch')
|
||||
module.exports = class RandoDogCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'randocat',
|
||||
name: 'randodog',
|
||||
group: 'fun',
|
||||
memberName: 'randocat',
|
||||
description: `Show a random cat`,
|
||||
memberName: 'randodog',
|
||||
description: `Show a random dog`,
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, { city }) {
|
||||
const { body } = await snekfetch.get(`http://aws.random.cat/meow`);
|
||||
const dogEmbed = new Discord.RichEmbed()
|
||||
async run(message) {
|
||||
|
||||
fetch("http://aws.random.cat/meow").then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
const catEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setTitle('Meow')
|
||||
.setImage(body.file)
|
||||
.setImage(response.file)
|
||||
|
||||
|
||||
message.say(dogEmbed);
|
||||
}
|
||||
};
|
||||
message.say(catEmbed);
|
||||
});
|
||||
}};
|
@ -1,24 +1,27 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const Discord = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
module.exports = class RandoDogCommand extends Command {
|
||||
const fetch = require('node-fetch')
|
||||
module.exports = class RandoCatCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'randodog',
|
||||
name: 'randocat',
|
||||
group: 'fun',
|
||||
memberName: 'randodog',
|
||||
description: `Show a random doggy`,
|
||||
memberName: 'randocat',
|
||||
description: `Show a random cat`,
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, { city }) {
|
||||
const { body } = await snekfetch.get(`https://random.dog/woof.json`);
|
||||
async run(message) {
|
||||
|
||||
fetch("https://random.dog/woof.json").then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
const dogEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setTitle('Woof')
|
||||
.setImage(body.url)
|
||||
.setTitle('Meow')
|
||||
.setImage(response.file)
|
||||
|
||||
|
||||
message.say(dogEmbed);
|
||||
}
|
||||
};
|
||||
});
|
||||
}};
|
Loading…
Reference in New Issue