Migrate bunny command
This commit is contained in:
parent
e7169d960a
commit
35f7210b6e
3 changed files with 196 additions and 42 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue