What are the restrictions on Telegram bot message sending?

I’m trying to figure out how Telegram limits bot message sending. I’ve heard there’s a cap of 30 messages to different users for each bot. However, I’m unsure how this works when multiple bots operate from a single server.

For example, I have several bots running on one server, some via webhooks and others using long polling. I also manage a multi-tenant bot that handles multiple bot accounts concurrently.

My questions are:

  1. Do all bots on the same server share the same limit?
  2. When using different bot tokens on one server, is the limit applied per host or per individual bot account?

Any clarification on how these limits are enforced would be really helpful!

hey, i’ve run into this too. from what i’ve seen, the limit’s per bot token, not server. so ur bots should each have their own 30/sec limit. for ur multi-tenant setup, each bot account prolly has its own limit. just watch out for other api limits if ur sending loads of messages!

I’ve dealt with Telegram bot rate limits extensively in my projects. The 30 messages per second restriction is indeed applied per bot token, not per server. This means each of your bots, regardless of their hosting setup, has its own separate limit.

For your multi-tenant bot, each individual bot account it manages would have its own 30/second allowance. Telegram’s systems don’t consider server architecture when enforcing these limits.

One crucial point to remember is that there are other API limits beyond just message frequency. I’ve encountered issues with bulk sending even when staying under 30/second. Implementing your own rate limiting and possibly adding delays between batches can help avoid triggering Telegram’s anti-spam measures.

Always monitor your bot’s performance closely, especially when scaling up operations or handling multiple accounts simultaneously.

As someone who’s been developing Telegram bots for a while, I can shed some light on this. The 30 messages per second limit is actually per bot token, not per server. So each of your bots, regardless of whether they’re on the same server or not, has its own separate limit.

I’ve run into this myself when scaling up operations. What I found is that Telegram tracks these limits based on the bot’s unique token. This means you can have multiple bots on one server without them interfering with each other’s limits.

For your multi-tenant bot setup, each bot account it manages would have its own individual limit. The server itself doesn’t factor into Telegram’s rate limiting calculations.

One thing to watch out for though - if you’re sending bulk messages, you might hit other API limits before the 30/second kicks in. I’ve found it helpful to implement my own rate limiting on the server side to avoid potential issues with Telegram’s anti-spam measures.