This commit is contained in:
Daniel Odendahl Jr
2018-09-21 11:08:16 +00:00
parent f58f677e12
commit c6f0bee5db
+1 -1
View File
@@ -12,7 +12,7 @@ module.exports = class SubredditCommand extends Command {
async run(msg, { subreddit }) { async run(msg, { subreddit }) {
if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit; if (!subreddit) subreddit = typeof this.subreddit === 'function' ? this.subreddit() : this.subreddit;
try { try {
const { post, subreddit } = await this.random(msg.channel.nsfw); const { post, subreddit } = await this.random(subreddit, msg.channel.nsfw);
if (!post) return msg.reply(`I couldn't fetch anything from r/${subreddit}...`); if (!post) return msg.reply(`I couldn't fetch anything from r/${subreddit}...`);
return msg.say(this.generateText(post, subreddit)); return msg.say(this.generateText(post, subreddit));
} catch (err) { } catch (err) {