Fix event building

This commit is contained in:
Lonami Exo 2022-02-04 11:46:57 +01:00
parent d490cf0f70
commit ab6d60dab2
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)