diff --git a/docs/substitutions/global.rst b/docs/substitutions/global.rst index 37edc74a446..4a75fc25ace 100644 --- a/docs/substitutions/global.rst +++ b/docs/substitutions/global.rst @@ -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. diff --git a/telegram/_bot.py b/telegram/_bot.py index ebc7817b9d2..d79d1e08800 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -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, @@ -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. @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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. @@ -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( diff --git a/telegram/_callbackquery.py b/telegram/_callbackquery.py index af89c784b10..4adf0e03ac1 100644 --- a/telegram/_callbackquery.py +++ b/telegram/_callbackquery.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/telegram/_message.py b/telegram/_message.py index b0605cd094d..b60ad1ce55a 100644 --- a/telegram/_message.py +++ b/telegram/_message.py @@ -3578,7 +3578,10 @@ async def edit_text( """Shortcut for:: await bot.edit_message_text( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_text`. @@ -3588,6 +3591,9 @@ async def edit_text( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise ``True`` is returned. @@ -3608,6 +3614,7 @@ async def edit_text( api_kwargs=api_kwargs, entities=entities, inline_message_id=None, + business_connection_id=self.business_connection_id, ) async def edit_caption( @@ -3627,7 +3634,10 @@ async def edit_caption( """Shortcut for:: await bot.edit_message_caption( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see @@ -3638,6 +3648,9 @@ async def edit_caption( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise ``True`` is returned. @@ -3657,6 +3670,7 @@ async def edit_caption( caption_entities=caption_entities, inline_message_id=None, show_caption_above_media=show_caption_above_media, + business_connection_id=self.business_connection_id, ) async def edit_media( @@ -3673,7 +3687,10 @@ async def edit_media( """Shortcut for:: await bot.edit_message_media( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see @@ -3684,6 +3701,9 @@ async def edit_media( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is not an inline message, the edited Message is returned, otherwise ``True`` is returned. @@ -3700,6 +3720,7 @@ async def edit_media( pool_timeout=pool_timeout, api_kwargs=api_kwargs, inline_message_id=None, + business_connection_id=self.business_connection_id, ) async def edit_reply_markup( @@ -3715,7 +3736,10 @@ async def edit_reply_markup( """Shortcut for:: await bot.edit_message_reply_markup( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see @@ -3726,6 +3750,9 @@ async def edit_reply_markup( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise ``True`` is returned. @@ -3740,6 +3767,7 @@ async def edit_reply_markup( pool_timeout=pool_timeout, api_kwargs=api_kwargs, inline_message_id=None, + business_connection_id=self.business_connection_id, ) async def edit_live_location( @@ -3762,7 +3790,10 @@ async def edit_live_location( """Shortcut for:: await bot.edit_message_live_location( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see @@ -3773,6 +3804,9 @@ async def edit_live_location( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. @@ -3794,6 +3828,7 @@ async def edit_live_location( proximity_alert_radius=proximity_alert_radius, live_period=live_period, inline_message_id=None, + business_connection_id=self.business_connection_id, ) async def stop_live_location( @@ -3809,7 +3844,10 @@ async def stop_live_location( """Shortcut for:: await bot.stop_message_live_location( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see @@ -3820,6 +3858,9 @@ async def stop_live_location( of methods) or channel posts, if the bot is an admin in that channel. However, this behaviour is undocumented and might be changed by Telegram. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. @@ -3834,6 +3875,7 @@ async def stop_live_location( pool_timeout=pool_timeout, api_kwargs=api_kwargs, inline_message_id=None, + business_connection_id=self.business_connection_id, ) async def set_game_score( @@ -3964,11 +4006,17 @@ async def stop_poll( """Shortcut for:: await bot.stop_poll( - chat_id=message.chat_id, message_id=message.message_id, *args, **kwargs + chat_id=message.chat_id, + message_id=message.message_id, + business_connection_id=message.business_connection_id, + *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.stop_poll`. + .. versionchanged:: NEXT.VERSION + Now also passes :attr:`business_connection_id`. + Returns: :class:`telegram.Poll`: On success, the stopped Poll with the final results is returned. @@ -3983,6 +4031,7 @@ async def stop_poll( connect_timeout=connect_timeout, pool_timeout=pool_timeout, api_kwargs=api_kwargs, + business_connection_id=self.business_connection_id, ) async def pin( diff --git a/telegram/ext/_extbot.py b/telegram/ext/_extbot.py index 917e9d8ef97..67139a96379 100644 --- a/telegram/ext/_extbot.py +++ b/telegram/ext/_extbot.py @@ -767,6 +767,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, @@ -780,6 +781,7 @@ async def stop_poll( chat_id=chat_id, message_id=message_id, reply_markup=self._replace_keyboard(reply_markup), + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, @@ -1511,6 +1513,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, @@ -1527,6 +1530,7 @@ async def edit_message_caption( reply_markup=reply_markup, 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, @@ -1547,6 +1551,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, @@ -1568,6 +1573,7 @@ async def edit_message_live_location( proximity_alert_radius=proximity_alert_radius, live_period=live_period, location=location, + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, @@ -1582,6 +1588,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, @@ -1596,6 +1603,7 @@ async def edit_message_media( message_id=message_id, inline_message_id=inline_message_id, reply_markup=reply_markup, + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, @@ -1609,6 +1617,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, @@ -1622,6 +1631,7 @@ async def edit_message_reply_markup( message_id=message_id, inline_message_id=inline_message_id, reply_markup=reply_markup, + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, @@ -1639,6 +1649,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, @@ -1657,6 +1668,7 @@ async def edit_message_text( disable_web_page_preview=disable_web_page_preview, reply_markup=reply_markup, entities=entities, + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, @@ -3633,6 +3645,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, @@ -3646,6 +3659,7 @@ async def stop_message_live_location( message_id=message_id, inline_message_id=inline_message_id, reply_markup=reply_markup, + business_connection_id=business_connection_id, read_timeout=read_timeout, write_timeout=write_timeout, connect_timeout=connect_timeout, diff --git a/tests/test_bot.py b/tests/test_bot.py index d22ea96db2e..08c5d4ea0fe 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -2171,14 +2171,17 @@ async def make_assertion(url, request_data: RequestData, *args, **kwargs): async def test_business_connection_id_argument(self, bot, monkeypatch): """We can't connect to a business acc, so we just test that the correct data is passed. - We also can't test every single method easily, so we just test one. Our linting will catch - any unused args with the others.""" + We also can't test every single method easily, so we just test a few. Our linting will + catch any unused args with the others.""" async def make_assertion(url, request_data: RequestData, *args, **kwargs): - return request_data.parameters.get("business_connection_id") == 42 + assert request_data.parameters.get("business_connection_id") == 42 + return {} monkeypatch.setattr(bot.request, "post", make_assertion) - assert await bot.send_message(2, "text", business_connection_id=42) + + await bot.send_message(2, "text", business_connection_id=42) + await bot.stop_poll(chat_id=1, message_id=2, business_connection_id=42) async def test_message_effect_id_argument(self, bot, monkeypatch): """We can't test every single method easily, so we just test one. Our linting will catch diff --git a/tests/test_callbackquery.py b/tests/test_callbackquery.py index 66dc6856924..5e41b5993cf 100644 --- a/tests/test_callbackquery.py +++ b/tests/test_callbackquery.py @@ -68,8 +68,8 @@ class TestCallbackQueryWithoutRequest(TestCallbackQueryBase): @staticmethod def skip_params(callback_query: CallbackQuery): if callback_query.inline_message_id: - return {"message_id", "chat_id"} - return {"inline_message_id"} + return {"message_id", "chat_id", "business_connection_id"} + return {"inline_message_id", "business_connection_id"} @staticmethod def shortcut_kwargs(callback_query: CallbackQuery): @@ -178,7 +178,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.edit_message_text, Bot.edit_message_text, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -210,7 +210,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.edit_message_caption, Bot.edit_message_caption, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -242,7 +242,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.edit_message_reply_markup, Bot.edit_message_reply_markup, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -274,7 +274,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.edit_message_media, Bot.edit_message_media, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -308,7 +308,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.edit_message_live_location, Bot.edit_message_live_location, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -340,7 +340,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( CallbackQuery.stop_message_live_location, Bot.stop_message_live_location, - ["inline_message_id", "message_id", "chat_id"], + ["inline_message_id", "message_id", "chat_id", "business_connection_id"], [], ) assert await check_shortcut_call( diff --git a/tests/test_message.py b/tests/test_message.py index 075d7089d3a..8bfc632769d 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -2347,7 +2347,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.edit_text, Bot.edit_message_text, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2355,7 +2355,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "edit_message_text", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.edit_text, message.get_bot()) @@ -2372,7 +2372,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.edit_caption, Bot.edit_message_caption, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2380,7 +2380,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "edit_message_caption", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.edit_caption, message.get_bot()) @@ -2397,7 +2397,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.edit_media, Bot.edit_message_media, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2405,7 +2405,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "edit_message_media", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.edit_media, message.get_bot()) @@ -2422,7 +2422,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.edit_reply_markup, Bot.edit_message_reply_markup, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2430,7 +2430,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "edit_message_reply_markup", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.edit_reply_markup, message.get_bot()) @@ -2449,7 +2449,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.edit_live_location, Bot.edit_message_live_location, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2457,7 +2457,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "edit_message_live_location", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.edit_live_location, message.get_bot()) @@ -2473,7 +2473,7 @@ async def make_assertion(*_, **kwargs): assert check_shortcut_signature( Message.stop_live_location, Bot.stop_message_live_location, - ["chat_id", "message_id", "inline_message_id"], + ["chat_id", "message_id", "inline_message_id", "business_connection_id"], [], ) assert await check_shortcut_call( @@ -2481,7 +2481,7 @@ async def make_assertion(*_, **kwargs): message.get_bot(), "stop_message_live_location", skip_params=["inline_message_id"], - shortcut_kwargs=["message_id", "chat_id"], + shortcut_kwargs=["message_id", "chat_id", "business_connection_id"], ) assert await check_defaults_handling(message.stop_live_location, message.get_bot()) @@ -2561,9 +2561,17 @@ async def make_assertion(*_, **kwargs): return chat_id and message_id assert check_shortcut_signature( - Message.stop_poll, Bot.stop_poll, ["chat_id", "message_id"], [] + Message.stop_poll, + Bot.stop_poll, + ["chat_id", "message_id", "business_connection_id"], + [], + ) + assert await check_shortcut_call( + message.stop_poll, + message.get_bot(), + "stop_poll", + shortcut_kwargs=["business_connection_id"], ) - assert await check_shortcut_call(message.stop_poll, message.get_bot(), "stop_poll") assert await check_defaults_handling(message.stop_poll, message.get_bot()) monkeypatch.setattr(message.get_bot(), "stop_poll", make_assertion)
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: