mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-14 05:26:36 +03:00
Fix from_users filter not accounting for None from_id
This commit is contained in:
parent
cb92a40156
commit
20606b3a71
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user