[x] The error is in the library's code, and not in my own.
[x] I have searched for this issue before posting it and there isn't a duplicate.
[x] I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip and triggered the bug in the latest version.
Description
Megagroups and channels on test server is giving a negative 13 digit number on Bot API, but Telethon is only masking it with prepending -100.
For example, a megagroup is giving -1000010567596 as its ID on bot API, but Telethon is recognising it as -10010567596 (since the raw ID is 10567596).
Steps of reproduction
Log in with any real account (99966- accounts will not work) on a test server.
Create a bot with @BotFather
Create a megagroup / channel (“Chat A” onwards) and add the bot in.
Send a message in Chat A
Get the masked ID of Chat A via bot API (entry point: https://api.telegram.org/botTOKEN/test/getUpdates).
Log in with the same account on test server using Telethon and run code below:
Checklist
pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip
and triggered the bug in the latest version.Description Megagroups and channels on test server is giving a negative 13 digit number on Bot API, but Telethon is only masking it with prepending -100.
For example, a megagroup is giving
-1000010567596
as its ID on bot API, but Telethon is recognising it as-10010567596
(since the raw ID is10567596
).Steps of reproduction
https://api.telegram.org/botTOKEN/test/getUpdates
).Traceback
Additional contexts
Part of code responsible of masking channel ID https://github.com/LonamiWebs/Telethon/blob/0683d9771a891efc07266451117b5f6295fbf2a3/telethon/utils.py#L927-L928