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