Improved deleted message handling (#645)

* Tidy up namings of invite link methods

* Improved deleted message handling

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
This commit is contained in:
trenoduro 2021-05-11 10:45:55 +02:00 committed by GitHub
parent 293e852afd
commit 3be981ada1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,4 +52,10 @@ class DeletedMessagesHandler(Handler):
super().__init__(callback, filters) super().__init__(callback, filters)
async def check(self, client: "pyrogram.Client", messages: List[Message]): 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