sglowery/Telegram-Repost-Bot

Process updates in batches and make use of concurrency

Opened this issue · 0 comments

A reason I chose to shut down my own instance of Repost Bot was because of spammers who were sending TONS of pictures for extended periods of time, often keeping the bot busy doing that for hours. Making use of more async code will alleviate the issue, including running commands asynchronously as well as processing images in batches. When an update comes in, the update queue can be accessed and it may be possible to process them all in one go. Large batches of updates are especially likely to happen if the bot is shut down for a short period of time before being turned back on. Another option would be to add a CLI flag to drop updates (which I think is something I can do when instantiating the Updater or when initiating polling).

The python-telegram-bot maintainers are working on asyncio support, but do I need to wait for them to implement any of this?