With the Bot API rate limiting, it can be of great value to employ multiple bots in order to balance the user requests between them. The best example of this would be @MasterTagAlertBot, which uses 10 additional bots and redirects users to the other ones if the load on one is too high:

It would be nice to have native support for this, as bots built with the library start to exceed the 10k MAU threshold and the flood criteria of Telegram are kind of odd.
Therefore, in a very simple 20-minute prototype hack, I managed to implement a LoadBalancingUpdater that takes a list of tokens or bots, and a BotSelector instance with an abstract method select_best_candidate (random.choice(available_bots) per default) which is passed to the job_queue and the dispatcher. Not many changes were required for this, and the added value is great from what I can tell by discussions with @thegasta (MTABot developer).
Things to consider:
- Responding to updates from the "correct" bot, i.e. the one the user has actually interacted with.
- Border cases of polling and webhooks that I haven't considered so far
Naming for everything is WIP and suggestions are appreciated.
With the Bot API rate limiting, it can be of great value to employ multiple bots in order to balance the user requests between them. The best example of this would be @MasterTagAlertBot, which uses 10 additional bots and redirects users to the other ones if the load on one is too high:
It would be nice to have native support for this, as bots built with the library start to exceed the 10k MAU threshold and the flood criteria of Telegram are kind of odd.
Therefore, in a very simple 20-minute prototype hack, I managed to implement a
LoadBalancingUpdaterthat takes a list of tokens or bots, and aBotSelectorinstance with an abstract methodselect_best_candidate(random.choice(available_bots)per default) which is passed to the job_queue and the dispatcher. Not many changes were required for this, and the added value is great from what I can tell by discussions with @thegasta (MTABot developer).Things to consider:
Naming for everything is WIP and suggestions are appreciated.