mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-26 00:10:45 +03:00
Fix CallbackQuery ignoring func
This commit is contained in:
parent
bd6c03e5f9
commit
6d83b16503
|
@ -60,6 +60,7 @@ class CallbackQuery(EventBuilder):
|
||||||
return event
|
return event
|
||||||
|
|
||||||
def filter(self, event):
|
def filter(self, event):
|
||||||
|
# We can't call super().filter(...) because it ignores chat_instance
|
||||||
if self.chats is not None:
|
if self.chats is not None:
|
||||||
inside = event.query.chat_instance in self.chats
|
inside = event.query.chat_instance in self.chats
|
||||||
if event.chat_id:
|
if event.chat_id:
|
||||||
|
@ -76,6 +77,7 @@ class CallbackQuery(EventBuilder):
|
||||||
elif event.query.data != self.data:
|
elif event.query.data != self.data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if not self.func or self.func(event):
|
||||||
return event
|
return event
|
||||||
|
|
||||||
class Event(EventCommon, SenderGetter):
|
class Event(EventCommon, SenderGetter):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user