Commit Graph

122 Commits

Author SHA1 Message Date
Lonami Exo
10251f9782 Create a new Message.file property (#1168) 2019-05-08 18:41:40 +02:00
Lonami Exo
c6691dc6a8 Update the reference with even more types and other docs 2019-05-07 21:25:55 +02:00
Lonami Exo
1e17ef1c98 Apply several lints 2019-05-03 21:38:41 +02:00
Lonami Exo
1a00de6494 Add missing checks in the message for is client None 2019-05-02 18:44:28 +02:00
Lonami Exo
3a1496c205 Reuse code for _get_entity_pair
Less error-prone, improved the function flow for all callers,
and removed some duplicate work.
2019-05-01 17:52:32 +02:00
Lonami Exo
a59f53d592 Load entities for new via_bot property and forward 2019-03-28 11:07:41 +01:00
Lonami Exo
8abc7ade22 Use the new in-memory entity cache
This should avoid a disk access every time an input entity
is needed, which is very often. Another step for #1141.
2019-03-26 11:39:25 +01:00
Lonami Exo
5ac88f764d Fix and update links in the documentation 2019-01-12 13:06:14 +01:00
Lonami Exo
fbf7f75b00 Fix send_message with buttons not always returning ReplyMarkup 2019-01-12 12:53:21 +01:00
Lonami Exo
d31aaa5d0d Make Message.edit respect preview and buttons 2019-01-12 12:45:37 +01:00
Lonami Exo
2631144702 Add more properties to the client to make media more convenient 2019-01-03 18:34:29 +01:00
Lonami Exo
7100b75598 Update to layer 89
This breaks edit_2fa
2018-12-18 16:37:07 +01:00
Lonami Exo
09f994c105 Except TypeError on empty access hash from 5018879 thoroughly 2018-12-18 08:39:36 +01:00
Lonami Exo
4d8f078ad9 Fix _document_by_attribute calls using cond 2018-12-03 08:49:24 +01:00
Lonami Exo
ed1bcb509f Use InputMessageReplyTo in get_reply_message
This lets bots access to messages other bots sent through replies.
2018-11-29 14:21:49 +01:00
Lonami Exo
4a8a85d7a6 Refetch ChatAction service message to get input users 2018-11-28 18:59:49 +01:00
Lonami Exo
4e07712b04 Return new .web_preview's .photo/.document if present in Message 2018-09-15 10:45:15 +02:00
Lonami Exo
11ef4ce370 Fix _document_by_attribute failing on empty media 2018-09-06 15:41:04 +02:00
Lonami Exo
4e5b8c9c34 Let sender = chat for messages from channels 2018-09-06 10:33:56 +02:00
Lonami Exo
2cf95ce2b9 Fix accessing buttons on messages with reply markup 2018-08-04 11:16:51 +02:00
Lonami Exo
070c971d11 Set media as None if it is MessageMediaEmpty 2018-08-02 20:18:28 +02:00
Lonami Exo
ace7254344 Fix classes MRO and abstractmethod usage
Furthermore utils needs to access the message by reference
through types.Message because it is patched and replaced.
2018-07-22 19:26:34 +02:00
Lonami Exo
fd17098447 Rename MessageBase for Message 2018-07-22 17:22:52 +02:00
Lonami Exo
c4e94abcf0 Complete moving properties to the new message base 2018-07-22 16:49:42 +02:00
Lonami Exo
5df46f9ed8 (Try to) fix infinite recursion in custom.Message again 2018-07-22 12:27:08 +02:00
Lonami Exo
bc03c29216 Fix logical bugs when getting input peers in custom.Message
Such as incorrectly handling InputPeerSelf/InputPeerChat and
using self._input_sender when self._input_chat was expected.
2018-07-22 11:33:29 +02:00
Lonami Exo
13437cc3f2 Fix infinite recursion for custom.Message.message 2018-07-21 10:19:17 +02:00
Lonami Exo
051d56af88 Support clicking buttons known their data 2018-07-12 16:26:22 +02:00
Lonami Exo
e2ffa816dc Fix infinite recursion 2018-07-11 11:23:11 +02:00
Lonami Exo
8eecd9c226 Reuse code to get chat and sender 2018-07-10 17:59:13 +02:00
Lonami Exo
1b22d0eb12 Add missing await 2018-07-08 23:44:56 +02:00
Lonami Exo
44630542d0 Fix MessageAction not allowing access to media
This caused some issues with events.MessageEdited because
some MessageAction can trigger these edit updates such as
scoring in a game.
2018-07-03 14:13:44 +02:00
Lonami Exo
43afdb9d77 Fix-up 53fbfb2 for InputPeerChat or others 2018-07-03 14:05:42 +02:00
Lonami Exo
53fbfb215f Fix Telegram may omit entities' access hash in updates 2018-07-02 18:43:42 +02:00
Lonami Exo
0f5f6cc050 Fix opposite condition 2018-06-28 15:50:26 +02:00
Lonami Exo
ad01bda503 Fix custom.Message.buttons being None in channels (#870)
The implications behind this were bigger than expected. The sender
of the message is not actually needed for anything in the bot. The
bot itself may be needed, but only for KeyboardButtonSwitchInline.
2018-06-27 19:25:14 +02:00
chrizrobert
1eb4af33df Fix get_entities_text with cls (#866) 2018-06-26 15:58:55 +02:00
Lonami Exo
96e8b0b840 Remove get_fwd_sender 2018-06-26 12:38:58 +02:00
Lonami Exo
410518aa65 Stop using await with properties 2018-06-25 11:38:56 +02:00
Lonami Exo
0d09f9d8c1 Create a custom.Forward class 2018-06-25 11:34:10 +02:00
Lonami Exo
266d44dd86 Fix EventsCommon still having async properties 2018-06-24 13:05:58 +02:00
Lonami Exo
0d0e78e10b Use the right chat peer in private messages 2018-06-23 15:10:07 +02:00
Lonami Exo
8d98c04932 Fix awaits on input_chat property 2018-06-22 10:05:29 +02:00
Lonami Exo
5e322a6ca9 Remove async properties from custom.Message
Awaiting on a property was strange and only really made sense
in events.NewMessage. Methods like client.get_messages() and
similar return entire custom.Message which won't need to touch
the network, and requiring the await was a poor UX.
2018-06-21 21:15:48 +02:00
Lonami Exo
8d5c052fce Fix TypeError when accessing unexisting sender 2018-06-21 09:26:31 +02:00
Lonami Exo
c85ba4accc Revisit documentation, cross-references and unnecessary indents 2018-06-20 11:06:03 +02:00
Lonami Exo
ee7a44d447 Return an empty list from get_entities_text if no entities 2018-06-18 13:54:09 +02:00
Lonami Exo
56ddaaee6f Make non-fwded messages sent to yourself outgoing 2018-06-16 17:35:24 +02:00
Lonami Exo
b7286be3b0 Get the "correct" chat in private incoming messages 2018-06-15 12:46:41 +02:00
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
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
0418f7e375 Fix get_entities_text and allow filtering by type 2018-06-07 10:46:32 +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
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