mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added business_connection_id to the Message API methods shortcuts (#1586)
* Add business_connection_id to message API methods Integrated the business_connection_id attribute into various message manipulation methods, ensuring consistent data handling. This update eliminates the need to pass the business_connection_id as a parameter, instead directly accessing it from the instance attributes. * Added changelog
This commit is contained in:
parent
592267dd99
commit
a2af73ad78
3 changed files with 29 additions and 27 deletions
|
|
@ -223,6 +223,7 @@ edit_text:
|
||||||
fill: &message-target
|
fill: &message-target
|
||||||
chat_id: self.chat.id
|
chat_id: self.chat.id
|
||||||
message_id: self.message_id
|
message_id: self.message_id
|
||||||
|
business_connection_id: self.business_connection_id
|
||||||
|
|
||||||
edit_media:
|
edit_media:
|
||||||
method: editMessageMedia
|
method: editMessageMedia
|
||||||
|
|
|
||||||
6
CHANGES/1586.misc.rst
Normal file
6
CHANGES/1586.misc.rst
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
Added business_connection_id to the :class:`aiogram.types.message.Message` API methods shortcuts.
|
||||||
|
|
||||||
|
Integrated the :code:`business_connection_id` attribute into various message manipulation methods,
|
||||||
|
ensuring consistent data handling. This update eliminates the need to pass the
|
||||||
|
:code:`business_connection_id` as a parameter,
|
||||||
|
instead directly accessing it from the instance attributes.
|
||||||
|
|
@ -3625,7 +3625,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
def edit_text(
|
def edit_text(
|
||||||
self,
|
self,
|
||||||
text: str,
|
text: str,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||||
entities: Optional[list[MessageEntity]] = None,
|
entities: Optional[list[MessageEntity]] = None,
|
||||||
|
|
@ -3644,13 +3643,13 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to edit text and `game <https://core.telegram.org/bots/api#games>`_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
Use this method to edit text and `game <https://core.telegram.org/bots/api#games>`_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#editmessagetext
|
Source: https://core.telegram.org/bots/api#editmessagetext
|
||||||
|
|
||||||
:param text: New text of the message, 1-4096 characters after entities parsing
|
:param text: New text of the message, 1-4096 characters after entities parsing
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the message text. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
|
:param entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of *parse_mode*
|
||||||
|
|
@ -3671,8 +3670,8 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageText(
|
return EditMessageText(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
text=text,
|
text=text,
|
||||||
business_connection_id=business_connection_id,
|
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
parse_mode=parse_mode,
|
parse_mode=parse_mode,
|
||||||
entities=entities,
|
entities=entities,
|
||||||
|
|
@ -3735,7 +3734,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
InputMediaPhoto,
|
InputMediaPhoto,
|
||||||
InputMediaVideo,
|
InputMediaVideo,
|
||||||
],
|
],
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
|
|
@ -3746,13 +3744,13 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#editmessagemedia
|
Source: https://core.telegram.org/bots/api#editmessagemedia
|
||||||
|
|
||||||
:param media: A JSON-serialized object for a new media content of the message
|
:param media: A JSON-serialized object for a new media content of the message
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||||
:return: instance of method :class:`aiogram.methods.edit_message_media.EditMessageMedia`
|
:return: instance of method :class:`aiogram.methods.edit_message_media.EditMessageMedia`
|
||||||
|
|
@ -3769,8 +3767,8 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageMedia(
|
return EditMessageMedia(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
media=media,
|
media=media,
|
||||||
business_connection_id=business_connection_id,
|
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
reply_markup=reply_markup,
|
reply_markup=reply_markup,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|
@ -3778,7 +3776,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
def edit_reply_markup(
|
def edit_reply_markup(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
|
|
@ -3789,12 +3786,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
|
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
:param reply_markup: A JSON-serialized object for an `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||||
:return: instance of method :class:`aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup`
|
:return: instance of method :class:`aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup`
|
||||||
|
|
@ -3811,7 +3808,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageReplyMarkup(
|
return EditMessageReplyMarkup(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=self.business_connection_id,
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
reply_markup=reply_markup,
|
reply_markup=reply_markup,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|
@ -3819,7 +3816,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
def delete_reply_markup(
|
def delete_reply_markup(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> EditMessageReplyMarkup:
|
) -> EditMessageReplyMarkup:
|
||||||
|
|
@ -3829,13 +3825,13 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
- :code:`reply_markup`
|
- :code:`reply_markup`
|
||||||
|
|
||||||
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
|
Source: https://core.telegram.org/bots/api#editmessagereplymarkup
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:return: instance of method :class:`aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup`
|
:return: instance of method :class:`aiogram.methods.edit_message_reply_markup.EditMessageReplyMarkup`
|
||||||
"""
|
"""
|
||||||
|
|
@ -3851,8 +3847,8 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageReplyMarkup(
|
return EditMessageReplyMarkup(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
reply_markup=None,
|
reply_markup=None,
|
||||||
business_connection_id=business_connection_id,
|
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
).as_(self._bot)
|
).as_(self._bot)
|
||||||
|
|
@ -3861,7 +3857,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
self,
|
self,
|
||||||
latitude: float,
|
latitude: float,
|
||||||
longitude: float,
|
longitude: float,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
live_period: Optional[int] = None,
|
live_period: Optional[int] = None,
|
||||||
horizontal_accuracy: Optional[float] = None,
|
horizontal_accuracy: Optional[float] = None,
|
||||||
|
|
@ -3876,6 +3871,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
|
Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
|
||||||
|
|
||||||
|
|
@ -3883,7 +3879,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
:param latitude: Latitude of new location
|
:param latitude: Latitude of new location
|
||||||
:param longitude: Longitude of new location
|
:param longitude: Longitude of new location
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param live_period: New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged
|
:param live_period: New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current *live_period* by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then *live_period* remains unchanged
|
||||||
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
|
:param horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
|
||||||
|
|
@ -3904,9 +3899,9 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageLiveLocation(
|
return EditMessageLiveLocation(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude,
|
longitude=longitude,
|
||||||
business_connection_id=business_connection_id,
|
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
live_period=live_period,
|
live_period=live_period,
|
||||||
horizontal_accuracy=horizontal_accuracy,
|
horizontal_accuracy=horizontal_accuracy,
|
||||||
|
|
@ -3918,7 +3913,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
def stop_live_location(
|
def stop_live_location(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
reply_markup: Optional[InlineKeyboardMarkup] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
|
|
@ -3929,12 +3923,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to stop updating a live location message before *live_period* expires. On success, if the message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
|
Use this method to stop updating a live location message before *live_period* expires. On success, if the message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#stopmessagelivelocation
|
Source: https://core.telegram.org/bots/api#stopmessagelivelocation
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
:param reply_markup: A JSON-serialized object for a new `inline keyboard <https://core.telegram.org/bots/features#inline-keyboards>`_.
|
||||||
:return: instance of method :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`
|
:return: instance of method :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`
|
||||||
|
|
@ -3951,7 +3945,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return StopMessageLiveLocation(
|
return StopMessageLiveLocation(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=self.business_connection_id,
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
reply_markup=reply_markup,
|
reply_markup=reply_markup,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|
@ -3959,7 +3953,6 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
def edit_caption(
|
def edit_caption(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
inline_message_id: Optional[str] = None,
|
inline_message_id: Optional[str] = None,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
parse_mode: Optional[Union[str, Default]] = Default("parse_mode"),
|
||||||
|
|
@ -3976,12 +3969,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#editmessagecaption
|
Source: https://core.telegram.org/bots/api#editmessagecaption
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message to be edited was sent
|
|
||||||
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
:param inline_message_id: Required if *chat_id* and *message_id* are not specified. Identifier of the inline message
|
||||||
:param caption: New caption of the message, 0-1024 characters after entities parsing
|
:param caption: New caption of the message, 0-1024 characters after entities parsing
|
||||||
:param parse_mode: Mode for parsing entities in the message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
:param parse_mode: Mode for parsing entities in the message caption. See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_ for more details.
|
||||||
|
|
@ -4002,7 +3995,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return EditMessageCaption(
|
return EditMessageCaption(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=self.business_connection_id,
|
||||||
inline_message_id=inline_message_id,
|
inline_message_id=inline_message_id,
|
||||||
caption=caption,
|
caption=caption,
|
||||||
parse_mode=parse_mode,
|
parse_mode=parse_mode,
|
||||||
|
|
@ -4022,6 +4015,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to delete a message, including service messages, with the following limitations:
|
Use this method to delete a message, including service messages, with the following limitations:
|
||||||
|
|
||||||
|
|
@ -4059,12 +4053,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return DeleteMessage(
|
return DeleteMessage(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
).as_(self._bot)
|
).as_(self._bot)
|
||||||
|
|
||||||
def pin(
|
def pin(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
disable_notification: Optional[bool] = None,
|
disable_notification: Optional[bool] = None,
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> PinChatMessage:
|
) -> PinChatMessage:
|
||||||
|
|
@ -4074,12 +4068,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#pinchatmessage
|
Source: https://core.telegram.org/bots/api#pinchatmessage
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be pinned
|
|
||||||
:param disable_notification: 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.
|
:param disable_notification: 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.
|
||||||
:return: instance of method :class:`aiogram.methods.pin_chat_message.PinChatMessage`
|
:return: instance of method :class:`aiogram.methods.pin_chat_message.PinChatMessage`
|
||||||
"""
|
"""
|
||||||
|
|
@ -4095,14 +4089,13 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return PinChatMessage(
|
return PinChatMessage(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=self.business_connection_id,
|
||||||
disable_notification=disable_notification,
|
disable_notification=disable_notification,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
).as_(self._bot)
|
).as_(self._bot)
|
||||||
|
|
||||||
def unpin(
|
def unpin(
|
||||||
self,
|
self,
|
||||||
business_connection_id: Optional[str] = None,
|
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> UnpinChatMessage:
|
) -> UnpinChatMessage:
|
||||||
"""
|
"""
|
||||||
|
|
@ -4111,12 +4104,12 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns :code:`True` on success.
|
||||||
|
|
||||||
Source: https://core.telegram.org/bots/api#unpinchatmessage
|
Source: https://core.telegram.org/bots/api#unpinchatmessage
|
||||||
|
|
||||||
:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be unpinned
|
|
||||||
:return: instance of method :class:`aiogram.methods.unpin_chat_message.UnpinChatMessage`
|
:return: instance of method :class:`aiogram.methods.unpin_chat_message.UnpinChatMessage`
|
||||||
"""
|
"""
|
||||||
# DO NOT EDIT MANUALLY!!!
|
# DO NOT EDIT MANUALLY!!!
|
||||||
|
|
@ -4131,7 +4124,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return UnpinChatMessage(
|
return UnpinChatMessage(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=self.business_connection_id,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
).as_(self._bot)
|
).as_(self._bot)
|
||||||
|
|
||||||
|
|
@ -4178,6 +4171,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
|
|
||||||
- :code:`chat_id`
|
- :code:`chat_id`
|
||||||
- :code:`message_id`
|
- :code:`message_id`
|
||||||
|
- :code:`business_connection_id`
|
||||||
|
|
||||||
Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.
|
Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns :code:`True` on success.
|
||||||
|
|
||||||
|
|
@ -4199,6 +4193,7 @@ class Message(MaybeInaccessibleMessage):
|
||||||
return SetMessageReaction(
|
return SetMessageReaction(
|
||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
message_id=self.message_id,
|
message_id=self.message_id,
|
||||||
|
business_connection_id=self.business_connection_id,
|
||||||
reaction=reaction,
|
reaction=reaction,
|
||||||
is_big=is_big,
|
is_big=is_big,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue