mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 12:53:44 +03:00
Fix event building
This commit is contained in:
parent
d490cf0f70
commit
ab6d60dab2
|
@ -216,7 +216,8 @@ async def _dispatch(self, update):
|
|||
for handler in self._update_handlers:
|
||||
event = event_cache.get(handler._event)
|
||||
if not event:
|
||||
event_cache[handler._event] = event = handler._event._build(update)
|
||||
event_cache[handler._event] = event = handler._event._build(
|
||||
update, [], self._session_state.user_id, {}, self)
|
||||
|
||||
while True:
|
||||
# filters can be modified at any time, and there can be any amount of them which are not yet resolved
|
||||
|
|
|
@ -41,7 +41,7 @@ class MessageEdited(EventBuilder):
|
|||
print('Message', event.id, 'changed at', event.date)
|
||||
"""
|
||||
@classmethod
|
||||
def _build(cls, update, others=None, self_id=None, *todo, **todo2):
|
||||
def _build(cls, update, others, self_id, entities, client):
|
||||
if isinstance(update, (_tl.UpdateEditMessage,
|
||||
_tl.UpdateEditChannelMessage)):
|
||||
return cls.Event(update.message)
|
||||
return cls._new(client, update.message, entities, None)
|
||||
|
|
|
@ -109,4 +109,4 @@ class NewMessage(EventBuilder, _custom.Message):
|
|||
else:
|
||||
return
|
||||
|
||||
return cls.Event(_custom.Message._new(client, msg, entities, None))
|
||||
return cls._new(client, msg, entities, None)
|
||||
|
|
Loading…
Reference in New Issue
Block a user