From 7cdf903d3c25d94904eadf757bf6641969be4fb3 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 25 Sep 2018 23:22:34 +0000 Subject: [PATCH] Fix --- structures/commands/Subreddit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/structures/commands/Subreddit.js b/structures/commands/Subreddit.js index 6b9acfd7..e4f2b239 100644 --- a/structures/commands/Subreddit.js +++ b/structures/commands/Subreddit.js @@ -12,9 +12,9 @@ module.exports = class SubredditCommand extends Command { async run(msg, { subreddit }) { if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit; try { - const { post, origin } = await this.random(subreddit, msg.channel.nsfw); - if (!post) return msg.reply(`I couldn't fetch anything from r/${origin}...`); - return msg.say(this.generateText(post, origin)); + const post = await this.random(subreddit, msg.channel.nsfw); + if (!post) return msg.reply(`I couldn't fetch anything from r/${post.origin}...`); + return msg.say(this.generateText(post.post, post.origin)); } catch (err) { if (err.status === 403) return msg.say('This subreddit is private.'); if (err.status === 404) return msg.say('Could not find any results.');