added upvotes and comments

This commit is contained in:
loicbersier 2018-09-27 22:49:48 +02:00
parent 16fa8b9302
commit 8f1878113c

View file

@ -29,12 +29,13 @@ module.exports = class redditCommand extends Command {
i = Math.floor((Math.random() * 20) + 1); i = Math.floor((Math.random() * 20) + 1);
} }
if (body.data.children[i].data.over_18 == true) { 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() const redditEmbed = new Discord.RichEmbed()
.setColor("#ff9900") .setColor("#ff9900")
.setTitle(body.data.children[i].data.title) .setTitle(body.data.children[i].data.title)
.setImage(body.data.children[i].data.preview.images[0].source.url) .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); message.say(redditEmbed);
} }