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);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"token": "",
|
||||
"prefix": "d!",
|
||||
"prefix": "v!",
|
||||
"commands": [
|
||||
"commands"
|
||||
],
|
||||
|
@ -9,10 +9,10 @@
|
|||
],
|
||||
"about": {
|
||||
"description": "Discord Bot for Vylpes' Den",
|
||||
"version": "2.1",
|
||||
"version": "2.1.2",
|
||||
"core-ver": "1.0.4",
|
||||
"author": "Vylpes",
|
||||
"date": "17-Feb-21"
|
||||
"date": "29-May-21"
|
||||
},
|
||||
"ban": {
|
||||
"modrole": "Moderator",
|
||||
|
|
1427
package-lock.json
generated
1427
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue