From 687a99fb3979e5d595122894359c2052a2b987ed Mon Sep 17 00:00:00 2001 From: matty Date: Fri, 10 Feb 2023 08:27:57 -0500 Subject: [PATCH] allow calling so replybot can do regular statuses --- nice-bot.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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);