This project is a simple Telegram bot that sends scheduled messages to a specified chat.
- Sends scheduled messages at specified times.
- Supports loading configuration from an external YAML file.
- Python 3.9+
- Docker (optional)
-
Clone the repository:
git clone https://github.com/koidula/scheduled_tg_bot.git
-
Install the required dependencies:
pip install -r requirements.txt
-
or if you are using Docker:
docker build -t telegram_bot .
-
Create a config.yml file in the root directory of the project.
-
Add your Telegram bot token, chat ID, and the scheduled message. Example:
TOKEN: "your_bot_token_here" CHAT_ID: "your_chat_id_here" SCHEDULED_MESSAGE: "Your scheduled message here"
Run:
python telegram_bot.py
If you've already built the Docker image, run the container:
docker run -e TZ=Europe/Moscow -d telegram_bot
Now your bot will send scheduled messages at specified times to the specified chat.