diff --git a/pyrogram/client/handlers/callback_query_handler.py b/pyrogram/client/handlers/callback_query_handler.py index c5346519..5d09f7d9 100644 --- a/pyrogram/client/handlers/callback_query_handler.py +++ b/pyrogram/client/handlers/callback_query_handler.py @@ -49,6 +49,6 @@ class CallbackQueryHandler(Handler): def check(self, callback_query): return ( self.filters(callback_query) - if self.filters + if callable(self.filters) else True ) diff --git a/pyrogram/client/handlers/deleted_messages_handler.py b/pyrogram/client/handlers/deleted_messages_handler.py index 55d5715f..8f5ef448 100644 --- a/pyrogram/client/handlers/deleted_messages_handler.py +++ b/pyrogram/client/handlers/deleted_messages_handler.py @@ -50,6 +50,6 @@ class DeletedMessagesHandler(Handler): def check(self, messages): return ( self.filters(messages.messages[0]) - if self.filters + if callable(self.filters) else True ) diff --git a/pyrogram/client/handlers/message_handler.py b/pyrogram/client/handlers/message_handler.py index 1b4770b3..e4c3d13f 100644 --- a/pyrogram/client/handlers/message_handler.py +++ b/pyrogram/client/handlers/message_handler.py @@ -50,6 +50,6 @@ class MessageHandler(Handler): def check(self, message): return ( self.filters(message) - if self.filters + if callable(self.filters) else True )