Files
screenclipper/apps/worker/worker/telegram.py
T
ayrisdevandClaude Sonnet 5 eccc74166a StreamClipper AI Faz 1: ingestion + sinyal analizi + STT + altyapı iskeleti
yt-dlp headless capture (15dk segmentleme), ses peak + chat velocity sinyal
tespiti, OpenAI Whisper STT (kelime zaman damgalı), BullMQ/Redis/Postgres
altyapısı ve kanal durumu + transkript kütüphanesi gösteren Next.js panel.
LLM virality skorlama, render/crop/altyazı ve multi-platform dağıtım bu
fazın kapsamı dışında.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-30 14:36:50 +03:00

21 lines
671 B
Python

import os
import httpx
BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "")
CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "")
async def send_telegram_message(text: str) -> None:
if not BOT_TOKEN or not CHAT_ID:
print(f"[telegram] not configured, skipping notification: {text}")
return
url = f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage"
async with httpx.AsyncClient() as client:
resp = await client.post(
url, json={"chat_id": CHAT_ID, "text": text, "parse_mode": "Markdown"}
)
if resp.status_code >= 400:
print(f"[telegram] failed to send message: {resp.status_code} {resp.text}")