mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added support of Bot API 6.2 (#975)
* Added support of Bot API 6.2 * Added changelog * Update tests * Update API version * Update dependencies, pre-commit config * Added pytest config
This commit is contained in:
parent
4315ecf1a2
commit
c1341ba2df
78 changed files with 523 additions and 785 deletions
|
|
@ -34,6 +34,7 @@ from .get_chat_member import GetChatMember
|
|||
from .get_chat_member_count import GetChatMemberCount
|
||||
from .get_chat_members_count import GetChatMembersCount
|
||||
from .get_chat_menu_button import GetChatMenuButton
|
||||
from .get_custom_emoji_stickers import GetCustomEmojiStickers
|
||||
from .get_file import GetFile
|
||||
from .get_game_high_scores import GetGameHighScores
|
||||
from .get_me import GetMe
|
||||
|
|
@ -168,6 +169,7 @@ __all__ = (
|
|||
"DeleteMessage",
|
||||
"SendSticker",
|
||||
"GetStickerSet",
|
||||
"GetCustomEmojiStickers",
|
||||
"UploadStickerFile",
|
||||
"CreateNewStickerSet",
|
||||
"AddStickerToSet",
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class AnswerInlineQuery(TelegramMethod[bool]):
|
|||
cache_time: Optional[int] = None
|
||||
"""The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300."""
|
||||
is_personal: Optional[bool] = None
|
||||
"""Pass :code:`True`, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query"""
|
||||
"""Pass :code:`True` if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query"""
|
||||
next_offset: Optional[str] = None
|
||||
"""Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes."""
|
||||
switch_pm_text: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ class AnswerShippingQuery(TelegramMethod[bool]):
|
|||
shipping_query_id: str
|
||||
"""Unique identifier for the query to be answered"""
|
||||
ok: bool
|
||||
"""Specify :code:`True` if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)"""
|
||||
"""Pass :code:`True` if delivery to the specified address is possible and :code:`False` if there are any problems (for example, if delivery to the specified address is not possible)"""
|
||||
shipping_options: Optional[List[ShippingOption]] = None
|
||||
"""Required if *ok* is :code:`True`. A JSON-serialized array of available shipping options."""
|
||||
error_message: Optional[str] = None
|
||||
"""Required if *ok* is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user."""
|
||||
"""Required if *ok* is :code:`False`. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class CopyMessage(TelegramMethod[MessageId]):
|
||||
"""
|
||||
Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.
|
||||
Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz :class:`aiogram.methods.poll.Poll` can be copied only if the value of the field *correct_option_id* is known to the bot. The method is analogous to the method :class:`aiogram.methods.forward_message.ForwardMessage`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#copymessage
|
||||
"""
|
||||
|
|
@ -45,7 +45,7 @@ class CopyMessage(TelegramMethod[MessageId]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -45,19 +45,19 @@ class CreateInvoiceLink(TelegramMethod[str]):
|
|||
photo_height: Optional[int] = None
|
||||
"""Photo height"""
|
||||
need_name: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's full name to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's full name to complete the order"""
|
||||
need_phone_number: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's phone number to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's phone number to complete the order"""
|
||||
need_email: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's email address to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's email address to complete the order"""
|
||||
need_shipping_address: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's shipping address to complete the order"""
|
||||
send_phone_number_to_provider: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the user's phone number should be sent to the provider"""
|
||||
"""Pass :code:`True` if the user's phone number should be sent to the provider"""
|
||||
send_email_to_provider: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the user's email address should be sent to the provider"""
|
||||
"""Pass :code:`True` if the user's email address should be sent to the provider"""
|
||||
is_flexible: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the final price depends on the shipping method"""
|
||||
"""Pass :code:`True` if the final price depends on the shipping method"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ class CreateNewStickerSet(TelegramMethod[bool]):
|
|||
"""**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_`https://core.telegram.org/stickers#animated-sticker-requirements <https://core.telegram.org/stickers#animated-sticker-requirements>`_ for technical requirements"""
|
||||
webm_sticker: Optional[InputFile] = None
|
||||
"""**WEBM** video with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_`https://core.telegram.org/stickers#video-sticker-requirements <https://core.telegram.org/stickers#video-sticker-requirements>`_ for technical requirements"""
|
||||
contains_masks: Optional[bool] = None
|
||||
"""Pass :code:`True`, if a set of mask stickers should be created"""
|
||||
sticker_type: Optional[str] = None
|
||||
"""Type of stickers in the set, pass 'regular' or 'mask'. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created."""
|
||||
mask_position: Optional[MaskPosition] = None
|
||||
"""A JSON-serialized object for position where the mask should be placed on faces"""
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class GetChatAdministrators(
|
|||
]
|
||||
):
|
||||
"""
|
||||
Use this method to get a list of administrators in a chat. On success, returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
|
||||
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getchatadministrators
|
||||
"""
|
||||
|
|
|
|||
27
aiogram/methods/get_custom_emoji_stickers.py
Normal file
27
aiogram/methods/get_custom_emoji_stickers.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, List
|
||||
|
||||
from ..types import Sticker
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
|
||||
|
||||
class GetCustomEmojiStickers(TelegramMethod[List[Sticker]]):
|
||||
"""
|
||||
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of :class:`aiogram.types.sticker.Sticker` objects.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getcustomemojistickers
|
||||
"""
|
||||
|
||||
__returning__ = List[Sticker]
|
||||
|
||||
custom_emoji_ids: List[str]
|
||||
"""List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="getCustomEmojiStickers", data=data)
|
||||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class GetGameHighScores(TelegramMethod[List[GameHighScore]]):
|
||||
"""
|
||||
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
||||
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of :class:`aiogram.types.game_high_score.GameHighScore` objects.
|
||||
|
||||
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class GetMyCommands(TelegramMethod[List[BotCommand]]):
|
||||
"""
|
||||
Use this method to get the current list of the bot's commands for the given scope and user language. Returns Array of :class:`aiogram.types.bot_command.BotCommand` on success. If commands aren't set, an empty list is returned.
|
||||
Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of :class:`aiogram.types.bot_command.BotCommand` objects. If commands aren't set, an empty list is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#getmycommands
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
|
||||
class GetUpdates(TelegramMethod[List[Update]]):
|
||||
"""
|
||||
Use this method to receive incoming updates using long polling (`wiki <https://en.wikipedia.org/wiki/Push_technology#Long_polling>`_). An Array of :class:`aiogram.types.update.Update` objects is returned.
|
||||
Use this method to receive incoming updates using long polling (`wiki <https://en.wikipedia.org/wiki/Push_technology#Long_polling>`_). Returns an Array of :class:`aiogram.types.update.Update` objects.
|
||||
|
||||
**Notes**
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class PinChatMessage(TelegramMethod[bool]):
|
|||
message_id: int
|
||||
"""Identifier of a message to pin"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Pass :code:`True`, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats."""
|
||||
"""Pass :code:`True` if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats."""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -22,27 +22,27 @@ class PromoteChatMember(TelegramMethod[bool]):
|
|||
user_id: int
|
||||
"""Unique identifier of the target user"""
|
||||
is_anonymous: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator's presence in the chat is hidden"""
|
||||
"""Pass :code:`True` if the administrator's presence in the chat is hidden"""
|
||||
can_manage_chat: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"""
|
||||
"""Pass :code:`True` if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"""
|
||||
can_post_messages: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can create channel posts, channels only"""
|
||||
"""Pass :code:`True` if the administrator can create channel posts, channels only"""
|
||||
can_edit_messages: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can edit messages of other users and can pin messages, channels only"""
|
||||
"""Pass :code:`True` if the administrator can edit messages of other users and can pin messages, channels only"""
|
||||
can_delete_messages: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can delete messages of other users"""
|
||||
"""Pass :code:`True` if the administrator can delete messages of other users"""
|
||||
can_manage_video_chats: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can manage video chats"""
|
||||
"""Pass :code:`True` if the administrator can manage video chats"""
|
||||
can_restrict_members: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can restrict, ban or unban chat members"""
|
||||
"""Pass :code:`True` if the administrator can restrict, ban or unban chat members"""
|
||||
can_promote_members: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)"""
|
||||
"""Pass :code:`True` if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)"""
|
||||
can_change_info: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can change chat title, photo and other settings"""
|
||||
"""Pass :code:`True` if the administrator can change chat title, photo and other settings"""
|
||||
can_invite_users: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can invite new users to the chat"""
|
||||
"""Pass :code:`True` if the administrator can invite new users to the chat"""
|
||||
can_pin_messages: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the administrator can pin messages, supergroups only"""
|
||||
"""Pass :code:`True` if the administrator can pin messages, supergroups only"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class SendContact(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SendDice(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class SendDocument(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class SendGame(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game."""
|
||||
|
||||
|
|
|
|||
|
|
@ -49,19 +49,19 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
photo_height: Optional[int] = None
|
||||
"""Photo height"""
|
||||
need_name: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's full name to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's full name to complete the order"""
|
||||
need_phone_number: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's phone number to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's phone number to complete the order"""
|
||||
need_email: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's email address to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's email address to complete the order"""
|
||||
need_shipping_address: Optional[bool] = None
|
||||
"""Pass :code:`True`, if you require the user's shipping address to complete the order"""
|
||||
"""Pass :code:`True` if you require the user's shipping address to complete the order"""
|
||||
send_phone_number_to_provider: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the user's phone number should be sent to provider"""
|
||||
"""Pass :code:`True` if the user's phone number should be sent to provider"""
|
||||
send_email_to_provider: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the user's email address should be sent to provider"""
|
||||
"""Pass :code:`True` if the user's email address should be sent to provider"""
|
||||
is_flexible: Optional[bool] = None
|
||||
"""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
|
||||
"""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
|
||||
|
|
@ -69,7 +69,7 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating>`_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button."""
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class SendLocation(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the messages are a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class SendMessage(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None
|
||||
"""Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*."""
|
||||
is_closed: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the poll needs to be immediately closed. This can be useful for poll preview."""
|
||||
"""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
|
||||
|
|
@ -60,7 +60,7 @@ class SendPoll(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class SendSticker(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class SendVenue(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
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*"""
|
||||
supports_streaming: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the uploaded video is suitable for streaming"""
|
||||
"""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
|
||||
|
|
@ -54,7 +54,7 @@ class SendVideo(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class SendVoice(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
allow_sending_without_reply: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found"""
|
||||
"""Pass :code:`True` if the message should be sent even if the specified replied-to message is not found"""
|
||||
reply_markup: Optional[
|
||||
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]
|
||||
] = None
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ class SetGameScore(TelegramMethod[Union[Message, bool]]):
|
|||
score: int
|
||||
"""New score, must be non-negative"""
|
||||
force: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters"""
|
||||
"""Pass :code:`True` if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters"""
|
||||
disable_edit_message: Optional[bool] = None
|
||||
"""Pass :code:`True`, if the game message should not be automatically edited to include the current scoreboard"""
|
||||
"""Pass :code:`True` if the game message should not be automatically edited to include the current scoreboard"""
|
||||
chat_id: Optional[int] = None
|
||||
"""Required if *inline_message_id* is not specified. Unique identifier for the target chat"""
|
||||
message_id: Optional[int] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue