Skip to content

SudoBot is a powerful Telegram Bot that allows users to execute commands, retrieve system information, check IP details, and manage system processes all from Telegram

License

Notifications You must be signed in to change notification settings

HackerShohag/SudoBot

Repository files navigation

πŸ€– SudoBot - Telegram Execution and Remote Assistant Bot

SudoBot is a powerful Telegram Bot that allows users to execute commands, retrieve system information, check IP details, and manage system processesβ€”all from Telegram.

πŸš€ Features

  • βœ… Command Execution: Run shell commands remotely.
  • 🌍 IP Information: Fetch local and public IP addresses.
  • πŸ–₯️ System Monitoring: Get system details and disk usage.
  • πŸ“œ Menu Integration: Access bot features via a built-in menu.
  • πŸ”‘ Sudo Support: Securely run commands as superuser.
  • πŸ› οΈ Systemd Service Support: Run the bot as a background system service.

πŸ› οΈ Installation

1️⃣ Clone the Repository

git clone https://github.com/yourusername/yourbot.git
cd yourbot

2️⃣ Setup Virtual Environment (Recommended)

It's recommended to use a virtual environment for dependency isolation.

πŸ“Œ Install virtualenv

pip3 install virtualenv

πŸ“Œ Create & Activate Virtual Environment

  • For Linux/macOS:
    virtualenv venv
    source venv/bin/activate
  • For Windows:
    virtualenv venv
    venv\Scripts\activate

πŸ“Œ Deactivate Virtual Environment

deactivate

πŸ“¦ Installing Dependencies

πŸ“Œ Install Required Packages

pip3 install -r requirements.txt

πŸ“Œ Update Dependencies

pip3 install --upgrade -r requirements.txt

πŸ“Œ Freeze Dependencies

pip3 freeze > requirements.txt

βš™οΈ Configuration

πŸ“Œ Create .env File

cp .env.example .env

πŸ“Œ Edit .env File

BOT_TOKEN=your_telegram_bot_token
  • Get your BOT_TOKEN from BotFather on Telegram.

πŸš€ Running the Bot

πŸ“Œ Start the Bot

python3 main.py

πŸ“Œ Run in the Background (for servers)

nohup python3 main.py > bot.log 2>&1 &

πŸ“Œ Stop the Bot

pkill -f main.py

πŸ§ͺ Running Tests

πŸ“Œ Run All Tests

python3 -m unittest discover tests
python3 -m unittest discover tests/bot

πŸ“Œ Run Specific Test File

python3 -m unittest tests.test_menu

πŸ”§ Systemd Service (Auto-Start on Boot)

πŸ“Œ Install the Bot as a systemd Service

Simply run the following script to install the bot as a systemd service:

bash install_service.sh
  • This script will automatically configure and start the bot on boot.

πŸ“œ License

This project is licensed under the GNU General Public License v3.0 (GPLv3).
You can read the full license text in the LICENSE file or at GNU’s official site.


🀝 Contributing

Pull requests are welcome!
Feel free to fork the repo and submit your changes.


πŸ“ž Contact


πŸ”₯ Developed with ❀️ by Shohag


This version emphasizes that the only step needed for systemd service installation is running the install.sh script. Let me know if you'd like any further adjustments! πŸš€

About

SudoBot is a powerful Telegram Bot that allows users to execute commands, retrieve system information, check IP details, and manage system processes all from Telegram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published