Hermitter / BDO-Boss-Alerts

A Discord bot that sends notification messages when a boss in Black Desert Online spawns.
9 stars 16 forks source link

Run without having to keep node.js running #6

Closed TylerBGit closed 6 years ago

TylerBGit commented 6 years ago

Hi, i'm just wondering if i am able to keep the bot running without having to keep my terminal open. If i exit my terminal the bot logs off after about 30 seconds.

Hermitter commented 6 years ago

On Linux, you can have it run in the background as a service, but I'm not too sure about Mac and Windows.

TylerBGit commented 6 years ago

Please see - https://github.com/coreybutler/node-windows

This module allows users to run node.js scripts as a service.

If you could update the read-me to accommodate adding a node.js script to windows services using this tool that would be great. I think this would be useful documentation to copy and paste over to your other bots that are using node too.

Thanks for the reply.

Hermitter commented 6 years ago

Although the game itself only runs on Windows, the bot is intended to run on any OS that supports Node. In the future, when I have time, I could look into making a branch for this.

Ayeven commented 6 years ago

For Krizzieb or anyone who will run this on windows platform;

  1. In command console/windows powershell : run npm i -g --production windows-build-tools which should install phytons and windows C++ Build Tools standalone.
    1. Install all the dependcy that discod.js needed. eg. node-opus, uws . This should take few minutes install all the dependency need for running on windows platform.
    2. Install pm2 module by npm install pm2. pm2 is an process management node . forever module is no supported on Windows
    3. After all that have done, run your apps by using pm2 e.g pm2 start app.js --name NoobBot . This should make the bot run without the need to open terminal all time.

Also, pardon if my "term" is quite wrong as I am just hobbyist coder/code collector.

Hermitter commented 6 years ago

Due to no recent activity, I will be closing the issue.