From 16fa8b93020f2bbdb42e8e9a6a3473620860f80a Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 27 Sep 2018 20:37:55 +0200 Subject: [PATCH] removed console.log beacause it was useless and making errors --- commands/fun/reddit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/fun/reddit.js b/commands/fun/reddit.js index 7f9d94b..566a4ee 100644 --- a/commands/fun/reddit.js +++ b/commands/fun/reddit.js @@ -22,8 +22,7 @@ module.exports = class redditCommand extends Command { async run(message, { sub }) { const { body } = await snekfetch.get('https://www.reddit.com/r/' + sub + '.json'); let /* the bodies hit the floor */ i = Math.floor((Math.random() * 10) + 1); - console.log(body.data.children[i].data.post_hint) - if (body.data.dist == '0') { + if (!body.data.children[1]) { return message.say('Not a valid subreddit') } while (body.data.children[i].data.post_hint !== 'image') {