Thanks to visit codestin.com
Credit goes to github.com

Skip to content

API 7.5 business_connection_id Parameters #4315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/substitutions/global.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@

.. |business_id_str| replace:: Unique identifier of the business connection on behalf of which the message will be sent.

.. |business_id_str_edit| replace:: Unique identifier of the business connection on behalf of which the message to be edited was sent

.. |message_effect_id| replace:: Unique identifier of the message effect to be added to the message; for private chats only.

.. |show_cap_above_med| replace:: :obj:`True`, if the caption must be shown above the message media.
Expand Down
35 changes: 35 additions & 0 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,7 @@ async def edit_message_live_location(
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
live_period: Optional[int] = None,
business_connection_id: Optional[str] = None,
*,
location: Optional[Location] = None,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -2849,6 +2850,9 @@ async def edit_message_live_location(
remains unchanged

.. versionadded:: 21.2.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Keyword Args:
location (:class:`telegram.Location`, optional): The location to send.
Expand Down Expand Up @@ -2888,6 +2892,7 @@ async def edit_message_live_location(
"editMessageLiveLocation",
data,
reply_markup=reply_markup,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand All @@ -2901,6 +2906,7 @@ async def stop_message_live_location(
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
reply_markup: Optional["InlineKeyboardMarkup"] = None,
business_connection_id: Optional[str] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand All @@ -2920,6 +2926,9 @@ async def stop_message_live_location(
:paramref:`message_id` are not specified. Identifier of the inline message.
reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for a new
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand All @@ -2935,6 +2944,7 @@ async def stop_message_live_location(
"stopMessageLiveLocation",
data,
reply_markup=reply_markup,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand Down Expand Up @@ -3945,6 +3955,7 @@ async def edit_message_text(
reply_markup: Optional["InlineKeyboardMarkup"] = None,
entities: Optional[Sequence["MessageEntity"]] = None,
link_preview_options: ODVInput["LinkPreviewOptions"] = DEFAULT_NONE,
business_connection_id: Optional[str] = None,
*,
disable_web_page_preview: Optional[bool] = None,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -3988,6 +3999,9 @@ async def edit_message_text(

reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for an
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Keyword Args:
disable_web_page_preview (:obj:`bool`, optional): Disables link previews for links in
Expand Down Expand Up @@ -4029,6 +4043,7 @@ async def edit_message_text(
reply_markup=reply_markup,
parse_mode=parse_mode,
link_preview_options=link_preview_options,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand All @@ -4046,6 +4061,7 @@ async def edit_message_caption(
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Optional[Sequence["MessageEntity"]] = None,
show_caption_above_media: Optional[bool] = None,
business_connection_id: Optional[str] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -4080,6 +4096,9 @@ async def edit_message_caption(
show_caption_above_media (:obj:`bool`, optional): Pass |show_cap_above_med|

.. versionadded:: 21.3
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand All @@ -4103,6 +4122,7 @@ async def edit_message_caption(
caption=caption,
parse_mode=parse_mode,
caption_entities=caption_entities,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand All @@ -4117,6 +4137,7 @@ async def edit_message_media(
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
reply_markup: Optional["InlineKeyboardMarkup"] = None,
business_connection_id: Optional[str] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -4147,6 +4168,9 @@ async def edit_message_media(
specified. Identifier of the inline message.
reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for an
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand All @@ -4166,6 +4190,7 @@ async def edit_message_media(
"editMessageMedia",
data,
reply_markup=reply_markup,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand All @@ -4179,6 +4204,7 @@ async def edit_message_reply_markup(
message_id: Optional[int] = None,
inline_message_id: Optional[str] = None,
reply_markup: Optional["InlineKeyboardMarkup"] = None,
business_connection_id: Optional[str] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand All @@ -4202,6 +4228,9 @@ async def edit_message_reply_markup(
specified. Identifier of the inline message.
reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for an
inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Returns:
:class:`telegram.Message`: On success, if edited message is not an inline message, the
Expand All @@ -4221,6 +4250,7 @@ async def edit_message_reply_markup(
"editMessageReplyMarkup",
data,
reply_markup=reply_markup,
business_connection_id=business_connection_id,
read_timeout=read_timeout,
write_timeout=write_timeout,
connect_timeout=connect_timeout,
Expand Down Expand Up @@ -7119,6 +7149,7 @@ async def stop_poll(
chat_id: Union[int, str],
message_id: int,
reply_markup: Optional["InlineKeyboardMarkup"] = None,
business_connection_id: Optional[str] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand All @@ -7134,6 +7165,9 @@ async def stop_poll(
message_id (:obj:`int`): Identifier of the original message with the poll.
reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for a new
message inline keyboard.
business_connection_id (:obj:`str`, optional): |business_id_str_edit|

.. versionadded:: NEXT.VERSION

Returns:
:class:`telegram.Poll`: On success, the stopped Poll is returned.
Expand All @@ -7146,6 +7180,7 @@ async def stop_poll(
"chat_id": chat_id,
"message_id": message_id,
"reply_markup": reply_markup,
"business_connection_id": business_connection_id,
}

result = await self._post(
Expand Down
12 changes: 12 additions & 0 deletions telegram/_callbackquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ async def edit_message_text(
entities=entities,
chat_id=None,
message_id=None,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().edit_text(
text=text,
Expand Down Expand Up @@ -328,6 +330,8 @@ async def edit_message_caption(
chat_id=None,
message_id=None,
show_caption_above_media=show_caption_above_media,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().edit_caption(
caption=caption,
Expand Down Expand Up @@ -388,6 +392,8 @@ async def edit_message_reply_markup(
api_kwargs=api_kwargs,
chat_id=None,
message_id=None,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().edit_reply_markup(
reply_markup=reply_markup,
Expand Down Expand Up @@ -445,6 +451,8 @@ async def edit_message_media(
api_kwargs=api_kwargs,
chat_id=None,
message_id=None,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().edit_media(
media=media,
Expand Down Expand Up @@ -516,6 +524,8 @@ async def edit_message_live_location(
live_period=live_period,
chat_id=None,
message_id=None,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().edit_live_location(
latitude=latitude,
Expand Down Expand Up @@ -579,6 +589,8 @@ async def stop_message_live_location(
api_kwargs=api_kwargs,
chat_id=None,
message_id=None,
# inline messages can not be sent on behalf of a bcid
business_connection_id=None,
)
return await self._get_message().stop_live_location(
reply_markup=reply_markup,
Expand Down
Loading
Loading