Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mearashadowfax/guardianchrono

A Telegram bot that simplifies global time tracking, synchronization, and conversion with ease
https://github.com/mearashadowfax/guardianchrono

bot python python-telegram-bot telegram telegram-bot timezone-conversion

Last synced: 4 days ago
JSON representation

A Telegram bot that simplifies global time tracking, synchronization, and conversion with ease

Awesome Lists containing this project

README

        

# GuardianChrono Telegram Bot

![GuardianChronoPoster](https://github.com/mearashadowfax/GuardianChrono/assets/125820963/8d68ac0b-0553-403b-a72a-47059b79f433)

GuardianChrono is a Telegram bot built with Python's python-telegram-bot library. It is designed to provide a range of useful time-related features, including obtaining the current time and timezone of any city, converting timezones, and calculating the time difference between cities. To use the bot, simply send a message with the name of a city you're interested in, and GuardianChrono will promptly respond with the current local time and timezone.

## Getting started
To get started with this project, follow these steps:
1. Create a new Telegram Bot and obtain a token following the [instructions](https://core.telegram.org/bots#how-do-i-create-a-bot)
2. Clone this repository and navigate to the project directory
3. Create a `.env` file in the project directory and define a variable named `TELEGRAM_API_TOKEN` with your Telegram Bot token. The contents of your `.env` file should look like this:
```python
TELEGRAM_API_TOKEN = YOUR_TELEGRAM_API_TOKEN
```
4. In your existing `config.py` file within the project directory, make sure to adjust the setup accordingly to load and use this environmental variable

Native Installation

5. Install the required dependencies using `pip3 install -r requirements.txt`
6. Run the `main.py` script using `python3 main.py`

Docker Installation

5. Build the Docker container using

```console
docker build -t guardian-chrono .
```
6. Run the Docker container using the command

```console
docker run --mount type=bind,source="$(pwd)"/config.py,target=/config.py,readonly guardian-chrono
```

Docker Compose Installation

5. Build and run the Docker container using

```console
docker-compose up -d
```

Afterwards, start the bot in Telegram by searching for the bot name and clicking on the `start` button

## Usage
This Telegram bot offers the following features:
1. Discover Local Time: Type the name of a city to get the current local time.
2. Get City Timezone: Enter a city name to retrieve its timezone.
3. Convert Timezone: Convert a specific time to your local timezone.
4. Compare Time Difference: Easily compare the time difference between two cities.

To learn more about the bot's features, visit the bot at [GuardianChrono](https://t.me/GuardianChronoBot).
## Contributing
If you'd like to contribute to this project, feel free to fork the repository and submit a pull request. You can also create an issue to report bugs or suggest new features.

## License
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/mearashadowfax/GuardianChrono/blob/main/LICENSE) file for details.