|
|
|
@ -29,12 +29,13 @@ module.exports = class redditCommand extends Command {
|
|
|
|
|
i = Math.floor((Math.random() * 20) + 1);
|
|
|
|
|
}
|
|
|
|
|
if (body.data.children[i].data.over_18 == true) {
|
|
|
|
|
return message.say("No nsfw")
|
|
|
|
|
return message.say("No nsfw ( if you want a nsfw version of this commands use the feedback commands \"haha feedback <your feedback>\")")
|
|
|
|
|
}
|
|
|
|
|
const redditEmbed = new Discord.RichEmbed()
|
|
|
|
|
.setColor("#ff9900")
|
|
|
|
|
.setTitle(body.data.children[i].data.title)
|
|
|
|
|
.setImage(body.data.children[i].data.preview.images[0].source.url)
|
|
|
|
|
.setFooter(`⬆ ${body.data.children[i].data.ups} 💬 ${body.data.children[i].data.num_comments}`)
|
|
|
|
|
|
|
|
|
|
message.say(redditEmbed);
|
|
|
|
|
}
|
|
|
|
|