mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added typehints for init methods of types and methods (#1245)
* Generate init * Fixed mypy errors * Bump butcher * Added changelog
This commit is contained in:
parent
aea876dfe0
commit
11dc7eaa31
257 changed files with 7275 additions and 247 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -33,3 +33,38 @@ class Animation(TelegramObject):
|
|||
"""*Optional*. MIME type of the file as defined by sender"""
|
||||
file_size: Optional[int] = None
|
||||
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
file_id: str,
|
||||
file_unique_id: str,
|
||||
width: int,
|
||||
height: int,
|
||||
duration: int,
|
||||
thumbnail: Optional[PhotoSize] = None,
|
||||
file_name: Optional[str] = None,
|
||||
mime_type: Optional[str] = None,
|
||||
file_size: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
file_id=file_id,
|
||||
file_unique_id=file_unique_id,
|
||||
width=width,
|
||||
height=height,
|
||||
duration=duration,
|
||||
thumbnail=thumbnail,
|
||||
file_name=file_name,
|
||||
mime_type=mime_type,
|
||||
file_size=file_size,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -33,3 +33,38 @@ class Audio(TelegramObject):
|
|||
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||
thumbnail: Optional[PhotoSize] = None
|
||||
"""*Optional*. Thumbnail of the album cover to which the music file belongs"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
file_id: str,
|
||||
file_unique_id: str,
|
||||
duration: int,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
file_name: Optional[str] = None,
|
||||
mime_type: Optional[str] = None,
|
||||
file_size: Optional[int] = None,
|
||||
thumbnail: Optional[PhotoSize] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
file_id=file_id,
|
||||
file_unique_id=file_unique_id,
|
||||
duration=duration,
|
||||
performer=performer,
|
||||
title=title,
|
||||
file_name=file_name,
|
||||
mime_type=mime_type,
|
||||
file_size=file_size,
|
||||
thumbnail=thumbnail,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
||||
|
|
@ -14,3 +16,16 @@ class BotCommand(MutableTelegramObject):
|
|||
"""Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores."""
|
||||
description: str
|
||||
"""Description of the command; 1-256 characters."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, command: str, description: str, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(command=command, description=description, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -17,3 +17,21 @@ class BotCommandScopeAllChatAdministrators(BotCommandScope):
|
|||
BotCommandScopeType.ALL_CHAT_ADMINISTRATORS
|
||||
] = BotCommandScopeType.ALL_CHAT_ADMINISTRATORS
|
||||
"""Scope type, must be *all_chat_administrators*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[
|
||||
BotCommandScopeType.ALL_CHAT_ADMINISTRATORS
|
||||
] = BotCommandScopeType.ALL_CHAT_ADMINISTRATORS,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -15,3 +15,21 @@ class BotCommandScopeAllGroupChats(BotCommandScope):
|
|||
|
||||
type: Literal[BotCommandScopeType.ALL_GROUP_CHATS] = BotCommandScopeType.ALL_GROUP_CHATS
|
||||
"""Scope type, must be *all_group_chats*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[
|
||||
BotCommandScopeType.ALL_GROUP_CHATS
|
||||
] = BotCommandScopeType.ALL_GROUP_CHATS,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -15,3 +15,21 @@ class BotCommandScopeAllPrivateChats(BotCommandScope):
|
|||
|
||||
type: Literal[BotCommandScopeType.ALL_PRIVATE_CHATS] = BotCommandScopeType.ALL_PRIVATE_CHATS
|
||||
"""Scope type, must be *all_private_chats*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[
|
||||
BotCommandScopeType.ALL_PRIVATE_CHATS
|
||||
] = BotCommandScopeType.ALL_PRIVATE_CHATS,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Union
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -17,3 +17,20 @@ class BotCommandScopeChat(BotCommandScope):
|
|||
"""Scope type, must be *chat*"""
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[BotCommandScopeType.CHAT] = BotCommandScopeType.CHAT,
|
||||
chat_id: Union[int, str],
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, chat_id=chat_id, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Union
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -19,3 +19,22 @@ class BotCommandScopeChatAdministrators(BotCommandScope):
|
|||
"""Scope type, must be *chat_administrators*"""
|
||||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[
|
||||
BotCommandScopeType.CHAT_ADMINISTRATORS
|
||||
] = BotCommandScopeType.CHAT_ADMINISTRATORS,
|
||||
chat_id: Union[int, str],
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, chat_id=chat_id, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Union
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -19,3 +19,21 @@ class BotCommandScopeChatMember(BotCommandScope):
|
|||
"""Unique identifier for the target chat or username of the target supergroup (in the format :code:`@supergroupusername`)"""
|
||||
user_id: int
|
||||
"""Unique identifier of the target user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[BotCommandScopeType.CHAT_MEMBER] = BotCommandScopeType.CHAT_MEMBER,
|
||||
chat_id: Union[int, str],
|
||||
user_id: int,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, chat_id=chat_id, user_id=user_id, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import BotCommandScopeType
|
||||
from .bot_command_scope import BotCommandScope
|
||||
|
|
@ -15,3 +15,19 @@ class BotCommandScopeDefault(BotCommandScope):
|
|||
|
||||
type: Literal[BotCommandScopeType.DEFAULT] = BotCommandScopeType.DEFAULT
|
||||
"""Scope type, must be *default*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[BotCommandScopeType.DEFAULT] = BotCommandScopeType.DEFAULT,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -10,3 +12,14 @@ class BotDescription(TelegramObject):
|
|||
|
||||
description: str
|
||||
"""The bot's description"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, description: str, **__pydantic_kwargs: Any) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(description=description, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -10,3 +12,14 @@ class BotName(TelegramObject):
|
|||
|
||||
name: str
|
||||
"""The bot's name"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, name: str, **__pydantic_kwargs: Any) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(name=name, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -10,3 +12,16 @@ class BotShortDescription(TelegramObject):
|
|||
|
||||
short_description: str
|
||||
"""The bot's short description"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, short_description: str, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(short_description=short_description, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,37 @@ class CallbackQuery(TelegramObject):
|
|||
game_short_name: Optional[str] = None
|
||||
"""*Optional*. Short name of a `Game <https://core.telegram.org/bots/api#games>`_ to be returned, serves as the unique identifier for the game"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
id: str,
|
||||
from_user: User,
|
||||
chat_instance: str,
|
||||
message: Optional[Message] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
data: Optional[str] = None,
|
||||
game_short_name: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
id=id,
|
||||
from_user=from_user,
|
||||
chat_instance=chat_instance,
|
||||
message=message,
|
||||
inline_message_id=inline_message_id,
|
||||
data=data,
|
||||
game_short_name=game_short_name,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
def answer(
|
||||
self,
|
||||
text: Optional[str] = None,
|
||||
|
|
|
|||
|
|
@ -106,6 +106,79 @@ class Chat(TelegramObject):
|
|||
location: Optional[ChatLocation] = None
|
||||
"""*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
id: int,
|
||||
type: str,
|
||||
title: Optional[str] = None,
|
||||
username: Optional[str] = None,
|
||||
first_name: Optional[str] = None,
|
||||
last_name: Optional[str] = None,
|
||||
is_forum: Optional[bool] = None,
|
||||
photo: Optional[ChatPhoto] = None,
|
||||
active_usernames: Optional[List[str]] = None,
|
||||
emoji_status_custom_emoji_id: Optional[str] = None,
|
||||
bio: Optional[str] = None,
|
||||
has_private_forwards: Optional[bool] = None,
|
||||
has_restricted_voice_and_video_messages: Optional[bool] = None,
|
||||
join_to_send_messages: Optional[bool] = None,
|
||||
join_by_request: Optional[bool] = None,
|
||||
description: Optional[str] = None,
|
||||
invite_link: Optional[str] = None,
|
||||
pinned_message: Optional[Message] = None,
|
||||
permissions: Optional[ChatPermissions] = None,
|
||||
slow_mode_delay: Optional[int] = None,
|
||||
message_auto_delete_time: Optional[int] = None,
|
||||
has_aggressive_anti_spam_enabled: Optional[bool] = None,
|
||||
has_hidden_members: Optional[bool] = None,
|
||||
has_protected_content: Optional[bool] = None,
|
||||
sticker_set_name: Optional[str] = None,
|
||||
can_set_sticker_set: Optional[bool] = None,
|
||||
linked_chat_id: Optional[int] = None,
|
||||
location: Optional[ChatLocation] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
id=id,
|
||||
type=type,
|
||||
title=title,
|
||||
username=username,
|
||||
first_name=first_name,
|
||||
last_name=last_name,
|
||||
is_forum=is_forum,
|
||||
photo=photo,
|
||||
active_usernames=active_usernames,
|
||||
emoji_status_custom_emoji_id=emoji_status_custom_emoji_id,
|
||||
bio=bio,
|
||||
has_private_forwards=has_private_forwards,
|
||||
has_restricted_voice_and_video_messages=has_restricted_voice_and_video_messages,
|
||||
join_to_send_messages=join_to_send_messages,
|
||||
join_by_request=join_by_request,
|
||||
description=description,
|
||||
invite_link=invite_link,
|
||||
pinned_message=pinned_message,
|
||||
permissions=permissions,
|
||||
slow_mode_delay=slow_mode_delay,
|
||||
message_auto_delete_time=message_auto_delete_time,
|
||||
has_aggressive_anti_spam_enabled=has_aggressive_anti_spam_enabled,
|
||||
has_hidden_members=has_hidden_members,
|
||||
has_protected_content=has_protected_content,
|
||||
sticker_set_name=sticker_set_name,
|
||||
can_set_sticker_set=can_set_sticker_set,
|
||||
linked_chat_id=linked_chat_id,
|
||||
location=location,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
@property
|
||||
def shifted_id(self) -> int:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -39,3 +39,44 @@ class ChatAdministratorRights(TelegramObject):
|
|||
"""*Optional*. :code:`True`, if the user is allowed to pin messages; groups and supergroups only"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
is_anonymous: bool,
|
||||
can_manage_chat: bool,
|
||||
can_delete_messages: bool,
|
||||
can_manage_video_chats: bool,
|
||||
can_restrict_members: bool,
|
||||
can_promote_members: bool,
|
||||
can_change_info: bool,
|
||||
can_invite_users: bool,
|
||||
can_post_messages: Optional[bool] = None,
|
||||
can_edit_messages: Optional[bool] = None,
|
||||
can_pin_messages: Optional[bool] = None,
|
||||
can_manage_topics: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
is_anonymous=is_anonymous,
|
||||
can_manage_chat=can_manage_chat,
|
||||
can_delete_messages=can_delete_messages,
|
||||
can_manage_video_chats=can_manage_video_chats,
|
||||
can_restrict_members=can_restrict_members,
|
||||
can_promote_members=can_promote_members,
|
||||
can_change_info=can_change_info,
|
||||
can_invite_users=can_invite_users,
|
||||
can_post_messages=can_post_messages,
|
||||
can_edit_messages=can_edit_messages,
|
||||
can_pin_messages=can_pin_messages,
|
||||
can_manage_topics=can_manage_topics,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -34,3 +34,38 @@ class ChatInviteLink(TelegramObject):
|
|||
"""*Optional*. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"""
|
||||
pending_join_request_count: Optional[int] = None
|
||||
"""*Optional*. Number of pending join requests created using this link"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
invite_link: str,
|
||||
creator: User,
|
||||
creates_join_request: bool,
|
||||
is_primary: bool,
|
||||
is_revoked: bool,
|
||||
name: Optional[str] = None,
|
||||
expire_date: Optional[datetime.datetime] = None,
|
||||
member_limit: Optional[int] = None,
|
||||
pending_join_request_count: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
invite_link=invite_link,
|
||||
creator=creator,
|
||||
creates_join_request=creates_join_request,
|
||||
is_primary=is_primary,
|
||||
is_revoked=is_revoked,
|
||||
name=name,
|
||||
expire_date=expire_date,
|
||||
member_limit=member_limit,
|
||||
pending_join_request_count=pending_join_request_count,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -70,6 +70,35 @@ class ChatJoinRequest(TelegramObject):
|
|||
invite_link: Optional[ChatInviteLink] = None
|
||||
"""*Optional*. Chat invite link that was used by the user to send the join request"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
chat: Chat,
|
||||
from_user: User,
|
||||
user_chat_id: int,
|
||||
date: datetime.datetime,
|
||||
bio: Optional[str] = None,
|
||||
invite_link: Optional[ChatInviteLink] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
chat=chat,
|
||||
from_user=from_user,
|
||||
user_chat_id=user_chat_id,
|
||||
date=date,
|
||||
bio=bio,
|
||||
invite_link=invite_link,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
def approve(
|
||||
self,
|
||||
**kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -19,3 +19,16 @@ class ChatLocation(TelegramObject):
|
|||
"""The location to which the supergroup is connected. Can't be a live location."""
|
||||
address: str
|
||||
"""Location address; 1-64 characters, as defined by the chat owner"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, location: Location, address: str, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(location=location, address=address, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -48,3 +48,52 @@ class ChatMemberAdministrator(ChatMember):
|
|||
"""*Optional*. :code:`True`, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only"""
|
||||
custom_title: Optional[str] = None
|
||||
"""*Optional*. Custom title for this user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.ADMINISTRATOR] = ChatMemberStatus.ADMINISTRATOR,
|
||||
user: User,
|
||||
can_be_edited: bool,
|
||||
is_anonymous: bool,
|
||||
can_manage_chat: bool,
|
||||
can_delete_messages: bool,
|
||||
can_manage_video_chats: bool,
|
||||
can_restrict_members: bool,
|
||||
can_promote_members: bool,
|
||||
can_change_info: bool,
|
||||
can_invite_users: bool,
|
||||
can_post_messages: Optional[bool] = None,
|
||||
can_edit_messages: Optional[bool] = None,
|
||||
can_pin_messages: Optional[bool] = None,
|
||||
can_manage_topics: Optional[bool] = None,
|
||||
custom_title: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
status=status,
|
||||
user=user,
|
||||
can_be_edited=can_be_edited,
|
||||
is_anonymous=is_anonymous,
|
||||
can_manage_chat=can_manage_chat,
|
||||
can_delete_messages=can_delete_messages,
|
||||
can_manage_video_chats=can_manage_video_chats,
|
||||
can_restrict_members=can_restrict_members,
|
||||
can_promote_members=can_promote_members,
|
||||
can_change_info=can_change_info,
|
||||
can_invite_users=can_invite_users,
|
||||
can_post_messages=can_post_messages,
|
||||
can_edit_messages=can_edit_messages,
|
||||
can_pin_messages=can_pin_messages,
|
||||
can_manage_topics=can_manage_topics,
|
||||
custom_title=custom_title,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -23,3 +23,21 @@ class ChatMemberBanned(ChatMember):
|
|||
"""Information about the user"""
|
||||
until_date: datetime.datetime
|
||||
"""Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.KICKED] = ChatMemberStatus.KICKED,
|
||||
user: User,
|
||||
until_date: datetime.datetime,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(status=status, user=user, until_date=until_date, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -20,3 +20,20 @@ class ChatMemberLeft(ChatMember):
|
|||
"""The member's status in the chat, always 'left'"""
|
||||
user: User
|
||||
"""Information about the user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.LEFT] = ChatMemberStatus.LEFT,
|
||||
user: User,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(status=status, user=user, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -20,3 +20,20 @@ class ChatMemberMember(ChatMember):
|
|||
"""The member's status in the chat, always 'member'"""
|
||||
user: User
|
||||
"""Information about the user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.MEMBER] = ChatMemberStatus.MEMBER,
|
||||
user: User,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(status=status, user=user, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -24,3 +24,28 @@ class ChatMemberOwner(ChatMember):
|
|||
""":code:`True`, if the user's presence in the chat is hidden"""
|
||||
custom_title: Optional[str] = None
|
||||
"""*Optional*. Custom title for this user"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.CREATOR] = ChatMemberStatus.CREATOR,
|
||||
user: User,
|
||||
is_anonymous: bool,
|
||||
custom_title: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
status=status,
|
||||
user=user,
|
||||
is_anonymous=is_anonymous,
|
||||
custom_title=custom_title,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import ChatMemberStatus
|
||||
from .chat_member import ChatMember
|
||||
|
|
@ -53,3 +53,56 @@ class ChatMemberRestricted(ChatMember):
|
|||
""":code:`True`, if the user is allowed to create forum topics"""
|
||||
until_date: datetime.datetime
|
||||
"""Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
status: Literal[ChatMemberStatus.RESTRICTED] = ChatMemberStatus.RESTRICTED,
|
||||
user: User,
|
||||
is_member: bool,
|
||||
can_send_messages: bool,
|
||||
can_send_audios: bool,
|
||||
can_send_documents: bool,
|
||||
can_send_photos: bool,
|
||||
can_send_videos: bool,
|
||||
can_send_video_notes: bool,
|
||||
can_send_voice_notes: bool,
|
||||
can_send_polls: bool,
|
||||
can_send_other_messages: bool,
|
||||
can_add_web_page_previews: bool,
|
||||
can_change_info: bool,
|
||||
can_invite_users: bool,
|
||||
can_pin_messages: bool,
|
||||
can_manage_topics: bool,
|
||||
until_date: datetime.datetime,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
status=status,
|
||||
user=user,
|
||||
is_member=is_member,
|
||||
can_send_messages=can_send_messages,
|
||||
can_send_audios=can_send_audios,
|
||||
can_send_documents=can_send_documents,
|
||||
can_send_photos=can_send_photos,
|
||||
can_send_videos=can_send_videos,
|
||||
can_send_video_notes=can_send_video_notes,
|
||||
can_send_voice_notes=can_send_voice_notes,
|
||||
can_send_polls=can_send_polls,
|
||||
can_send_other_messages=can_send_other_messages,
|
||||
can_add_web_page_previews=can_add_web_page_previews,
|
||||
can_change_info=can_change_info,
|
||||
can_invite_users=can_invite_users,
|
||||
can_pin_messages=can_pin_messages,
|
||||
can_manage_topics=can_manage_topics,
|
||||
until_date=until_date,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -90,6 +90,51 @@ class ChatMemberUpdated(TelegramObject):
|
|||
via_chat_folder_invite_link: Optional[bool] = None
|
||||
"""*Optional*. True, if the user joined the chat via a chat folder invite link"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
chat: Chat,
|
||||
from_user: User,
|
||||
date: datetime.datetime,
|
||||
old_chat_member: Union[
|
||||
ChatMemberOwner,
|
||||
ChatMemberAdministrator,
|
||||
ChatMemberMember,
|
||||
ChatMemberRestricted,
|
||||
ChatMemberLeft,
|
||||
ChatMemberBanned,
|
||||
],
|
||||
new_chat_member: Union[
|
||||
ChatMemberOwner,
|
||||
ChatMemberAdministrator,
|
||||
ChatMemberMember,
|
||||
ChatMemberRestricted,
|
||||
ChatMemberLeft,
|
||||
ChatMemberBanned,
|
||||
],
|
||||
invite_link: Optional[ChatInviteLink] = None,
|
||||
via_chat_folder_invite_link: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
chat=chat,
|
||||
from_user=from_user,
|
||||
date=date,
|
||||
old_chat_member=old_chat_member,
|
||||
new_chat_member=new_chat_member,
|
||||
invite_link=invite_link,
|
||||
via_chat_folder_invite_link=via_chat_folder_invite_link,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
def answer(
|
||||
self,
|
||||
text: str,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -40,3 +40,48 @@ class ChatPermissions(MutableTelegramObject):
|
|||
"""*Optional*. :code:`True`, if the user is allowed to pin messages. Ignored in public supergroups"""
|
||||
can_manage_topics: Optional[bool] = None
|
||||
"""*Optional*. :code:`True`, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
can_send_messages: Optional[bool] = None,
|
||||
can_send_audios: Optional[bool] = None,
|
||||
can_send_documents: Optional[bool] = None,
|
||||
can_send_photos: Optional[bool] = None,
|
||||
can_send_videos: Optional[bool] = None,
|
||||
can_send_video_notes: Optional[bool] = None,
|
||||
can_send_voice_notes: Optional[bool] = None,
|
||||
can_send_polls: Optional[bool] = None,
|
||||
can_send_other_messages: Optional[bool] = None,
|
||||
can_add_web_page_previews: Optional[bool] = None,
|
||||
can_change_info: Optional[bool] = None,
|
||||
can_invite_users: Optional[bool] = None,
|
||||
can_pin_messages: Optional[bool] = None,
|
||||
can_manage_topics: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
can_send_messages=can_send_messages,
|
||||
can_send_audios=can_send_audios,
|
||||
can_send_documents=can_send_documents,
|
||||
can_send_photos=can_send_photos,
|
||||
can_send_videos=can_send_videos,
|
||||
can_send_video_notes=can_send_video_notes,
|
||||
can_send_voice_notes=can_send_voice_notes,
|
||||
can_send_polls=can_send_polls,
|
||||
can_send_other_messages=can_send_other_messages,
|
||||
can_add_web_page_previews=can_add_web_page_previews,
|
||||
can_change_info=can_change_info,
|
||||
can_invite_users=can_invite_users,
|
||||
can_pin_messages=can_pin_messages,
|
||||
can_manage_topics=can_manage_topics,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -18,3 +20,28 @@ class ChatPhoto(TelegramObject):
|
|||
"""File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."""
|
||||
big_file_unique_id: str
|
||||
"""Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
small_file_id: str,
|
||||
small_file_unique_id: str,
|
||||
big_file_id: str,
|
||||
big_file_unique_id: str,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
small_file_id=small_file_id,
|
||||
small_file_unique_id=small_file_unique_id,
|
||||
big_file_id=big_file_id,
|
||||
big_file_unique_id=big_file_unique_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -12,3 +14,16 @@ class ChatShared(TelegramObject):
|
|||
"""Identifier of the request"""
|
||||
chat_id: int
|
||||
"""Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, request_id: int, chat_id: int, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(request_id=request_id, chat_id=chat_id, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
|
|
@ -29,3 +29,30 @@ class ChosenInlineResult(TelegramObject):
|
|||
"""*Optional*. Sender location, only for bots that require user location"""
|
||||
inline_message_id: Optional[str] = None
|
||||
"""*Optional*. Identifier of the sent inline message. Available only if there is an `inline keyboard <https://core.telegram.org/bots/api#inlinekeyboardmarkup>`_ attached to the message. Will be also received in `callback queries <https://core.telegram.org/bots/api#callbackquery>`_ and can be used to `edit <https://core.telegram.org/bots/api#updating-messages>`_ the message."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
result_id: str,
|
||||
from_user: User,
|
||||
query: str,
|
||||
location: Optional[Location] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
result_id=result_id,
|
||||
from_user=from_user,
|
||||
query=query,
|
||||
location=location,
|
||||
inline_message_id=inline_message_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -22,3 +22,30 @@ class Contact(TelegramObject):
|
|||
"""*Optional*. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."""
|
||||
vcard: Optional[str] = None
|
||||
"""*Optional*. Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: Optional[str] = None,
|
||||
user_id: Optional[int] = None,
|
||||
vcard: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
phone_number=phone_number,
|
||||
first_name=first_name,
|
||||
last_name=last_name,
|
||||
user_id=user_id,
|
||||
vcard=vcard,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -15,6 +17,19 @@ class Dice(TelegramObject):
|
|||
value: int
|
||||
"""Value of the dice, 1-6 for '🎲', '🎯' and '🎳' base emoji, 1-5 for '🏀' and '⚽' base emoji, 1-64 for '🎰' base emoji"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, emoji: str, value: int, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(emoji=emoji, value=value, **__pydantic_kwargs)
|
||||
|
||||
|
||||
class DiceEmoji:
|
||||
DICE = "🎲"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -27,3 +27,32 @@ class Document(TelegramObject):
|
|||
"""*Optional*. MIME type of the file as defined by sender"""
|
||||
file_size: Optional[int] = None
|
||||
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
file_id: str,
|
||||
file_unique_id: str,
|
||||
thumbnail: Optional[PhotoSize] = None,
|
||||
file_name: Optional[str] = None,
|
||||
mime_type: Optional[str] = None,
|
||||
file_size: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
file_id=file_id,
|
||||
file_unique_id=file_unique_id,
|
||||
thumbnail=thumbnail,
|
||||
file_name=file_name,
|
||||
mime_type=mime_type,
|
||||
file_size=file_size,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -16,3 +18,16 @@ class EncryptedCredentials(TelegramObject):
|
|||
"""Base64-encoded data hash for data authentication"""
|
||||
secret: str
|
||||
"""Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, data: str, hash: str, secret: str, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(data=data, hash=hash, secret=secret, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -35,3 +35,40 @@ class EncryptedPassportElement(TelegramObject):
|
|||
"""*Optional*. Encrypted file with the selfie of the user holding a document, provided by the user; available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`."""
|
||||
translation: Optional[List[PassportFile]] = None
|
||||
"""*Optional*. Array of encrypted files with translated versions of documents provided by the user. Available if requested for 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: str,
|
||||
hash: str,
|
||||
data: Optional[str] = None,
|
||||
phone_number: Optional[str] = None,
|
||||
email: Optional[str] = None,
|
||||
files: Optional[List[PassportFile]] = None,
|
||||
front_side: Optional[PassportFile] = None,
|
||||
reverse_side: Optional[PassportFile] = None,
|
||||
selfie: Optional[PassportFile] = None,
|
||||
translation: Optional[List[PassportFile]] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
hash=hash,
|
||||
data=data,
|
||||
phone_number=phone_number,
|
||||
email=email,
|
||||
files=files,
|
||||
front_side=front_side,
|
||||
reverse_side=reverse_side,
|
||||
selfie=selfie,
|
||||
translation=translation,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from aiogram.types.base import TelegramObject
|
||||
|
||||
|
|
@ -19,3 +19,10 @@ class ErrorEvent(TelegramObject):
|
|||
"""Received update"""
|
||||
exception: Exception
|
||||
"""Exception"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
||||
def __init__(
|
||||
__pydantic_self__, *, update: Update, exception: Exception, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
super().__init__(update=update, exception=exception, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -22,3 +22,28 @@ class File(TelegramObject):
|
|||
"""*Optional*. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."""
|
||||
file_path: Optional[str] = None
|
||||
"""*Optional*. File path. Use :code:`https://api.telegram.org/file/bot<token>/<file_path>` to get the file."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
file_id: str,
|
||||
file_unique_id: str,
|
||||
file_size: Optional[int] = None,
|
||||
file_path: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
file_id=file_id,
|
||||
file_unique_id=file_unique_id,
|
||||
file_size=file_size,
|
||||
file_path=file_path,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal, Optional
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -25,3 +25,26 @@ class ForceReply(MutableTelegramObject):
|
|||
"""*Optional*. The placeholder to be shown in the input field when the reply is active; 1-64 characters"""
|
||||
selective: Optional[bool] = None
|
||||
"""*Optional*. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the *text* of the :class:`aiogram.types.message.Message` object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
force_reply: Literal[True] = True,
|
||||
input_field_placeholder: Optional[str] = None,
|
||||
selective: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
force_reply=force_reply,
|
||||
input_field_placeholder=input_field_placeholder,
|
||||
selective=selective,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -20,3 +20,28 @@ class ForumTopic(TelegramObject):
|
|||
"""Color of the topic icon in RGB format"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Unique identifier of the custom emoji shown as the topic icon"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
message_thread_id: int,
|
||||
name: str,
|
||||
icon_color: int,
|
||||
icon_custom_emoji_id: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
message_thread_id=message_thread_id,
|
||||
name=name,
|
||||
icon_color=icon_color,
|
||||
icon_custom_emoji_id=icon_custom_emoji_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -18,3 +18,26 @@ class ForumTopicCreated(TelegramObject):
|
|||
"""Color of the topic icon in RGB format"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. Unique identifier of the custom emoji shown as the topic icon"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
name: str,
|
||||
icon_color: int,
|
||||
icon_custom_emoji_id: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
name=name,
|
||||
icon_color=icon_color,
|
||||
icon_custom_emoji_id=icon_custom_emoji_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
|
@ -14,3 +14,22 @@ class ForumTopicEdited(TelegramObject):
|
|||
"""*Optional*. New name of the topic, if it was edited"""
|
||||
icon_custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
name: Optional[str] = None,
|
||||
icon_custom_emoji_id: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
name=name, icon_custom_emoji_id=icon_custom_emoji_id, **__pydantic_kwargs
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -29,3 +29,32 @@ class Game(TelegramObject):
|
|||
"""*Optional*. Special entities that appear in *text*, such as usernames, URLs, bot commands, etc."""
|
||||
animation: Optional[Animation] = None
|
||||
"""*Optional*. Animation that will be displayed in the game message in chats. Upload via `BotFather <https://t.me/botfather>`_"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
title: str,
|
||||
description: str,
|
||||
photo: List[PhotoSize],
|
||||
text: Optional[str] = None,
|
||||
text_entities: Optional[List[MessageEntity]] = None,
|
||||
animation: Optional[Animation] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
title=title,
|
||||
description=description,
|
||||
photo=photo,
|
||||
text=text,
|
||||
text_entities=text_entities,
|
||||
animation=animation,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -24,3 +24,16 @@ class GameHighScore(TelegramObject):
|
|||
"""User"""
|
||||
score: int
|
||||
"""Score"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, position: int, user: User, score: int, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(position=position, user=user, score=score, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -38,3 +38,40 @@ class InlineKeyboardButton(MutableTelegramObject):
|
|||
"""*Optional*. Description of the game that will be launched when the user presses the button."""
|
||||
pay: Optional[bool] = None
|
||||
"""*Optional*. Specify :code:`True`, to send a `Pay button <https://core.telegram.org/bots/api#payments>`_."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
text: str,
|
||||
url: Optional[str] = None,
|
||||
callback_data: Optional[str] = None,
|
||||
web_app: Optional[WebAppInfo] = None,
|
||||
login_url: Optional[LoginUrl] = None,
|
||||
switch_inline_query: Optional[str] = None,
|
||||
switch_inline_query_current_chat: Optional[str] = None,
|
||||
switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = None,
|
||||
callback_game: Optional[CallbackGame] = None,
|
||||
pay: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
text=text,
|
||||
url=url,
|
||||
callback_data=callback_data,
|
||||
web_app=web_app,
|
||||
login_url=login_url,
|
||||
switch_inline_query=switch_inline_query,
|
||||
switch_inline_query_current_chat=switch_inline_query_current_chat,
|
||||
switch_inline_query_chosen_chat=switch_inline_query_chosen_chat,
|
||||
callback_game=callback_game,
|
||||
pay=pay,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List
|
||||
from typing import TYPE_CHECKING, Any, List
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -18,3 +18,19 @@ class InlineKeyboardMarkup(MutableTelegramObject):
|
|||
|
||||
inline_keyboard: List[List[InlineKeyboardButton]]
|
||||
"""Array of button rows, each represented by an Array of :class:`aiogram.types.inline_keyboard_button.InlineKeyboardButton` objects"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
inline_keyboard: List[List[InlineKeyboardButton]],
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(inline_keyboard=inline_keyboard, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,35 @@ class InlineQuery(TelegramObject):
|
|||
location: Optional[Location] = None
|
||||
"""*Optional*. Sender location, only for bots that request user location"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
id: str,
|
||||
from_user: User,
|
||||
query: str,
|
||||
offset: str,
|
||||
chat_type: Optional[str] = None,
|
||||
location: Optional[Location] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
id=id,
|
||||
from_user=from_user,
|
||||
query=query,
|
||||
offset=offset,
|
||||
chat_type=chat_type,
|
||||
location=location,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
def answer(
|
||||
self,
|
||||
results: List[
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -49,3 +49,48 @@ class InlineQueryResultArticle(InlineQueryResult):
|
|||
"""*Optional*. Thumbnail width"""
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.ARTICLE] = InlineQueryResultType.ARTICLE,
|
||||
id: str,
|
||||
title: str,
|
||||
input_message_content: Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
],
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
url: Optional[str] = None,
|
||||
hide_url: Optional[bool] = None,
|
||||
description: Optional[str] = None,
|
||||
thumbnail_url: Optional[str] = None,
|
||||
thumbnail_width: Optional[int] = None,
|
||||
thumbnail_height: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
title=title,
|
||||
input_message_content=input_message_content,
|
||||
reply_markup=reply_markup,
|
||||
url=url,
|
||||
hide_url=hide_url,
|
||||
description=description,
|
||||
thumbnail_url=thumbnail_url,
|
||||
thumbnail_width=thumbnail_width,
|
||||
thumbnail_height=thumbnail_height,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -54,3 +54,50 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the audio"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.AUDIO] = InlineQueryResultType.AUDIO,
|
||||
id: str,
|
||||
audio_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
performer: Optional[str] = None,
|
||||
audio_duration: Optional[int] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
audio_url=audio_url,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
performer=performer,
|
||||
audio_duration=audio_duration,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -48,3 +48,44 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the audio"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.AUDIO] = InlineQueryResultType.AUDIO,
|
||||
id: str,
|
||||
audio_file_id: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
audio_file_id=audio_file_id,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -52,3 +52,48 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the file"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.DOCUMENT] = InlineQueryResultType.DOCUMENT,
|
||||
id: str,
|
||||
title: str,
|
||||
document_file_id: str,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
title=title,
|
||||
document_file_id=document_file_id,
|
||||
description=description,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -49,3 +49,46 @@ class InlineQueryResultCachedGif(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the GIF animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.GIF] = InlineQueryResultType.GIF,
|
||||
id: str,
|
||||
gif_file_id: str,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
gif_file_id=gif_file_id,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -49,3 +49,46 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.MPEG4_GIF] = InlineQueryResultType.MPEG4_GIF,
|
||||
id: str,
|
||||
mpeg4_file_id: str,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
mpeg4_file_id=mpeg4_file_id,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -51,3 +51,48 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the photo"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.PHOTO] = InlineQueryResultType.PHOTO,
|
||||
id: str,
|
||||
photo_file_id: str,
|
||||
title: Optional[str] = None,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
photo_file_id=photo_file_id,
|
||||
title=title,
|
||||
description=description,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -40,3 +40,38 @@ class InlineQueryResultCachedSticker(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the sticker"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.STICKER] = InlineQueryResultType.STICKER,
|
||||
id: str,
|
||||
sticker_file_id: str,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
sticker_file_id=sticker_file_id,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -51,3 +51,48 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.VIDEO] = InlineQueryResultType.VIDEO,
|
||||
id: str,
|
||||
video_file_id: str,
|
||||
title: str,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
video_file_id=video_file_id,
|
||||
title=title,
|
||||
description=description,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -50,3 +50,46 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the voice message"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.VOICE] = InlineQueryResultType.VOICE,
|
||||
id: str,
|
||||
voice_file_id: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
voice_file_id=voice_file_id,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -52,3 +52,50 @@ class InlineQueryResultContact(InlineQueryResult):
|
|||
"""*Optional*. Thumbnail width"""
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.CONTACT] = InlineQueryResultType.CONTACT,
|
||||
id: str,
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
thumbnail_url: Optional[str] = None,
|
||||
thumbnail_width: Optional[int] = None,
|
||||
thumbnail_height: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
phone_number=phone_number,
|
||||
first_name=first_name,
|
||||
last_name=last_name,
|
||||
vcard=vcard,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
thumbnail_url=thumbnail_url,
|
||||
thumbnail_width=thumbnail_width,
|
||||
thumbnail_height=thumbnail_height,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -60,3 +60,56 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|||
"""*Optional*. Thumbnail width"""
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.DOCUMENT] = InlineQueryResultType.DOCUMENT,
|
||||
id: str,
|
||||
title: str,
|
||||
document_url: str,
|
||||
mime_type: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
description: Optional[str] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
thumbnail_url: Optional[str] = None,
|
||||
thumbnail_width: Optional[int] = None,
|
||||
thumbnail_height: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
title=title,
|
||||
document_url=document_url,
|
||||
mime_type=mime_type,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
description=description,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
thumbnail_url=thumbnail_url,
|
||||
thumbnail_width=thumbnail_width,
|
||||
thumbnail_height=thumbnail_height,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -25,3 +25,28 @@ class InlineQueryResultGame(InlineQueryResult):
|
|||
"""Short name of the game"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. `Inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_ attached to the message"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.GAME] = InlineQueryResultType.GAME,
|
||||
id: str,
|
||||
game_short_name: str,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
game_short_name=game_short_name,
|
||||
reply_markup=reply_markup,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -59,3 +59,56 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the GIF animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.GIF] = InlineQueryResultType.GIF,
|
||||
id: str,
|
||||
gif_url: str,
|
||||
thumbnail_url: str,
|
||||
gif_width: Optional[int] = None,
|
||||
gif_height: Optional[int] = None,
|
||||
gif_duration: Optional[int] = None,
|
||||
thumbnail_mime_type: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
gif_url=gif_url,
|
||||
thumbnail_url=thumbnail_url,
|
||||
gif_width=gif_width,
|
||||
gif_height=gif_height,
|
||||
gif_duration=gif_duration,
|
||||
thumbnail_mime_type=thumbnail_mime_type,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -58,3 +58,56 @@ class InlineQueryResultLocation(InlineQueryResult):
|
|||
"""*Optional*. Thumbnail width"""
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.LOCATION] = InlineQueryResultType.LOCATION,
|
||||
id: str,
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
title: str,
|
||||
horizontal_accuracy: Optional[float] = None,
|
||||
live_period: Optional[int] = None,
|
||||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
thumbnail_url: Optional[str] = None,
|
||||
thumbnail_width: Optional[int] = None,
|
||||
thumbnail_height: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
title=title,
|
||||
horizontal_accuracy=horizontal_accuracy,
|
||||
live_period=live_period,
|
||||
heading=heading,
|
||||
proximity_alert_radius=proximity_alert_radius,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
thumbnail_url=thumbnail_url,
|
||||
thumbnail_width=thumbnail_width,
|
||||
thumbnail_height=thumbnail_height,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -59,3 +59,56 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.MPEG4_GIF] = InlineQueryResultType.MPEG4_GIF,
|
||||
id: str,
|
||||
mpeg4_url: str,
|
||||
thumbnail_url: str,
|
||||
mpeg4_width: Optional[int] = None,
|
||||
mpeg4_height: Optional[int] = None,
|
||||
mpeg4_duration: Optional[int] = None,
|
||||
thumbnail_mime_type: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
mpeg4_url=mpeg4_url,
|
||||
thumbnail_url=thumbnail_url,
|
||||
mpeg4_width=mpeg4_width,
|
||||
mpeg4_height=mpeg4_height,
|
||||
mpeg4_duration=mpeg4_duration,
|
||||
thumbnail_mime_type=thumbnail_mime_type,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -57,3 +57,54 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the photo"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.PHOTO] = InlineQueryResultType.PHOTO,
|
||||
id: str,
|
||||
photo_url: str,
|
||||
thumbnail_url: str,
|
||||
photo_width: Optional[int] = None,
|
||||
photo_height: Optional[int] = None,
|
||||
title: Optional[str] = None,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
photo_url=photo_url,
|
||||
thumbnail_url=thumbnail_url,
|
||||
photo_width=photo_width,
|
||||
photo_height=photo_height,
|
||||
title=title,
|
||||
description=description,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -60,3 +60,58 @@ class InlineQueryResultVenue(InlineQueryResult):
|
|||
"""*Optional*. Thumbnail width"""
|
||||
thumbnail_height: Optional[int] = None
|
||||
"""*Optional*. Thumbnail height"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.VENUE] = InlineQueryResultType.VENUE,
|
||||
id: str,
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
title: str,
|
||||
address: str,
|
||||
foursquare_id: Optional[str] = None,
|
||||
foursquare_type: Optional[str] = None,
|
||||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
thumbnail_url: Optional[str] = None,
|
||||
thumbnail_width: Optional[int] = None,
|
||||
thumbnail_height: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
title=title,
|
||||
address=address,
|
||||
foursquare_id=foursquare_id,
|
||||
foursquare_type=foursquare_type,
|
||||
google_place_id=google_place_id,
|
||||
google_place_type=google_place_type,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
thumbnail_url=thumbnail_url,
|
||||
thumbnail_width=thumbnail_width,
|
||||
thumbnail_height=thumbnail_height,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -63,3 +63,58 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the video. This field is **required** if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.VIDEO] = InlineQueryResultType.VIDEO,
|
||||
id: str,
|
||||
video_url: str,
|
||||
mime_type: str,
|
||||
thumbnail_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
video_width: Optional[int] = None,
|
||||
video_height: Optional[int] = None,
|
||||
video_duration: Optional[int] = None,
|
||||
description: Optional[str] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
video_url=video_url,
|
||||
mime_type=mime_type,
|
||||
thumbnail_url=thumbnail_url,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
video_width=video_width,
|
||||
video_height=video_height,
|
||||
video_duration=video_duration,
|
||||
description=description,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -52,3 +52,48 @@ class InlineQueryResultVoice(InlineQueryResult):
|
|||
]
|
||||
] = None
|
||||
"""*Optional*. Content of the message to be sent instead of the voice recording"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InlineQueryResultType.VOICE] = InlineQueryResultType.VOICE,
|
||||
id: str,
|
||||
voice_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
voice_duration: Optional[int] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
Union[
|
||||
InputTextMessageContent,
|
||||
InputLocationMessageContent,
|
||||
InputVenueMessageContent,
|
||||
InputContactMessageContent,
|
||||
InputInvoiceMessageContent,
|
||||
]
|
||||
] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
id=id,
|
||||
voice_url=voice_url,
|
||||
title=title,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
voice_duration=voice_duration,
|
||||
reply_markup=reply_markup,
|
||||
input_message_content=input_message_content,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -21,3 +21,23 @@ class InlineQueryResultsButton(TelegramObject):
|
|||
"""*Optional*. Description of the `Web App <https://core.telegram.org/bots/webapps>`_ that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method `switchInlineQuery <https://core.telegram.org/bots/webapps#initializing-web-apps>`_ inside the Web App."""
|
||||
start_parameter: Optional[str] = None
|
||||
"""*Optional*. `Deep-linking <https://core.telegram.org/bots/features#deep-linking>`_ parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
text: str,
|
||||
web_app: Optional[WebAppInfo] = None,
|
||||
start_parameter: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
text=text, web_app=web_app, start_parameter=start_parameter, **__pydantic_kwargs
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
|
|
@ -20,3 +20,28 @@ class InputContactMessageContent(InputMessageContent):
|
|||
"""*Optional*. Contact's last name"""
|
||||
vcard: Optional[str] = None
|
||||
"""*Optional*. Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
phone_number: str,
|
||||
first_name: str,
|
||||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
phone_number=phone_number,
|
||||
first_name=first_name,
|
||||
last_name=last_name,
|
||||
vcard=vcard,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,15 +4,7 @@ import io
|
|||
import os
|
||||
from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
AsyncGenerator,
|
||||
AsyncIterator,
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any, AsyncGenerator, Dict, Optional, Union
|
||||
|
||||
import aiofiles
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
|
|
@ -55,3 +55,60 @@ class InputInvoiceMessageContent(InputMessageContent):
|
|||
"""*Optional*. Pass :code:`True` if the user's email address should be sent to provider"""
|
||||
is_flexible: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` if the final price depends on the shipping method"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
title: str,
|
||||
description: str,
|
||||
payload: str,
|
||||
provider_token: str,
|
||||
currency: str,
|
||||
prices: List[LabeledPrice],
|
||||
max_tip_amount: Optional[int] = None,
|
||||
suggested_tip_amounts: Optional[List[int]] = None,
|
||||
provider_data: Optional[str] = None,
|
||||
photo_url: Optional[str] = None,
|
||||
photo_size: Optional[int] = None,
|
||||
photo_width: Optional[int] = None,
|
||||
photo_height: Optional[int] = None,
|
||||
need_name: Optional[bool] = None,
|
||||
need_phone_number: Optional[bool] = None,
|
||||
need_email: Optional[bool] = None,
|
||||
need_shipping_address: Optional[bool] = None,
|
||||
send_phone_number_to_provider: Optional[bool] = None,
|
||||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
title=title,
|
||||
description=description,
|
||||
payload=payload,
|
||||
provider_token=provider_token,
|
||||
currency=currency,
|
||||
prices=prices,
|
||||
max_tip_amount=max_tip_amount,
|
||||
suggested_tip_amounts=suggested_tip_amounts,
|
||||
provider_data=provider_data,
|
||||
photo_url=photo_url,
|
||||
photo_size=photo_size,
|
||||
photo_width=photo_width,
|
||||
photo_height=photo_height,
|
||||
need_name=need_name,
|
||||
need_phone_number=need_phone_number,
|
||||
need_email=need_email,
|
||||
need_shipping_address=need_shipping_address,
|
||||
send_phone_number_to_provider=send_phone_number_to_provider,
|
||||
send_email_to_provider=send_email_to_provider,
|
||||
is_flexible=is_flexible,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
|
|
@ -24,3 +24,32 @@ class InputLocationMessageContent(InputMessageContent):
|
|||
"""*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."""
|
||||
proximity_alert_radius: Optional[int] = None
|
||||
"""*Optional*. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
horizontal_accuracy: Optional[float] = None,
|
||||
live_period: Optional[int] = None,
|
||||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
horizontal_accuracy=horizontal_accuracy,
|
||||
live_period=live_period,
|
||||
heading=heading,
|
||||
proximity_alert_radius=proximity_alert_radius,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -38,3 +38,40 @@ class InputMediaAnimation(InputMedia):
|
|||
"""*Optional*. Animation duration in seconds"""
|
||||
has_spoiler: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` if the animation needs to be covered with a spoiler animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InputMediaType.ANIMATION] = InputMediaType.ANIMATION,
|
||||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
media=media,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
width=width,
|
||||
height=height,
|
||||
duration=duration,
|
||||
has_spoiler=has_spoiler,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -36,3 +36,38 @@ class InputMediaAudio(InputMedia):
|
|||
"""*Optional*. Performer of the audio"""
|
||||
title: Optional[str] = None
|
||||
"""*Optional*. Title of the audio"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InputMediaType.AUDIO] = InputMediaType.AUDIO,
|
||||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
media=media,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
duration=duration,
|
||||
performer=performer,
|
||||
title=title,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -32,3 +32,34 @@ class InputMediaDocument(InputMedia):
|
|||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
disable_content_type_detection: Optional[bool] = None
|
||||
"""*Optional*. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always :code:`True`, if the document is sent as part of an album."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InputMediaType.DOCUMENT] = InputMediaType.DOCUMENT,
|
||||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
media=media,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
disable_content_type_detection=disable_content_type_detection,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -30,3 +30,32 @@ class InputMediaPhoto(InputMedia):
|
|||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
has_spoiler: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` if the photo needs to be covered with a spoiler animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InputMediaType.PHOTO] = InputMediaType.PHOTO,
|
||||
media: Union[str, InputFile],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
media=media,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
has_spoiler=has_spoiler,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
|
|
@ -40,3 +40,42 @@ class InputMediaVideo(InputMedia):
|
|||
"""*Optional*. Pass :code:`True` if the uploaded video is suitable for streaming"""
|
||||
has_spoiler: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` if the video needs to be covered with a spoiler animation"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[InputMediaType.VIDEO] = InputMediaType.VIDEO,
|
||||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
duration: Optional[int] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
media=media,
|
||||
thumbnail=thumbnail,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
width=width,
|
||||
height=height,
|
||||
duration=duration,
|
||||
supports_streaming=supports_streaming,
|
||||
has_spoiler=has_spoiler,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -24,3 +24,28 @@ class InputSticker(TelegramObject):
|
|||
"""*Optional*. Position where the mask should be placed on faces. For 'mask' stickers only."""
|
||||
keywords: Optional[List[str]] = None
|
||||
"""*Optional*. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For 'regular' and 'custom_emoji' stickers only."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
sticker: Union[InputFile, str],
|
||||
emoji_list: List[str],
|
||||
mask_position: Optional[MaskPosition] = None,
|
||||
keywords: Optional[List[str]] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
sticker=sticker,
|
||||
emoji_list=emoji_list,
|
||||
mask_position=mask_position,
|
||||
keywords=keywords,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
|
||||
from .base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PARSE_MODE
|
||||
from .input_message_content import InputMessageContent
|
||||
|
|
@ -24,3 +24,28 @@ class InputTextMessageContent(InputMessageContent):
|
|||
"""*Optional*. List of special entities that appear in message text, which can be specified instead of *parse_mode*"""
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
"""*Optional*. Disables link previews for links in the sent message"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
message_text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
message_text=message_text,
|
||||
parse_mode=parse_mode,
|
||||
entities=entities,
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
|
|
@ -28,3 +28,36 @@ class InputVenueMessageContent(InputMessageContent):
|
|||
"""*Optional*. Google Places identifier of the venue"""
|
||||
google_place_type: Optional[str] = None
|
||||
"""*Optional*. Google Places type of the venue. (See `supported types <https://developers.google.com/places/web-service/supported_types>`_.)"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
latitude: float,
|
||||
longitude: float,
|
||||
title: str,
|
||||
address: str,
|
||||
foursquare_id: Optional[str] = None,
|
||||
foursquare_type: Optional[str] = None,
|
||||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
title=title,
|
||||
address=address,
|
||||
foursquare_id=foursquare_id,
|
||||
foursquare_type=foursquare_type,
|
||||
google_place_id=google_place_id,
|
||||
google_place_type=google_place_type,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -20,3 +22,30 @@ class Invoice(TelegramObject):
|
|||
"""Three-letter ISO 4217 `currency <https://core.telegram.org/bots/payments#supported-currencies>`_ code"""
|
||||
total_amount: int
|
||||
"""Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
title: str,
|
||||
description: str,
|
||||
start_parameter: str,
|
||||
currency: str,
|
||||
total_amount: int,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
title=title,
|
||||
description=description,
|
||||
start_parameter=start_parameter,
|
||||
currency=currency,
|
||||
total_amount=total_amount,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -39,3 +39,34 @@ class KeyboardButton(MutableTelegramObject):
|
|||
"""*Optional*. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only."""
|
||||
web_app: Optional[WebAppInfo] = None
|
||||
"""*Optional*. If specified, the described `Web App <https://core.telegram.org/bots/webapps>`_ will be launched when the button is pressed. The Web App will be able to send a 'web_app_data' service message. Available in private chats only."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
text: str,
|
||||
request_user: Optional[KeyboardButtonRequestUser] = None,
|
||||
request_chat: Optional[KeyboardButtonRequestChat] = None,
|
||||
request_contact: Optional[bool] = None,
|
||||
request_location: Optional[bool] = None,
|
||||
request_poll: Optional[KeyboardButtonPollType] = None,
|
||||
web_app: Optional[WebAppInfo] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
text=text,
|
||||
request_user=request_user,
|
||||
request_chat=request_chat,
|
||||
request_contact=request_contact,
|
||||
request_location=request_location,
|
||||
request_poll=request_poll,
|
||||
web_app=web_app,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -14,3 +14,16 @@ class KeyboardButtonPollType(MutableTelegramObject):
|
|||
|
||||
type: Optional[str] = None
|
||||
"""*Optional*. If *quiz* is passed, the user will be allowed to create only polls in the quiz mode. If *regular* is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, type: Optional[str] = None, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
|
@ -31,3 +31,36 @@ class KeyboardButtonRequestChat(TelegramObject):
|
|||
"""*Optional*. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of *user_administrator_rights*. If not specified, no additional restrictions are applied."""
|
||||
bot_is_member: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a chat with the bot as a member. Otherwise, no additional restrictions are applied."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
request_id: int,
|
||||
chat_is_channel: bool,
|
||||
chat_is_forum: Optional[bool] = None,
|
||||
chat_has_username: Optional[bool] = None,
|
||||
chat_is_created: Optional[bool] = None,
|
||||
user_administrator_rights: Optional[ChatAdministratorRights] = None,
|
||||
bot_administrator_rights: Optional[ChatAdministratorRights] = None,
|
||||
bot_is_member: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
request_id=request_id,
|
||||
chat_is_channel=chat_is_channel,
|
||||
chat_is_forum=chat_is_forum,
|
||||
chat_has_username=chat_has_username,
|
||||
chat_is_created=chat_is_created,
|
||||
user_administrator_rights=user_administrator_rights,
|
||||
bot_administrator_rights=bot_administrator_rights,
|
||||
bot_is_member=bot_is_member,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from aiogram.types import TelegramObject
|
||||
|
||||
|
|
@ -16,3 +16,26 @@ class KeyboardButtonRequestUser(TelegramObject):
|
|||
"""*Optional*. Pass :code:`True` to request a bot, pass :code:`False` to request a regular user. If not specified, no additional restrictions are applied."""
|
||||
user_is_premium: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request a premium user, pass :code:`False` to request a non-premium user. If not specified, no additional restrictions are applied."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
request_id: int,
|
||||
user_is_bot: Optional[bool] = None,
|
||||
user_is_premium: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
request_id=request_id,
|
||||
user_is_bot=user_is_bot,
|
||||
user_is_premium=user_is_premium,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
||||
|
|
@ -14,3 +16,16 @@ class LabeledPrice(MutableTelegramObject):
|
|||
"""Portion label"""
|
||||
amount: int
|
||||
"""Price of the product in the *smallest units* of the `currency <https://core.telegram.org/bots/payments#supported-currencies>`_ (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json <https://core.telegram.org/bots/payments/currencies.json>`_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, label: str, amount: int, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(label=label, amount=amount, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -24,3 +24,32 @@ class Location(TelegramObject):
|
|||
"""*Optional*. The direction in which user is moving, in degrees; 1-360. For active live locations only."""
|
||||
proximity_alert_radius: Optional[int] = None
|
||||
"""*Optional*. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
longitude: float,
|
||||
latitude: float,
|
||||
horizontal_accuracy: Optional[float] = None,
|
||||
live_period: Optional[int] = None,
|
||||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
longitude=longitude,
|
||||
latitude=latitude,
|
||||
horizontal_accuracy=horizontal_accuracy,
|
||||
live_period=live_period,
|
||||
heading=heading,
|
||||
proximity_alert_radius=proximity_alert_radius,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -23,3 +23,28 @@ class LoginUrl(TelegramObject):
|
|||
"""*Optional*. Username of a bot, which will be used for user authorization. See `Setting up a bot <https://core.telegram.org/widgets/login#setting-up-a-bot>`_ for more details. If not specified, the current bot's username will be assumed. The *url*'s domain must be the same as the domain linked with the bot. See `Linking your domain to the bot <https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot>`_ for more details."""
|
||||
request_write_access: Optional[bool] = None
|
||||
"""*Optional*. Pass :code:`True` to request the permission for your bot to send messages to the user."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
url: str,
|
||||
forward_text: Optional[str] = None,
|
||||
bot_username: Optional[str] = None,
|
||||
request_write_access: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
url=url,
|
||||
forward_text=forward_text,
|
||||
bot_username=bot_username,
|
||||
request_write_access=request_write_access,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -18,3 +20,24 @@ class MaskPosition(TelegramObject):
|
|||
"""Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position."""
|
||||
scale: float
|
||||
"""Mask scaling coefficient. For example, 2.0 means double size."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
point: str,
|
||||
x_shift: float,
|
||||
y_shift: float,
|
||||
scale: float,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
point=point, x_shift=x_shift, y_shift=y_shift, scale=scale, **__pydantic_kwargs
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import MutableTelegramObject
|
||||
|
||||
|
|
@ -27,3 +27,21 @@ class MenuButton(MutableTelegramObject):
|
|||
"""*Optional*. Text on the button"""
|
||||
web_app: Optional[WebAppInfo] = None
|
||||
"""*Optional*. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: str,
|
||||
text: Optional[str] = None,
|
||||
web_app: Optional[WebAppInfo] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, text=text, web_app=web_app, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import MenuButtonType
|
||||
from .menu_button import MenuButton
|
||||
|
|
@ -15,3 +15,19 @@ class MenuButtonCommands(MenuButton):
|
|||
|
||||
type: Literal[MenuButtonType.COMMANDS] = MenuButtonType.COMMANDS
|
||||
"""Type of the button, must be *commands*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[MenuButtonType.COMMANDS] = MenuButtonType.COMMANDS,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import MenuButtonType
|
||||
from .menu_button import MenuButton
|
||||
|
|
@ -15,3 +15,19 @@ class MenuButtonDefault(MenuButton):
|
|||
|
||||
type: Literal[MenuButtonType.DEFAULT] = MenuButtonType.DEFAULT
|
||||
"""Type of the button, must be *default*"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[MenuButtonType.DEFAULT] = MenuButtonType.DEFAULT,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import MenuButtonType
|
||||
from .menu_button import MenuButton
|
||||
|
|
@ -22,3 +22,21 @@ class MenuButtonWebApp(MenuButton):
|
|||
"""Text on the button"""
|
||||
web_app: WebAppInfo
|
||||
"""Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method :class:`aiogram.methods.answer_web_app_query.AnswerWebAppQuery`."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: Literal[MenuButtonType.WEB_APP] = MenuButtonType.WEB_APP,
|
||||
text: str,
|
||||
web_app: WebAppInfo,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(type=type, text=text, web_app=web_app, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
|
|
@ -249,6 +249,165 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
message_id: int,
|
||||
date: datetime.datetime,
|
||||
chat: Chat,
|
||||
message_thread_id: Optional[int] = None,
|
||||
from_user: Optional[User] = None,
|
||||
sender_chat: Optional[Chat] = None,
|
||||
forward_from: Optional[User] = None,
|
||||
forward_from_chat: Optional[Chat] = None,
|
||||
forward_from_message_id: Optional[int] = None,
|
||||
forward_signature: Optional[str] = None,
|
||||
forward_sender_name: Optional[str] = None,
|
||||
forward_date: Optional[int] = None,
|
||||
is_topic_message: Optional[bool] = None,
|
||||
is_automatic_forward: Optional[bool] = None,
|
||||
reply_to_message: Optional[Message] = None,
|
||||
via_bot: Optional[User] = None,
|
||||
edit_date: Optional[int] = None,
|
||||
has_protected_content: Optional[bool] = None,
|
||||
media_group_id: Optional[str] = None,
|
||||
author_signature: Optional[str] = None,
|
||||
text: Optional[str] = None,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
animation: Optional[Animation] = None,
|
||||
audio: Optional[Audio] = None,
|
||||
document: Optional[Document] = None,
|
||||
photo: Optional[List[PhotoSize]] = None,
|
||||
sticker: Optional[Sticker] = None,
|
||||
video: Optional[Video] = None,
|
||||
video_note: Optional[VideoNote] = None,
|
||||
voice: Optional[Voice] = None,
|
||||
caption: Optional[str] = None,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_media_spoiler: Optional[bool] = None,
|
||||
contact: Optional[Contact] = None,
|
||||
dice: Optional[Dice] = None,
|
||||
game: Optional[Game] = None,
|
||||
poll: Optional[Poll] = None,
|
||||
venue: Optional[Venue] = None,
|
||||
location: Optional[Location] = None,
|
||||
new_chat_members: Optional[List[User]] = None,
|
||||
left_chat_member: Optional[User] = None,
|
||||
new_chat_title: Optional[str] = None,
|
||||
new_chat_photo: Optional[List[PhotoSize]] = None,
|
||||
delete_chat_photo: Optional[bool] = None,
|
||||
group_chat_created: Optional[bool] = None,
|
||||
supergroup_chat_created: Optional[bool] = None,
|
||||
channel_chat_created: Optional[bool] = None,
|
||||
message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = None,
|
||||
migrate_to_chat_id: Optional[int] = None,
|
||||
migrate_from_chat_id: Optional[int] = None,
|
||||
pinned_message: Optional[Message] = None,
|
||||
invoice: Optional[Invoice] = None,
|
||||
successful_payment: Optional[SuccessfulPayment] = None,
|
||||
user_shared: Optional[UserShared] = None,
|
||||
chat_shared: Optional[ChatShared] = None,
|
||||
connected_website: Optional[str] = None,
|
||||
write_access_allowed: Optional[WriteAccessAllowed] = None,
|
||||
passport_data: Optional[PassportData] = None,
|
||||
proximity_alert_triggered: Optional[ProximityAlertTriggered] = None,
|
||||
forum_topic_created: Optional[ForumTopicCreated] = None,
|
||||
forum_topic_edited: Optional[ForumTopicEdited] = None,
|
||||
forum_topic_closed: Optional[ForumTopicClosed] = None,
|
||||
forum_topic_reopened: Optional[ForumTopicReopened] = None,
|
||||
general_forum_topic_hidden: Optional[GeneralForumTopicHidden] = None,
|
||||
general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden] = None,
|
||||
video_chat_scheduled: Optional[VideoChatScheduled] = None,
|
||||
video_chat_started: Optional[VideoChatStarted] = None,
|
||||
video_chat_ended: Optional[VideoChatEnded] = None,
|
||||
video_chat_participants_invited: Optional[VideoChatParticipantsInvited] = None,
|
||||
web_app_data: Optional[WebAppData] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
message_id=message_id,
|
||||
date=date,
|
||||
chat=chat,
|
||||
message_thread_id=message_thread_id,
|
||||
from_user=from_user,
|
||||
sender_chat=sender_chat,
|
||||
forward_from=forward_from,
|
||||
forward_from_chat=forward_from_chat,
|
||||
forward_from_message_id=forward_from_message_id,
|
||||
forward_signature=forward_signature,
|
||||
forward_sender_name=forward_sender_name,
|
||||
forward_date=forward_date,
|
||||
is_topic_message=is_topic_message,
|
||||
is_automatic_forward=is_automatic_forward,
|
||||
reply_to_message=reply_to_message,
|
||||
via_bot=via_bot,
|
||||
edit_date=edit_date,
|
||||
has_protected_content=has_protected_content,
|
||||
media_group_id=media_group_id,
|
||||
author_signature=author_signature,
|
||||
text=text,
|
||||
entities=entities,
|
||||
animation=animation,
|
||||
audio=audio,
|
||||
document=document,
|
||||
photo=photo,
|
||||
sticker=sticker,
|
||||
video=video,
|
||||
video_note=video_note,
|
||||
voice=voice,
|
||||
caption=caption,
|
||||
caption_entities=caption_entities,
|
||||
has_media_spoiler=has_media_spoiler,
|
||||
contact=contact,
|
||||
dice=dice,
|
||||
game=game,
|
||||
poll=poll,
|
||||
venue=venue,
|
||||
location=location,
|
||||
new_chat_members=new_chat_members,
|
||||
left_chat_member=left_chat_member,
|
||||
new_chat_title=new_chat_title,
|
||||
new_chat_photo=new_chat_photo,
|
||||
delete_chat_photo=delete_chat_photo,
|
||||
group_chat_created=group_chat_created,
|
||||
supergroup_chat_created=supergroup_chat_created,
|
||||
channel_chat_created=channel_chat_created,
|
||||
message_auto_delete_timer_changed=message_auto_delete_timer_changed,
|
||||
migrate_to_chat_id=migrate_to_chat_id,
|
||||
migrate_from_chat_id=migrate_from_chat_id,
|
||||
pinned_message=pinned_message,
|
||||
invoice=invoice,
|
||||
successful_payment=successful_payment,
|
||||
user_shared=user_shared,
|
||||
chat_shared=chat_shared,
|
||||
connected_website=connected_website,
|
||||
write_access_allowed=write_access_allowed,
|
||||
passport_data=passport_data,
|
||||
proximity_alert_triggered=proximity_alert_triggered,
|
||||
forum_topic_created=forum_topic_created,
|
||||
forum_topic_edited=forum_topic_edited,
|
||||
forum_topic_closed=forum_topic_closed,
|
||||
forum_topic_reopened=forum_topic_reopened,
|
||||
general_forum_topic_hidden=general_forum_topic_hidden,
|
||||
general_forum_topic_unhidden=general_forum_topic_unhidden,
|
||||
video_chat_scheduled=video_chat_scheduled,
|
||||
video_chat_started=video_chat_started,
|
||||
video_chat_ended=video_chat_ended,
|
||||
video_chat_participants_invited=video_chat_participants_invited,
|
||||
web_app_data=web_app_data,
|
||||
reply_markup=reply_markup,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
@property
|
||||
def content_type(self) -> str:
|
||||
if self.text:
|
||||
|
|
@ -400,6 +559,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendAnimation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendAnimation(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -472,6 +635,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendAnimation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendAnimation(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -542,6 +709,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendAudio
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendAudio(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -612,6 +783,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendAudio
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendAudio(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -672,6 +847,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendContact
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendContact(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -729,6 +908,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendContact
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendContact(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -789,6 +972,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendDocument
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendDocument(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -852,6 +1039,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendDocument
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendDocument(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -902,6 +1093,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendGame
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendGame(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -948,6 +1143,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendGame
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendGame(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1033,6 +1232,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendInvoice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendInvoice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1139,6 +1342,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendInvoice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendInvoice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1216,6 +1423,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendLocation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendLocation(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1279,6 +1490,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendLocation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendLocation(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1327,6 +1542,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendMediaGroup
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendMediaGroup(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1370,6 +1589,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendMediaGroup
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendMediaGroup(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1422,6 +1645,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendMessage(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1479,6 +1706,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendMessage(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1537,6 +1768,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendPhoto
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendPhoto(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1597,6 +1832,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendPhoto
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendPhoto(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1670,6 +1909,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendPoll
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendPoll(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1751,6 +1994,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendPoll
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendPoll(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1809,6 +2056,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendDice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendDice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1857,6 +2108,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendDice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendDice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1906,6 +2161,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendSticker
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendSticker(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -1957,6 +2216,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendSticker
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendSticker(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2019,6 +2282,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVenue
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVenue(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2088,6 +2355,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVenue
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVenue(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2160,6 +2431,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVideo
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVideo(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2235,6 +2510,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVideo
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVideo(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2297,6 +2576,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVideoNote
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVideoNote(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2354,6 +2637,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVideoNote
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVideoNote(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2412,6 +2699,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVoice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVoice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2472,6 +2763,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import SendVoice
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return SendVoice(
|
||||
chat_id=self.chat.id,
|
||||
message_thread_id=self.message_thread_id if self.is_topic_message else None,
|
||||
|
|
@ -2513,14 +2808,14 @@ class Message(TelegramObject):
|
|||
SendVoice,
|
||||
]:
|
||||
"""
|
||||
Send copy of message.
|
||||
Send copy of a message.
|
||||
|
||||
Is similar to :meth:`aiogram.client.bot.Bot.copy_message`
|
||||
but returning the sent message instead of :class:`aiogram.types.message_id.MessageId`
|
||||
|
||||
.. note::
|
||||
|
||||
This method don't use the API method named `copyMessage` and
|
||||
This method doesn't use the API method named `copyMessage` and
|
||||
historically implemented before the similar method is added to API
|
||||
|
||||
:param chat_id:
|
||||
|
|
@ -2548,7 +2843,7 @@ class Message(TelegramObject):
|
|||
SendVoice,
|
||||
)
|
||||
|
||||
kwargs = {
|
||||
kwargs: Dict[str, Any] = {
|
||||
"chat_id": chat_id,
|
||||
"reply_markup": reply_markup or self.reply_markup,
|
||||
"disable_notification": disable_notification,
|
||||
|
|
@ -2556,38 +2851,48 @@ class Message(TelegramObject):
|
|||
"message_thread_id": message_thread_id,
|
||||
"allow_sending_without_reply": allow_sending_without_reply,
|
||||
}
|
||||
text = self.text or self.caption
|
||||
entities = self.entities or self.caption_entities
|
||||
|
||||
if self.text:
|
||||
return SendMessage(text=text, entities=entities, **kwargs).as_(self._bot)
|
||||
return SendMessage(text=self.text, entities=self.entities, **kwargs).as_(self._bot)
|
||||
if self.audio:
|
||||
return SendAudio(
|
||||
audio=self.audio.file_id,
|
||||
caption=text,
|
||||
caption=self.caption,
|
||||
title=self.audio.title,
|
||||
performer=self.audio.performer,
|
||||
duration=self.audio.duration,
|
||||
caption_entities=entities,
|
||||
caption_entities=self.caption_entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.animation:
|
||||
return SendAnimation(
|
||||
animation=self.animation.file_id, caption=text, caption_entities=entities, **kwargs
|
||||
animation=self.animation.file_id,
|
||||
caption=self.caption,
|
||||
caption_entities=self.caption_entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.document:
|
||||
return SendDocument(
|
||||
document=self.document.file_id, caption=text, caption_entities=entities, **kwargs
|
||||
document=self.document.file_id,
|
||||
caption=self.caption,
|
||||
caption_entities=self.caption_entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.photo:
|
||||
return SendPhoto(
|
||||
photo=self.photo[-1].file_id, caption=text, caption_entities=entities, **kwargs
|
||||
photo=self.photo[-1].file_id,
|
||||
caption=self.caption,
|
||||
caption_entities=self.caption_entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.sticker:
|
||||
return SendSticker(sticker=self.sticker.file_id, **kwargs)
|
||||
if self.video:
|
||||
return SendVideo(
|
||||
video=self.video.file_id, caption=text, caption_entities=entities, **kwargs
|
||||
video=self.video.file_id,
|
||||
caption=self.caption,
|
||||
caption_entities=self.caption_entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.video_note:
|
||||
return SendVideoNote(video_note=self.video_note.file_id, **kwargs).as_(self._bot)
|
||||
|
|
@ -2670,6 +2975,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import CopyMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return CopyMessage(
|
||||
from_chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
|
|
@ -2720,8 +3029,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageText
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageText(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
text=text,
|
||||
inline_message_id=inline_message_id,
|
||||
|
|
@ -2762,6 +3075,10 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import ForwardMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return ForwardMessage(
|
||||
from_chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
|
|
@ -2806,8 +3123,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageMedia
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageMedia(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
media=media,
|
||||
inline_message_id=inline_message_id,
|
||||
|
|
@ -2841,8 +3162,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageReplyMarkup
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageReplyMarkup(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
inline_message_id=inline_message_id,
|
||||
reply_markup=reply_markup,
|
||||
|
|
@ -2874,8 +3199,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageReplyMarkup
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageReplyMarkup(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
reply_markup=None,
|
||||
inline_message_id=inline_message_id,
|
||||
|
|
@ -2918,8 +3247,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageLiveLocation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageLiveLocation(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
latitude=latitude,
|
||||
longitude=longitude,
|
||||
|
|
@ -2957,8 +3290,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import StopMessageLiveLocation
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return StopMessageLiveLocation(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
inline_message_id=inline_message_id,
|
||||
reply_markup=reply_markup,
|
||||
|
|
@ -2997,8 +3334,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import EditMessageCaption
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return EditMessageCaption(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
inline_message_id=inline_message_id,
|
||||
caption=caption,
|
||||
|
|
@ -3048,8 +3389,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import DeleteMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return DeleteMessage(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
@ -3078,8 +3423,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import PinChatMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return PinChatMessage(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
disable_notification=disable_notification,
|
||||
**kwargs,
|
||||
|
|
@ -3107,8 +3456,12 @@ class Message(TelegramObject):
|
|||
|
||||
from aiogram.methods import UnpinChatMessage
|
||||
|
||||
assert (
|
||||
self.chat is not None
|
||||
), "This method can be used only if chat is present in the message."
|
||||
|
||||
return UnpinChatMessage(
|
||||
chat_id=self.chat.id if self.chat else None,
|
||||
chat_id=self.chat.id,
|
||||
message_id=self.message_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -12,3 +14,18 @@ class MessageAutoDeleteTimerChanged(TelegramObject):
|
|||
|
||||
message_auto_delete_time: int
|
||||
"""New auto-delete time for messages in the chat; in seconds"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__, *, message_auto_delete_time: int, **__pydantic_kwargs: Any
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
message_auto_delete_time=message_auto_delete_time, **__pydantic_kwargs
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from ..utils.text_decorations import add_surrogates, remove_surrogates
|
||||
from .base import MutableTelegramObject
|
||||
|
|
@ -31,6 +31,37 @@ class MessageEntity(MutableTelegramObject):
|
|||
custom_emoji_id: Optional[str] = None
|
||||
"""*Optional*. For 'custom_emoji' only, unique identifier of the custom emoji. Use :class:`aiogram.methods.get_custom_emoji_stickers.GetCustomEmojiStickers` to get full information about the sticker"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
type: str,
|
||||
offset: int,
|
||||
length: int,
|
||||
url: Optional[str] = None,
|
||||
user: Optional[User] = None,
|
||||
language: Optional[str] = None,
|
||||
custom_emoji_id: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
type=type,
|
||||
offset=offset,
|
||||
length=length,
|
||||
url=url,
|
||||
user=user,
|
||||
language=language,
|
||||
custom_emoji_id=custom_emoji_id,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
def extract_from(self, text: str) -> str:
|
||||
return remove_surrogates(
|
||||
add_surrogates(text)[self.offset * 2 : (self.offset + self.length) * 2]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -12,3 +14,14 @@ class MessageId(TelegramObject):
|
|||
|
||||
message_id: int
|
||||
"""Unique message identifier"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(__pydantic__self__, *, message_id: int, **__pydantic_kwargs: Any) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(message_id=message_id, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -23,3 +23,28 @@ class OrderInfo(TelegramObject):
|
|||
"""*Optional*. User email"""
|
||||
shipping_address: Optional[ShippingAddress] = None
|
||||
"""*Optional*. User shipping address"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
name: Optional[str] = None,
|
||||
phone_number: Optional[str] = None,
|
||||
email: Optional[str] = None,
|
||||
shipping_address: Optional[ShippingAddress] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
name=name,
|
||||
phone_number=phone_number,
|
||||
email=email,
|
||||
shipping_address=shipping_address,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, List
|
||||
from typing import TYPE_CHECKING, Any, List
|
||||
|
||||
from .base import TelegramObject
|
||||
|
||||
|
|
@ -20,3 +20,20 @@ class PassportData(TelegramObject):
|
|||
"""Array with information about documents and other Telegram Passport elements that was shared with the bot"""
|
||||
credentials: EncryptedCredentials
|
||||
"""Encrypted credentials required to decrypt the data"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
data: List[EncryptedPassportElement],
|
||||
credentials: EncryptedCredentials,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(data=data, credentials=credentials, **__pydantic_kwargs)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import PassportElementErrorType
|
||||
from .passport_element_error import PassportElementError
|
||||
|
|
@ -23,3 +23,30 @@ class PassportElementErrorDataField(PassportElementError):
|
|||
"""Base64-encoded data hash"""
|
||||
message: str
|
||||
"""Error message"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
source: Literal[PassportElementErrorType.DATA] = PassportElementErrorType.DATA,
|
||||
type: str,
|
||||
field_name: str,
|
||||
data_hash: str,
|
||||
message: str,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
source=source,
|
||||
type=type,
|
||||
field_name=field_name,
|
||||
data_hash=data_hash,
|
||||
message=message,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from ..enums import PassportElementErrorType
|
||||
from .passport_element_error import PassportElementError
|
||||
|
|
@ -21,3 +21,24 @@ class PassportElementErrorFile(PassportElementError):
|
|||
"""Base64-encoded file hash"""
|
||||
message: str
|
||||
"""Error message"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
source: Literal[PassportElementErrorType.FILE] = PassportElementErrorType.FILE,
|
||||
type: str,
|
||||
file_hash: str,
|
||||
message: str,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
source=source, type=type, file_hash=file_hash, message=message, **__pydantic_kwargs
|
||||
)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue