Haha-Yes/commands/fun/randocat.js

31 lines
879 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')
2018-10-15 20:23:45 +02:00
const blacklist = require('../../json/blacklist.json')
2018-09-28 17:57:00 +02:00
module.exports = class RandoDogCommand extends Command {
2018-09-26 13:47:21 +02:00
constructor(client) {
super(client, {
2018-09-28 17:57:00 +02:00
name: 'randodog',
2018-09-26 13:47:21 +02:00
group: 'fun',
2018-09-28 17:57:00 +02:00
memberName: 'randodog',
description: `Show a random dog`,
2018-09-26 13:47:21 +02:00
});
}
2018-09-28 17:57:00 +02:00
async run(message) {
2018-10-15 20:23:45 +02:00
if(blacklist[message.author.id])
return message.channel.send("You are blacklisted")
2018-09-28 17:57:00 +02:00
fetch("http://aws.random.cat/meow").then((response) => {
return response.json();
}).then((response) => {
const catEmbed = new Discord.RichEmbed()
2018-09-26 13:47:21 +02:00
.setColor("#ff9900")
.setTitle('Meow')
2018-09-28 17:57:00 +02:00
.setImage(response.file)
2018-09-26 13:47:21 +02:00
2018-09-28 17:57:00 +02:00
message.say(catEmbed);
});
}};