Telegram Server Manager Bot - Safe & Easy run command in your RaspberryPi, PC or server from every where.
-
To begin, you'll need an Access Token. If you already read and followed Introduction to the API, you can use the one you generated then. If not: To generate an Access Token, you have to talk to @BotFather and follow a few simple steps (described here). You should really read the introduction first, though. Source: Your first bot from python-telegram-bot
-
First install some dependencies: Best way is use Virtualenv:
virtualenv -p python3 .env
source .env/bin/activate
pip install -r requirements.txt
Install these package for using htop command:
apt-get install htop aha
yum install htop
git clone https://github.com/theZiz/aha.git
cd aha
make
make install
- After create your bot and get your Token from botFather, send some text(more than two message) to your bot and use this command to find your chat_id:
use @userinfobot bot to get your chat_id by sending /start to bot.
Copy
config.example
toconfig
and put yourchat_id
andToken
(in step1) in config file.
cp config.example config
- Run code:
python bot.py
- Send you command: send any command you want like:
ps -aux
To get a snapshot of htop, send /htop
command to bot, output will be like this: