mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: add warning with respect to type hint
This commit is contained in:
parent
b9424106a7
commit
d98b4ba181
1 changed files with 6 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import inspect
|
||||
import logging
|
||||
import re
|
||||
import typing
|
||||
from collections import Container
|
||||
from contextvars import ContextVar
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Dict, Iterable, Optional, Union
|
||||
|
|
@ -10,10 +10,10 @@ from babel.support import LazyProxy
|
|||
|
||||
from aiogram import types
|
||||
from aiogram.dispatcher.filters.filters import BoundFilter, Filter
|
||||
from aiogram.types import CallbackQuery, Message, InlineQuery, Poll, ChatType
|
||||
|
||||
from aiogram.types import CallbackQuery, ChatType, InlineQuery, Message, Poll
|
||||
|
||||
ChatIDArgumentType = typing.Union[typing.Iterable[typing.Union[int, str]], str, int]
|
||||
logger = logging.getLogger("aiogram")
|
||||
|
||||
|
||||
def extract_chat_ids(chat_id: ChatIDArgumentType) -> typing.Set[int]:
|
||||
|
|
@ -708,7 +708,8 @@ class ChatTypeFilter(BoundFilter):
|
|||
obj = obj.chat
|
||||
elif isinstance(obj, CallbackQuery):
|
||||
obj = obj.message.chat
|
||||
else:
|
||||
raise NotImplementedError
|
||||
else:
|
||||
logger.warning("ChatTypeFilter doesn't support %s as input", type(obj))
|
||||
return False
|
||||
|
||||
return obj.type in self.chat_type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue