Migrate bunny command

This commit is contained in:
Ethan Lane 2021-12-02 11:11:46 +00:00
parent e7169d960a
commit 35f7210b6e
Signed by: Vylpes
GPG key ID: EED233CC06D12504
3 changed files with 196 additions and 42 deletions

View file

@ -1,35 +0,0 @@
// Required components
const { command } = require('vylbot-core');
const { MessageEmbed } = require('discord.js');
const randomBunny = require('random-bunny');
// 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
randomBunny('rabbits', 'hot', (image, title) => {
// Create an embed containing the random image
const embed = new MessageEmbed()
.setColor(embedColor)
.setTitle(title)
.setImage(image)
.setFooter('r/Rabbits');
// Send the embed
context.message.channel.send(embed);
});
}
}
module.exports = bunny;