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>
21 lines
671 B
Python
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}")
|