Hey folks, I’m trying to figure out the restrictions on sending messages through the Telegram bot API. From what I’ve heard, there’s a limit of 30 messages to different users. But I’m a bit confused about how this works with multiple bots.
I’ve got a bunch of bots running on one server (both webhooks and pull updates). Do they all share the same limit? Or does each bot have its own quota?
Also, I’ve set up this cool multi-tenant bot that can handle several bot accounts at once. If I’m sending messages using different bot tokens but from the same server, does the 30-message limit apply to each bot separately or to the server as a whole?
Anyone know how this works? It’d be super helpful to understand the ins and outs of these limits. Thanks!
yo, ive used telegram bots a bunch. each bot gets its own 30 msg/sec limit, doesnt matter if theyre on same server. ur multi-tenant setup shud be fine, each token has seperate quota. but watch out for IP-level limits if u send tons of msgs. maybe add a queue system to be safe. gl with ur project!
Based on my experience with Telegram bots, I can confirm that the 30 messages per second limit is indeed applied separately to each bot token. This means your multi-tenant setup should work without issues, as each bot will have its own quota.
However, it’s worth noting that Telegram may implement additional rate limiting at the IP level if they detect a high volume of requests from a single source. To mitigate this, consider implementing a queue system or rate limiting mechanism on your server.
Additionally, make sure to handle potential rate limit errors gracefully in your code. Telegram usually returns a 429 error when you exceed the limit, so you can catch this and adjust your sending rate accordingly.
Remember that these limits can change, so it’s always prudent to check the official Telegram Bot API documentation for the most current information.
I’ve been working with Telegram bots for a while now, and I can shed some light on this. From my experience, each bot has its own separate limit, regardless of whether they’re running on the same server or not. The 30 messages per second limit applies individually to each bot token.
For your multi-tenant setup, you should be fine. Each bot account (token) will have its own quota. However, keep in mind that Telegram might have some additional rate limiting on the IP level if they detect an unusually high volume of requests from a single source.
One thing I’ve found helpful is to implement a queue system on your server to manage message sending. This way, you can ensure you’re not exceeding the limits and risking temporary blocks. It’s also worth noting that these limits can change, so it’s always a good idea to keep an eye on the official Telegram Bot API documentation for the most up-to-date information.