- Single webhook ingestion via
/api/webhooks/telegram - Optional header verification with
x-telegram-bot-api-secret-token - One bot can serve many groups/channels concurrently (route by
chat_id) - Normalizes incoming
Updateobjects (text/caption) into Commonly message buffer - Commands in Telegram:
/commonly-enable <code>to link a chat to a pod/summaryto post integration summary to Commonly/pod_summaryto post latest pod summary in Telegram
chatId(required once connected) — Telegram chat ID linked to the podchatTitle(optional) — stored for displaychatType(optional) —group,supergroup,channel, etc.connectCode(required before linking) — generated by Commonly and used with/commonly-enablesecretToken(optional) — set asTELEGRAM_SECRET_TOKENenv and used insetWebhook
TELEGRAM_BOT_TOKEN— universal bot token used to send command responses.TELEGRAM_SECRET_TOKEN— optional webhook secret token (recommended).
- Call
https://api.telegram.org/bot<botToken>/setWebhookwith:url:https://<your-host>/api/webhooks/telegramsecret_token:TELEGRAM_SECRET_TOKEN(optional but recommended)- Telegram requires HTTPS and ports 443/80/88/8443.
- Only one webhook is allowed; Telegram disables
getUpdateswhen webhook is active.
- Attachments are not yet parsed; we keep text/caption content.
- To avoid loops we ignore messages sent via bots (
via_bot/from.is_bot). - Add the bot as admin in channels to receive
channel_post. - Disable privacy mode in BotFather if you want all messages (not just commands).
- The hourly scheduler consumes buffered messages and posts a bot summary to the pod.
- Sidebar Apps quick-add opens BotFather and shows a
/commonly-enablecommand. - Use the generated connect code to link a chat to the pod.
⚠️ Legacy in-platform provider (will move to external service).- External service stub lives at
external/commonly-provider-services/telegram-service/.
- Parse common attachment types (photo/document/audio) for richer summaries.