Stream Telegram Bot is a bot that checks for scheduled YouTube streams and sends notifications about them in Telegram. After the stream ends, the bot automatically deletes the corresponding messages.
- Checks a YouTube channel for scheduled streams.
- Sends a notification to a Telegram channel about an upcoming stream.
- Sends an additional notification 15 minutes before the stream starts.
- Deletes the stream message after it ends.
Examples of notifications the bot sends to Telegram are stored in the scr/constants.py file.
"Запланирован стрим в {time}, не пропустите!\n{url}""Стрим будет в {time}, присоединяйтесь.\n{url}"
"Стрим начнётся в {time}, осталось совсем немного!\n{url}""До стрима в {time} осталось немного времени.\n{url}"
Before starting, make sure you have Docker and Docker Compose installed.
-
Clone the repository:
git clone https://github.com/your-username/stream_telegram_bot.git cd stream_telegram_bot -
Create a
.envfile by copying the template:cp env.template .env
-
Fill in the
.envfile with the required values:# TELEGRAM TELEGRAM_TOKEN=TOKEN TELEGRAM_CHANNEL=@the_forever_student # YOUTUBE YOUTUBE_CHANNEL_URL=https://www.youtube.com/@the_forever_student_live # REDIS REDIS_URL=redis://localhost:6379 REDIS_HOST=localhost REDIS_PORT=6379
You can run the bot using make:
make runOr manually through Docker Compose:
docker compose up --buildRun Celery Worker:
make workerRun Celery Beat (for periodic tasks):
make beatThe bot will now check scheduled streams and send notifications to Telegram!
This project is licensed under the MIT license. Details can be found in the LICENSE file.
Stream Telegram Bot - это бот, который проверяет наличие запланированных трансляций на YouTube-канале и уведомляет о них в Telegram. После завершения трансляции бот автоматически удаляет соответствующие сообщения.
- Проверяет YouTube-канал на наличие запланированных трансляций.
- Отправляет уведомление в Telegram-канал о предстоящем стриме.
- За 15 минут до начала стрима отправляет дополнительное уведомление.
- Удаляет сообщение о стриме после его завершения.
Примеры оповещений, которые бот отправляет в Telegram, хранятся в файле scr/constants.py.
"Запланирован стрим в {time}, не пропустите!\n{url}""Стрим будет в {time}, присоединяйтесь.\n{url}"
"Стрим начнётся в {time}, осталось совсем немного!\n{url}""До стрима в {time} осталось немного времени.\n{url}"
Перед запуском убедитесь, что у вас установлен Docker и Docker Compose.
- Склонируйте репозиторий:
git clone https://github.com/your-username/stream_telegram_bot.git cd stream_telegram_bot - Создайте
.envфайл, скопировав шаблон:cp env.template .env
- Заполните
.envфайл нужными значениями:# TELEGRAM TELEGRAM_TOKEN=TOKEN TELEGRAM_CHANNEL=@the_forever_student # YOUTUBE YOUTUBE_CHANNEL_URL=https://www.youtube.com/@the_forever_student_live # REDIS REDIS_URL=redis://localhost:6379 REDIS_HOST=localhost REDIS_PORT=6379
Запустить бота можно с помощью make:
make runИли вручную через Docker Compose:
docker compose up --buildЗапустить Celery Worker:
make workerЗапустить Celery Beat (для периодических задач):
make beatБот теперь будет проверять запланированные трансляции и отправлять уведомления в Telegram!
Этот проект распространяется под лицензией MIT. Подробности в файле LICENSE.