From 240526387627989bd5ef31d7f4cd5a86255d96a8 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 25 Mar 2020 14:19:55 -0400 Subject: [PATCH] Prevent errors from thumbnail being "self" --- commands/random-res/subreddit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/random-res/subreddit.js b/commands/random-res/subreddit.js index 5ca7469d..8ac8e2ee 100644 --- a/commands/random-res/subreddit.js +++ b/commands/random-res/subreddit.js @@ -33,7 +33,9 @@ module.exports = class SubredditCommand extends SubredditCommandBase { .setURL(`https://www.reddit.com${post.permalink}`) .setTimestamp(post.created_utc * 1000) .setFooter(`⬆ ${formatNumber(post.score)}`); - if (post.thumbnail && post.post_hint !== 'image') embed.setThumbnail(post.thumbnail); + if (post.thumbnail && post.thumbnail !== 'self' && post.post_hint !== 'image') { + embed.setThumbnail(post.thumbnail); + } return embed; } };