The Profile Updater script is a Python program that allows you to update your Telegram profile name and about section with the current time. The script is designed to be flexible and configurable, allowing you to enable or disable specific profile update features and customize various settings through a configuration file.
To run the Profile Updater script, you need to have Python 3.x installed on your system. You can follow these steps to get started:
-
Clone the repository or download the script files to your local machine.
-
Install the required dependencies by running the following command in your terminal:
pip install -r requirements.txt
Before running the Profile Updater script, you need to configure the settings in the config.json
file. The configuration options available are as follows:
api_id
: Your Telegram API ID. You can obtain this by creating an application in the Telegram API development platform (https://my.telegram.org/apps).api_hash
: Your Telegram API hash. This is also obtained during the application creation process.update_name
: A boolean value indicating whether to update the profile name. Set it totrue
to enable name updates orfalse
to disable them.update_about
: A boolean value indicating whether to update the profile about section. Set it totrue
to enable about section updates orfalse
to disable them.timezone
: The desired timezone for displaying the current time. You can set this to any valid timezone value supported by thepytz
library.show_seconds
: A boolean value indicating whether to include seconds in the displayed time. Set it totrue
to include seconds orfalse
to exclude them. Warning: Enabling this option may increase the frequency of profile updates and potentially lead to rate limiting by the Telegram API.
To run the Profile Updater script, follow these steps:
-
Configure the
config.json
file with your desired settings. -
Open a terminal or command prompt and navigate to the directory where the script files are located.
-
Run the following command:
python main.py
-
The script will start executing and will update your Telegram profile based on the configured settings. The script will continue running indefinitely, updating the profile every minute when the seconds reach 0.
The Profile Updater script logs its activity to two log files: profile_update.log
and profile_update_summary.log
.
-
profile_update.log
: This log file contains detailed log messages, including information about each profile update action performed by the script. It provides a comprehensive record of the script's activities and any potential errors or warnings encountered. -
profile_update_summary.log
: This log file contains summary messages that only include the updated timestamp and the section (name or about) that was updated. It serves as a concise summary of the profile update events without duplicating the detailed log entries.
Both log files follow the same log format:
[timestamp] - [name] - [log level] - [message]
timestamp
: The timestamp of the log entry.name
: The logger name (ProfileUpdater
orProfileUpdaterSummary
).log level
: The log level indicating the severity of the message (e.g., INFO, WARNING, ERROR).message
: The log message describing the event or information.
If you want to customize the logging behavior or extend the script's functionality, you can modify the code accordingly. Here are some possible customizations:
- Adjust the log format or log levels to suit your preferences.
- Add additional features or actions to be performed during profile updates.
- Implement error handling or exception handling mechanisms to handle specific scenarios.
Feel
free to modify the code to fit your specific requirements and use cases.
The Profile Updater script provides a convenient way to automatically update your Telegram profile with the current time. By configuring the script according to your preferences, you can personalize your profile and display dynamic information.