Commit Graph

53 Commits

Author SHA1 Message Date
Lonami Exo
4e73577d59 Update to layer 123 2021-01-28 19:48:01 +01:00
Lonami Exo
9c87598950 Don't include *Empty entities in returned dialogs 2020-11-13 10:59:53 +01:00
Lonami Exo
d5e4398ace Adapt the rest of the library to layer 119 2020-10-01 12:22:55 +02:00
Lonami Exo
1c3e7dda01 Avoid explicitly passing the loop to asyncio
This behaviour is deprecated and will be removed in future versions
of Python. Technically, it could be considered a bug (invalid usage
causing different behaviour from the expected one), and in practice
it should not break much code (because .get_event_loop() would likely
be the same event loop anyway).
2020-07-25 18:39:35 +02:00
Lonami Exo
e9c5e719f1 Minor docs update, bump v1.11.3 2020-02-24 13:15:56 +01:00
Lonami Exo
7ffb87170b Update some URLs
Some were out of date, some were examples pointing to a personal
link, which were replaced with generic examples.
2020-02-20 11:50:15 +01:00
Lonami Exo
d68d70362b Handle PeerIdInvalidError in delete_dialog 2020-01-07 12:14:19 +01:00
Lonami Exo
fa736f81af Handle all entity types on isinstance checks
Only the uses of `isinstance` against `InputPeer*` types were
reviewed. Notably, `utils` is exempt on this because it needs
to deal with everything on a case-by-case basis.

Since the addition of `*FromMessage` peers, any manual `isinstance`
checks to determine the type were prone to breaking or being
forgotten to be updated, so a common `helpers._entity_type()`
method was made to share this logic.

Since the conversion to `Peer` would be too expensive, a simpler
check against the name is made, which should be fast and cheap.
2019-12-23 13:52:07 +01:00
Lonami Exo
5c72e1286e Let delete_dialog work for bot accounts without erroring 2019-09-10 21:38:46 +02:00
Lonami Exo
67183ff9e8 Improve method signatures in the docs 2019-09-08 10:56:35 +02:00
Lonami Exo
e1905d0d7a Avoid using telethon.sync in the examples 2019-08-13 23:33:39 +02:00
Lonami Exo
8a933afc5d Support iterating over specific drafts more easily 2019-08-01 20:15:32 +02:00
Lonami Exo
5a225d1668 Fix a dialog's message could be wrong in rare cases 2019-07-23 12:44:19 +02:00
Lonami Exo
8e36bb4c4d Link Python keywords with Python's documentation 2019-07-06 12:11:00 +02:00
Lonami Exo
9322c37a94 Document iteration order 2019-06-28 20:44:06 +02:00
Lonami Exo
84c4fcdec6 Fix entities weren't being passed to Draft 2019-06-28 20:34:30 +02:00
Lonami Exo
b6b4ea669d Remove messy subclassing in the TelegramClient
Since it was easy to cause MRO inconsistencies, and it's
not really needed now that self is type hinted as the client.
2019-06-24 17:48:46 +02:00
Lonami Exo
31a26c0a0a Fix iter_dialogs missing dialogs once and for all 2019-06-11 10:04:36 +02:00
Lonami Exo
b8a38baaf6 Expose ignore_pinned in iter_dialogs 2019-06-11 09:55:13 +02:00
Lonami Exo
e47f3ec1d6 Clarify some aspects of the documentation 2019-06-01 16:28:20 +02:00
Lonami Exo
0d64fd98f7 Create new client.delete_dialog method 2019-05-30 13:58:05 +02:00
Lonami Exo
c3d1d7a64c Rename client.archive as client.edit_folder 2019-05-22 11:20:56 +02:00
Lonami Exo
7c1c040d50 Update docstrings to have consistent style 2019-05-20 11:57:11 +02:00
Lonami Exo
313caf440e Add friendly methods for archiving dialogs 2019-05-10 18:12:16 +02:00
Lonami Exo
1828dca0b9 Support filtering by folder on iter_dialogs 2019-05-10 15:45:24 +02:00
Lonami Exo
0a3d6106f0 Completely overhaul the documentation 2019-05-09 12:50:09 +02:00
Lonami Exo
d92d989569 Quote type hints
Otherwise, sphinx completely butchers the documentation.
2019-05-08 17:16:09 +02:00
Lonami Exo
61613ab6ac Create a new page with a summary of the method reference 2019-05-06 11:38:26 +02:00
Lonami Exo
cd4b915522 Add type hints to all public methods in the client 2019-05-03 21:38:41 +02:00
Lonami
4c1555cc5f
Fix iter_dialogs missing many dialogs 2019-04-16 13:00:18 +02:00
Lonami Exo
7c48857d0c Update docs for send_file/timeouts and add new known error 2019-03-18 17:34:48 +01:00
Lonami Exo
598b9f25e1 Fix DialogsIter not passing the client to the built objects 2019-03-13 09:12:44 +01:00
Lonami Exo
6b50152bb3 Use constants for chunk sizes, remove irrelevant TODO 2019-02-27 13:07:25 +01:00
Lonami Exo
d02d0e2d5e Handle negative limits gracefully in async generators
We rely on >= 0 for setting the batch size to use (which must
be valid), so it makes sense to make negative limits equal 0.

This is similar to how asyncio.sleep(negative) sleeps 0 seconds,
despite the fact that time.sleep(negative) fails.
2019-02-27 13:01:04 +01:00
Lonami Exo
d508e58d49 Remove the "private" _total parameter 2019-02-27 12:59:50 +01:00
Lonami Exo
c73b8eda26 Simplify filling RequestIter's buffer 2019-02-27 11:25:35 +01:00
Lonami Exo
968da5f72d Use RequestIter in the dialog methods 2019-02-27 10:38:50 +01:00
Lonami Exo
c2c8a3caeb Saner timeouts for conversation (#1099) 2019-01-31 11:11:20 +01:00
Lonami Exo
8c0250f775 Locally check dialog's offset date (#1043)
Telegram ignores the parameter if it's alone.
2019-01-03 22:35:07 +01:00
Lonami Exo
0094eb391e Support exclusive conversations by default 2018-10-12 22:17:07 +02:00
Lonami Exo
bbeb8f4ba3 Clarify and fix some docstrings 2018-09-04 11:27:10 +02:00
Lonami Exo
785ef7676f Create a basic custom.Conversation 2018-08-03 17:51:56 +02:00
Lonami Exo
7cce7aa3e4 Return helpers.TotalList instances on client.get_ methods 2018-08-02 23:00:10 +02:00
Lonami Exo
1c0d595205 Replace custom.Message creation with ._finish_init 2018-07-22 19:20:55 +02:00
Lonami Exo
baedd10110 Update to layer 82 2018-06-29 13:23:56 +02:00
Lonami Exo
72835dfb44 Update to v1.0 2018-06-27 13:41:20 +02:00
Lonami Exo
d6818f25f5 Fix rare iter_dialogs infinite loop 2018-06-20 21:12:47 +02:00
Lonami Exo
a1477a84bf Update in-memory updates.State 2018-06-20 19:58:01 +02:00
Lonami Exo
a0eb824e87 Support ignore_migrated in iter_dialogs 2018-06-20 12:03:42 +02:00
Lonami Exo
463847ad50 Revisit and remove a few TODOs 2018-06-18 18:46:06 +02:00