From 11f0ed80b02cbde980c0a25fb4b5db4ea3224ec1 Mon Sep 17 00:00:00 2001 From: Dalton Date: Sat, 8 Dec 2018 01:44:17 -0800 Subject: [PATCH] missing argument fix? --- bot.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bot.js b/bot.js index acff2c7..dd9073e 100644 --- a/bot.js +++ b/bot.js @@ -186,7 +186,7 @@ function imgurRequest(subreddit, page_max) { // Abstracted Reddit Json media grab. function handleRedditJson(data) { let json = data.json(); - if(json.data) { + if (json.data) { for (let i = 0; i < json.data.children.length; i++) { let rand = getRandomInt(0, json.data.children.length - 1); @@ -600,11 +600,14 @@ client.on('message', message => { if (site_response) { message.channel.send(site_response); } - - // Missing Argument - } else { - message.channel.send('wut do i summon?'); } + } else if (messageSplit.length > 3) { + let imgur_terms = message.content.substring(9); + message.channel.send('summoning ' + imgur_terms); + + } else { + // Missing Argument + message.channel.send('wut do i summon?'); } } else { message.channel.send("You're a bad boi and a banned author, you can't summon til you learn to behave.");