Commit Graph

91 Commits

Author SHA1 Message Date
Lonami Exo
410518aa65 Stop using await with properties 2018-06-25 11:38:56 +02:00
Lonami Exo
efc9f4c414 Get rid of all remaining async properties 2018-06-25 11:03:20 +02:00
Lonami Exo
266d44dd86 Fix EventsCommon still having async properties 2018-06-24 13:05:58 +02:00
Lonami Exo
1a1d9d346c Fix most private messages being outgoing since 56ddaae
56ddaae checked to_id and from_id to compare if they were equal,
and if they were, mark the event as outgoing for convenience in
your private chat (saved messages).

However when reconstructing the Message from UpdateShortMessage
to_id didn't mimic 100% Telegram's behaviour (the chat to which
the message is sent is "different" depending on who sent the
messages). This bug is what actually caused most messages to
be outgoing, even though 56ddaae's logic is correct.
2018-06-22 10:25:20 +02:00
Lonami Exo
f733f8e565 Rewrite the first part of the docs for asyncio 2018-06-21 21:54:54 +02:00
Lonami Exo
9e3f6483e8 Fix pattern= and move pattern_match to events.NewMessage 2018-06-20 20:03:44 +02:00
Lonami Exo
c893eaaa84 Allow filtering new messages by sender/forwards 2018-06-20 11:58:44 +02:00
Lonami Exo
c85ba4accc Revisit documentation, cross-references and unnecessary indents 2018-06-20 11:06:03 +02:00
Lonami Exo
56ddaaee6f Make non-fwded messages sent to yourself outgoing 2018-06-16 17:35:24 +02:00
Lonami Exo
24d2074e0c Set _input_chat on custom.Message creation/fixup input_chat 2018-06-14 23:40:44 +02:00
Lonami Exo
f95400ea7e Try again to get input_chat on EventsCommon 2018-06-14 23:26:04 +02:00
Lonami Exo
179af9894f Add missing parenthesis around await 2018-06-14 22:25:03 +02:00
Lonami Exo
908dfa148b Revisit codebase to add missing async/await 2018-06-14 17:09:20 +02:00
Lonami Exo
3ce8b17193 Dispatch updates to event handlers 2018-06-13 16:20:15 +02:00
Lonami Exo
2e43fb3217 More nasty hacks to fix events.NewMessage attrs 2018-06-03 17:09:36 +02:00
Lonami Exo
997f2b62ce Fix EventCommon/custom.Message conflicting properties 2018-06-03 16:41:13 +02:00
Lonami Exo
b2ed6caff4 Fix setattr for events.NewMessage/custom.Message 2018-06-03 13:00:07 +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
5c76af34aa Fix copy-paste typo 2018-06-02 12:38:47 +02:00
Lonami Exo
6dcd0911a7 Move events.NewMessage properties to custom.Message 2018-06-02 12:30:25 +02:00
Lonami Exo
9e4854fcce Use custom.Message in events 2018-05-31 13:30:22 +02:00
Lonami Exo
6c20f8a2c7 Set is private/group=True for messages deleted out of channels 2018-05-28 18:27:44 +02:00
Lonami Exo
a1b22e0911 Support incoming=False to indicate outgoing=True 2018-05-28 18:25:01 +02:00
Lonami Exo
cffef411b2 Enhance documentation 2018-05-17 12:00:22 +02:00
Lonami Exo
d6935355ae Fix two tiny typos 2018-04-28 13:42:36 +02:00
Lonami Exo
ce7e5abb58 Support filtering events.Raw by update type 2018-04-28 13:37:19 +02:00
Lonami Exo
5c6ac18a52 Attach original_update to all events 2018-04-28 12:58:41 +02:00
Lonami Exo
f31ca142a3 Support autocast to InputMessage 2018-04-23 11:05:38 +02:00
Lonami Exo
a13863a4fb Re-export events.Raw (removed on b7c3f80) 2018-04-13 17:36:23 +02:00
Lonami Exo
414fec91f1 Stop using input version on events to just get the ID 2018-04-08 15:55:10 +02:00
Lonami Exo
93b5909be5 Add chat_id-like convenience properties to the events 2018-04-08 14:24:01 +02:00
Jeff
259bb6ace1 Several documentation fixes/additions (#750) 2018-04-08 14:15:26 +02:00
Lonami Exo
b7c3f80679 Split events into separate files 2018-04-05 20:14:22 +02:00
Lonami Exo
f9f49a893b Return a single message from client.forward on non-list inputs 2018-04-04 20:58:58 +02:00
Lonami Exo
7bc021bba4 Update to layer 75 (again) 2018-03-30 20:28:07 +02:00
Lonami Exo
dede5520dd Rename .entities -> ._entities from 7e9d19d to avoid collision 2018-03-29 00:56:05 +02:00
Lonami Exo
395e702586 Make py:obj default Sphinx's role 2018-03-28 16:03:47 +02:00
Lonami Exo
dcb7820c5f Add a new events.MessageRead 2018-03-28 15:52:55 +02:00
Lonami Exo
790b0d2d23 Guess entity type on positive IDs in events and avoid some RPCs
Now specifying a single positive integer ID will add all the types
to the white/blacklist so it can be "guessed". Explicit peers will
always be only that type, and an RPC is avoided  (since it was not
needed to begin with).
2018-03-24 18:34:07 +01:00
Lonami Exo
13e59983af Slightly change docs for events (#668) 2018-03-24 12:42:19 +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
Jeff
95f368201e Fix ChatAction not handling all pin events (#715) 2018-03-21 10:01:14 +01:00
Lonami Exo
3550974b71 Fix documentation for events
Changing the .__name__ of a class will make it not show in the
generated documentation, so instead we need to use a different
variable.
2018-03-21 09:17:56 +01:00
Lonami Exo
89ae0cb164 Make readthedocs build run without warnings 2018-03-21 08:55:13 +01:00
Lonami Exo
d379b26339 Fix assignement to wrong variable on ChatAction 2018-03-18 10:24:48 +01:00
Lonami Exo
d6c051fd52 Add __str__ and .stringify() to events 2018-03-16 09:54:16 +01:00
Lonami Exo
48869f0f4e Fix MessageEdited ignoring NewMessage constructor arguments
These include outgoing/incoming and pattern which are now handled.
2018-03-14 21:09:51 +01:00
Lonami Exo
8ae12fbb70 Return the entire entity from the helper events._get_entity too 2018-03-14 10:32:59 +01:00
Lonami Exo
7e9d19d727 Add known entities to all updates and use them in the events
This should reduce the amount of API calls made when getting the
full sender/chat on events (mostly on channels, where Telegram
seems to always send Updates instead only a normal Update).
2018-03-14 10:28:21 +01:00