OPEN SOURCE / SELF-HOSTED

Telegram Bot integration

Configure Telegram botToken and Webhook secretToken separately, register a DuDu callback and validate bot text conversations.

Two different credentials

botToken authenticates calls to the Telegram Bot API. secretToken validates the incoming X-Telegram-Bot-Api-Secret-Token header. Console accepts botToken and the server constructs the fixed Telegram API address; arbitrary sending URLs are not supported.

Configuration and validation

  1. Prepare a Telegram bot and its token. Deploy the server with a public HTTPS callback endpoint.
  2. Create a Telegram account in Console, assign its group and set secretToken. Add botToken to enable replies.
  3. Call Telegram Bot API setWebhook with url set to the callback URL from Console and secret_token set to the same secretToken. Consult the official API for complete parameters and restrictions.
  4. Check registration with getWebhookInfo, then send a message to the bot. Confirm an authorized agent receives it and can send a text reply. Telegram callbacks do not use a GET challenge handshake.

Rotation and troubleshooting

For callback failures, check HTTPS, the callback path and whether the gateway preserves the secret token header. For sending failures, check botToken, the bot’s permission to message that chat and platform rate limits. Tokens may be rotated for the same Bot ID. Create a new channel account to switch bots; clearing the token does not remove identity binding.

References

Telegram setWebhook ↗ · getWebhookInfo ↗ · DuDu fields and identity constraints ↗. Keep real bot tokens out of repositories, screenshots and public logs.