Fix callback query

This commit is contained in:
Yasir Aris M 2023-11-03 13:13:27 +07:00 committed by GitHub
parent e8d3aed257
commit 2af6d257f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,9 +98,15 @@ class CallbackQueryHandler(Handler):
client, query
)
handler_does_match = (
await self.filters(client, query) if callable(self.filters) else True
)
if callable(self.filters):
if iscoroutinefunction(self.filters.__call__):
handler_does_match = await self.filters(client, query)
else:
handler_does_match = await client.loop.run_in_executor(
None, self.filters, client, query
)
else:
handler_does_match = True
data = self.compose_data_identifier(query)