diff --git a/nice-bot.js b/nice-bot.js index eaeff29..91dc133 100755 --- a/nice-bot.js +++ b/nice-bot.js @@ -9,15 +9,12 @@ const choice = process.argv[2]; // command line switch try{ switch (choice.toLowerCase()){ - case 'replybot reply': // you can choose "reply" or "status" from here when calling in Crontab - await postReply(); - break; - case 'replybot status': - await postRegularStatus(); - break; + case 'replybot': // node nice-bot.js replybot [reply] + process.argv[3] === 'reply' ? postReply() : postRegularStatus(); + break; default: - console.log('Something went wrong with nice-bot (ya dun goof\'d)'); - break; + console.log('Something went wrong with nice-bot (ya dun goof\'d)'); + break; }; } catch (error){ throw Error(error);