mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed #1217: Fixed union subtypes generation inside arrays of elements
This commit is contained in:
parent
0ed62bcadf
commit
21351de335
7 changed files with 183 additions and 19 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
|
|
@ -8,7 +8,26 @@ from .base import TelegramObject
|
|||
|
||||
if TYPE_CHECKING:
|
||||
from ..methods import AnswerInlineQuery
|
||||
from .inline_query_result import InlineQueryResult
|
||||
from .inline_query_result_article import InlineQueryResultArticle
|
||||
from .inline_query_result_audio import InlineQueryResultAudio
|
||||
from .inline_query_result_cached_audio import InlineQueryResultCachedAudio
|
||||
from .inline_query_result_cached_document import InlineQueryResultCachedDocument
|
||||
from .inline_query_result_cached_gif import InlineQueryResultCachedGif
|
||||
from .inline_query_result_cached_mpeg4_gif import InlineQueryResultCachedMpeg4Gif
|
||||
from .inline_query_result_cached_photo import InlineQueryResultCachedPhoto
|
||||
from .inline_query_result_cached_sticker import InlineQueryResultCachedSticker
|
||||
from .inline_query_result_cached_video import InlineQueryResultCachedVideo
|
||||
from .inline_query_result_cached_voice import InlineQueryResultCachedVoice
|
||||
from .inline_query_result_contact import InlineQueryResultContact
|
||||
from .inline_query_result_document import InlineQueryResultDocument
|
||||
from .inline_query_result_game import InlineQueryResultGame
|
||||
from .inline_query_result_gif import InlineQueryResultGif
|
||||
from .inline_query_result_location import InlineQueryResultLocation
|
||||
from .inline_query_result_mpeg4_gif import InlineQueryResultMpeg4Gif
|
||||
from .inline_query_result_photo import InlineQueryResultPhoto
|
||||
from .inline_query_result_venue import InlineQueryResultVenue
|
||||
from .inline_query_result_video import InlineQueryResultVideo
|
||||
from .inline_query_result_voice import InlineQueryResultVoice
|
||||
from .inline_query_results_button import InlineQueryResultsButton
|
||||
from .location import Location
|
||||
from .user import User
|
||||
|
|
@ -36,7 +55,30 @@ class InlineQuery(TelegramObject):
|
|||
|
||||
def answer(
|
||||
self,
|
||||
results: List[InlineQueryResult],
|
||||
results: List[
|
||||
Union[
|
||||
InlineQueryResultCachedAudio,
|
||||
InlineQueryResultCachedDocument,
|
||||
InlineQueryResultCachedGif,
|
||||
InlineQueryResultCachedMpeg4Gif,
|
||||
InlineQueryResultCachedPhoto,
|
||||
InlineQueryResultCachedSticker,
|
||||
InlineQueryResultCachedVideo,
|
||||
InlineQueryResultCachedVoice,
|
||||
InlineQueryResultArticle,
|
||||
InlineQueryResultAudio,
|
||||
InlineQueryResultContact,
|
||||
InlineQueryResultGame,
|
||||
InlineQueryResultDocument,
|
||||
InlineQueryResultGif,
|
||||
InlineQueryResultLocation,
|
||||
InlineQueryResultMpeg4Gif,
|
||||
InlineQueryResultPhoto,
|
||||
InlineQueryResultVenue,
|
||||
InlineQueryResultVideo,
|
||||
InlineQueryResultVoice,
|
||||
]
|
||||
],
|
||||
cache_time: Optional[int] = None,
|
||||
is_personal: Optional[bool] = None,
|
||||
next_offset: Optional[str] = None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue