Fix bunny command #41

Merged
Vylpes merged 1 commit from hotfix/40-random-bunny into main 2021-05-29 10:46:39 +01:00
3 changed files with 14 additions and 1430 deletions

View file

@ -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);

View file

@ -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

File diff suppressed because it is too large Load diff