Haha-Yes/commands/fun/randodog.js

31 lines
880 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 RandoCatCommand extends Command {
2018-09-26 13:47:21 +02:00
constructor(client) {
super(client, {
2018-11-03 13:07:29 +01:00
name: 'randodog',
2018-09-26 13:47:21 +02:00
group: 'fun',
2018-11-03 13:07:29 +01: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("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-11-03 13:07:29 +01:00
.setTitle('woof')
.setImage(response.url)
2018-09-26 13:47:21 +02:00
message.say(dogEmbed);
2018-09-28 17:57:00 +02:00
});
}};