Switch account, when flood wait limits one account for a long period of time
See original GitHub issueBackground When using the bot for large amounts of forwarding (thousands of messages and files each day), there is a floodwait enforced from the Telegram API. This floodwait varies and sometimes you can hit a long wait time of hours or a temporary suspension of 24 hours.
Workaround If we have multiple Telegram Accounts, we can setup multiple Apps and API users / Bots. This means we can just delete the .forwardersession file and start again on another account.
Request Enhance the Telegram Chat Forward bot to allow for it to alternate between various Telegram API users and .forwardersession files to avoid this ban.
Sample
Viable option:
Have multiple api_id and hash stored in the .env file and anytime a floodwait error is over X amount of seconds (300 etc) then switch to the next api_id / hash in the file:
api_id_1=302XXX
api_hash_1=7exxxxxxx
api_id_2=303XXX
api_hash_2=7fxxxxxxx
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Related StackOverflow Question
Fantastic idea.
Actually, I am restructuring the code for a lot of reasons.
I will try to implement this feature in the new version. In the new version (upcoming), you can also login using a bot account. (and not your user account)
This is to terminate the risk of your account getting banned.
The bot that will do the forwarding must be in the source as well as destination channel/group. If the source channel is not owned by you, you will not be able to reap the feature.
if you want to use multiple accounts, you need to do that manually. create two different folders. and create different sessions.
automatic client switching in the middle of forwarding will add unnecessary complexity.
after the introduction of custom_delay, you are less likely to face 1 day suspensions.