TSocial TSocial
Open in Telegram
Better in TelegramOpen in Telegram
TSocial planet logoTelesocial

Telesocial › Cheat sheets

Polling or Webhook? A Decision Card for Bot Builders

Cheat sheets · 2026-11-06 · 18+ readers

Both methods deliver the same updates. The choice is about where your bot icon bot lives and who calls whom. Answer the questions below and you will know.

Five questions

  1. Does the bot run on a public code icon HTTPS address? If not, polling.
  2. Does it run only when needed, as a function? Webhook.
  3. Do you need several copies for load? Webhook.
  4. Are you still experimenting on a laptop? Polling.
  5. Is inbound traffic blocked by a firewall? Polling.

At a glance

PollingWebhook
Who starts the callYour bot Telegram
Needs public HTTPSNoYes
Idle costAlways runningCan be zero
Copies at onceOneMany
DebuggingSimpleNeeds logs

Switching safely

  • Polling to webhook: stop the poller, setWebhook, check getWebhookInfo.
  • Webhook to polling: deleteWebhook, then poll.
  • Never run both for one token.

Two rules for webhooks

Reply with a 2xx quickly, and treat repeated updates as normal. Record each update_id so that a retry does nothing twice.

Frequently asked questions

Which is faster?

Both are fast enough for chat. Your handler speed matters more.

What are the allowed webhook ports?

The documentation lists 443, 80, 88 and 8443.

How do I debug a webhook?

Use getWebhookInfo and read the last error message.

More cheat sheets

Polling or Webhook? A Decision Card for Bot Builders | Telesocial