From 4c59c31319b30a038c14094058bad96336e67432 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 16 Jan 2020 00:24:14 -0500 Subject: [PATCH] Fix --- structures/commands/Subreddit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structures/commands/Subreddit.js b/structures/commands/Subreddit.js index a16d4757..f2dcc453 100644 --- a/structures/commands/Subreddit.js +++ b/structures/commands/Subreddit.js @@ -45,7 +45,7 @@ module.exports = class SubredditCommand extends Command { return (this.postType ? this.postType.includes(post.data.post_hint) : true) && post.data.url && post.data.title; }); if (!posts.length) return null; - if (getIcon) icon = await this.getIcon(subreddit); + if (getIcon) icon = await this.fetchIcon(subreddit); return { origin: subreddit, post: posts[Math.floor(Math.random() * posts.length)].data, @@ -53,7 +53,7 @@ module.exports = class SubredditCommand extends Command { }; } - async getIcon(subreddit) { + async fetchIcon(subreddit) { const { body } = await request.get(`https://www.reddit.com/r/${subreddit}/about.json`); if (!body.data.icon_img) return 'https://i.imgur.com/DSBOK0P.png'; return body.data.icon_img;