mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: respect type hints
This commit is contained in:
parent
768491d976
commit
b9424106a7
1 changed files with 4 additions and 1 deletions
|
|
@ -706,6 +706,9 @@ class ChatTypeFilter(BoundFilter):
|
|||
async def check(self, obj: Union[Message, CallbackQuery]):
|
||||
if isinstance(obj, Message):
|
||||
obj = obj.chat
|
||||
if isinstance(obj, CallbackQuery):
|
||||
elif isinstance(obj, CallbackQuery):
|
||||
obj = obj.message.chat
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
return obj.type in self.chat_type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue