#Web hook with Telegram

1 messages · Page 1 of 1 (latest)

solid jackal
#

Im using Telegram, but I is very unstable.
I want to set it up as a web hook instead - how do i do that?

potent beaconBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

pine geyserBOT
#

Yep — OpenClaw’s Telegram channel defaults to long polling, but it also supports Telegram webhooks.

1) What “webhook mode” means (and what you need)

Webhook mode only changes how Telegram delivers inbound updates to your Gateway (Telegram → your server). So you need:

  • a public HTTPS URL reachable by Telegram (domain + valid TLS cert)
  • that URL must route to the Gateway’s Telegram webhook handler

Docs: https://docs.openclaw.ai/channels/telegram#long-polling-vs-webhook

2) Config: switch Telegram from polling → webhook

In your config.json5:

{
  channels: {
#
    telegram: {
      enabled: true,
      botToken: "123:abc",

      // enable webhook mode:
      webhookUrl: "https://YOUR.DOMAIN/telegram-webhook",
      webhookSecret: "generate-a-long-random-secret",
      // optional:
      // webhookPath: "/telegram-webhook", // default
      // webhookHost: "127.0.0.1",         // default (recommended with a reverse proxy)
    },
  },
}

When channels.telegram.webhookUrl + channels.telegram.webhookSecret are set, the Gateway will use webhook mode (otherwise it long-polls).