What Automated Group Responses on Telegram Actually Cover

Setting up Telegram bots for automated group responses looks like a five-minute job: create a bot, paste a token, write a keyword list. That version genuinely works — until the group has a few thousand members, three moderators, and a support queue that expects an answer within seconds. At that point the interesting questions stop being about the bot and start being about throughput, latency, hosting cost, and who is allowed to read the message log.

This guide treats group automation as a performance-and-cost problem first and a configuration problem second. Every section states an approach, the reasoning behind it, and the boundary where that approach stops paying for itself. Where a conclusion comes from observed behaviour rather than vendor documentation, it is labelled as an empirical observation and paired with a reproducible verification step, so you can confirm it inside your own group instead of taking it on faith.

One scope note before going further. A Telegram bot is an account operated by software through the HTTP Bot API, identified by a username ending in bot and authenticated by a token issued by the official @BotFather account. Everything below assumes that definition. Telegram's own built-in conveniences — such as the auto-reply rules that Telegram Business accounts can apply to private conversations — are separate mechanisms, and they are mentioned only where the difference changes your architecture.

What Automated Group Responses on Telegram Actually Cover
What Automated Group Responses on Telegram Actually Cover

Where bot replies end and Telegram's own features begin

It is worth separating three cases that beginners frequently conflate. In private chats, a Telegram Business account can attach a bot and apply quick replies and away messages without writing any code. In channels, a bot posts content but does not converse, because channels have no member message stream. In groups and supergroups — the case this article covers — a bot can read certain messages and post responses, and the exact set of messages it receives depends almost entirely on one BotFather setting discussed below.

A fourth case, group topics (the forum layout inside supergroups), adds a routing dimension on top of those three. Reply automation that ignores topic identifiers will answer in the wrong thread, which reads as a bug even when the matching logic is correct. Keep this in mind; it returns in the deployment section.

A note on channels, forum topics, and Business accounts

The distinctions above are not academic — they decide which tool you should reach for. If your actual goal is a public announcement feed, a bot is the wrong tool and a channel is the right one. If your goal is answering customer questions one-to-one, Telegram Business auto-replies may be sufficient and cost nothing to operate. Automated group responses occupy a specific niche: they scale an answer that many people need to see at once, and they must do so inside a rate-limited, moderator-governed space. Everything that follows is written for that niche.

Performance and Cost: Defining Your Thresholds Before You Write Code

Teams usually discover their performance requirements by violating them. A cleaner approach is to write four numbers on a wall before the first line of code, then design so that those numbers still hold at ten times the current traffic. The value is not precision — it is deciding in advance what "working" means, and what you will do when it stops being true.

The four numbers worth measuring

Response latency is the gap between a member sending a message and the bot's reply appearing. For support-style automation, a p50 under roughly one second and a p95 under a few seconds is a reasonable working target; beyond that, members begin to type the answer themselves. Example: a member asks for the network password at 09:14:02 and the answer appears at 09:14:03. That single second contains both the transport leg and your own processing leg, and only the second of those is yours to optimise. These are targets, not Telegram guarantees — Telegram does not publish a latency SLA for bot delivery, so treat any number you adopt as an internal budget.

Throughput per chat is the harder constraint, because it is imposed from outside. Telegram's own Bot API documentation states that a bot should avoid sending more than one message per second into a single chat, that bulk notification sending is generally accepted at around thirty messages per second overall, and that a bot will not be able to send more than twenty messages per minute to the same group. Those published figures are the ceiling. Your working ceiling should sit well below them, because bursts, retries, and moderation actions all consume the same allowance.

Cost per thousand replies behaves differently at each volume band: it is dominated by fixed hosting at low volume and by concurrency and egress at high volume. A useful discipline is to compute this number monthly and watch its direction rather than its absolute value; a figure that climbs while traffic is flat usually means retries or duplicate processing, not growth.

Error budget covers two signals: HTTP 429 responses (rate limiting) and webhook backlog. If either is nonzero for more than a small fraction of a day, the system is running closer to its limits than the design intends.

A reproducible measurement procedure

You do not need a metrics stack to get started. Four steps, repeated after any change, will give you comparable numbers:

  1. Log a receive timestamp the instant your handler accepts an incoming update, and log a send timestamp immediately after the Bot API call returns.
  2. Compare the receive timestamp against the message.date field carried in the update. The difference is the transport leg; the send-minus-receive difference is your own processing leg.
  3. Compute p50 and p95 over a full day rather than an hour, because group traffic is bursty around working hours in the group's dominant timezone.
  4. Call getWebhookInfo periodically and record pending_update_count. A value that trends upward across the day means delivery is outrunning processing.

Read the results as a set rather than in isolation. A rising processing p95 with a flat transport leg points at your code; a flat processing leg with a rising transport delay points at the network path; and a rising pending count alongside both usually means the queue between them has become the bottleneck.

Tip: Record the two legs separately from day one. Most "the bot is slow" complaints turn out to be transport delay rather than application delay, and separating the legs tells you which of the two you actually need to fix.

When the numbers say stop

There is a point where automation is the wrong answer. If a single group generates sustained traffic close to the per-group rate guidance, no amount of application optimisation will help, because the ceiling is imposed by the platform. At that scale the correct response is to split the conversation across multiple groups, move the high-volume interaction into private chats where each conversation has its own allowance, or accept that a human-moderated queue is the honest design.

Single-User Setup: From BotFather to First Reply

Everything in this section can be done from a phone. The single-user path is short, but two of its steps — token handling and the privacy-mode decision — have consequences that are expensive to reverse later, so they are called out explicitly rather than folded into a general checklist.

Creating the bot and securing the token

Open a chat with @BotFather — the official bot-management account — and send /newbot. BotFather asks for a display name and then for a username that must end in bot. On success it returns a token of the form <numeric id>:<random string>. That token is a full credential: anyone holding it controls the bot.

Treat it accordingly. Store it as an environment variable on your host, never in a repository, and never in a screenshot. If it leaks, send /revoke to BotFather to invalidate it and issue a new one; the old credential stops working immediately, which is also the fastest way to confirm a suspected leak.

Two BotFather commands are worth running at this stage even though they are optional, because they reduce repeat questions before automation even runs. /setcommands publishes the command list that appears when a member types a slash in your group, while /setdescription and /setabouttext control the text shown on the bot's empty chat screen and profile.

Privacy mode — the switch that decides everything

By default, a bot in a group operates in privacy mode: it receives commands addressed to it, messages that reply to one of its own messages, and messages that mention it. It does not receive ordinary conversation. This default exists to protect member privacy, and it is the reason so many first attempts at keyword auto-replies silently do nothing.

To change it, send /setprivacy to BotFather, select the bot, and choose Disable. The change takes effect for the group only after the bot is removed and re-added — a step that is easy to miss and is consistently reported as the cause of "I disabled privacy but nothing changed" in community troubleshooting threads.

Warning: Disabling privacy mode means your bot receives the group's ordinary message stream — including anything members type without addressing the bot. In groups with a reasonable expectation of privacy, that is a governance decision, not a technical one. Announce it before you enable it, and see the compliance section below for the retention implications.

There is a second, commonly used route to the same end: grant the bot administrator rights. In practice, an admin bot receives the full message stream regardless of the privacy setting. Treat that as an empirical observation rather than a documented rule, and verify it in your own environment with the test described in the troubleshooting section.

Adding the bot to a group across platforms

The shortest path differs slightly by client. On Android, open the group, tap the group name at the top, choose Administrators, tap Add Admin, and search for the bot's username. On iOS, open the group, tap the header, tap Edit, then Administrators, then Add Admin. On Telegram Desktop, click the group name in the header, choose Manage Group (labels vary by version and language), then Administrators. Where you only need the bot present and not privileged, the alternative is to open the bot's profile and use Add to Group — but note that without admin rights it will stay in privacy mode unless you disabled it in BotFather.

If the bot does not appear in the search field, check /setjoingroups in BotFather. That setting can prevent the bot from being added to groups at all, and it is occasionally disabled by default by third-party bot templates.

Long Polling or Webhook? A Decision With Cost Implications

The Bot API offers two ways to receive updates, and the choice shapes your hosting bill more than any other single decision.

Criterion Long polling (getUpdates) Webhook (setWebhook)
Hosting requirement Any host with outbound HTTPS; no public address needed Public HTTPS endpoint with a valid certificate
Typical latency One polling interval plus network round trip One network round trip
Scaling model Single consumer per token; horizontal scaling requires care Stateless handler; scales behind a load balancer
Operational surface One process to keep alive TLS renewal, endpoint monitoring, secret handling
Best fit Prototypes, single-group communities, restricted networks Production, multi-group fleets, low-latency requirements

The cost logic behind that table is straightforward. Long polling keeps a process running continuously, which means you pay for uptime even when no messages arrive. A webhook endpoint can be served by a function-as-a-service platform that bills per invocation, so an idle group costs close to nothing — attractive for a fleet of small communities, less attractive once invocation counts and cold-start latency become visible in your p95 figures.

Registering a webhook is a single call. Include a secret_token so your endpoint can reject forged requests, and narrow allowed_updates to the update types you actually handle — fewer update types means less bandwidth and less parsing surface.

curl -X POST "https://api.telegram.org/bot<TOKEN>/setWebhook" \
  -d "url=https://bot.example.com/hook" \
  -d "secret_token=<LONG_RANDOM_STRING>" \
  -d "allowed_updates=[\"message\",\"callback_query\"]"

Then verify what the platform thinks is registered:

curl "https://api.telegram.org/bot<TOKEN>/getWebhookInfo"

The response carries pending_update_count and, after a failure, last_error_date and last_error_message. Those three fields are the cheapest observability you will ever get from this platform. Poll them on a schedule rather than only when something feels wrong.

Tip: During development, keep a separate bot for experiments. Switching a production bot between polling and webhook modes is safe, but stale queued updates from an earlier mode occasionally surface and confuse the test you are running.

A Minimal Auto-Reply Handler You Can Actually Deploy

The smallest useful handler does three things: advances an offset so updates are not reprocessed, matches a rule, and replies with a reference to the triggering message so the thread stays readable. The example below uses long polling because it needs no public endpoint; the parsing and matching logic is identical behind a webhook.

import os, requests

TOKEN = os.environ["TG_BOT_TOKEN"]
API = f"https://api.telegram.org/bot{TOKEN}"
RULES = {
    "/help":     "Available commands: /help, /rules, /contact",
    "/rules":    "Group rules are pinned in the description. Be civil.",
    "/contact":  "A moderator will reply within the hour.",
}
offset = None

while True:
    params = {"timeout": 30}
    if offset is not None:
        params["offset"] = offset
    resp = requests.get(f"{API}/getUpdates", params=params, timeout=40).json()
    for update in resp.get("result", []):
        offset = update["update_id"] + 1          # never revisit this update
        msg = update.get("message")
        if not msg or "text" not in msg:
            continue
        key = msg["text"].strip().split()[0].lower()
        if key not in RULES:
            continue
        requests.post(f"{API}/sendMessage", json={
            "chat_id": msg["chat"]["id"],
            "text": RULES[key],
            "reply_parameters": {"message_id": msg["message_id"]},
        })

Three details in that snippet carry more weight than they appear to. First, offset = update_id + 1 is the entire idempotency story for polling: once acknowledged, an update will not be delivered again. Second, reply_parameters turns a bare message into a threaded reply, which is what makes automated answers readable in an active group. Third, the loop has no error handling — deliberately, for clarity. In production, wrap the send call and treat a 429 response as a signal to slow down rather than to retry immediately.

For keyword rules rather than commands, the same structure applies with one change of emphasis: keep the rule table in configuration rather than code, and match on whole words where possible. Substring matching on short tokens produces embarrassing false positives in busy groups.

{
  "rules": [
    {
      "id": "wifi",
      "match": {"type": "any_word", "values": ["wifi", "wi-fi"]},
      "cooldown_seconds": 300,
      "reply": "Network: see the pinned message. If it fails, ping a moderator."
    },
    {
      "id": "hours",
      "match": {"type": "any_word", "values": ["opening", "hours"]},
      "cooldown_seconds": 600,
      "reply": "Support hours are listed in the group description."
    }
  ]
}

cooldown_seconds is not a decoration. Without a per-rule cooldown, one member asking the same question five times will consume five messages of your per-group allowance and make the bot look broken to everyone else. Cooldowns are the cheapest form of protection you can implement, and they are also what keeps the automation from tripping anti-spam heuristics.

In forum-style groups, remember to echo back message_thread_id when you send. Omitting it drops every answer into the general thread, and members reasonably interpret that as the bot ignoring them.

Team Collaboration Configuration

A single-operator bot tolerates improvisation. The moment a second person edits the rule table, improvisation becomes the primary source of incidents.

Separating environments

Create two bots with BotFather: one for staging, one for production. Run the same code against both, driven entirely by environment variables. A test group with two or three members is enough to validate a rule change, and it costs nothing because Bots are free to create. The alternative — testing in the production group — means every rule typo is visible to the whole community, and rollback becomes a social problem rather than a technical one.

Shared configuration and secrets

Split configuration into two layers, and keep the boundary between them obvious. Non-secret rules (keyword tables, reply texts, cooldowns) belong in version control and should be reviewed like code; a one-line change to a reply string has caused more arguments than most code changes. Secrets — the bot token, any database credential, any webhook secret — belong in the platform's secret store, readable by the runtime but not by every contributor.

Grant BotFather access sparingly. Anyone with access to the BotFather chat history for a given bot can retrieve or revoke its token. In practice, teams that manage more than a couple of bots find it useful to nominate one person as token custodian and keep BotFather conversations out of shared devices.

Moderator workflow and escalation

Automation should hand off, not dead-end. When no rule matches, the useful behaviour is to log the message and optionally notify a moderator channel — not to send a generic "I did not understand" reply, which trains members to stop using the bot. Build the escalation path before you build the tenth rule; it is the difference between a bot that helps and a bot that annoys.

A practical threshold: if unmatched messages exceed a noticeable share of matched ones over a week, the rule table is not covering the community's real questions. That is a content problem, not an engineering one, and it is worth reviewing with moderators rather than solving with more code.

Enterprise Deployment: Scaling, Idempotency, and Observability

At organisational scale the bot stops being an application and becomes a piece of infrastructure with an on-call owner. Three design properties separate the two.

Enterprise Deployment: Scaling, Idempotency, and Observability
Enterprise Deployment: Scaling, Idempotency, and Observability

Idempotency and the update_id contract

Every incoming update carries an update_id. Webhook delivery is at-least-once in practice: if your endpoint times out, Telegram may retry, and the same update can arrive twice. Without a deduplication step, the group sees the answer twice. The fix is a short-lived record of processed update_id values — a cache with a few minutes of retention is generally sufficient — checked before any side effect is executed.

This is the single most common difference between a demo-quality bot and one that survives a traffic spike. It is also invisible until the first retry, which is why it is worth building before launch rather than after the first duplicate reply.

Queueing, worker pools, and ordering

The standard production shape is: webhook endpoint validates and enqueues, a worker pool dequeues, matches rules, and calls the Bot API. The endpoint stays fast; the workers absorb bursts; scaling is a matter of worker count. The trade-off is that ordering is no longer guaranteed. Telegram assigns update_id values in increasing order, so if your rules depend on sequence — a two-step confirmation flow, for example — you must partition the queue by chat rather than by arrival, or accept that occasional out-of-order processing is possible.

For most auto-reply workloads, ordering does not matter and a simple parallel worker pool is fine. Be explicit about which of the two situations you are in; the assumption is easy to make implicitly and painful to discover later.

The cost curve at volume

Cost behaviour changes shape as you grow. Under a few hundred messages a day, the bill is essentially the fixed cost of whichever host you chose, and the marginal cost of a reply is invisible. In the middle band, the bill tracks invocation counts and database reads, and caching the rule table starts to matter. At the top, the bill is dominated by concurrency, log retention, and the observability stack — the automation itself becomes a rounding error next to the tooling around it. Revisit the host choice at each transition rather than assuming the original one still fits.

Observability worth paying for

Four signals cover most incidents: webhook pending_update_count, the rate of HTTP 429 responses, the p95 of your processing leg, and the count of unmatched messages. Anything beyond that is usually indirection. If you ship only one alert, alert on a rising pending count — it is the earliest warning that the system is falling behind, and it precedes member complaints by a useful margin.

Compliance, Privacy, and Group Governance

Automation changes what your organisation holds. A bot that reads the full message stream is, functionally, a logging system for a private conversation, and that has consequences independent of how well the code is written.

Start with disclosure, because every decision below assumes that members know the bot is present. If privacy mode is disabled or the bot holds admin rights, members' ordinary messages reach your server. State this in the group description or a pinned message, in plain language. In jurisdictions with data protection legislation, group chat content may include personal data, and processing it without a stated basis is the kind of issue that surfaces during an audit rather than during development.

Retention is the second lever. Most automation needs the message only long enough to decide whether to reply. Persisting full message text — for analytics, for moderation review, for model training — should be a deliberate decision with a stated retention period and a deletion mechanism, not a default that arrived with the logging library. A defensible pattern is to store the matched rule and a timestamp, and to discard the message body once the reply has been sent.

Least privilege applies directly here. Grant the bot only the administrator permissions it actually uses. A bot that deletes messages should not also be able to ban members; a bot that pins announcements should not be able to invite users. Audit the permission list quarterly, because permission sets tend to grow one incident at a time and never shrink.

Two platform-level constraints deserve mention because they affect designs that monetise or broadcast. Telegram Stars — the in-app currency — is the mechanism for charging members for digital goods through bots, and any design that involves payment inherits the associated obligations. Separately, all bots operate under Telegram's published terms and the Bot API's documented limits; automated behaviour that resembles bulk messaging to strangers is the fastest route to a restricted bot, regardless of intent.

Warning: Rules and policies change. Before deploying automation in a regulated context, read the current Telegram Terms of Service and the Bot API documentation rather than relying on this or any other secondary summary. Nothing here is legal advice.

Troubleshooting: Symptom → Cause → Verification → Fix

The failure modes below account for most "my bot does not work" reports. Each is described with a verification step, because guessing at causes is slower than measuring them.

Symptom: the bot replies in private chat but stays silent in the group. The usual cause is privacy mode still being enabled, or the bot lacking the permissions the reply requires. Verify by sending an explicit command to the bot inside the group — if the command is answered but ordinary keywords are not, privacy mode is the explanation. Fix by sending /setprivacy to BotFather, choosing Disable, then removing and re-adding the bot. Confirm that /setjoingroups is enabled if the bot cannot be added at all.

Symptom: HTTP 429 responses appear in bursts. Your sending rate is exceeding the platform's allowance for a chat or overall. Verify by logging the per-chat send rate alongside the response codes; if 429s cluster in one group, the per-chat limit is the constraint. Fix by adding per-chat queueing with a modest spacing between sends and honouring the retry delay indicated in the error response, rather than retrying immediately.

Symptom: updates stopped arriving at the webhook. Verify with getWebhookInfo: a non-empty last_error_message usually points at certificate or endpoint problems, while a growing pending_update_count points at slow processing. Fix accordingly — renewing the certificate in the first case, adding workers or shortening handler time in the second. A common cause of the first case is an expired TLS certificate on the endpoint, which fails silently from inside the application.

Symptom: some members receive duplicate replies. Almost always a webhook retry combined with missing deduplication. Verify by logging update_id values and checking for repeats within a short window. Fix by recording processed identifiers for a few minutes before executing any side effect.

Symptom: replies land in the wrong topic. The reply omitted message_thread_id. Verify by comparing the incoming update's thread identifier with the outgoing send parameters. Fix by carrying the identifier through to every send call that answers a topic message.

Across all five symptoms the pattern is the same: measure before changing anything, because the visible symptom and the actual cause usually sit at different layers of the stack.

Applicable and Non-Applicable Scenarios

Automation earns its keep under identifiable conditions, and it actively harms communities outside them. Use the following as admission criteria rather than as aspirations.

It is worth automating when the same question recurs predictably, when a wrong answer is cheap to correct, when the group has moderators who will review unmatched messages, and when the traffic per group stays comfortably below the platform's published sending guidance. A single-group community with a handful of recurring questions meets all four conditions and is an excellent starting point.

It is not worth automating when answers require judgement about a specific member's situation, when the group is small enough that a human replies faster than the bot can be maintained, when the reply text changes weekly and nobody owns the rule table, or when sustained per-group traffic already approaches the documented rate ceilings. In the last case, splitting the community or routing detailed conversations into private chats is a better answer than tuning the bot.

There is also a middle case worth naming: groups where automation should exist but only for a narrow slice — pinning a weekly digest, answering three fixed commands, routing everything else to a moderator. Narrow automation is more durable than broad automation because its rule table stops growing before it becomes unmaintainable.

Best Practices Checklist

The following rules compress the preceding sections into decisions you can apply immediately. They are ordered roughly by the sequence in which you will encounter them.

  1. Create separate staging and production bots before writing rule logic, and drive both entirely from environment variables.
  2. Store the bot token only in a secret store; use /revoke in BotFather the moment a leak is suspected.
  3. Decide on privacy mode deliberately, document the decision, and re-add the bot to the group after changing it.
  4. Prefer commands over keyword matching where members can be trained to use them; keywords are a fallback, not a foundation.
  5. Add per-rule cooldowns before adding the tenth rule.
  6. Always carry message_thread_id through in forum groups.
  7. Choose webhook for production and polling for prototypes; register a webhook secret and restrict allowed_updates.
  8. Implement update_id deduplication before launch, not after the first duplicate reply.
  9. Monitor webhook pending count, 429 rate, processing p95, and unmatched-message volume — and alert on the first of these.
  10. Grant the minimum administrator permissions and audit them on a schedule.
  11. Publish a plain-language disclosure when the bot reads the full message stream.
  12. Retain only what the automation needs, with a stated retention period.

Treat the list as a sequence rather than a one-time audit: the early items determine whether the later ones are cheap or expensive to apply, and the items near the end are the ones that quietly decay if no one owns them.

Verification and Ongoing Observation

Because this article deliberately avoids fixed numbers and dates, the way to make its guidance concrete is to measure inside your own environment. Re-run the four-step measurement procedure monthly, and re-read the platform's Bot API documentation at the same interval — the API is versioned and capabilities are added over time, so a behaviour you worked around in the past may have a supported answer today.

When you do observe an improvement after a change, treat the observation as qualitative until you have a week of comparable data behind it. "Noticeably faster" is a legitimate and useful finding; a precise millisecond figure captured from a single afternoon is not, and it will mislead the next person who reads your notes.

The practical expectation to hold is not that the platform will stay still, but that the boundary between what Telegram provides natively and what your bot must implement will keep shifting. Each time a convenience moves into the platform — the way Business auto-replies did for private conversations — a piece of custom logic becomes optional. Designs that survive that shift are the ones that keep the transport layer thin, hold rules in configuration rather than in code, and separate matching from delivery.

Version expectations should be set the same way as latency budgets: qualitatively, with a verification habit attached. Re-reading the Bot API documentation on a fixed schedule costs an hour a month, and it is the cheapest way to notice that something you maintain by hand is now maintained for you. Treat any improvement you gain from that reading as an empirical observation until you have reproduced it in your own group.

Frequently Asked Questions

Why does my Telegram bot ignore ordinary messages in a group but respond in private chat?

This is the privacy-mode default. Bots in groups only receive commands, replies to their own messages, and mentions unless privacy mode is disabled. Send /setprivacy to the official @BotFather account, select your bot, choose Disable, then remove and re-add the bot to the group for the change to take effect. If the bot cannot be added at all, check /setjoingroups in BotFather as well.

Should I use long polling or a webhook for group auto-replies?

Use long polling for prototypes and single-group communities, because it needs no public HTTPS endpoint. Use a webhook for production and multi-group deployments, because the handler is stateless, scales horizontally, and typically produces lower latency. The matching and reply logic is the same in both cases; only the transport differs.

What are the practical sending limits for an automated bot in a group?

Telegram's Bot API documentation advises against more than about one message per second into a single chat, describes bulk sending as generally accepted at around thirty messages per second overall, and states that a bot will not be able to send more than twenty messages per minute to the same group. Treat these as ceilings, design well below them, and handle HTTP 429 responses by slowing down rather than retrying immediately.

Why do some members see the same automated reply twice?

Webhook delivery can be retried when your endpoint responds slowly, so the same update may arrive more than once. Store processed update_id values for a few minutes and check them before executing any side effect. This deduplication step is the usual difference between a demo bot and one that behaves correctly under load.

Do I need to tell group members that the bot reads their messages?

If privacy mode is disabled or the bot holds administrator rights, ordinary member messages reach your server, which makes the bot functionally a logging system. Disclose this in the group description or a pinned message, and set an explicit retention period for any message content you store. In regulated contexts, consult current guidance rather than relying on a secondary summary.

Where to Go From Here

The short version of this article fits in four sentences. Create the bot with @BotFather and guard the token. Decide consciously whether privacy mode stays on, and re-add the bot after changing it. Choose webhook for production, implement update deduplication, and keep per-chat sending far below the platform's published guidance. Then measure latency, throughput, cost, and errors every month rather than every incident.

If you are starting today, the most useful next action is a thirty-minute experiment: create a staging bot, disable privacy mode, add it to a small test group, and run the minimal polling handler above with two rules. That gives you a working baseline and, more importantly, real numbers for the four thresholds — which is the only way this guidance becomes specific to your community.

If you already run automation, the next action is different: call getWebhookInfo, record the pending count and any error fields, and compare them against what you observed a month ago. Systems of this kind rarely fail suddenly; they drift, and the drift is visible long before members notice.