mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Make handlers test whether filters are callable and not if they exist
This commit is contained in:
parent
b893698f1e
commit
4e293f23a9
@ -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
|
||||
)
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -50,6 +50,6 @@ class MessageHandler(Handler):
|
||||
def check(self, message):
|
||||
return (
|
||||
self.filters(message)
|
||||
if self.filters
|
||||
if callable(self.filters)
|
||||
else True
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user