-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemed.js
30 lines (26 loc) · 908 Bytes
/
memed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const { MessageEmbed } = require('discord.js');
const somethingRandom = require('some-random-cat').Random // Import the package...
const subreddits = [
"meme",
"memes",
"dankmemes",
// You can add as many as you wish...
]
exports.run = (bot, message, args, func) => {
let randomSubReddit = subreddits[Math.floor(Math.random() * subreddits.length)] // Generates a random subreddit from the array...
somethingRandom.getMeme(randomSubReddit).then(res => {
const embed = new MessageEmbed()
.setTitle(res.title)
.setURL(`https://www.reddit.com/r/${randomSubReddit}`)
.setImage(res.img)
.setFooter(`👍 ${res.upvotes} | 💬 ${res.comments}`)
.setAuthor(`From ${res.author}`)
.setColor('RANDOM')
message.channel.send(embed)
console.log(res)
}).catch(e => message.channel.send('API Error.'))
}
module.exports.help = {
name: "memed",
aliases: ["dank"]
}