News and Interesting Commands

This commit is contained in:
Dragon Fire
2020-06-08 16:49:21 -04:00
parent 5d6557ff76
commit 1592041760
8 changed files with 128 additions and 9 deletions
+5 -1
View File
@@ -37,7 +37,7 @@ module.exports = class SubredditCommand extends Command {
}
makeEmbed(post, subreddit, icon) {
return new MessageEmbed()
const embed = new MessageEmbed()
.setColor(0xFF4500)
.setAuthor(`r/${subreddit}`, icon, `https://www.reddit.com/r/${subreddit}/`)
.setTitle(shorten(post.title, 256))
@@ -45,6 +45,10 @@ module.exports = class SubredditCommand extends Command {
.setURL(`https://www.reddit.com${post.permalink}`)
.setTimestamp(post.created_utc * 1000)
.setFooter(`${formatNumberK(post.ups)}`);
if (post.thumbnail && post.thumbnail !== 'self' && post.post_hint !== 'image') {
embed.setThumbnail(post.thumbnail);
}
return embed;
}
async random(subreddit, nsfw) {