This program runs upon system startup and serves as an alert for computer booting. It also offers control options via buttons in a Telegram chat to execute specific actions.
-
Upon system boot, the program sends an alert message to a designated Telegram chat, providing information about the system startup, such as username and IP address.
-
The program allows interaction via buttons in a Telegram chat to perform various actions on the system.
-
Create a Telegram bot and obtain the API token. You can do this by chatting with the BotFather on Telegram.
-
Send a message to your bot and access the URL https://api.telegram.org/bot<API_TOKEN>/getUpdates to retrieve the chat ID. Look for the chat object in the JSON response.
-
Use the following environment variables loader to configure the necessary variables before running the program:
# python
import os
def load_environ():
os.environ['tlg_api_key'] = '' # Assign your Telegram bot's API token here
os.environ['chat_id'] = '' # Assign your Telegram chat ID here
os.environ["photo_name"] = "" # Path to the image for taking photos
Make sure to replace the empty strings ('') with the corresponding values for the API token and chat ID.
Configure your system to run this program upon startup. Depending on your operating system, you can achieve this by adding the program to startup applications or using task scheduler.
Make sure all dependencies required by the program are installed. Refer to the requirements.txt file for details.
Upon system boot, the program automatically sends an alert message to the designated Telegram chat, including information about the system startup.
Interact with the program via buttons in the Telegram chat to perform various actions on the system. The available options may include:
You can add more options as needed.
Ensure proper configuration of environment variables and Telegram bot settings for seamless operation. Customize the behavior of the program and control options according to your preferences and system requirements. It's recommended to run this program in a secure environment and grant necessary permissions only to trusted users.