Messaging service

Telegram

The Telegram integration connects a Telegram bot — send messages, automatically register the inbound webhook so incoming updates are forwarded to your own webhook, and expose pending-update metrics.

Telegram is one of the Messaging service integrations. It has a Dreambase webhook and an inbound route:

POST/telegram/webhook
Dreambase lifecycle — challenge, deployment, health, metrics, functions
POST/telegram/incoming
Inbound updates from Telegram

What it does

On DEPLOYMENT_CREATED the service verifies the bot token via getMe, then registers the inbound webhook with Telegram via setWebhook (so updates flow to the service and on to your forwardUrl), and publishes the connection details — botToken, apiUrl, forwardUrl, botUsername, and incomingWebhookUrl — as outputs.

Inputs

FieldRequiredDescription
botTokenyesBot token from @BotFather. Supports {{env.MY_SECRET}}.
forwardUrlyesWhere inbound updates are forwarded.
forwardSecretnoUsed as the Telegram webhook secret and sent as a Bearer token on forwarded requests.

Outputs

  • botToken, apiUrl, botUsername — for other services to send with.
  • forwardUrl — the inbound target.
  • incomingWebhookUrl — the webhook registered with Telegram (set automatically).

Functions

  • sendMessage — send a message (chatId, text, optional parseMode).
  • setWebhook — (re)register the inbound webhook with Telegram.
  • getMe — return the bot's profile.

Metrics

On METRIC_UPDATE the service reports pending_updates (updates awaiting delivery) and webhook_configured (1 if the webhook is set), from getWebhookInfo. Health checks call getMe.

Webhook set automatically

You don't need to register the webhook yourself — the deployment calls setWebhook with the incomingWebhookUrl once a forwardUrl is configured.

Events it handles

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • HEALTH_CHECK — call getMe.
  • METRIC_UPDATE — report pending-update metrics.
  • DEPLOYMENT_CREATED — verify the token, set the webhook, publish outputs.
  • DEPLOYMENT_DELETED — remove the Telegram webhook and stop tracking.
  • FUNCTION_CALL — run a named function.