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).
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).
GitHub
2.0 wishlist · Issue #1169 · LonamiWebs/Telethon
Telethon currently has some weird things in it that need changing, but would be breaking changes. Therefore, a new major release should be made. We should aim for making a single release with the b...
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
The current output of
The idea would be for
__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(The current output of
user_id=123,
access_hash=456
)
__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(And
user_id=123,
access_hash=456
)
__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.Telegram
lonami in Telethon Chat
Should the output of __str__ and __repr__ change for raw API objects?
Keep __str__ as is (single-line) / Make __str__ output multiline (same as current .stringify) / Keep __repr__ output as is (Python's default) / Make __repr__ output single-line (same as…
Keep __str__ as is (single-line) / Make __str__ output multiline (same as current .stringify) / Keep __repr__ output as is (Python's default) / Make __repr__ output single-line (same as…
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
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.
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.
core.telegram.org
Sponsored messages
Related TL schema: Getting sponsored messages sponsoredMessage#4d93a990 flags:# recommended:flags.5?true can_report:flags.12?true…
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
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,
) (or use a virtual environment).
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).
GitHub
RPC login error · Issue #3215 · LonamiWebs/Telethon
telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SignInRequest) I am getting this error, anyone know the problem? Ubuntu 20.04 fresh install & can also r...
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…»
I have pushed v1.24 to PyPi, which fixes login (thus avoiding
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
Thank you for your patience and understanding.
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"…»
Proper usage of messagebox in update handling loop (0129192 by Lonami)
Fix messagebox porting errors (259fcca by Lonami)
Remove GitHub workflow (0d597d1 by Lonami)
Fix constructing PtsInfo for channels (de2cd1f by Lonami)
Fix update handling for channels (1f40372 by Lonami)
Process self-produced updates like any other (f1a517d by Lonami)
Handle TypeNotFoundError during gzip packed msgs (015acf2 by Lonami)
Persist session state and usage fixes (f547a00 by Lonami)
Reimplement catch_up (4b85ced by Lonami)
Add missing catch_up param to client init (3aa53dd by Lonami)
Don't store empty pts in messagebox (4b61ce1 by Lonami)
Fix reset_deadline check in messagebox (f7ccf8d by Lonami)
Properly load and save channel state (f775484 by Lonami)
Reintroduce keepalive pings in the sender (b0b1f30 by Lonami)
Review, unify and simplify retry_range usage (a25f019 by Lonami)
Add new features from new layer (#3676) (539e3cb by New-dev0)
Merge branch 'v2' (ed70991 by Lonami)
Fix messagebox porting errors (259fcca by Lonami)
Remove GitHub workflow (0d597d1 by Lonami)
Fix constructing PtsInfo for channels (de2cd1f by Lonami)
Fix update handling for channels (1f40372 by Lonami)
Process self-produced updates like any other (f1a517d by Lonami)
Handle TypeNotFoundError during gzip packed msgs (015acf2 by Lonami)
Persist session state and usage fixes (f547a00 by Lonami)
Reimplement catch_up (4b85ced by Lonami)
Add missing catch_up param to client init (3aa53dd by Lonami)
Don't store empty pts in messagebox (4b61ce1 by Lonami)
Fix reset_deadline check in messagebox (f7ccf8d by Lonami)
Properly load and save channel state (f775484 by Lonami)
Reintroduce keepalive pings in the sender (b0b1f30 by Lonami)
Review, unify and simplify retry_range usage (a25f019 by Lonami)
Add new features from new layer (#3676) (539e3cb by New-dev0)
Merge branch 'v2' (ed70991 by Lonami)