Telethon Updates
1.46K subscribers
29 photos
21 files
1.34K links
Official channel for updates about Telethon.
Official English group: @TelethonChat

Other channels:
• Russian: @TelethonRussian
• Persian: @TelethonGap
• Snippets: @TelethonSnippets2
Download Telegram
Update ChatAction to include MessageActionGameScore (#1651) (022c1db by Sunda001)
Update to layer 132 (#3142) (2182e7f by SpEcHiDe)
Implement Sticker Choosing Action (#3144) (391fbab by New-dev0)
Update to layer 133 (#3155) (28d3d4b by SpEcHiDe)
Telethon Updates
Update to layer 133 (#3155) (28d3d4b by SpEcHiDe)
Telegram is changing user, chat and channel identifiers to occupy 64 bits instead of 32 bits!

If you were storing these values with an explicitly fixed size, you might want to consider updating that code to deal with long or i64 instead of the old int or i32 sizes.

Previous discussion: https://t.me/TelethonUpdates/1175 (and the follow-up, https://t.me/TelethonUpdates/1178)
Update documentation and list of known errors (3f5f5db by Lonami)
Add ttl parameter to send_file (2e1be01 by Lonami)
I'm steadily making progress towards version 2.0 of the library (after several years of waiting), so you might see a few polls pop up here over the next few weeks, where I see arguments in favour of a specific change, but the community may disagree for some reason (if you do, please argument why in @TelethonChat). So here it goes.

Note that version 2.0's primary goal is removing oddities (and necessarily breaking old code for the better). You can see progress in the v2 branch of GitHub, and the current list of breaking changes in v2-migration-guide.rst. Please do raise your voice if there is something you largely disagree with (and "ugh you're making me change my code!!1!" is not a good argument).
On raw API types, should __str__ output the same as the current stringify (multiline, pretty printed), and __repr__ output the same as the current __str__ (singleline, pretty printed)?
Anonymous Poll
16%
Yes
84%
No
Poll #1. How should the output of __str__ and __repr__ change? (Sorry, but it needs to be public or bots would ruin it again.)

The current output of obj.stringify() is as follows:

InputPeerUser(
user_id=123,
access_hash=456
)

The current output of __str__ is as follows:

InputPeerUser(user_id=123, access_hash=456)

And the current output of __repr__ is as follows:

<telethon._tl.InputPeerUser object at 0x7f9f870d5fd0>



The idea would be for __str__ to be:

InputPeerUser(
user_id=123,
access_hash=456
)

And __repr__ to be:

InputPeerUser(user_id=123, access_hash=456)

The old __repr__ output isn't really useful. The only argument for keeping it is to not spam the REPL when using interactive mode. The old __str__ is hard to read, because objects get really big. Please vote on the options that apply.
Telethon Updates
On raw API types, should __str__ output the same as the current stringify (multiline, pretty printed), and __repr__ output the same as the current __str__ (singleline, pretty printed)?
(To whoever is using bots to vote on this without even looking at the message, thanks for ruining the way I gauge interest in a change, and I hope you get banned.)
Telethon Updates pinned «Poll #1. How should the output of __str__ and __repr__ change? (Sorry, but it needs to be public or bots would ruin it again.) The current output of obj.stringify() is as follows: InputPeerUser( user_id=123, access_hash=456 ) The current output of __str__…»
Forwarded from KeralaGram [Official]®
Third-party developers using the Telegam API are required to support and properly display official sponsored messages in their apps by December 15, 2021.

https://corefork.telegram.org/api/sponsored-messages

ℹ️ @KeralaGramChannel
What does this mean for Telethon users? My interpretation is, if you're developing an application which can access the message history from channels and bot accounts, you are required to show these messages. If your application is published to some store, the risk of consequences for not complying is probably higher.

I am not a lawyer, but personal use or "userbots" (which simply enhance your experience with "commands") are probably safe. Still, you should read the official statement at https://core.telegram.org/api/sponsored-messages (the date seems to be now January 1, 2022).

As usual, using a library to interact with Telegram's library does not exempt you from complying with Telegram's Terms and Conditions yourself. The library is only a means to use the API, but you, the developer, have to make sure your application complies. Failing to comply risks getting your API access revoked.
Forwarded from lonami
Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN error.

I will try to find time to update the library as soon as possible. Although the first version supporting this new layer may not be as well-tested as I would've liked (because I haven't had much time to devote to open source lately). Thank you for your patience.

If you want to stay updated, so you can subscribe to the GitHub thread https://github.com/LonamiWebs/Telethon/issues/3215.

If someone desperatily needs this fix, please uninstall telethon and install https://t.me/TelethonChat/400936 as a temporary workaround (or spechide's,
pip3 install git+git://github.com/SpEcHiDe/Telethon@72afe59#egg=telethon
) (or use a virtual environment).
Telethon Updates pinned «Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN error. I will try to find time to update the library…»
Fix typo, add errors, and update to 133 again (#3157) (9c796e8 by SpEcHiDe)
Fix peer ID check to work with higher IDs (c9ecd61 by Lonami)
I have pushed v1.24 to PyPi, which fixes login (thus avoiding UPDATE_APP_TO_LOGIN), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find on GitHub.

It contains the above two fixes (and the "latest" 133 layer, to prevent receiving broken constructors), but not the latest layer, currently 135, to avoid breaking more things than necessary). Note that if you uninstalled telethon to install the workarounds, you will now need to uninstall the workarounds and install telethon again.

Thank you for your patience and understanding.
Telethon Updates pinned «I have pushed v1.24 to PyPi, which fixes login (thus avoiding UPDATE_APP_TO_LOGIN), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find on GitHub. It contains the above two fixes (and the "latest"…»
Bump to v1.24 (bda4259 by Lonami)