LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!

Home Page:https://docs.telethon.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inject self_bot parameter in initialization or control the DIFF_LIMIT

egorcco opened this issue · comments

Describe your suggested feature

When listening to high volume message groups, I encountered missing messages. After trying to modify the messagebox.py file, I found these parameters:
BOT_CHANNEL_DIFF_LIMIT = 100000 USER_CHANNEL_DIFF_LIMIT = 100 NO_UPDATES_TIMEOUT = 15 * 60

After changing USER_CHANNEL_DIFF_LIMIT to 100K, I no longer encountered missing messages. The limit is set to 100 because of this line:
limit=BOT_CHANNEL_DIFF_LIMIT if chat_hashes.self_bot else USER_CHANNEL_DIFF_LIMIT

Since self_bot defaults to False, is it possible to add a constructor for this value in order to control the DIFF_LIMIT we send?

Checklist

  • I have searched for this issue before posting it and there isn't a duplicate.

I don't have plans for this in v1, but v2 should already handle it.