Reworked defaults

This commit is contained in:
JRoot Junior 2024-01-03 00:02:41 +02:00
parent 1281bf551a
commit 47bd869bbd
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
139 changed files with 591 additions and 531 deletions

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,5 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1,2 @@
disable_web_page_preview: link_preview_is_disabled
parse_mode: parse_mode

View file

@ -1,5 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
disable_web_page_preview:
value: UNSET_DISABLE_WEB_PAGE_PREVIEW

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,8 +1,4 @@
annotations: annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT
thumbnail: thumbnail:
parsed_type: parsed_type:
type: entity type: entity

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,8 +1,4 @@
annotations: annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT
thumbnail: thumbnail:
parsed_type: parsed_type:
type: entity type: entity

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,8 +1,4 @@
annotations: annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT
thumbnail: thumbnail:
parsed_type: parsed_type:
type: entity type: entity

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,4 @@
disable_web_page_preview: link_preview_is_disabled
parse_mode: parse_mode
protect_content: protect_content
link_preview_options: link_preview

View file

@ -1,7 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
disable_web_page_preview:
value: UNSET_DISABLE_WEB_PAGE_PREVIEW
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,5 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,2 @@
explanation_parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,8 +1,4 @@
annotations: annotations:
explanation_parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT
close_date: close_date:
parsed_type: parsed_type:
type: union type: union

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,3 +0,0 @@
annotations:
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,8 +1,4 @@
annotations: annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT
thumbnail: thumbnail:
parsed_type: parsed_type:
type: entity type: entity

View file

@ -0,0 +1 @@
protect_content: protect_content

View file

@ -1,6 +1,4 @@
annotations: annotations:
protect_content:
value: UNSET_PROTECT_CONTENT
thumbnail: thumbnail:
parsed_type: parsed_type:
type: entity type: entity

View file

@ -0,0 +1,2 @@
parse_mode: parse_mode
protect_content: protect_content

View file

@ -1,5 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
protect_content:
value: UNSET_PROTECT_CONTENT

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -1,3 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -15,5 +15,3 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -15,5 +15,3 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -15,5 +15,3 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -9,5 +9,3 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1 @@
parse_mode: parse_mode

View file

@ -15,5 +15,3 @@ annotations:
references: references:
category: types category: types
name: InputFile name: InputFile
parse_mode:
value: UNSET_PARSE_MODE

View file

@ -0,0 +1,2 @@
disable_web_page_preview: disable_web_page_preview
parse_mode: parse_mode

View file

@ -1,5 +0,0 @@
annotations:
parse_mode:
value: UNSET_PARSE_MODE
disable_web_page_preview:
value: UNSET_DISABLE_WEB_PAGE_PREVIEW

View file

@ -0,0 +1,4 @@
is_disabled: link_preview_is_disabled
prefer_small_media: link_preview_prefer_small_media
prefer_large_media: link_preview_prefer_large_media
show_above_text: link_preview_show_above_text

View file

@ -0,0 +1,2 @@
quote_parse_mode: parse_mode
allow_sending_without_reply: allow_sending_without_reply

View file

@ -1,3 +0,0 @@
annotations:
quote_parse_mode:
value: UNSET_PARSE_MODE

View file

@ -3,6 +3,7 @@ from __future__ import annotations
import datetime import datetime
import io import io
import pathlib import pathlib
import warnings
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from typing import ( from typing import (
Any, Any,
@ -19,7 +20,9 @@ from typing import (
import aiofiles import aiofiles
from aiogram.utils.token import extract_bot_id, validate_token from aiogram.utils.token import extract_bot_id, validate_token
from .default import Default, DefaultBotProperties
from .session.aiohttp import AiohttpSession
from .session.base import BaseSession
from ..methods import ( from ..methods import (
AddStickerToSet, AddStickerToSet,
AnswerCallbackQuery, AnswerCallbackQuery,
@ -143,7 +146,6 @@ from ..methods import (
UploadStickerFile, UploadStickerFile,
) )
from ..types import ( from ..types import (
UNSET_PARSE_MODE,
BotCommand, BotCommand,
BotCommandScopeAllChatAdministrators, BotCommandScopeAllChatAdministrators,
BotCommandScopeAllGroupChats, BotCommandScopeAllGroupChats,
@ -233,9 +235,6 @@ from ..types import (
UserProfilePhotos, UserProfilePhotos,
WebhookInfo, WebhookInfo,
) )
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
from .session.aiohttp import AiohttpSession
from .session.base import BaseSession
T = TypeVar("T") T = TypeVar("T")
@ -248,6 +247,7 @@ class Bot:
parse_mode: Optional[str] = None, parse_mode: Optional[str] = None,
disable_web_page_preview: Optional[bool] = None, disable_web_page_preview: Optional[bool] = None,
protect_content: Optional[bool] = None, protect_content: Optional[bool] = None,
default: Optional[DefaultBotProperties] = None,
) -> None: ) -> None:
""" """
Bot class Bot class
@ -261,6 +261,8 @@ class Bot:
If specified it will be propagated into the API methods at runtime. If specified it will be propagated into the API methods at runtime.
:param protect_content: Default protect_content mode. :param protect_content: Default protect_content mode.
If specified it will be propagated into the API methods at runtime. 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 :raise TokenValidationError: When token has invalid format this exception will be raised
""" """
@ -268,11 +270,32 @@ class Bot:
if session is None: if session is None:
session = AiohttpSession() 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.session = session
self.parse_mode = parse_mode self.parse_mode = parse_mode
self.disable_web_page_preview = disable_web_page_preview self.disable_web_page_preview = disable_web_page_preview
self.protect_content = protect_content 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.__token = token
self._me: Optional[User] = None self._me: Optional[User] = None
@ -805,10 +828,10 @@ class Bot:
message_id: int, message_id: int,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -1302,7 +1325,7 @@ class Bot:
message_id: Optional[int] = None, message_id: Optional[int] = None,
inline_message_id: Optional[str] = None, inline_message_id: Optional[str] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
@ -1451,11 +1474,13 @@ class Bot:
chat_id: Optional[Union[int, str]] = None, chat_id: Optional[Union[int, str]] = None,
message_id: Optional[int] = None, message_id: Optional[int] = None,
inline_message_id: Optional[str] = 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, entities: Optional[List[MessageEntity]] = None,
link_preview_options: Optional[LinkPreviewOptions] = None, link_preview_options: Optional[LinkPreviewOptions] = None,
reply_markup: Optional[InlineKeyboardMarkup] = 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, request_timeout: Optional[int] = None,
) -> Union[Message, bool]: ) -> Union[Message, bool]:
""" """
@ -1518,7 +1543,7 @@ class Bot:
message_id: int, message_id: int,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = 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, request_timeout: Optional[int] = None,
) -> Message: ) -> Message:
""" """
@ -2137,11 +2162,11 @@ class Bot:
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
has_spoiler: Optional[bool] = None, has_spoiler: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2203,14 +2228,14 @@ class Bot:
audio: Union[InputFile, str], audio: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2304,7 +2329,7 @@ class Bot:
last_name: Optional[str] = None, last_name: Optional[str] = None,
vcard: Optional[str] = None, vcard: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2356,7 +2381,7 @@ class Bot:
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2403,11 +2428,11 @@ class Bot:
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
disable_content_type_detection: Optional[bool] = None, disable_content_type_detection: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2463,7 +2488,7 @@ class Bot:
game_short_name: str, game_short_name: str,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,
@ -2527,7 +2552,7 @@ class Bot:
send_email_to_provider: Optional[bool] = None, send_email_to_provider: Optional[bool] = None,
is_flexible: Optional[bool] = None, is_flexible: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,
@ -2616,7 +2641,7 @@ class Bot:
heading: Optional[int] = None, heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None, proximity_alert_radius: Optional[int] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2672,7 +2697,7 @@ class Bot:
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,
reply_to_message_id: Optional[int] = None, reply_to_message_id: Optional[int] = None,
@ -2712,17 +2737,21 @@ class Bot:
chat_id: Union[int, str], chat_id: Union[int, str],
text: str, text: str,
message_thread_id: Optional[int] = None, 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, 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, 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
] = None, ] = None,
allow_sending_without_reply: Optional[bool] = 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, reply_to_message_id: Optional[int] = None,
request_timeout: Optional[int] = None, request_timeout: Optional[int] = None,
) -> Message: ) -> Message:
@ -2771,11 +2800,11 @@ class Bot:
photo: Union[InputFile, str], photo: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
has_spoiler: Optional[bool] = None, has_spoiler: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2834,13 +2863,13 @@ class Bot:
allows_multiple_answers: Optional[bool] = None, allows_multiple_answers: Optional[bool] = None,
correct_option_id: Optional[int] = None, correct_option_id: Optional[int] = None,
explanation: Optional[str] = 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, explanation_entities: Optional[List[MessageEntity]] = None,
open_period: Optional[int] = None, open_period: Optional[int] = None,
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
is_closed: Optional[bool] = None, is_closed: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2909,7 +2938,7 @@ class Bot:
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -2964,7 +2993,7 @@ class Bot:
google_place_id: Optional[str] = None, google_place_id: Optional[str] = None,
google_place_type: Optional[str] = None, google_place_type: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -3028,12 +3057,12 @@ class Bot:
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
has_spoiler: Optional[bool] = None, has_spoiler: Optional[bool] = None,
supports_streaming: Optional[bool] = None, supports_streaming: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -3100,7 +3129,7 @@ class Bot:
length: Optional[int] = None, length: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
@ -3152,11 +3181,11 @@ class Bot:
voice: Union[InputFile, str], voice: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

73
aiogram/client/default.py Normal file
View file

@ -0,0 +1,73 @@
from __future__ import annotations
import sys
from dataclasses import dataclass
from typing import Any, Optional, TYPE_CHECKING, Dict
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
disable_notification: Optional[bool] = None
protect_content: Optional[bool] = None
allow_sending_without_reply: Optional[bool] = None
link_preview: Optional[LinkPreviewOptions] = None
link_preview_is_disabled: Optional[bool] = None
link_preview_prefer_small_media: Optional[bool] = None
link_preview_prefer_large_media: Optional[bool] = None
link_preview_show_above_text: Optional[bool] = None
def __post_init__(self) -> None:
if any(
(
self.link_preview_is_disabled,
self.link_preview_prefer_small_media,
self.link_preview_prefer_large_media,
self.link_preview_show_above_text,
)
):
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)

View file

@ -6,7 +6,6 @@ from typing import (
TYPE_CHECKING, TYPE_CHECKING,
Any, Any,
AsyncGenerator, AsyncGenerator,
AsyncIterator,
Dict, Dict,
Iterable, Iterable,
List, List,

View file

@ -38,8 +38,8 @@ from aiogram.exceptions import (
from ...methods import Response, TelegramMethod from ...methods import Response, TelegramMethod
from ...methods.base import TelegramType from ...methods.base import TelegramType
from ...types import UNSET_PARSE_MODE, InputFile from ...types import InputFile
from ...types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT from ..default import Default
from ..telegram import PRODUCTION, TelegramAPIServer from ..telegram import PRODUCTION, TelegramAPIServer
from .middlewares.manager import RequestMiddlewareManager from .middlewares.manager import RequestMiddlewareManager
@ -191,18 +191,9 @@ class BaseSession(abc.ABC):
return None return None
if isinstance(value, str): if isinstance(value, str):
return value return value
if value is UNSET_PARSE_MODE: if isinstance(value, Default):
return self.prepare_value( default_value = bot.default[value.name]
bot.parse_mode, bot=bot, files=files, _dumps_json=_dumps_json return self.prepare_value(default_value, 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, InputFile): if isinstance(value, InputFile):
key = secrets.token_urlsafe(10) key = secrets.token_urlsafe(10)
files[key] = value files[key] = value

View file

@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
UNSET_PARSE_MODE,
ForceReply, ForceReply,
InlineKeyboardMarkup, InlineKeyboardMarkup,
MessageEntity, MessageEntity,
@ -14,7 +14,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
caption: Optional[str] = None caption: Optional[str] = None
"""New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept""" """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.""" """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 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*""" """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 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -77,10 +76,10 @@ class CopyMessage(TelegramMethod[MessageId]):
message_id: int, message_id: int,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -2,6 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Optional, Union from typing import TYPE_CHECKING, Any, List, Optional, Union
from ..client.default import Default
from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity
from .base import TelegramMethod 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""" """Required if *chat_id* and *message_id* are not specified. Identifier of the inline message"""
caption: Optional[str] = None caption: Optional[str] = None
"""New caption of the message, 0-1024 characters after entities parsing""" """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.""" """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 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*""" """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, message_id: Optional[int] = None,
inline_message_id: Optional[str] = None, inline_message_id: Optional[str] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
**__pydantic_kwargs: Any, **__pydantic_kwargs: Any,

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
UNSET_PARSE_MODE, UNSET_PARSE_MODE,
InlineKeyboardMarkup, InlineKeyboardMarkup,
@ -11,7 +12,6 @@ from ..types import (
Message, Message,
MessageEntity, MessageEntity,
) )
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW
from .base import TelegramMethod 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""" """Required if *inline_message_id* is not specified. Identifier of the message to edit"""
inline_message_id: Optional[str] = None inline_message_id: Optional[str] = None
"""Required if *chat_id* and *message_id* are not specified. Identifier of the inline message""" """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.""" """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 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*""" """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""" """Link preview generation options for the message"""
reply_markup: Optional[InlineKeyboardMarkup] = None reply_markup: Optional[InlineKeyboardMarkup] = None
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.""" """A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
disable_web_page_preview: Optional[bool] = Field( disable_web_page_preview: Optional[Union[bool, Default]] = Field(
UNSET_DISABLE_WEB_PAGE_PREVIEW, json_schema_extra={"deprecated": True} Default("link_preview_is_disabled"), json_schema_extra={"deprecated": True}
) )
"""Disables link previews for links in this message """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, chat_id: Optional[Union[int, str]] = None,
message_id: Optional[int] = None, message_id: Optional[int] = None,
inline_message_id: Optional[str] = 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, entities: Optional[List[MessageEntity]] = None,
link_preview_options: Optional[LinkPreviewOptions] = None, link_preview_options: Optional[LinkPreviewOptions] = None,
reply_markup: Optional[InlineKeyboardMarkup] = 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, **__pydantic_kwargs: Any,
) -> None: ) -> None:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!

View file

@ -2,6 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Union from typing import TYPE_CHECKING, Any, Optional, Union
from ..client.default import Default
from ..types import Message from ..types import Message
from ..types.base import UNSET_PROTECT_CONTENT from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None 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.""" """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""" """Protects the contents of the forwarded message from forwarding and saving"""
if TYPE_CHECKING: if TYPE_CHECKING:
@ -42,7 +43,7 @@ class ForwardMessage(TelegramMethod[Message]):
message_id: int, message_id: int,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = 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, **__pydantic_kwargs: Any,
) -> None: ) -> None:
# DO NOT EDIT MANUALLY!!! # DO NOT EDIT MANUALLY!!!

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
UNSET_PARSE_MODE, UNSET_PARSE_MODE,
ForceReply, ForceReply,
@ -15,7 +16,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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>`""" """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 caption: Optional[str] = None
"""Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing""" """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.""" """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 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*""" """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""" """Pass :code:`True` if the animation needs to be covered with a spoiler animation"""
disable_notification: Optional[bool] = None 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -89,11 +89,11 @@ class SendAnimation(TelegramMethod[Message]):
height: Optional[int] = None, height: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
has_spoiler: Optional[bool] = None, has_spoiler: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
UNSET_PARSE_MODE,
ForceReply, ForceReply,
InlineKeyboardMarkup, InlineKeyboardMarkup,
InputFile, InputFile,
@ -15,7 +15,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
caption: Optional[str] = None caption: Optional[str] = None
"""Audio caption, 0-1024 characters after entities parsing""" """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.""" """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 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*""" """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>`""" """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 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -84,14 +83,14 @@ class SendAudio(TelegramMethod[Message]):
audio: Union[InputFile, str], audio: Union[InputFile, str],
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
duration: Optional[int] = None, duration: Optional[int] = None,
performer: Optional[str] = None, performer: Optional[str] = None,
title: Optional[str] = None, title: Optional[str] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
ForceReply, ForceReply,
InlineKeyboardMarkup, InlineKeyboardMarkup,
@ -12,7 +13,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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""" """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 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -75,7 +75,7 @@ class SendContact(TelegramMethod[Message]):
last_name: Optional[str] = None, last_name: Optional[str] = None,
vcard: Optional[str] = None, vcard: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
ForceReply, ForceReply,
InlineKeyboardMarkup, InlineKeyboardMarkup,
@ -12,7 +13,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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 '🎲'""" """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 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.""" """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""" """Protects the contents of the sent message from forwarding"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -66,7 +66,7 @@ class SendDice(TelegramMethod[Message]):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
emoji: Optional[str] = None, emoji: Optional[str] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import ( from ..types import (
UNSET_PARSE_MODE, UNSET_PARSE_MODE,
ForceReply, ForceReply,
@ -15,7 +16,6 @@ from ..types import (
ReplyKeyboardRemove, ReplyKeyboardRemove,
ReplyParameters, ReplyParameters,
) )
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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>`""" """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 caption: Optional[str] = None
"""Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing""" """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.""" """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 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*""" """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""" """Disables automatic server-side content type detection for files uploaded using multipart/form-data"""
disable_notification: Optional[bool] = None 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -80,11 +80,11 @@ class SendDocument(TelegramMethod[Message]):
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
thumbnail: Optional[InputFile] = None, thumbnail: Optional[InputFile] = None,
caption: 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, caption_entities: Optional[List[MessageEntity]] = None,
disable_content_type_detection: Optional[bool] = None, disable_content_type_detection: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[ reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]

View file

@ -1,11 +1,11 @@
from __future__ import annotations from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import InlineKeyboardMarkup, Message, ReplyParameters from ..types import InlineKeyboardMarkup, Message, ReplyParameters
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod 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""" """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only"""
disable_notification: Optional[bool] = None 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -57,7 +57,7 @@ class SendGame(TelegramMethod[Message]):
game_short_name: str, game_short_name: str,
message_thread_id: Optional[int] = None, message_thread_id: Optional[int] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,

View file

@ -4,8 +4,8 @@ from typing import TYPE_CHECKING, Any, List, Optional, Union
from pydantic import Field from pydantic import Field
from ..client.default import Default
from ..types import InlineKeyboardMarkup, LabeledPrice, Message, ReplyParameters from ..types import InlineKeyboardMarkup, LabeledPrice, Message, ReplyParameters
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod from .base import TelegramMethod
@ -67,7 +67,7 @@ class SendInvoice(TelegramMethod[Message]):
"""Pass :code:`True` if the final price depends on the shipping method""" """Pass :code:`True` if the final price depends on the shipping method"""
disable_notification: Optional[bool] = None 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.""" """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""" """Protects the contents of the sent message from forwarding and saving"""
reply_parameters: Optional[ReplyParameters] = None reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to""" """Description of the message to reply to"""
@ -117,7 +117,7 @@ class SendInvoice(TelegramMethod[Message]):
send_email_to_provider: Optional[bool] = None, send_email_to_provider: Optional[bool] = None,
is_flexible: Optional[bool] = None, is_flexible: Optional[bool] = None,
disable_notification: 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_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[InlineKeyboardMarkup] = None, reply_markup: Optional[InlineKeyboardMarkup] = None,
allow_sending_without_reply: Optional[bool] = None, allow_sending_without_reply: Optional[bool] = None,

Some files were not shown because too many files have changed in this diff Show more