ncd-bot/nice-bot.js

25 lines
601 B
JavaScript
Raw Normal View History

2023-02-10 01:18:05 +00:00
#!/home/bot/.nvm/versions/node/v18.14.0/bin/node
'use strict';
import 'dotenv/config';
import { postRegularStatus, postReply } from './lib/replybot.js';
2023-02-10 01:18:05 +00:00
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
2023-02-10 01:18:05 +00:00
await postReply();
break;
case 'replybot status':
await postRegularStatus();
break;
2023-02-10 01:18:05 +00:00
default:
console.log('Something went wrong with nice-bot (ya dun goof\'d)');
break;
};
} catch (error){
throw Error(error);
}