Commit Graph

224 Commits

Author SHA1 Message Date
Lonami Exo
21e5f0b547 Fix GetUsersRequest has a limit of 200 2017-12-27 15:08:29 +01:00
Lonami Exo
f96d88d3b5 Modify .get_entity to support fetching many entities at once 2017-12-27 12:36:38 +01:00
Lonami Exo
3512028d0f Fix .get_input_entity excepting wrong type 2017-12-27 12:36:14 +01:00
Lonami Exo
5c17097d8d Clean up .get_entity and remove force_fetch 2017-12-27 11:56:05 +01:00
Lonami Exo
aef96f1b68 Remove custom EntityDatabase and use sqlite3 instead
There are still a few things to change, like cleaning up the
code and actually caching the entities as a whole (currently,
although the username/phone/name can be used to fetch their
input version which is an improvement, their full version
needs to be re-fetched. Maybe it's a good thing though?)
2017-12-27 00:50:09 +01:00
Lonami Exo
238198db5a Create a convenient class to wrap Dialog instances 2017-12-24 16:18:09 +01:00
Dmitry D. Chernov
fb9813ae61 TelegramClient.send_code_request(): Change logic of methods invocation
Before:
  First call, force_sms=False: SendCodeRequest
  Next call, force_sms=False: SendCodeRequest
  First call, force_sms=True: raise ValueError
  Next call, force_sms=True: ResendCodeRequest

That's inconvenient because the user must remember whether the code requested at all and whether the request was successful.
In addition, the repeated invocation of SendCodeRequest does nothing.

This commit changes logic to this:
  First call, force_sms=False: SendCodeRequest
  Next call, force_sms=False: ResendCodeRequest
  First call, force_sms=True: SendCodeRequest, ResendCodeRequest
  Next call, force_sms=True: ResendCodeRequest
2017-12-24 21:25:17 +10:00
Lonami Exo
152856dfbc Add a force_fetch parameter to .get_entity 2017-11-20 10:58:11 +01:00
Vladislav Kolesnichenko
ee5915e86d Add support for connecting through IPv6 (#425 for #112) 2017-11-16 13:30:18 +01:00
Lonami Exo
b346561f89 Remove unnecessary call to .get_input_entity() 2017-11-16 13:24:32 +01:00
Lonami Exo
5a57a8a498 Fix message history failing if sender fwd from channel
Closes #424
2017-11-11 19:35:57 +01:00
Lonami Exo
81baced12b Support t.me/ links when resolving usernames/joinchat links
Closes #419
2017-11-10 13:27:51 +01:00
Lonami Exo
7d75eebdab Make markdown parser use only Telegram's MessageEntity's 2017-11-10 11:07:36 +01:00
Lonami Exo
f381b26790 Add optional force_sms parameter to .send_code_request() 2017-11-04 20:46:02 +01:00
Lonami Exo
1741608f28 Use larger batches for .get_dialogs(limit=None) 2017-11-04 12:35:12 +01:00
Lonami Exo
9a12738f0e Fix .get_message_history not working with limit=0 2017-10-31 13:52:43 +01:00
Lonami Exo
3d6c8915e3 Allow >100 limits when getting message history (implements #290) 2017-10-31 12:52:07 +01:00
Lonami
6c2363acd2
Merge pull request #396 from LonamiWebs/md-parsing
Support markdown again (implements  #118)
2017-10-30 11:19:48 +01:00
Lonami Exo
7e204632e2 Add parse_mode parameter to TelegramClient.send_message() 2017-10-30 11:17:22 +01:00
Lonami Exo
6567f4b567 Clean .download_contact and a wrong indent level 2017-10-29 20:13:36 +01:00
Lonami Exo
e48f15be80 Fix-up af08d59 (missing parenthesis) 2017-10-28 11:11:51 +02:00
Tanuj
af08d59cb7 Fix bug with semicolons when downloading contacts (#319) 2017-10-28 11:09:46 +02:00
Lonami Exo
d7f917ebfc Update docstrings 2017-10-21 16:59:20 +02:00
Nikolay
9907d763a8 Use peer as key instead top_message on .get_dialogs (fix #329) 2017-10-14 11:50:48 +02:00
88ee55
db63b5e39a Fix .send_message not expecting UpdateNewChannelMessage (#331) 2017-10-13 10:53:36 +02:00
Lonami Exo
2a1a4508b8 Allow overriding DocumentAttributes on .send_file (fix #294) 2017-10-09 11:20:31 +02:00
Lonami Exo
4673a02ce6 Stop calling .process_entities where not needed 2017-10-09 11:20:31 +02:00
Joscha Götzer
4a482b3506 .get_drafts() and a custom Draft class (#310) 2017-10-09 09:54:48 +02:00
Lonami Exo
48c8837f19 Don't look on all dialogs on .get_entity miss 2017-10-08 16:25:50 +02:00
Lonami Exo
a17def8026 Use basename instead abspath for filename attribute (#294) 2017-10-06 21:48:53 +02:00
Lonami Exo
3bf70692b4 Fix TelegramClient.get_input_entity always failing/missing return 2017-10-06 21:43:04 +02:00
Lonami Exo
804a29d0bc Fix get_input_entity from peer ID not actually working 2017-10-06 21:05:02 +02:00
Lonami Exo
7aa21dbd07 Fix .get_dialogs to never return more than limit 2017-10-05 13:55:58 +02:00
Lonami Exo
99cc0778bb Allow EntityDatabase to be accessed by phone 2017-10-05 13:01:00 +02:00
Lonami Exo
e5c4df98df Use EntityDatabase on TelegramClient.get_entity instead lru_cache 2017-10-05 12:27:32 +02:00
Joscha Götzer
6c375a7aed Add method to .delete_messages() (#282) 2017-10-02 18:59:29 +02:00
3bl3gamer
0f019f0476 Rename last subclass_of_id to upper case (#285) 2017-10-02 13:26:55 +02:00
Lonami Exo
ba147bbe10 Fix TgClient.get_input* not calling utils.get_input* when needed 2017-10-01 21:15:49 +02:00
Lonami Exo
43f796caab Fix .get_dialogs() failing on Windows 2017-10-01 21:02:41 +02:00
Lonami Exo
62ea77cbea Fix opposite condition on .get_dialogs 2017-10-01 19:45:42 +02:00
Lonami Exo
269949595f Allow phone as int on .sign_in (#278) 2017-10-01 19:02:53 +02:00
Lonami Exo
d30fdbe778 Support "string" peers on .get_input_entity 2017-10-01 16:59:18 +02:00
Lonami Exo
8df4d7c4a5 Internal methods should use .get_input_entity 2017-10-01 16:54:11 +02:00
Lonami Exo
1cdf879888 Fix .get_input_entity failing for chats 2017-10-01 16:53:47 +02:00
Lonami Exo
71b6e527a6 Allow using parenthesis or spaces in phones when .get_entity 2017-10-01 15:50:23 +02:00
Lonami Exo
5b6f9b6542 Add a new .get_input_entity method and use it on .get_entity 2017-10-01 14:19:04 +02:00
Lonami Exo
9445d2ba53 More enhancements on .sign_in from different clients (#278) 2017-10-01 11:37:18 +02:00
Lonami Exo
1d250a5441 Allow overriding phone on .sign_in (fix #278) 2017-10-01 11:31:26 +02:00
Lonami Exo
68e7d481f4 Add support to get all dialogs at once 2017-10-01 11:25:12 +02:00
Lonami Exo
671ac1cdb7 Fix **kwargs not being passed to TelegramBareClient 2017-09-30 18:02:08 +02:00