Commit Graph

192 Commits

Author SHA1 Message Date
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
Lonami Exo
a596f88497 Fix wrong super() args for events.MessageDeleted (fix #675) 2018-03-11 09:48:48 +01:00
Lonami Exo
2fb42772c6 Add .video_note and .gif convenience properties to NewMessage 2018-03-08 20:21:56 +01:00
Lonami Exo
cf650e061e Avoid editing events.NewMessage that are forwards 2018-03-08 20:18:10 +01:00
Lonami Exo
09f0f86f1e Add convenience NewMessage attrs to get media of specific types 2018-03-08 10:30:49 +01:00
Lonami Exo
d3d190f36e Fix-up previous commit overriding .action_message with None 2018-03-07 17:57:54 +01:00
Lonami Exo
801018fa9b Add respond, reply and delete methods to events.ChatAction
Also introduces the new .action_message member.
2018-03-07 17:51:59 +01:00
Lonami Exo
dc99d119c3 Fix events.MessageDeleted always failing due to extra "self." 2018-03-07 17:31:21 +01:00
Lonami Exo
82c034dc56 Add forward_to on events.NewMessage 2018-03-04 00:32:26 +01:00
Lonami Exo
4de811b8cb Expose the client on events as a public property 2018-03-03 23:55:35 +01:00
Lonami Exo
458d220af9 Fix users not being set for some events.ChatAction and properties 2018-03-03 23:41:27 +01:00
Lonami Exo
1c8bf44713 Add input user versions to events.ChatAction 2018-03-03 23:31:06 +01:00
Lonami Exo
c40a3ca77c Split MessageChanged into MessageEdited and MessageDeleted 2018-03-03 23:23:14 +01:00
Joscha Götzer
3184641549 Allow access to events' pattern match (#654) 2018-03-01 00:15:30 +01:00
Joscha Götzer
0b662f3b04 Support stopping propagation of events (#622) 2018-02-27 11:30:42 +01:00
Lonami Exo
5a54e2279f Avoid relying on .__iter__ to tell iterators apart
.send_file() would fail with stream objects (those from open())
since they are iterable, and asserting that they weren't bytes
or str was not enough.
2018-02-26 14:12:21 +01:00
Lonami Exo
9604161c91 Fix incoming private messages not working with whitelists
For some reason this was only happening with bots and not
actual private messages. The fix doesn't seem to affect
previous behaviour with actual users in private messages.
2018-02-26 12:15:53 +01:00
Lonami Exo
098602ca13 Let events.Raw.resolve() be a no-op 2018-02-25 10:36:53 +01:00
Lonami Exo
448a04a7c5 Stop using InputPeerSelf() on events and special case edit()
Used to fail on the chat with your own (where messages are
"incoming" instead outgoing). Now the ID of the chat and
sender are compared to achieve the same effect. Fixes #632.
2018-02-22 21:01:18 +01:00
Jannik
ea0da8fc0e Add pattern argument on the NewMessage event (#620) 2018-02-20 15:55:02 +01:00
Lonami Exo
bf086f3e80 Fix UpdateDeleteMessages doesn't have .channel_id (#619) 2018-02-19 20:23:52 +01:00
Lonami Exo
89df481ae4 Make MessageChanged.Event inherit NewMessage.Event 2018-02-18 14:07:13 +01:00
Lonami Exo
d581589313 Add missing UpdateShortChatMessage case on events.NewMessage 2018-02-17 11:40:38 +01:00
Lonami Exo
6d993af338 Move events chats and blacklist_chats into the base, reuse code 2018-02-17 11:29:16 +01:00
Lonami Exo
8718cf0e7e Reuse turning chats into a set of IDs and handle self case 2018-02-17 10:41:43 +01:00
Lonami Exo
196275e9c8 Add edit and delete shorthand methods to events.NewMessage 2018-02-15 11:35:12 +01:00
Lonami Exo
08b9d7c4ef Add more logic to better retrieve input_sender on events 2018-02-13 10:24:35 +01:00
Lonami Exo
0633e204c2 Fix whitelisting multiple chats on events not working 2018-02-11 10:30:45 +01:00
Lonami Exo
14389a0ef2 Better document the events module 2018-02-09 15:56:42 +01:00
Lonami Exo
5167754368 Fix input_sender events' property not using cached value 2018-02-09 13:10:02 +01:00
Lonami Exo
f5eda72329 Add a new Raw Event 2018-02-09 13:08:09 +01:00
Lonami Exo
8786a52257 Add a new MessageChanged Event 2018-02-09 13:05:34 +01:00
Lonami Exo
ffe826b35f Add a new UserUpdate Event 2018-02-09 12:45:40 +01:00
Lonami Exo
379c775558 Add a new ChatAction Event 2018-02-09 11:37:17 +01:00
Lonami Exo
510bbf0fc8 Create a more reusable Event base class 2018-02-09 11:36:41 +01:00
Lonami Exo
91ba50174a Provide easier access to media through NewMessage event 2018-02-08 19:43:15 +01:00
Lonami Exo
c79fbe451f Fix NewMessage event not dropping MessageService 2018-02-07 14:06:36 +01:00
Lonami Exo
2e0a8d6bce Add respond and reply methods to the NewMessage event 2018-02-07 13:55:41 +01:00
Lonami Exo
dc43757cff Don't access NewMessage properties when building the event 2018-02-07 13:55:25 +01:00
Lonami Exo
9c09233b4f Make NewMessage's input chat/sender actual Input* if possible 2018-02-07 13:45:17 +01:00
Lonami Exo
ef837b1a53 Add a NewMessage event to handle incoming messages 2018-02-07 10:42:40 +01:00
Lonami Exo
5ec984dd82 Allow adding events with the client.on decorator 2018-02-07 10:41:58 +01:00