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):
return (
self.filters(callback_query)
if self.filters
if callable(self.filters)
else True
)

View File

@ -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
)

View File

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