Telethon Updates
1.75K subscribers
36 photos
21 files
1.44K links
Official channel for updates about Telethon.
Official English group: @TelethonChat

Community channels:
• Chinese: @TelethonChinese
• Persian: @TelethonGap
• Russian: @TelethonRussian
• Snippets: @TelethonSnippets2
Download Telegram
Handle DestroySessionRes (292a36f by Lonami)
Fix setting logout result was not checking for future cancellation (4c771bf by Lonami)
👍1
Update to version 1.20 (d9691c9 by Lonami)
Use tgcrypto if available (#1715) (42cc9e6 by igerzog)
👍1
Don't omit False flag values from serialization (8724949 by Lonami)
Update known errors and error message (3ee94bd by Lonami)
👍1
Support clicking buttons that require password (bfa7e4c by Lonami)
👍1
Warning to everyone storing user identifiers

If your code is storing the user_id or sender_id in a database, make sure to use the type "long" or "int64". The user IDs will soon become larger than 2³¹ - 1, so they will not fit in a signed int32 type.

We recommend using int64 and not uint32 to prepare for whatever may happen in the future.

Telethon will accomodate to this change by reading and serializing the identifiers as uint32 (thus gaining an extra bit of size). For more size, Telegram will need to change the schema, so this is the best it can do for now.

Python itself does not care about the integer size, the session files also handles large integers, and so does JSON or pickle, so no changes are needed here.

You only need to worry about this if your database stores it as a signed integer 32-bits wide. If you're not storing user IDs anywhere this does not concern you.

See https://t.me/BotNews/57 for the official statement and more information.
👍1
Telethon Updates pinned «Warning to everyone storing user identifiers If your code is storing the user_id or sender_id in a database, make sure to use the type "long" or "int64". The user IDs will soon become larger than 2³¹ - 1, so they will not fit in a signed int32 type. We recommend…»
(De)serialize user_id as u32 (a1f91d6 by Lonami)
👍1
Telethon Updates
Warning to everyone storing user identifiers If your code is storing the user_id or sender_id in a database, make sure to use the type "long" or "int64". The user IDs will soon become larger than 2³¹ - 1, so they will not fit in a signed int32 type. We recommend…
Maybe not? According to FrayxRulez on the commit above:
> The message in @botnews is specific to the bot API, you don’t really have to care about it and this change isn’t needed.

Best case scenario none of this really matters for now. But I'd still recommend switching to something larger than 32 bits -- it might be needed in the future, once Telegram gains enough users.

It is technically possible for Telegram to send negative user identifiers, the schema definition allows it. So it still makes sense for Telethon to take measures to not expose negative user IDs even if that happened. (more discussion, but please stay on topic)
❤1
Fix _get_input_notify on TLObjects (52ae9f0 by Lonami)
👍1
Make input entity errors less useless (#1726) (0ad9b13 by tulir)
👍1
Update to layer 125 (8f46f70 by Lonami)
👍1
(yes I forgot to change the title but it mostly applies)
❤1
Remove chat hack from events.UserUpdate (6f2f8ae by Lonami)
Fix delete_dialog on chats (eba95eb by Lonami)
Move message.out patching in self-chat to Message (bdc3247 by Lonami)
Update to version 1.21 (3d6a2bb by Lonami)
❤1
Add password support for quart example (#1732) (ad0307f by painor)
❤1
Fix file.width and .height not working on Photo (58013f4 by Lonami)
❤1
By the way, the invite links are slowly migrating to a new format, so Telethon will no longer be able to extract the chat ID from them (and thus can't use the cache). If you were relying on this, or utils.resolve_invite_links, you're encouraged to migrate and start using IDs directly, as the new links are likely random and thus contain no meaningful information client-side. Server is the only one who knows what they are.
❤1
Don't treat False field as flag omission (b06f496 by Lonami)
Update to version 1.21.1 (1cef917 by Lonami)
❤1