Commit Graph

168 Commits

Author SHA1 Message Date
Lonami Exo
24d2074e0c Set _input_chat on custom.Message creation/fixup input_chat 2018-06-14 23:40:44 +02:00
Lonami
bb3a564500
Merge pull request #843 from LonamiWebs/core-rewrite
Core rewrite
2018-06-14 16:25:28 +02:00
Lonami Exo
3f16c92eb3 Subclass TLRequest for content-related objects 2018-06-12 20:14:21 +02:00
Lonami Exo
d4dc147459 Handle DraftMessageEmpty (closes #844) 2018-06-12 19:25:13 +02:00
Lonami Exo
2a90de2b08 Fix broadcast being named post for is_group property 2018-06-12 12:31:37 +02:00
Lonami Exo
f581db294a Better custom.MessageButton.click() docs 2018-06-11 10:25:57 +02:00
Lonami Exo
aa6d3430ae Properly handle bot timeouts when clicking buttons 2018-06-11 10:20:22 +02:00
Lonami Exo
f86f52d960 Fix async_generator's and missing awaits 2018-06-10 22:00:55 +02:00
Lonami Exo
d462b04a9c Add async/await on tl.custom 2018-06-10 20:29:57 +02:00
Lonami Exo
3e151a1b7a Make TelegramBareClient able to invoke requests 2018-06-09 21:03:48 +02:00
Lonami Exo
be279ce3f5 Make TLMessage always have a valid TLObject
This simplifies the flow instead of having separate request/body
attributes, and also means that BinaryReader.tgread_object() can
be used without so many special cases.
2018-06-09 13:48:27 +02:00
Lonami Exo
f7e8907c6f Create RpcResult class and generalise core special cases
This results in a cleaner MTProtoSender, which now can always
read a TLObject with a guaranteed item, if the message is OK.
2018-06-09 13:13:55 +02:00
Lonami Exo
adfe861e9f Create a self-contained MTProtoState
This frees us from using entire Session objects in something
that's supposed to just send and receive items from the net.
2018-06-09 11:34:01 +02:00
Lonami Exo
0418f7e375 Fix get_entities_text and allow filtering by type 2018-06-07 10:46:32 +02:00
Lonami Exo
56b09c0c9d Properly set future results 2018-06-07 10:30:20 +02:00
Lonami Exo
e469258ab9 Create a new MTProtoSender structure and its foundation
This means that the TcpClient and the Connection (currently only
ConnectionTcpFull) will no longer be concerned about handling
errors, but the MTProtoSender will.

The foundation of the library will now be based on asyncio.
2018-06-06 20:41:01 +02:00
Lonami Exo
8c8a0153ef Revert 9db9d1e's count and fix typo 2018-06-03 15:20:52 +02:00
Lonami Exo
b2ed6caff4 Fix setattr for events.NewMessage/custom.Message 2018-06-03 13:00:07 +02:00
Lonami Exo
0a3151175d Fix infinite recursion on setattr custom.Message 2018-06-03 12:29:30 +02:00
Lonami Exo
8d7c7a19c0 Add some setters for custom.Message 2018-06-03 11:53:18 +02:00
Lonami Exo
8b16023566 Allow setting a per-client default parse mode 2018-06-03 11:29:48 +02:00
Lonami Exo
f7222407de Document custom.Message 2018-06-02 12:52:38 +02:00
Lonami Exo
6dcd0911a7 Move events.NewMessage properties to custom.Message 2018-06-02 12:30:25 +02:00
Lonami Exo
e2ce55871e Replace custom.Message's class on creation 2018-06-01 21:20:34 +02:00
Lonami Exo
9db9d1ed5c Implement __bytes__ and use count instead sum 2018-05-31 22:39:32 +02:00
Lonami Exo
2191fbf30b Fix custom.Message.click not having buttons 2018-05-31 14:10:19 +02:00
Lonami Exo
a1c511429e Port NewMessage.edit/delete to custom.Message 2018-05-31 14:01:42 +02:00
Lonami Exo
66d5443fcd Add custom.Message.fwd_from_entity 2018-05-31 13:56:33 +02:00
Lonami Exo
58f621ba82 Make custom.Message more consistent with previous patches 2018-05-31 13:50:08 +02:00
Lonami Exo
5aed494aac Fix custom.Message special methods 2018-05-31 12:50:08 +02:00
Lonami Exo
192b7af136 Lazily load user/input user on Message 2018-05-31 12:24:25 +02:00
Lonami Exo
aa70436441 Add a custom Message class 2018-05-31 10:32:32 +02:00
Lonami Exo
68bb8e8b91 Add is_user/group/channel and title to Dialog 2018-05-30 19:20:27 +02:00
Lonami Exo
ef509d13c7 Move InvokeAfterMsg to TLMessage to cleanly confirm results 2018-05-09 16:18:42 +02:00
Lonami Exo
3b7c4fe278 Further TLObject generator clean-up
Split everything into several functions, reused some more
common code (like accessing the "real" arguments instead
constantly filtering) and more, like using classmethods
instead staticmethods and then hardcoding the class name.
2018-04-14 20:28:25 +02:00
vegeta1k95
3bf259d6b3 Make TLObjects picklable (#752) 2018-04-12 18:02:46 +02:00
Lonami Exo
395e702586 Make py:obj default Sphinx's role 2018-03-28 16:03:47 +02:00
Lonami Exo
ae2abd2ba9 Add __str__/.stringify() to tl.custom for completeness 2018-03-27 11:08:40 +02:00
Lonami Exo
1c9dc8dc63 Fix getting ID on custom Dialog class from dce0fd9 2018-03-24 18:44:13 +01:00
Lonami Exo
43c6896481 Add a custom role for TL references and make use of it 2018-03-23 21:42:17 +01:00
Lonami Exo
dce0fd9e03 Add missing documentation for telethon.tl.custom and crosslinks 2018-03-22 19:02:08 +01:00
Lonami Exo
9d46bb35c8 Rename and reorder some params in Draft for consistency (#673) 2018-03-08 13:05:40 +01:00
Lonami Exo
8cefb22e14 Add .text and .raw_text properties to the Draft class (#673) 2018-03-08 12:56:20 +01:00
Lonami Exo
6e6d40be18 Implement Draft.send() (closes #673) 2018-03-08 12:37:06 +01:00
Joscha Götzer
835ff51e25 Multiple small changes/fixed typos to docs/error messages (#623) 2018-03-01 13:21:28 +01:00
Lonami Exo
fbd53e2126 Override TLObject's __eq__ and __ne__ methods 2018-02-01 12:10:03 +01:00
Lonami Exo
4a83784fe8 Simplify TLObject.pretty_format since Telegram returns no dicts 2018-01-25 09:51:12 +01:00
Lonami Exo
2873dcf1c6 Add '_' key to TLObject's .to_dict() and remove recursive param
Closes #559
2018-01-25 09:44:07 +01:00
Lonami Exo
b716c4fe67 Several documentation enhancements and build warnings fixes
- Made the documentation even more friendly towards newbies.
- Eased the usage of methods like get history which now set
  a default empty message for message actions and vice versa.
- Fixed some docstring documentations too.
- Updated the old normal docs/ to link back and forth RTD.
- Fixed the version of the documentation, now auto-loaded.
2018-01-20 11:47:17 +01:00
Lonami Exo
4d4e81e609 Fix cyclic imports on Python 3.4 by moving Session one level up 2018-01-19 22:55:28 +01:00