Control bots on your server. Easiest way to manage multiple bots. Works for any .py scripts/bots, not just telegram bots
- Pull the latest commit and restart the bot
- Gets current statistics of the server
- Notifies admins when a bot is either killed/stopped
-
Clone the repo
git clone https://github.com/GauthamramRavichandran/MasterBot
-
Change directory
cd MasterBot
-
Create a new virtual environment
virtualenv env
-
Activate the virtual environment by,
source env/bin/activate
-
Install the requirements,
pip3 install -r requirements.txt
-
Fill in the
/const/CONFIG.py
file -
Place the
cert.pem
file if bot wants to use webhook method -
Start the master bot,
python main.py
- All the bots should have a separate virtualenv (called env) within its folder
- The last argument should be the alias (only alias will be used, not the name of the .py file)
Once the masterbot restarts anyother program, the new program will be under the masterbot process tree. If masterbot killed for any reason, all the programs started via this bot will be terminated too.
One way to safe kill this bot is to send SIGTERM signal, which will terminate this bot while preserving its children to continue execution.
- Open
htop
- Locate this bot by searching (F3 key)
- F9 to kill > select SIGTERM
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. YOU MAY USE THIS SOFTWARE AT YOUR OWN RISK. THE USE IS COMPLETE RESPONSIBILITY OF THE END-USER. THE DEVELOPERS ASSUME NO LIABILITY AND ARE NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE CAUSED BY THIS PROGRAM.
Please feel free to raise an issue here if you have any queries