Fix from_users filter not accounting for None from_id

This commit is contained in:
Lonami Exo 2020-10-05 14:01:50 +02:00
parent cb92a40156
commit 20606b3a71
2 changed files with 2 additions and 4 deletions

View File

@ -156,7 +156,7 @@ class NewMessage(EventBuilder):
return return
if self.from_users is not None: if self.from_users is not None:
if utils.get_peer_id(event.message.from_id) not in self.from_users: if event.message.sender_id not in self.from_users:
return return
if self.pattern: if self.pattern:

View File

@ -31,9 +31,7 @@ class Forward(ChatGetter, SenderGetter):
self.original_fwd = original self.original_fwd = original
sender_id = sender = input_sender = peer = chat = input_chat = None sender_id = sender = input_sender = peer = chat = input_chat = None
if not original.from_id: if original.from_id:
pass
else:
ty = helpers._entity_type(original.from_id) ty = helpers._entity_type(original.from_id)
if ty == helpers._EntityType.USER: if ty == helpers._EntityType.USER:
sender_id = utils.get_peer_id(original.from_id) sender_id = utils.get_peer_id(original.from_id)