mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added more default values
This commit is contained in:
parent
25ed5b9e38
commit
3bca050b8a
49 changed files with 194 additions and 100 deletions
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
disable_web_page_preview:
|
||||
value: UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
|
|
|
|||
3
.butcher/methods/forwardMessage/replace.yml
Normal file
3
.butcher/methods/forwardMessage/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
3
.butcher/methods/sendContact/replace.yml
Normal file
3
.butcher/methods/sendContact/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
3
.butcher/methods/sendDice/replace.yml
Normal file
3
.butcher/methods/sendDice/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
3
.butcher/methods/sendGame/replace.yml
Normal file
3
.butcher/methods/sendGame/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
3
.butcher/methods/sendInvoice/replace.yml
Normal file
3
.butcher/methods/sendInvoice/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
3
.butcher/methods/sendLocation/replace.yml
Normal file
3
.butcher/methods/sendLocation/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
3
.butcher/methods/sendMediaGroup/replace.yml
Normal file
3
.butcher/methods/sendMediaGroup/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
disable_web_page_preview:
|
||||
value: UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
annotations:
|
||||
explanation_parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
close_date:
|
||||
parsed_type:
|
||||
type: union
|
||||
|
|
|
|||
3
.butcher/methods/sendSticker/replace.yml
Normal file
3
.butcher/methods/sendSticker/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
3
.butcher/methods/sendVenue/replace.yml
Normal file
3
.butcher/methods/sendVenue/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
3
.butcher/methods/sendVideoNote/replace.yml
Normal file
3
.butcher/methods/sendVideoNote/replace.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
annotations:
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
protect_content:
|
||||
value: UNSET_PROTECT_CONTENT
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@ bases:
|
|||
annotations:
|
||||
parse_mode:
|
||||
value: UNSET_PARSE_MODE
|
||||
disable_web_page_preview:
|
||||
value: UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ from ..types import (
|
|||
UserProfilePhotos,
|
||||
WebhookInfo,
|
||||
)
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
|
||||
from .session.aiohttp import AiohttpSession
|
||||
from .session.base import BaseSession
|
||||
|
||||
|
|
@ -198,6 +199,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
token: str,
|
||||
session: Optional[BaseSession] = None,
|
||||
parse_mode: Optional[str] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Bot class
|
||||
|
|
@ -207,6 +210,10 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
If not specified it will be automatically created.
|
||||
:param parse_mode: Default parse mode.
|
||||
If specified it will be propagated into the API methods at runtime.
|
||||
:param disable_web_page_preview: Default disable_web_page_preview mode.
|
||||
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.
|
||||
:raise TokenValidationError: When token has invalid format this exception will be raised
|
||||
"""
|
||||
|
||||
|
|
@ -217,6 +224,8 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
|
||||
self.session = session
|
||||
self.parse_mode = parse_mode
|
||||
self.disable_web_page_preview = disable_web_page_preview
|
||||
self.protect_content = protect_content
|
||||
self.__token = token
|
||||
self._me: Optional[User] = None
|
||||
|
||||
|
|
@ -707,7 +716,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1333,7 +1342,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
inline_message_id: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> Union[Message, bool]:
|
||||
|
|
@ -1395,7 +1404,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_id: int,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
request_timeout: Optional[int] = None,
|
||||
) -> Message:
|
||||
"""
|
||||
|
|
@ -1999,7 +2008,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2065,7 +2074,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
title: Optional[str] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2156,7 +2165,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2205,7 +2214,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2253,7 +2262,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2306,7 +2315,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
game_short_name: str,
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
@ -2367,7 +2376,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
@ -2453,7 +2462,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2506,7 +2515,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
request_timeout: Optional[int] = None,
|
||||
|
|
@ -2545,9 +2554,9 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2600,7 +2609,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2662,7 +2671,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2728,7 +2737,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
message_thread_id: Optional[int] = None,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2780,7 +2789,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2846,7 +2855,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2910,7 +2919,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2963,7 +2972,7 @@ class Bot(ContextInstanceMixin["Bot"]):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ 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 ..telegram import PRODUCTION, TelegramAPIServer
|
||||
from .middlewares.manager import RequestMiddlewareManager
|
||||
|
||||
|
|
@ -179,7 +180,17 @@ class BaseSession(abc.ABC):
|
|||
if isinstance(value, str):
|
||||
return value
|
||||
if value is UNSET_PARSE_MODE:
|
||||
return bot.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, InputFile):
|
||||
key = secrets.token_urlsafe(10)
|
||||
files[key] = value
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
Dict,
|
||||
Generator,
|
||||
Generic,
|
||||
Optional,
|
||||
TypeVar,
|
||||
)
|
||||
from typing import TYPE_CHECKING, Any, Dict, Generator, Generic, Optional, TypeVar
|
||||
|
||||
from pydantic import BaseConfig, BaseModel, Extra, root_validator
|
||||
from pydantic.generics import GenericModel
|
||||
|
||||
from ..types import UNSET_PARSE_MODE, InputFile, ResponseParameters
|
||||
from ..types import InputFile, ResponseParameters
|
||||
from ..types.base import UNSET_TYPE
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
|
@ -59,7 +52,7 @@ class TelegramMethod(ABC, BaseModel, Generic[TelegramType]):
|
|||
but UNSET might be passing to a model initialization from `Bot.method_name`,
|
||||
so we must take care of it and remove it before fields validation.
|
||||
"""
|
||||
return {k: v for k, v in values.items() if v is not UNSET_PARSE_MODE}
|
||||
return {k: v for k, v in values.items() if not isinstance(v, UNSET_TYPE)}
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -40,7 +41,7 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
"""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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING, List, Optional, Union
|
||||
|
||||
from ..types import UNSET_PARSE_MODE, InlineKeyboardMarkup, Message, MessageEntity
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
"""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*"""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
"""Disables link previews for links in this message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_."""
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING, Optional, Union
|
||||
|
||||
from ..types import Message
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -26,5 +27,5 @@ 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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the forwarded message from forwarding and saving"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -49,7 +50,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -48,7 +49,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -36,7 +37,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -30,7 +31,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -43,7 +44,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
from ..types import InlineKeyboardMarkup, Message
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -24,7 +25,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING, List, Optional, Union
|
||||
|
||||
from ..types import InlineKeyboardMarkup, LabeledPrice, Message
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -64,7 +65,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -40,7 +41,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from ..types import (
|
|||
InputMediaVideo,
|
||||
Message,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -30,7 +31,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent messages from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the messages are a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -34,11 +35,11 @@ class SendMessage(TelegramMethod[Message]):
|
|||
"""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*"""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
"""Disables link previews for links in this 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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -41,7 +42,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -55,7 +56,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -33,7 +34,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -44,7 +45,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -51,7 +52,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -37,7 +38,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from ..types import (
|
|||
ReplyKeyboardMarkup,
|
||||
ReplyKeyboardRemove,
|
||||
)
|
||||
from ..types.base import UNSET_PROTECT_CONTENT
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
|
|
@ -41,7 +42,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] = None
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
|
||||
"""Protects the contents of the sent message from forwarding and saving"""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ class MutableTelegramObject(TelegramObject):
|
|||
allow_mutation = True
|
||||
|
||||
|
||||
# special sentinel object which used in sutuation when None might be a useful value
|
||||
UNSET: Any = sentinel.UNSET
|
||||
# special sentinel object which used in situation when None might be a useful value
|
||||
UNSET_PARSE_MODE: Any = sentinel.UNSET_PARSE_MODE
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW = sentinel.UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
UNSET_PROTECT_CONTENT = sentinel.UNSET_PROTECT_CONTENT
|
||||
UNSET_TYPE = type(sentinel.DEFAULT)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
from .base import UNSET_PARSE_MODE
|
||||
from .base import UNSET_DISABLE_WEB_PAGE_PREVIEW, UNSET_PARSE_MODE
|
||||
from .input_message_content import InputMessageContent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -22,5 +22,5 @@ class InputTextMessageContent(InputMessageContent):
|
|||
"""*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*"""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW
|
||||
"""*Optional*. Disables link previews for links in the sent message"""
|
||||
|
|
|
|||
|
|
@ -12,7 +12,12 @@ from aiogram.utils.text_decorations import (
|
|||
)
|
||||
|
||||
from ..enums import ContentType
|
||||
from .base import UNSET_PARSE_MODE, TelegramObject
|
||||
from .base import (
|
||||
UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
UNSET_PARSE_MODE,
|
||||
UNSET_PROTECT_CONTENT,
|
||||
TelegramObject,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..methods import (
|
||||
|
|
@ -354,7 +359,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -425,7 +430,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -496,7 +501,7 @@ class Message(TelegramObject):
|
|||
title: Optional[str] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -565,7 +570,7 @@ class Message(TelegramObject):
|
|||
title: Optional[str] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -631,7 +636,7 @@ class Message(TelegramObject):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -687,7 +692,7 @@ class Message(TelegramObject):
|
|||
last_name: Optional[str] = None,
|
||||
vcard: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -746,7 +751,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -808,7 +813,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_content_type_detection: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -866,7 +871,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
game_short_name: str,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
|
|
@ -911,7 +916,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
game_short_name: str,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
@ -977,7 +982,7 @@ class Message(TelegramObject):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
|
|
@ -1082,7 +1087,7 @@ class Message(TelegramObject):
|
|||
send_email_to_provider: Optional[bool] = None,
|
||||
is_flexible: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
|
|
@ -1173,7 +1178,7 @@ class Message(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1235,7 +1240,7 @@ class Message(TelegramObject):
|
|||
heading: Optional[int] = None,
|
||||
proximity_alert_radius: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1293,7 +1298,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
) -> SendMediaGroup:
|
||||
|
|
@ -1335,7 +1340,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]],
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
**kwargs: Any,
|
||||
|
|
@ -1379,9 +1384,9 @@ class Message(TelegramObject):
|
|||
text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1435,9 +1440,9 @@ class Message(TelegramObject):
|
|||
text: str,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1495,7 +1500,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1554,7 +1559,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
has_spoiler: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1621,7 +1626,7 @@ class Message(TelegramObject):
|
|||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1701,7 +1706,7 @@ class Message(TelegramObject):
|
|||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None,
|
||||
is_closed: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1771,7 +1776,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1818,7 +1823,7 @@ class Message(TelegramObject):
|
|||
self,
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1867,7 +1872,7 @@ class Message(TelegramObject):
|
|||
sticker: Union[InputFile, str],
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -1917,7 +1922,7 @@ class Message(TelegramObject):
|
|||
sticker: Union[InputFile, str],
|
||||
emoji: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -1974,7 +1979,7 @@ class Message(TelegramObject):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2042,7 +2047,7 @@ class Message(TelegramObject):
|
|||
google_place_id: Optional[str] = None,
|
||||
google_place_type: Optional[str] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2113,7 +2118,7 @@ class Message(TelegramObject):
|
|||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2187,7 +2192,7 @@ class Message(TelegramObject):
|
|||
has_spoiler: Optional[bool] = None,
|
||||
supports_streaming: Optional[bool] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2256,7 +2261,7 @@ class Message(TelegramObject):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2312,7 +2317,7 @@ class Message(TelegramObject):
|
|||
length: Optional[int] = None,
|
||||
thumbnail: Optional[Union[InputFile, str]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2370,7 +2375,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
|
|
@ -2429,7 +2434,7 @@ class Message(TelegramObject):
|
|||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
duration: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2627,7 +2632,7 @@ class Message(TelegramObject):
|
|||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
reply_to_message_id: Optional[int] = None,
|
||||
allow_sending_without_reply: Optional[bool] = None,
|
||||
reply_markup: Optional[
|
||||
|
|
@ -2685,7 +2690,7 @@ class Message(TelegramObject):
|
|||
inline_message_id: Optional[str] = None,
|
||||
parse_mode: Optional[str] = UNSET_PARSE_MODE,
|
||||
entities: Optional[List[MessageEntity]] = None,
|
||||
disable_web_page_preview: Optional[bool] = None,
|
||||
disable_web_page_preview: Optional[bool] = UNSET_DISABLE_WEB_PAGE_PREVIEW,
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||
**kwargs: Any,
|
||||
) -> EditMessageText:
|
||||
|
|
@ -2730,7 +2735,7 @@ class Message(TelegramObject):
|
|||
chat_id: Union[int, str],
|
||||
message_thread_id: Optional[int] = None,
|
||||
disable_notification: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = None,
|
||||
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
|
||||
**kwargs: Any,
|
||||
) -> ForwardMessage:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class BaseRequestHandler(ABC):
|
|||
return writer
|
||||
|
||||
async def _handle_request(self, bot: Bot, request: web.Request) -> web.Response:
|
||||
result = await self.dispatcher.feed_webhook_update(
|
||||
result: Optional[TelegramMethod[Any]] = await self.dispatcher.feed_webhook_update(
|
||||
bot,
|
||||
await request.json(loads=bot.session.json_loads),
|
||||
**self.data,
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ features = [
|
|||
"test",
|
||||
]
|
||||
extra-dependencies = [
|
||||
"butcher @ git+https://github.com/aiogram/butcher.git@v0.1.12"
|
||||
"butcher @ git+https://github.com/aiogram/butcher.git@v0.1.13"
|
||||
]
|
||||
|
||||
[tool.hatch.envs.test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue