2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Make handlers test whether filters are callable and not if they exist

This commit is contained in:
Dan 2018-09-14 15:28:08 +02:00
parent b893698f1e
commit 4e293f23a9
3 changed files with 3 additions and 3 deletions

View File

@ -49,6 +49,6 @@ class CallbackQueryHandler(Handler):
def check(self, callback_query): def check(self, callback_query):
return ( return (
self.filters(callback_query) self.filters(callback_query)
if self.filters if callable(self.filters)
else True else True
) )

View File

@ -50,6 +50,6 @@ class DeletedMessagesHandler(Handler):
def check(self, messages): def check(self, messages):
return ( return (
self.filters(messages.messages[0]) self.filters(messages.messages[0])
if self.filters if callable(self.filters)
else True else True
) )

View File

@ -50,6 +50,6 @@ class MessageHandler(Handler):
def check(self, message): def check(self, message):
return ( return (
self.filters(message) self.filters(message)
if self.filters if callable(self.filters)
else True else True
) )