Fix bunny command
This commit is contained in:
parent
811f02c6ce
commit
b2c9823ccd
3 changed files with 14 additions and 1430 deletions
|
@ -1,7 +1,7 @@
|
|||
// Required components
|
||||
const { command } = require('vylbot-core');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const randomBunny = require('random-bunny');
|
||||
const { randomBunny } = require('random-bunny');
|
||||
|
||||
// Command variables
|
||||
const embedColor = "0x3050ba";
|
||||
|
@ -18,13 +18,14 @@ class bunny extends command {
|
|||
// Run method
|
||||
bunny(context) {
|
||||
// Get a random post from r/Rabbits
|
||||
randomBunny('rabbits', 'hot', (image, title) => {
|
||||
randomBunny('rabbits', 'hot', (res) => {
|
||||
// Create an embed containing the random image
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(embedColor)
|
||||
.setTitle(title)
|
||||
.setImage(image)
|
||||
.setFooter('r/Rabbits');
|
||||
.setTitle(res.title)
|
||||
.setImage(res.url)
|
||||
.setURL("https://reddit.com" + res.permalink)
|
||||
.setFooter(`r/Rabbits · ${res.ups} upvotes`);
|
||||
|
||||
// Send the embed
|
||||
context.message.channel.send(embed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue