vylbot-app/commands/bunny.js

34 lines
882 B
JavaScript
Raw Normal View History

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