mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +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):
|
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
|
||||||
)
|
)
|
||||||
|
@ -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
|
||||||
)
|
)
|
||||||
|
@ -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
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user