mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: fix NoneType exception in filters
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
99801df191
commit
407e75316b
1 changed files with 3 additions and 3 deletions
|
|
@ -1035,7 +1035,7 @@ class user(Filter, set):
|
||||||
|
|
||||||
async def __call__(self, _, message: Message):
|
async def __call__(self, _, message: Message):
|
||||||
is_usernames_in_filters = False
|
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:
|
for username in message.from_user.usernames:
|
||||||
if (
|
if (
|
||||||
username.username in self
|
username.username in self
|
||||||
|
|
@ -1078,7 +1078,7 @@ class chat(Filter, set):
|
||||||
async def __call__(self, _, message: Union[Message, Story]):
|
async def __call__(self, _, message: Union[Message, Story]):
|
||||||
if isinstance(message, Story):
|
if isinstance(message, Story):
|
||||||
is_usernames_in_filters = False
|
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:
|
for username in message.sender_chat.usernames:
|
||||||
if (
|
if (
|
||||||
username.username in self
|
username.username in self
|
||||||
|
|
@ -1107,7 +1107,7 @@ class chat(Filter, set):
|
||||||
) or is_usernames_in_filters
|
) or is_usernames_in_filters
|
||||||
else:
|
else:
|
||||||
is_usernames_in_filters = False
|
is_usernames_in_filters = False
|
||||||
if message.chat.usernames:
|
if message.chat and message.chat.usernames:
|
||||||
for username in message.chat.usernames:
|
for username in message.chat.usernames:
|
||||||
if (
|
if (
|
||||||
username.username in self
|
username.username in self
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue