Commit Graph

2956 Commits

Author SHA1 Message Date
Lonami Exo
8df66c0b47 Add markdown and html properties to Message 2022-02-08 11:40:40 +01:00
Lonami Exo
9b4808a558 Remove PackedChat
In favour of using the session entity type consistently.
2022-02-08 11:31:24 +01:00
Lonami Exo
07faa53c5a Remove client.edit_folder
Not happy with the design, and keeping it would mean
having to maintain it. It can be added back with a better design.
2022-02-08 10:23:55 +01:00
Lonami Exo
84b016cf1c Make more TLObject methods private
Even though raw API is somewhat necessary at times,
these methods should remain implementation details.
2022-02-08 10:02:59 +01:00
Lonami Exo
1f3ce07594 Manually set random_id in requests
Getting the response message relies on this ID.
Because requests are now immutable, and resolve sets the random_id,
the method to obtain the response message would lack the random_id,
as the original request is not touched by resolve.
2022-02-07 11:30:27 +01:00
Lonami Exo
bd7675581d Make custom.Message properties mutable
It is convenient to, for example, change the text before resending.
2022-02-07 11:30:27 +01:00
Lonami Exo
c220d50ed8 Add back _phone_code_hash
There isn't really a better way to do this.
2022-02-07 11:30:27 +01:00
Lonami Exo
faaa038825 Fix RpcError catch-all 2022-02-07 11:30:27 +01:00
Lonami Exo
9431e5cc3e Tidy up the migration guide some more 2022-02-07 11:30:27 +01:00
Lonami Exo
a6f53baaba Remove client check in custom Message 2022-02-07 11:30:27 +01:00
Lonami Exo
d87b68a756 Fix direct mutation of objects in friendly methods 2022-02-07 11:30:27 +01:00
Lonami Exo
ae43a47602 Update iter_ usages with get_ 2022-02-07 11:30:27 +01:00
Lonami Exo
3b12cc3e51 Fix stringify for custom Message 2022-02-07 11:30:27 +01:00
Lonami Exo
56faccf151 Fix and update usage of parse_mode 2022-02-07 11:30:27 +01:00
Lonami Exo
4b477e5b27 Add some missing filters 2022-02-07 11:30:27 +01:00
Lonami Exo
96b4059ae8 Properly handle exception cases during update dispatch 2022-02-07 11:30:27 +01:00
Lonami Exo
ab6d60dab2 Fix event building 2022-02-07 11:30:27 +01:00
Lonami Exo
d490cf0f70 Add missing NotResolved import 2022-02-07 11:30:27 +01:00
Lonami Exo
46ba9696aa Fix add_handler auto-type detection 2022-02-07 11:30:27 +01:00
Shrimadhav U K
cb628f3cce
Update to layer 138 (again) (#3699) 2022-02-05 14:54:54 +01:00
Devesh Pal
acc512683c
Update to layer 138 (#3698) 2022-02-04 14:22:51 +01:00
Lonami Exo
a3a60e6dca Add proper warnings when applying filters to updates fails 2022-01-28 21:07:55 +01:00
Lonami Exo
055eca49ea Introduce some filters 2022-01-28 21:07:55 +01:00
Lonami Exo
a1fe80557a Implement dispatching events 2022-01-28 21:07:55 +01:00
Lonami Exo
a16c397de4 Fix saving entity types in sqlite
ty is already a subclass of int.
2022-01-28 21:07:55 +01:00
Lonami Exo
05457eaf1c Fix date usage in messagebox impl 2022-01-28 21:07:55 +01:00
Lonami Exo
0802f7e6b2 Rework methods to manage event handlers 2022-01-28 21:07:55 +01:00
Lonami Exo
9726169a8c Begin unification of event builders and events 2022-01-28 21:07:53 +01:00
Lonami Exo
f2ef0bfceb Make upload_file private 2022-01-28 21:06:43 +01:00
Lonami Exo
070af28e85 Make raw API types immutable 2022-01-28 21:06:43 +01:00
Lonami Exo
d426099bf5 Remove input_peer parameter from get_me 2022-01-28 21:06:43 +01:00
Devesh Pal
7778e54467
Allow restricting channels (#3679) 2022-01-24 21:09:51 +01:00
Lonami Exo
0eadca670f Document more RPC errors
Closes #3163.
2022-01-24 14:33:30 +01:00
Lonami Exo
3c7bb53c3c Use threads for factorization
Closes #3162.
2022-01-24 14:33:30 +01:00
Lonami Exo
4aa23cfbbc Fix flood_sleep_threshold was not being forwarded
Closes #3160.
2022-01-24 14:33:30 +01:00
penn5
d9e2a8a5ca
Avoid usage of __builtins__ in the generator (#3161) 2022-01-24 14:25:58 +01:00
Lonami Exo
ed70991bf3 Merge branch 'v2'
v2 is still not complete. A lot of cleanup still needs to be done.
In particular, entities still need some care. However, most of it
is there, and keeping up with two branches is annoying.
This also lets me close a lot of issues to reduce noise
and focus on the important ones.

Closes #354 (input entities have been reworked).
Closes #902 (sessions were overhauled).
Closes #1125, #3253, #1589, #1634, #3150, #3668 (updates are reworked, gaps are properly handled now).
Closes #1169 (2.0 is now merged).
Closes #1311 (proper usage should not trigger this issue on the reworked connection code).
Closes #1327 (there have been some stringify changes).
Closes #1330 (gaps are now detected).
Closes #1366 (sessions are now async).
Closes #1476, #1484 (asyncio open connection is no longer used).
Closes #1529 (commonmark is now used).
Closes #1721 (update gaps are now properly handled).
Closes #1724 (a gap that fixes this will eventually trigger).
Closes #3006 (force_sms is gone).
Closes #3041 (a clean implementation to get difference now exists).
Closes #3049 (commonmark is now used).
Closes #3111 (to_dict has changed).
Closes #3117 (SMS is no longer an option).
Closes #3171 (connectivity bug is unlikely to be a bug in the library).
Closes #3206 (Telethon cannot really fix broken SSL).
Closes #3214, #3257, #3661 (not enough information).
Closes #3215 (this had already been fixed).
Closes #3230, #3674 (entities were reworked).
Closes #3234, #3238, #3245, #3258, #3264 (the layer has been updated).
Closes #3242 (bot-API file IDs have been removed).
Closes #3244 (the error is now documented).
Closes #3249 (errors have been reworked).
2022-01-24 13:24:35 +01:00
Danny Lin
674b7d68a5
Add support for new invite link format (#3213) 2022-01-24 13:17:22 +01:00
Shrimadhav U K
530284a68b
Slight rewording of error message (#3256) 2022-01-24 13:15:49 +01:00
vladislav doster
805898c2fd
Improve readability for readthedocs/concepts/entities.rst (#3259) 2022-01-24 13:15:32 +01:00
Devesh Pal
539e3cb808
Add new features from new layer (#3676)
Updated some documentation regarding raw API.
get_permissions has been adjusted.
Expose more parameters when sending messages.
Update chat action.
Support sending spoilers.
Update buttons.
2022-01-24 13:15:02 +01:00
Lonami Exo
a25f019964 Review, unify and simplify retry_range usage 2022-01-24 11:29:02 +01:00
Lonami Exo
b0b1f30436 Reintroduce keepalive pings in the sender 2022-01-24 11:21:01 +01:00
Lonami Exo
f775484172 Properly load and save channel state 2022-01-24 11:05:58 +01:00
Lonami Exo
f7ccf8d843 Fix reset_deadline check in messagebox 2022-01-24 11:05:27 +01:00
Lonami Exo
4b61ce18ff Don't store empty pts in messagebox
This lets us rely on "not present" for "not initialized",
as opposed to having to check not present OR not empty, and
helps prevent more bugs.
2022-01-24 11:01:51 +01:00
Lonami Exo
3aa53dd981 Add missing catch_up param to client init 2022-01-24 10:59:32 +01:00
Lonami Exo
4b85ced1e1 Reimplement catch_up 2022-01-23 19:53:48 +01:00
Lonami Exo
f547a00da3 Persist session state and usage fixes
Catching up is now an option when creating the client.
2022-01-23 19:46:51 +01:00
Lonami Exo
015acf20c6 Handle TypeNotFoundError during gzip packed msgs 2022-01-23 13:26:53 +01:00