vylbot-app/commands/bunny.js
2020-11-07 15:16:54 +00:00

34 lines
882 B
JavaScript

// Required components
const { command } = require('vylbot-core');
const { MessageEmbed } = require('discord.js');
const randomPuppy = require('random-puppy');
// Command variables
const embedColor = "0x3050ba";
// Command class
class bunny extends command {
constructor() {
// Set run method, description, and category
super("bunny");
super.description = "Gives you a random bunny";
super.category = "Fun";
}
// Run method
bunny(context) {
// Get a random post from r/Rabbits
randomPuppy('Rabbits').then(image => {
// Create an embed containing the random image
let embed = new MessageEmbed()
.setColor(embedColor)
.setImage(image);
// Send the embed
context.message.channel.send(embed);
});
}
}
module.exports = bunny;