Webhook or long polling? How Botxona works
Telegram bots can receive updates (messages, button presses) in two ways: via a webhook (Telegram pushes them to your server) or via long polling (the bot keeps asking Telegram itself, getUpdates). Botxona chose the second — long polling — and here's why.
Why Botxona uses long polling
Botxona is designed to run thousands of bots on a single infrastructure, on inexpensive servers. To do that, every bot is scale-to-zero — it stops completely when idle (details). In webhook mode, the bot must already be running when Telegram delivers a message to your server; if the bot is stopped, Telegram may lose the message or burn through its retries.
In long-polling mode, Botxona's platform-level proxy is always running (it never sleeps) and queues every update coming from Telegram; as soon as the bot wakes up, it fetches the queued messages from the proxy. This guarantees that no update is lost (at-least-once delivery) and ordering is preserved, even while the bot is temporarily asleep.
How this affects your code
Your code must not call setWebhook — Botxona doesn't use it, and if your code (e.g. migrated from another host) previously set a webhook, Telegram will keep trying to deliver messages to the old address that no longer works. The fix is to call deleteWebhook once at startup (harmless even if no webhook was set):
await bot.delete_webhook(drop_pending_updates=False)
await bot.telegram.deleteWebhook()
Normally, if you use the standard methods such as start_polling() / run_polling() / bot.launch() (aiogram, python-telegram-bot, grammY, Telegraf), no extra configuration is needed — they're already based on getUpdates.
How the proxy works (for the curious)
When your bot calls getUpdates, the request (even with nothing configured in your code) automatically goes to Botxona's node proxy. The proxy answers not from Telegram but from its own internal buffer — this ensures the bot never receives stale or duplicate updates, and that only one connection is active at a time (a second connection gets a 409 error).
If you get a "409 Conflict" error
It means something is connecting to the same token from two places at once (e.g. your computer and Botxona). Run the bot in only one place — stop the extra one. More: Errors and fixes.
Next steps
Upload your bot: Deploy your first bot in 10 minutes.