mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 03:54:51 +00:00
pyrofork: fix NoneType exception in filters
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
fd4eb09f7a
commit
52abec6e01
1 changed files with 3 additions and 3 deletions
|
|
@ -1035,7 +1035,7 @@ class user(Filter, set):
|
|||
|
||||
async def __call__(self, _, message: Message):
|
||||
is_usernames_in_filters = False
|
||||
if message.from_user.usernames:
|
||||
if message.from_user and message.from_user.usernames:
|
||||
for username in message.from_user.usernames:
|
||||
if (
|
||||
username.username in self
|
||||
|
|
@ -1078,7 +1078,7 @@ class chat(Filter, set):
|
|||
async def __call__(self, _, message: Union[Message, Story]):
|
||||
if isinstance(message, Story):
|
||||
is_usernames_in_filters = False
|
||||
if message.sender_chat.usernames:
|
||||
if message.sender_chat and message.sender_chat.usernames:
|
||||
for username in message.sender_chat.usernames:
|
||||
if (
|
||||
username.username in self
|
||||
|
|
@ -1107,7 +1107,7 @@ class chat(Filter, set):
|
|||
) or is_usernames_in_filters
|
||||
else:
|
||||
is_usernames_in_filters = False
|
||||
if message.chat.usernames:
|
||||
if message.chat and message.chat.usernames:
|
||||
for username in message.chat.usernames:
|
||||
if (
|
||||
username.username in self
|
||||
|
|
|
|||
Loading…
Reference in a new issue