Merge pull request #41 from Vylpes/hotfix/40-random-bunny
Fix bunny command
This commit is contained in:
commit
c8e48a9b80
3 changed files with 14 additions and 1430 deletions
|
@ -1,7 +1,7 @@
|
||||||
// Required components
|
// Required components
|
||||||
const { command } = require('vylbot-core');
|
const { command } = require('vylbot-core');
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const randomBunny = require('random-bunny');
|
const { randomBunny } = require('random-bunny');
|
||||||
|
|
||||||
// Command variables
|
// Command variables
|
||||||
const embedColor = "0x3050ba";
|
const embedColor = "0x3050ba";
|
||||||
|
@ -18,13 +18,14 @@ class bunny extends command {
|
||||||
// Run method
|
// Run method
|
||||||
bunny(context) {
|
bunny(context) {
|
||||||
// Get a random post from r/Rabbits
|
// Get a random post from r/Rabbits
|
||||||
randomBunny('rabbits', 'hot', (image, title) => {
|
randomBunny('rabbits', 'hot', (res) => {
|
||||||
// Create an embed containing the random image
|
// Create an embed containing the random image
|
||||||
const embed = new MessageEmbed()
|
const embed = new MessageEmbed()
|
||||||
.setColor(embedColor)
|
.setColor(embedColor)
|
||||||
.setTitle(title)
|
.setTitle(res.title)
|
||||||
.setImage(image)
|
.setImage(res.url)
|
||||||
.setFooter('r/Rabbits');
|
.setURL("https://reddit.com" + res.permalink)
|
||||||
|
.setFooter(`r/Rabbits · ${res.ups} upvotes`);
|
||||||
|
|
||||||
// Send the embed
|
// Send the embed
|
||||||
context.message.channel.send(embed);
|
context.message.channel.send(embed);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"token": "",
|
"token": "",
|
||||||
"prefix": "d!",
|
"prefix": "v!",
|
||||||
"commands": [
|
"commands": [
|
||||||
"commands"
|
"commands"
|
||||||
],
|
],
|
||||||
|
@ -9,10 +9,10 @@
|
||||||
],
|
],
|
||||||
"about": {
|
"about": {
|
||||||
"description": "Discord Bot for Vylpes' Den",
|
"description": "Discord Bot for Vylpes' Den",
|
||||||
"version": "2.1",
|
"version": "2.1.2",
|
||||||
"core-ver": "1.0.4",
|
"core-ver": "1.0.4",
|
||||||
"author": "Vylpes",
|
"author": "Vylpes",
|
||||||
"date": "17-Feb-21"
|
"date": "29-May-21"
|
||||||
},
|
},
|
||||||
"ban": {
|
"ban": {
|
||||||
"modrole": "Moderator",
|
"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