diff --git a/pyrogram/handlers/deleted_messages_handler.py b/pyrogram/handlers/deleted_messages_handler.py index dff1ebe7..e41158f9 100644 --- a/pyrogram/handlers/deleted_messages_handler.py +++ b/pyrogram/handlers/deleted_messages_handler.py @@ -52,4 +52,10 @@ class DeletedMessagesHandler(Handler): super().__init__(callback, filters) async def check(self, client: "pyrogram.Client", messages: List[Message]): - return await super().check(client, messages[0]) if messages else False # The messages list can be empty + # Every message should be checked, if at least one matches the filter True is returned + # otherwise, or if the list is empty, False is returned + for message in messages: + if await super().check(client, message): + return True + else: + return False