Fix filters.user and .chat breaking when no initial collection is passed

This commit is contained in:
Dan 2020-08-25 14:08:53 +02:00
parent d44e920655
commit 093d1e0dcb

View File

@ -30,7 +30,7 @@ class Handler:
self.filters = filters self.filters = filters
async def check(self, client: "pyrogram.Client", update: Update): async def check(self, client: "pyrogram.Client", update: Update):
if self.filters: if callable(self.filters):
if inspect.iscoroutinefunction(self.filters.__call__): if inspect.iscoroutinefunction(self.filters.__call__):
return await self.filters(client, update) return await self.filters(client, update)
else: else: