Telegram Bot Integration for Notifications
How it works
Section titled “How it works”- create a bot with BotFather
- get the bot token
- find your chat_id
Example (HTTP API)
Section titled “Example (HTTP API)”import os
import requests
def telegram_send(text: str):
token = os.environ["TELEGRAM_BOT_TOKEN"]
chat_id = os.environ["TELEGRAM_CHAT_ID"]
url = f"https://api.telegram.org/bot{token}/sendMessage"
r = requests.post(url, data={"chat_id": chat_id, "text": text}, timeout=10)
r.raise_for_status()
# telegram_send("Build finished")pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading