mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Reworked bot-wide defaults (#1392)
* Reworked defaults * Added changelog and partial docs
This commit is contained in:
parent
1281bf551a
commit
24f59da70d
140 changed files with 608 additions and 530 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import datetime
|
||||
import io
|
||||
import pathlib
|
||||
import warnings
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import (
|
||||
Any,
|
||||
|
|
@ -143,7 +144,6 @@ from ..methods import (
|
|||
UploadStickerFile,
|
||||
)
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
BotCommand,
|
||||
BotCommandScopeAllChatAdministrators,
|
||||
BotCommandScopeAllGroupChats,
|
||||
|
|
@ -233,7 +233,7 @@ from ..types import (
|
|||
UserProfilePhotos,
|
||||
WebhookInfo,
|
||||
)
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
|
||||
from .default import Default, DefaultBotProperties
|
||||
from .session.aiohttp import AiohttpSession
|
||||
from .session.base import BaseSession
|
||||
|
||||
|
|
@ -248,6 +248,7 @@ class Bot:
|
|||
parse_mode: Optional[str] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
default: Optional[DefaultBotProperties] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Bot class
|
||||
|
|
@ -261,6 +262,8 @@ class Bot:
|
|||
If specified it will be propagated into the API methods at runtime.
|
||||
:param protect_content: Default protect_content mode.
|
||||
If specified it will be propagated into the API methods at runtime.
|
||||
:param default: Default bot properties.
|
||||
If specified it will be propagated into the API methods at runtime.
|
||||
:raise TokenValidationError: When token has invalid format this exception will be raised
|
||||
"""
|
||||
|
||||
|
|
@ -268,11 +271,29 @@ class Bot:
|
|||
|
||||
if session is None:
|
||||
session = AiohttpSession()
|
||||
if default is None:
|
||||
default = DefaultBotProperties(
|
||||
parse_mode=parse_mode,
|
||||
link_preview_is_disabled=disable_web_page_preview,
|
||||
protect_content=protect_content,
|
||||
)
|
||||
|
||||
self.session = session
|
||||
self.parse_mode = parse_mode
|
||||
self.disable_web_page_preview = disable_web_page_preview
|
||||
self.protect_content = protect_content
|
||||
if (
|
||||
parse_mode is not None
|
||||
or disable_web_page_preview is not None
|
||||
or protect_content is not None
|
||||
):
|
||||
warnings.warn(
|
||||
"Passing `parse_mode`, `disable_web_page_preview` or `protect_content` "
|
||||
"to Bot initializer is deprecated. This arguments will be removed in 3.5.0 version\n"
|
||||
"Use `default=DefaultBotProperties(...)` instead.",
|
||||
category=DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
self.default = default
|
||||
|
||||
self.__token = token
|
||||
self._me: Optional[User] = None
|
||||
|
||||
|
|
@ -805,10 +826,10 @@ class Bot:
|
|||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1302,7 +1323,7 @@ class Bot:
|
|||
message_id: Optional[int] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
|
|
@ -1451,11 +1472,13 @@ class Bot:
|
|||
chat_id: Optional[Union[int, str]] = None,
|
||||
message_id: Optional[int] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> Union[Message, bool]:
|
||||
"""
|
||||
|
|
@ -1518,7 +1541,7 @@ class Bot:
|
|||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
|
|
@ -2137,11 +2160,11 @@ class Bot:
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2203,14 +2226,14 @@ class Bot:
|
|||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2304,7 +2327,7 @@ class Bot:
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2356,7 +2379,7 @@ class Bot:
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2403,11 +2426,11 @@ class Bot:
|
|||
message_thread_id: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2463,7 +2486,7 @@ class Bot:
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -2527,7 +2550,7 @@ class Bot:
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -2616,7 +2639,7 @@ class Bot:
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2672,7 +2695,7 @@ class Bot:
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -2712,17 +2735,21 @@ class Bot:
|
|||
chat_id: Union[int, str],
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> Message:
|
||||
|
|
@ -2771,11 +2798,11 @@ class Bot:
|
|||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2834,13 +2861,13 @@ class Bot:
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2909,7 +2936,7 @@ class Bot:
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2964,7 +2991,7 @@ class Bot:
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -3028,12 +3055,12 @@ class Bot:
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -3100,7 +3127,7 @@ class Bot:
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -3152,11 +3179,11 @@ class Bot:
|
|||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
84
aiogram/client/default.py
Normal file
84
aiogram/client/default.py
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from typing import TYPE_CHECKING, Any, Dict, Optional
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiogram.types import LinkPreviewOptions
|
||||
|
||||
|
||||
# @dataclass ??
|
||||
class Default:
|
||||
# Is not a dataclass because of JSON serialization.
|
||||
|
||||
__slots__ = ("_name",)
|
||||
|
||||
def __init__(self, name: str) -> None:
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self._name
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"Default({self._name!r})"
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<{self}>"
|
||||
|
||||
|
||||
_dataclass_properties: Dict[str, Any] = {}
|
||||
if sys.version_info >= (3, 10):
|
||||
# Speedup attribute access for dataclasses in Python 3.10+
|
||||
_dataclass_properties.update({"slots": True, "kw_only": True})
|
||||
|
||||
|
||||
@dataclass(**_dataclass_properties)
|
||||
class DefaultBotProperties:
|
||||
"""
|
||||
Default bot properties.
|
||||
"""
|
||||
|
||||
parse_mode: Optional[str] = None
|
||||
"""Default parse mode for messages."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message silently. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = None
|
||||
"""Protects content from copying."""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Allows to send messages without reply."""
|
||||
|
||||
link_preview: Optional[LinkPreviewOptions] = None
|
||||
"""Link preview settings."""
|
||||
link_preview_is_disabled: Optional[bool] = None
|
||||
"""Disables link preview."""
|
||||
link_preview_prefer_small_media: Optional[bool] = None
|
||||
"""Prefer small media in link preview."""
|
||||
link_preview_prefer_large_media: Optional[bool] = None
|
||||
"""Prefer large media in link preview."""
|
||||
link_preview_show_above_text: Optional[bool] = None
|
||||
"""Show link preview above text."""
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
has_any_link_preview_option = any(
|
||||
(
|
||||
self.link_preview_is_disabled,
|
||||
self.link_preview_prefer_small_media,
|
||||
self.link_preview_prefer_large_media,
|
||||
self.link_preview_show_above_text,
|
||||
)
|
||||
)
|
||||
|
||||
if has_any_link_preview_option and self.link_preview is None:
|
||||
from ..types import LinkPreviewOptions
|
||||
|
||||
self.link_preview = LinkPreviewOptions(
|
||||
is_disabled=self.link_preview_is_disabled,
|
||||
prefer_small_media=self.link_preview_prefer_small_media,
|
||||
prefer_large_media=self.link_preview_prefer_large_media,
|
||||
show_above_text=self.link_preview_show_above_text,
|
||||
)
|
||||
|
||||
def __getitem__(self, item: str) -> Any:
|
||||
return getattr(self, item, None)
|
||||
|
|
@ -6,7 +6,6 @@ from typing import (
|
|||
TYPE_CHECKING,
|
||||
Any,
|
||||
AsyncGenerator,
|
||||
AsyncIterator,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ from aiogram.exceptions import (
|
|||
|
||||
from ...methods import Response, TelegramMethod
|
||||
from ...methods.base import TelegramType
|
||||
from ...types import UNSET_PARSE_MODE, InputFile
|
||||
from ...types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
|
||||
from ...types import InputFile
|
||||
from ..default import Default
|
||||
from ..telegram import PRODUCTION, TelegramAPIServer
|
||||
from .middlewares.manager import RequestMiddlewareManager
|
||||
|
||||
|
|
@ -191,18 +191,9 @@ class BaseSession(abc.ABC):
|
|||
return None
|
||||
if isinstance(value, str):
|
||||
return value
|
||||
if value is UNSET_PARSE_MODE:
|
||||
return self.prepare_value(
|
||||
bot.parse_mode, bot=bot, files=files, _dumps_json=_dumps_json
|
||||
)
|
||||
if value is UNSET_DISABLE_WEB_PAGE_PREVIEW:
|
||||
return self.prepare_value(
|
||||
bot.disable_web_page_preview, bot=bot, files=files, _dumps_json=_dumps_json
|
||||
)
|
||||
if value is UNSET_PROTECT_CONTENT:
|
||||
return self.prepare_value(
|
||||
bot.protect_content, bot=bot, files=files, _dumps_json=_dumps_json
|
||||
)
|
||||
if isinstance(value, Default):
|
||||
default_value = bot.default[value.name]
|
||||
return self.prepare_value(default_value, bot=bot, files=files, _dumps_json=_dumps_json)
|
||||
if isinstance(value, InputFile):
|
||||
key = secrets.token_urlsafe(10)
|
||||
files[key] = value
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
MessageEntity,
|
||||
|
|
@ -14,7 +14,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -38,13 +37,13 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the new caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -77,10 +76,10 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
|
|||
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
|
||||
caption: Optional[str] = None
|
||||
"""New caption of the message, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -42,7 +43,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
|
|||
message_id: Optional[int] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -11,7 +12,6 @@ from ..types import (
|
|||
Message,
|
||||
MessageEntity,
|
||||
)
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
"""Required if *inline_message_id* is not specified. Identifier of the message to edit"""
|
||||
inline_message_id: Optional[str] = None
|
||||
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -41,8 +41,8 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
"""Link preview generation options for the message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
disable_web_page_preview: Optional[bool] = Field(
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True}
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Field(
|
||||
Default("link_preview_is_disabled"), json_schema_extra={"deprecated": True}
|
||||
)
|
||||
"""Disables link previews for links in this message
|
||||
|
||||
|
|
@ -60,11 +60,13 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
chat_id: Optional[Union[int, str]] = None,
|
||||
message_id: Optional[int] = None,
|
||||
inline_message_id: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import Message
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
|
@ -27,7 +28,7 @@ class ForwardMessage(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the forwarded message from forwarding and saving"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -42,7 +43,7 @@ class ForwardMessage(TelegramMethod[Message]):
|
|||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -53,7 +53,7 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
"""Pass :code:`True` if the animation needs to be covered with a spoiler animation"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -89,11 +89,11 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
InputFile,
|
||||
|
|
@ -15,7 +15,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Audio caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -52,7 +51,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -84,14 +83,14 @@ class SendAudio(TelegramMethod[Message]):
|
|||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -12,7 +13,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ class SendContact(TelegramMethod[Message]):
|
|||
"""Additional data about the contact in the form of a `vCard <https://en.wikipedia.org/wiki/VCard>`_, 0-2048 bytes"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -75,7 +75,7 @@ class SendContact(TelegramMethod[Message]):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -12,7 +13,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ class SendDice(TelegramMethod[Message]):
|
|||
"""Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲'"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -66,7 +66,7 @@ class SendDice(TelegramMethod[Message]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ class SendDocument(TelegramMethod[Message]):
|
|||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -47,7 +47,7 @@ class SendDocument(TelegramMethod[Message]):
|
|||
"""Disables automatic server-side content type detection for files uploaded using multipart/form-data"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -80,11 +80,11 @@ class SendDocument(TelegramMethod[Message]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import InlineKeyboardMarkup, Message, ReplyParameters
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ class SendGame(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -57,7 +57,7 @@ class SendGame(TelegramMethod[Message]):
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import InlineKeyboardMarkup, LabeledPrice, Message, ReplyParameters
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
"""Pass :code:`True` if the final price depends on the shipping method"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -117,7 +117,7 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -12,7 +13,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ class SendLocation(TelegramMethod[Message]):
|
|||
"""For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -81,7 +81,7 @@ class SendLocation(TelegramMethod[Message]):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
InputMediaAudio,
|
||||
InputMediaDocument,
|
||||
|
|
@ -12,7 +13,6 @@ from ..types import (
|
|||
Message,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends messages `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent messages from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -64,7 +64,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
|
|||
],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
LinkPreviewOptions,
|
||||
|
|
@ -15,7 +15,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -35,15 +34,15 @@ class SendMessage(TelegramMethod[Message]):
|
|||
"""Text of the message to be sent, 1-4096 characters after entities parsing"""
|
||||
message_thread_id: Optional[int] = None
|
||||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*"""
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default("link_preview")
|
||||
"""Link preview generation options for the message"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -58,8 +57,8 @@ class SendMessage(TelegramMethod[Message]):
|
|||
|
||||
.. deprecated:: API:7.0
|
||||
https://core.telegram.org/bots/api-changelog#december-29-2023"""
|
||||
disable_web_page_preview: Optional[bool] = Field(
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True}
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Field(
|
||||
Default("link_preview_is_disabled"), json_schema_extra={"deprecated": True}
|
||||
)
|
||||
"""Disables link previews for links in this message
|
||||
|
||||
|
|
@ -81,17 +80,21 @@ class SendMessage(TelegramMethod[Message]):
|
|||
chat_id: Union[int, str],
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -45,7 +45,7 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
"""Pass :code:`True` if the photo needs to be covered with a spoiler animation"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -77,11 +77,11 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
"""0-based identifier of the correct answer option, required for polls in quiz mode"""
|
||||
explanation: Optional[str] = None
|
||||
"""Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing"""
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the explanation. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
explanation_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -59,7 +59,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
"""Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -96,13 +96,13 @@ class SendPoll(TelegramMethod[Message]):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -13,7 +14,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class SendSticker(TelegramMethod[Message]):
|
|||
"""Emoji associated with the sticker; only for just uploaded stickers"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -70,7 +70,7 @@ class SendSticker(TelegramMethod[Message]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -12,7 +13,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ class SendVenue(TelegramMethod[Message]):
|
|||
"""Google Places type of the venue. (See `supported types <https://developers.google.com/places/web-service/supported_types>`_.)"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -87,7 +87,7 @@ class SendVenue(TelegramMethod[Message]):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -55,7 +55,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
"""Pass :code:`True` if the uploaded video is suitable for streaming"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -91,12 +91,12 @@ class SendVideo(TelegramMethod[Message]):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
ForceReply,
|
||||
InlineKeyboardMarkup,
|
||||
|
|
@ -13,7 +14,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -76,7 +76,7 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from ..client.default import Default
|
||||
from ..types import (
|
||||
UNSET_PARSE_MODE,
|
||||
ForceReply,
|
||||
|
|
@ -15,7 +16,6 @@ from ..types import (
|
|||
ReplyKeyboardRemove,
|
||||
ReplyParameters,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ class SendVoice(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
|
||||
caption: Optional[str] = None
|
||||
"""Voice message caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -45,7 +45,7 @@ class SendVoice(TelegramMethod[Message]):
|
|||
"""Duration of the voice message in seconds"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_parameters: Optional[ReplyParameters] = None
|
||||
"""Description of the message to reply to"""
|
||||
|
|
@ -77,11 +77,11 @@ class SendVoice(TelegramMethod[Message]):
|
|||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from unittest.mock import sentinel
|
|||
from pydantic import BaseModel, ConfigDict, model_validator
|
||||
|
||||
from aiogram.client.context_controller import BotContextController
|
||||
from aiogram.client.default import Default
|
||||
|
||||
|
||||
class TelegramObject(BotContextController, BaseModel):
|
||||
|
|
@ -41,7 +42,10 @@ class MutableTelegramObject(TelegramObject):
|
|||
|
||||
# special sentinel object which used in a situation when None might be a useful value
|
||||
UNSET: Any = sentinel.UNSET
|
||||
UNSET_PARSE_MODE: Any = sentinel.UNSET_PARSE_MODE
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW: Any = sentinel.UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
UNSET_PROTECT_CONTENT: Any = sentinel.UNSET_PROTECT_CONTENT
|
||||
UNSET_TYPE: Any = type(UNSET)
|
||||
|
||||
# Unused constants are needed only for backward compatibility with external
|
||||
# libraries that a working with framework internals
|
||||
UNSET_PARSE_MODE: Any = Default("parse_mode")
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW: Any = Default("link_preview_is_disabled")
|
||||
UNSET_PROTECT_CONTENT: Any = Default("protect_content")
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import (
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
UNSET_PARSE_MODE,
|
||||
UNSET_PROTECT_CONTENT,
|
||||
TelegramObject,
|
||||
)
|
||||
from ..client.default import Default
|
||||
from .base import TelegramObject
|
||||
from .custom import DateTime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -162,17 +158,21 @@ class ChatJoinRequest(TelegramObject):
|
|||
self,
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
|
|
@ -226,17 +226,21 @@ class ChatJoinRequest(TelegramObject):
|
|||
self,
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
|
|
@ -295,11 +299,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -371,11 +375,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -443,14 +447,14 @@ class ChatJoinRequest(TelegramObject):
|
|||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -517,14 +521,14 @@ class ChatJoinRequest(TelegramObject):
|
|||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -594,7 +598,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -655,7 +659,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -714,11 +718,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -781,11 +785,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -847,7 +851,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -897,7 +901,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -967,7 +971,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1077,7 +1081,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1172,7 +1176,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1239,7 +1243,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1301,7 +1305,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -1348,7 +1352,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -1395,11 +1399,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1459,11 +1463,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1528,13 +1532,13 @@ class ChatJoinRequest(TelegramObject):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1613,13 +1617,13 @@ class ChatJoinRequest(TelegramObject):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1693,7 +1697,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1745,7 +1749,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1798,7 +1802,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1853,7 +1857,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1914,7 +1918,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1987,7 +1991,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2057,12 +2061,12 @@ class ChatJoinRequest(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2136,12 +2140,12 @@ class ChatJoinRequest(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2214,7 +2218,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2275,7 +2279,7 @@ class ChatJoinRequest(TelegramObject):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2333,11 +2337,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2397,11 +2401,11 @@ class ChatJoinRequest(TelegramObject):
|
|||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -5,12 +5,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import (
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
UNSET_PARSE_MODE,
|
||||
UNSET_PROTECT_CONTENT,
|
||||
TelegramObject,
|
||||
)
|
||||
from ..client.default import Default
|
||||
from .base import TelegramObject
|
||||
from .custom import DateTime
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -142,17 +138,21 @@ class ChatMemberUpdated(TelegramObject):
|
|||
self,
|
||||
text: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
|
|
@ -211,11 +211,11 @@ class ChatMemberUpdated(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -283,14 +283,14 @@ class ChatMemberUpdated(TelegramObject):
|
|||
audio: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -360,7 +360,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -419,11 +419,11 @@ class ChatMemberUpdated(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -485,7 +485,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -555,7 +555,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -650,7 +650,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -712,7 +712,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -759,11 +759,11 @@ class ChatMemberUpdated(TelegramObject):
|
|||
photo: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -828,13 +828,13 @@ class ChatMemberUpdated(TelegramObject):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -908,7 +908,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -961,7 +961,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1022,7 +1022,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1092,12 +1092,12 @@ class ChatMemberUpdated(TelegramObject):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1170,7 +1170,7 @@ class ChatMemberUpdated(TelegramObject):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1228,11 +1228,11 @@ class ChatMemberUpdated(TelegramObject):
|
|||
voice: Union[InputFile, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -34,7 +34,7 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
"""Title"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -67,7 +67,7 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
audio_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
performer: Optional[str] = None,
|
||||
audio_duration: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -32,7 +32,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
|
|||
"""A valid file identifier for the audio file"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -60,7 +60,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
|
|||
id: str,
|
||||
audio_file_id: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -36,7 +36,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
|
|||
"""*Optional*. Short description of the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -66,7 +66,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
|
|||
document_file_id: str,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -33,7 +33,7 @@ class InlineQueryResultCachedGif(InlineQueryResult):
|
|||
"""*Optional*. Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -62,7 +62,7 @@ class InlineQueryResultCachedGif(InlineQueryResult):
|
|||
gif_file_id: str,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -33,7 +33,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
|||
"""*Optional*. Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -62,7 +62,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
|||
mpeg4_file_id: str,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -35,7 +35,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
|
|||
"""*Optional*. Short description of the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -65,7 +65,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
|
|||
title: Optional[str] = None,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -35,7 +35,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
|
|||
"""*Optional*. Short description of the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -65,7 +65,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
|
|||
title: str,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -34,7 +34,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
|
|||
"""Voice message title"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -63,7 +63,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
|
|||
voice_file_id: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -36,7 +36,7 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|||
"""MIME type of the content of the file, either 'application/pdf' or 'application/zip'"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -74,7 +74,7 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|||
document_url: str,
|
||||
mime_type: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
description: Optional[str] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
|
@ -43,7 +44,7 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
"""*Optional*. Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -77,7 +78,7 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
thumbnail_mime_type: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -43,7 +43,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
"""*Optional*. Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -77,7 +77,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
thumbnail_mime_type: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -41,7 +41,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
"""*Optional*. Short description of the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -74,7 +74,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
title: Optional[str] = None,
|
||||
description: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
input_message_content: Optional[
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -39,7 +39,7 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
"""Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -78,7 +78,7 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
thumbnail_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
video_width: Optional[int] = None,
|
||||
video_height: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InlineQueryResultType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .inline_query_result import InlineQueryResult
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -34,7 +34,7 @@ class InlineQueryResultVoice(InlineQueryResult):
|
|||
"""Recording title"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the voice message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -65,7 +65,7 @@ class InlineQueryResultVoice(InlineQueryResult):
|
|||
voice_url: str,
|
||||
title: str,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
voice_duration: Optional[int] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .input_media import InputMedia
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -26,7 +26,7 @@ class InputMediaAnimation(InputMedia):
|
|||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the animation caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -50,7 +50,7 @@ class InputMediaAnimation(InputMedia):
|
|||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .input_media import InputMedia
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -26,7 +26,7 @@ class InputMediaAudio(InputMedia):
|
|||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the audio caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -48,7 +48,7 @@ class InputMediaAudio(InputMedia):
|
|||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .input_media import InputMedia
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -26,7 +26,7 @@ class InputMediaDocument(InputMedia):
|
|||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the document caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -44,7 +44,7 @@ class InputMediaDocument(InputMedia):
|
|||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .input_media import InputMedia
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -24,7 +24,7 @@ class InputMediaPhoto(InputMedia):
|
|||
"""File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the photo caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -41,7 +41,7 @@ class InputMediaPhoto(InputMedia):
|
|||
type: Literal[InputMediaType.PHOTO] = InputMediaType.PHOTO,
|
||||
media: Union[str, InputFile],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Literal, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import InputMediaType
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .input_media import InputMedia
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -26,7 +26,7 @@ class InputMediaVideo(InputMedia):
|
|||
"""*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. :ref:`More information on Sending Files » <sending-files>`"""
|
||||
caption: Optional[str] = None
|
||||
"""*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the video caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*"""
|
||||
|
|
@ -52,7 +52,7 @@ class InputMediaVideo(InputMedia):
|
|||
media: Union[str, InputFile],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
width: Optional[int] = None,
|
||||
height: Optional[int] = None,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from .base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PARSE_MODE
|
||||
from ..client.default import Default
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -21,14 +21,14 @@ class InputTextMessageContent(InputMessageContent):
|
|||
|
||||
message_text: str
|
||||
"""Text of the message to be sent, 1-4096 characters"""
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. List of special entities that appear in message text, which can be specified instead of *parse_mode*"""
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None
|
||||
"""*Optional*. Link preview generation options for the message"""
|
||||
disable_web_page_preview: Optional[bool] = Field(
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True}
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Field(
|
||||
Default("disable_web_page_preview"), json_schema_extra={"deprecated": True}
|
||||
)
|
||||
"""*Optional*. Disables link previews for links in the sent message
|
||||
|
||||
|
|
@ -43,10 +43,12 @@ class InputTextMessageContent(InputMessageContent):
|
|||
__pydantic__self__,
|
||||
*,
|
||||
message_text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"disable_web_page_preview"
|
||||
),
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from typing import TYPE_CHECKING, Any, Optional
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
from ..client.default import Default
|
||||
from .base import TelegramObject
|
||||
|
||||
|
||||
|
|
@ -10,15 +11,15 @@ class LinkPreviewOptions(TelegramObject):
|
|||
Source: https://core.telegram.org/bots/api#linkpreviewoptions
|
||||
"""
|
||||
|
||||
is_disabled: Optional[bool] = None
|
||||
is_disabled: Optional[Union[bool, Default]] = Default("link_preview_is_disabled")
|
||||
"""*Optional*. :code:`True`, if the link preview is disabled"""
|
||||
url: Optional[str] = None
|
||||
"""*Optional*. URL to use for the link preview. If empty, then the first URL found in the message text will be used"""
|
||||
prefer_small_media: Optional[bool] = None
|
||||
prefer_small_media: Optional[Union[bool, Default]] = Default("link_preview_prefer_small_media")
|
||||
"""*Optional*. :code:`True`, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview"""
|
||||
prefer_large_media: Optional[bool] = None
|
||||
prefer_large_media: Optional[Union[bool, Default]] = Default("link_preview_prefer_large_media")
|
||||
"""*Optional*. :code:`True`, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview"""
|
||||
show_above_text: Optional[bool] = None
|
||||
show_above_text: Optional[Union[bool, Default]] = Default("link_preview_show_above_text")
|
||||
"""*Optional*. :code:`True`, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text"""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -28,11 +29,17 @@ class LinkPreviewOptions(TelegramObject):
|
|||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
is_disabled: Optional[bool] = None,
|
||||
is_disabled: Optional[Union[bool, Default]] = Default("link_preview_is_disabled"),
|
||||
url: Optional[str] = None,
|
||||
prefer_small_media: Optional[bool] = None,
|
||||
prefer_large_media: Optional[bool] = None,
|
||||
show_above_text: Optional[bool] = None,
|
||||
prefer_small_media: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_prefer_small_media"
|
||||
),
|
||||
prefer_large_media: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_prefer_large_media"
|
||||
),
|
||||
show_above_text: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_show_above_text"
|
||||
),
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
|
|
|
|||
|
|
@ -11,12 +11,8 @@ from aiogram.utils.text_decorations import (
|
|||
markdown_decoration,
|
||||
)
|
||||
|
||||
from ..client.default import Default
|
||||
from ..enums import ContentType
|
||||
from .base import (
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
UNSET_PARSE_MODE,
|
||||
UNSET_PROTECT_CONTENT,
|
||||
)
|
||||
from .custom import DateTime
|
||||
from .maybe_inaccessible_message import MaybeInaccessibleMessage
|
||||
|
||||
|
|
@ -629,11 +625,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -707,11 +703,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -782,14 +778,14 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
audio: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -858,14 +854,14 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
audio: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
performer: Optional[str] = None,
|
||||
title: Optional[str] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -938,7 +934,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1001,7 +997,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1063,11 +1059,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
document: Union[InputFile, str],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1132,11 +1128,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
document: Union[InputFile, str],
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1201,7 +1197,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
game_short_name: str,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1253,7 +1249,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
game_short_name: str,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1326,7 +1322,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1438,7 +1434,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
|
|
@ -1536,7 +1532,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1605,7 +1601,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1670,7 +1666,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
|
|
@ -1719,7 +1715,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
|
|
@ -1768,17 +1764,21 @@ class Message(MaybeInaccessibleMessage):
|
|||
def reply(
|
||||
self,
|
||||
text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
"""
|
||||
|
|
@ -1834,17 +1834,21 @@ class Message(MaybeInaccessibleMessage):
|
|||
def answer(
|
||||
self,
|
||||
text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
link_preview_options: Optional[Union[LinkPreviewOptions, Default]] = Default(
|
||||
"link_preview"
|
||||
),
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMessage:
|
||||
|
|
@ -1902,11 +1906,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
photo: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1968,11 +1972,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
photo: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2040,13 +2044,13 @@ class Message(MaybeInaccessibleMessage):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2127,13 +2131,13 @@ class Message(MaybeInaccessibleMessage):
|
|||
allows_multiple_answers: Optional[bool] = None,
|
||||
correct_option_id: Optional[int] = None,
|
||||
explanation: Optional[str] = None,
|
||||
explanation_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
explanation_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
explanation_entities: Optional[List[MessageEntity]] = None,
|
||||
open_period: Optional[int] = None,
|
||||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2210,7 +2214,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2264,7 +2268,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2320,7 +2324,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
sticker: Union[InputFile, str],
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2377,7 +2381,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
sticker: Union[InputFile, str],
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2441,7 +2445,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2516,7 +2520,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2589,12 +2593,12 @@ class Message(MaybeInaccessibleMessage):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2670,12 +2674,12 @@ class Message(MaybeInaccessibleMessage):
|
|||
height: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2751,7 +2755,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2814,7 +2818,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[InputFile] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2875,11 +2879,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
voice: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2941,11 +2945,11 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
voice: Union[InputFile, str],
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -3187,10 +3191,10 @@ class Message(MaybeInaccessibleMessage):
|
|||
chat_id: Union[int, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
reply_parameters: Optional[ReplyParameters] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -3253,11 +3257,13 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
text: str,
|
||||
inline_message_id: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
link_preview_options: Optional[LinkPreviewOptions] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_web_page_preview: Optional[Union[bool, Default]] = Default(
|
||||
"link_preview_is_disabled"
|
||||
),
|
||||
**kwargs: Any,
|
||||
) -> EditMessageText:
|
||||
"""
|
||||
|
|
@ -3307,7 +3313,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
chat_id: Union[int, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
|
||||
**kwargs: Any,
|
||||
) -> ForwardMessage:
|
||||
"""
|
||||
|
|
@ -3563,7 +3569,7 @@ class Message(MaybeInaccessibleMessage):
|
|||
self,
|
||||
inline_message_id: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
||||
|
||||
from .base import UNSET_PARSE_MODE, TelegramObject
|
||||
from ..client.default import Default
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .message_entity import MessageEntity
|
||||
|
|
@ -19,11 +20,13 @@ class ReplyParameters(TelegramObject):
|
|||
"""Identifier of the message that will be replied to in the current chat, or in the chat *chat_id* if it is specified"""
|
||||
chat_id: Optional[Union[int, str]] = None
|
||||
"""*Optional*. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format :code:`@channelusername`)"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
allow_sending_without_reply: Optional[Union[bool, Default]] = Default(
|
||||
"allow_sending_without_reply"
|
||||
)
|
||||
"""*Optional*. Pass :code:`True` if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic."""
|
||||
quote: Optional[str] = None
|
||||
"""*Optional*. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including *bold*, *italic*, *underline*, *strikethrough*, *spoiler*, and *custom_emoji* entities. The message will fail to send if the quote isn't found in the original message."""
|
||||
quote_parse_mode: Optional[str] = UNSET_PARSE_MODE
|
||||
quote_parse_mode: Optional[Union[str, Default]] = Default("parse_mode")
|
||||
"""*Optional*. Mode for parsing entities in the quote. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details."""
|
||||
quote_entities: Optional[List[MessageEntity]] = None
|
||||
"""*Optional*. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of *quote_parse_mode*."""
|
||||
|
|
@ -39,9 +42,11 @@ class ReplyParameters(TelegramObject):
|
|||
*,
|
||||
message_id: int,
|
||||
chat_id: Optional[Union[int, str]] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
allow_sending_without_reply: Optional[Union[bool, Default]] = Default(
|
||||
"allow_sending_without_reply"
|
||||
),
|
||||
quote: Optional[str] = None,
|
||||
quote_parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
quote_parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||
quote_entities: Optional[List[MessageEntity]] = None,
|
||||
quote_position: Optional[int] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue