Fix CallbackQuery ignoring func

This commit is contained in:
Lonami Exo 2019-04-13 16:42:53 +02:00
parent bd6c03e5f9
commit 6d83b16503

View File

@ -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,7 +77,8 @@ class CallbackQuery(EventBuilder):
elif event.query.data != self.data: elif event.query.data != self.data:
return None return None
return event if not self.func or self.func(event):
return event
class Event(EventCommon, SenderGetter): class Event(EventCommon, SenderGetter):
""" """