Skip to content

Commit 3be981a

Browse files
Improved deleted message handling (pyrogram#645)
* Tidy up namings of invite link methods * Improved deleted message handling Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
1 parent 293e852 commit 3be981a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pyrogram/handlers/deleted_messages_handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,10 @@ def __init__(self, callback: Callable, filters: Filter = None):
5252
super().__init__(callback, filters)
5353

5454
async def check(self, client: "pyrogram.Client", messages: List[Message]):
55-
return await super().check(client, messages[0]) if messages else False # The messages list can be empty
55+
# Every message should be checked, if at least one matches the filter True is returned
56+
# otherwise, or if the list is empty, False is returned
57+
for message in messages:
58+
if await super().check(client, message):
59+
return True
60+
else:
61+
return False

0 commit comments

Comments
 (0)