Haha-Yes/commands/fun/randodog.js

27 lines
725 B
JavaScript
Raw Normal View History

2018-09-26 13:47:21 +02:00
const { Command } = require('discord.js-commando');
const Discord = require('discord.js');
2018-09-28 17:57:00 +02:00
const fetch = require('node-fetch')
module.exports = class RandoCatCommand extends Command {
2018-09-26 13:47:21 +02:00
constructor(client) {
super(client, {
2018-09-28 17:57:00 +02:00
name: 'randocat',
2018-09-26 13:47:21 +02:00
group: 'fun',
2018-09-28 17:57:00 +02:00
memberName: 'randocat',
description: `Show a random cat`,
2018-09-26 13:47:21 +02:00
});
}
2018-09-28 17:57:00 +02:00
async run(message) {
fetch("https://random.dog/woof.json").then((response) => {
return response.json();
}).then((response) => {
2018-09-26 13:47:21 +02:00
const dogEmbed = new Discord.RichEmbed()
.setColor("#ff9900")
2018-09-28 17:57:00 +02:00
.setTitle('Meow')
.setImage(response.file)
2018-09-26 13:47:21 +02:00
message.say(dogEmbed);
2018-09-28 17:57:00 +02:00
});
}};