rentgg / telegram-bot-for-io.net

This bot is designed to facilitate working with your workers, especially if you have many of them. It allows you to start a node, reset containers and images, install a new worker, check the status of containers and images, and perform a server restart (remote).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please note that the servers must be on a linux system it will not work on other operating systems!!!

Instructions for Using the Bot:

  1. You need to download Python from the official website: Python 3.10.6 (tested on this version).

  2. Open the command prompt and navigate to the folder where your script is located using the command cd (path to the folder).

  3. Enter the following command in the command prompt:

    pip install -r requirements.txt

  4. Now you need to open the bot.py file and replace:

TELEGRAM_BOT_TOKEN = "your Telegram bot token" # Create it here

TELEGRAM_CHAT_ID = "your chat ID" # You can find it here

  1. Now that you have everything set up, you can start the bot by running the command:

    python bot.py

  2. To begin, send the command /start to the bot, and it will guide you on what to do next.

Video instructions / Demonstration of the bot's functionality

you can also watch a video that shows the installation process and the operation of all the bot's functionality from beginning to end here

Description of All Buttons and commands:

Buttons:

Setup New Worker - initiates the installation of all dependencies. Upon completion, it will notify you and ask you to launch the node using the "Launch Node" button. (note that before clicking on the Launch Node button you need to bind the command via /addcommand)

Reset Containers & Images - completely removes all containers and images.

Launch Node - launches the node, be sure to click after the Setup New Worker function (note that before clicking on the button you need to bind the command via /addcommand)

Check Containers Status - shows all information about containers if they are running. If not, it will indicate that there are no running containers.

Check Images Status - performs the same action as the previous function but for images.

Restart Server - restarts your remote server (takes about a minute).

Check Status All Servers - this allows you to check all servers for network connectivity and find out the status of containers (the video shows how it works on only 1 server, but it will work for you even if you have 10+ servers)

Commands:

/addserver - accepts data in the format [ip]:[username]:[pass] [name] (optional) - adds a new server to the database (saved in the file servers.json) /delserver - accepts data in the format [ip or name] - deletes the specified server /menu - opens the list of added servers /addcommand - accepts data in the format [ip] [command] - binds the /launch_binary command to the selected ip (saved in the file commands.json)

License and...

This is the first version of my bot, and there may be errors. Please feel free to report them either on GitHub in the Issues section or on Discord - rentgg.

I am also open to suggestions for improvement. However, please note that interacting with the website cloud.io.net is currently impossible because they do not have an open API.

I grant permission for other developers to use my code for further development or modification, but please credit me as the original author.

Change log

25.03.2024

+added saving servers after 1 input

29.03.2024

add server deletion - simple removal of servers with the command /delserver [name]

add command binding /launch_binary to each server - now you can bind startup commands to each ip with the command /addcommand [ip] [command]

add a 'check all containers' button to check all servers and all containers in the format 'name - status' - now you can check the status of all servers with one button (useful for those who have many servers)

Future updates

add a check for duplicates when adding servers

speed up the bot's work by transferring to asyncio

add a new feature that will restart the node every day

create a compiled version of the bot for windows system

About

This bot is designed to facilitate working with your workers, especially if you have many of them. It allows you to start a node, reset containers and images, install a new worker, check the status of containers and images, and perform a server restart (remote).


Languages

Language:Python 100.0%