From a46325ce7362061846dcac216f6a610c15593b62 Mon Sep 17 00:00:00 2001 From: Poolitzer Date: Thu, 7 May 2026 12:19:18 +0200 Subject: [PATCH 1/7] Fix: Improving the doc strings one dot at a time Or two rather --- src/telegram/_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/telegram/_message.py b/src/telegram/_message.py index c0d018ec406..271f816d3c0 100644 --- a/src/telegram/_message.py +++ b/src/telegram/_message.py @@ -686,7 +686,7 @@ class Message(MaybeInaccessibleMessage): .. versionadded:: 22.7 sender_tag (:obj:`str`, optional): Tag or custom title of the sender of the message; for - supergroups only + supergroups only. .. versionadded:: 22.7 @@ -1102,7 +1102,7 @@ class Message(MaybeInaccessibleMessage): .. versionadded:: 22.7 sender_tag (:obj:`str`): Optional. Tag or custom title of the sender of the message; for - supergroups only + supergroups only. .. versionadded:: 22.7 From db5d8393c0e2c092d60d5e1dd33fdbe333279c0c Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 20 May 2026 05:15:36 -0400 Subject: [PATCH 2/7] Sequence -> tuple doc fix --- src/telegram/_files/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/telegram/_files/video.py b/src/telegram/_files/video.py index d197e053cd2..eeb2fb584b8 100644 --- a/src/telegram/_files/video.py +++ b/src/telegram/_files/video.py @@ -105,7 +105,7 @@ class Video(_BaseThumbedMedium): .. deprecated:: v22.2 |time-period-int-deprecated| - qualities (Sequence[:class:`telegram.VideoQuality`]): Optional. List of available qualities + qualities (tuple[:class:`telegram.VideoQuality`]): Optional. List of available qualities of the video .. versionadded:: 22.7 From 5e78628638dead0492f4b4a5c58d816b004e9664 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 20 May 2026 05:16:25 -0400 Subject: [PATCH 3/7] Rename file without leading underscore the folder it's in is already private --- src/telegram/__init__.py | 10 +++++----- .../{_inputstorycontent.py => inputstorycontent.py} | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename src/telegram/_files/{_inputstorycontent.py => inputstorycontent.py} (100%) diff --git a/src/telegram/__init__.py b/src/telegram/__init__.py index 362f3253198..48045f4b90a 100644 --- a/src/telegram/__init__.py +++ b/src/telegram/__init__.py @@ -418,11 +418,6 @@ from ._dice import Dice from ._directmessagepricechanged import DirectMessagePriceChanged from ._directmessagestopic import DirectMessagesTopic -from ._files._inputstorycontent import ( - InputStoryContent, - InputStoryContentPhoto, - InputStoryContentVideo, -) from ._files.animation import Animation from ._files.audio import Audio from ._files.chatphoto import ChatPhoto @@ -447,6 +442,11 @@ InputProfilePhotoStatic, ) from ._files.inputsticker import InputSticker +from ._files.inputstorycontent import ( + InputStoryContent, + InputStoryContentPhoto, + InputStoryContentVideo, +) from ._files.location import Location from ._files.photosize import PhotoSize from ._files.sticker import MaskPosition, Sticker, StickerSet diff --git a/src/telegram/_files/_inputstorycontent.py b/src/telegram/_files/inputstorycontent.py similarity index 100% rename from src/telegram/_files/_inputstorycontent.py rename to src/telegram/_files/inputstorycontent.py From a4cad41b8379e109be3566c4ffc76c90261f97e0 Mon Sep 17 00:00:00 2001 From: harshil21 <37377066+harshil21@users.noreply.github.com> Date: Wed, 20 May 2026 09:18:09 +0000 Subject: [PATCH 4/7] Add chango fragment for PR #5240 --- changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml diff --git a/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml b/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml new file mode 100644 index 00000000000..3de543f6010 --- /dev/null +++ b/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml @@ -0,0 +1,5 @@ +documentation = "Documentation Improvements" +[[pull_requests]] +uid = "5240" +author_uids = ["harshil21"] +closes_threads = [] From a6b1e329af84631bec788b9e75aecfa00404b182 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 20 May 2026 05:26:51 -0400 Subject: [PATCH 5/7] Fix other imports --- src/telegram/request/_requestparameter.py | 2 +- tests/test_business_methods.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/telegram/request/_requestparameter.py b/src/telegram/request/_requestparameter.py index 26a2285324f..70024558c0f 100644 --- a/src/telegram/request/_requestparameter.py +++ b/src/telegram/request/_requestparameter.py @@ -24,11 +24,11 @@ from dataclasses import dataclass from typing import final -from telegram._files._inputstorycontent import InputStoryContent from telegram._files.inputfile import InputFile from telegram._files.inputmedia import InputMedia, InputPaidMedia from telegram._files.inputprofilephoto import InputProfilePhoto, InputProfilePhotoStatic from telegram._files.inputsticker import InputSticker +from telegram._files.inputstorycontent import InputStoryContent from telegram._telegramobject import TelegramObject from telegram._utils.datetime import to_timestamp from telegram._utils.enum import StringEnum diff --git a/tests/test_business_methods.py b/tests/test_business_methods.py index 43a666eb07e..b31a7c4c270 100644 --- a/tests/test_business_methods.py +++ b/tests/test_business_methods.py @@ -33,7 +33,7 @@ StoryAreaTypeUniqueGift, User, ) -from telegram._files._inputstorycontent import InputStoryContentVideo +from telegram._files.inputstorycontent import InputStoryContentVideo from telegram._files.sticker import Sticker from telegram._gifts import AcceptedGiftTypes, Gift from telegram._inline.inlinekeyboardbutton import InlineKeyboardButton From 5388a665ce16bdc60fbdb60d9a5932d407a44eda Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Tue, 26 May 2026 07:47:40 -0400 Subject: [PATCH 6/7] Add missing poll option to toctree --- docs/source/telegram.at-tree.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/telegram.at-tree.rst b/docs/source/telegram.at-tree.rst index 25d9c269838..842bbd5971a 100644 --- a/docs/source/telegram.at-tree.rst +++ b/docs/source/telegram.at-tree.rst @@ -154,6 +154,7 @@ Available Types telegram.photosize telegram.poll telegram.pollanswer + telegram.polloption telegram.polloptionadded telegram.polloptiondeleted telegram.preparedkeyboardbutton From 0c7053c8bdbda056e4f8e196a776ee7b0bd58a24 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Tue, 26 May 2026 08:54:48 -0400 Subject: [PATCH 7/7] Auto insert raises block, fix `Bot` kwargs insertion regression (#5241) --- .../5240.iJXyH8RNWNNQpC47SfNHzw.toml | 9 +- .../{kwargs_insertion.py => bot_insertion.py} | 14 + docs/auxil/sphinx_hooks.py | 22 +- src/telegram/_bot.py | 583 +----------------- 4 files changed, 52 insertions(+), 576 deletions(-) rename docs/auxil/{kwargs_insertion.py => bot_insertion.py} (90%) diff --git a/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml b/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml index 3de543f6010..24424c4695a 100644 --- a/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml +++ b/changes/unreleased/5240.iJXyH8RNWNNQpC47SfNHzw.toml @@ -1,5 +1,6 @@ documentation = "Documentation Improvements" -[[pull_requests]] -uid = "5240" -author_uids = ["harshil21"] -closes_threads = [] + +pull_requests = [ + { uid = "5240", author_uids = ["harshil21", "Poolitzer"] }, + { uid = "5241", author_uids = ["harshil21"] }, +] \ No newline at end of file diff --git a/docs/auxil/kwargs_insertion.py b/docs/auxil/bot_insertion.py similarity index 90% rename from docs/auxil/kwargs_insertion.py rename to docs/auxil/bot_insertion.py index b2f05f8741b..008f5413856 100644 --- a/docs/auxil/kwargs_insertion.py +++ b/docs/auxil/bot_insertion.py @@ -83,6 +83,13 @@ " ``2``.", ] +RAISES_BLOCK = [ + "Raises:", + "", + " :class:`telegram.error.TelegramError`", + "", +] + def find_insert_pos_for_kwargs(lines: list[str]) -> int: """Finds the correct position to insert the keyword arguments and returns the index.""" @@ -92,6 +99,13 @@ def find_insert_pos_for_kwargs(lines: list[str]) -> int: return False +def find_insert_pos_for_raises(lines: list[str]) -> int: + """Finds the correct position to insert the Raises block and returns the index.""" + if "Raises:" in lines: + return -1 # Don't insert if there's already a Raises block + return len(lines) # Insert at the end if there's no Raises block + + def check_timeout_and_api_kwargs_presence(obj: object) -> int: """Checks if the method has timeout and api_kwargs keyword only parameters.""" sig = inspect.signature(obj) diff --git a/docs/auxil/sphinx_hooks.py b/docs/auxil/sphinx_hooks.py index 7183a0dbaf7..1f0082369ad 100644 --- a/docs/auxil/sphinx_hooks.py +++ b/docs/auxil/sphinx_hooks.py @@ -27,9 +27,11 @@ import telegram import telegram.ext from docs.auxil.admonition_inserter import AdmonitionInserter -from docs.auxil.kwargs_insertion import ( +from docs.auxil.bot_insertion import ( + RAISES_BLOCK, check_timeout_and_api_kwargs_presence, find_insert_pos_for_kwargs, + find_insert_pos_for_raises, get_updates_read_timeout_addition, keyword_args, media_write_timeout_change, @@ -84,8 +86,8 @@ def autodoc_process_docstring( app: Sphinx, what, name: str, obj: object, options, lines: list[str] ): """We do the following things: - 1) Use this method to automatically insert the Keyword Args and "Shortcuts" admonitions - for the Bot methods. + 1) Use this method to automatically insert the Keyword Args, "Shortcuts" admonitions, + and the Raises block, wherever applicable, for the Bot methods. 2) Use this method to automatically insert "Returned in" admonition into classes that are returned from the Bot methods @@ -101,13 +103,15 @@ def autodoc_process_docstring( """ # 1) Insert the Keyword Args and "Shortcuts" admonitions for the Bot methods - method_name = name.rsplit(".", maxsplit=1)[0] + method_name = name.rsplit(".", maxsplit=1)[-1] if ( name.startswith("telegram.Bot.") and what == "method" and method_name.islower() and check_timeout_and_api_kwargs_presence(obj) ): + # Logic for inserting keyword args into docstrings: + # ------------------------------------------------- insert_index = find_insert_pos_for_kwargs(lines) if not insert_index: raise ValueError( @@ -133,6 +137,16 @@ def autodoc_process_docstring( lines[insert_idx:insert_idx] = effective_insert insert_idx += len(effective_insert) + # Logic for inserting Raises: + # ------------------------------------------------- + # We will only insert the Raises block if there isn't already one. + + insert_index = find_insert_pos_for_raises(lines) + if insert_index != -1: + lines[insert_index:insert_index] = RAISES_BLOCK + + # Logic for inserting "Shortcuts" admonition: + # ------------------------------------------- ADMONITION_INSERTER.insert_admonitions( obj=typing.cast("collections.abc.Callable", obj), docstring_lines=lines, diff --git a/src/telegram/_bot.py b/src/telegram/_bot.py index d9d1f83b069..571c7390041 100644 --- a/src/telegram/_bot.py +++ b/src/telegram/_bot.py @@ -921,13 +921,24 @@ async def do_api_request( instances of this class. If not specified, the raw result of the API call will be returned. + Keyword Args: + read_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to + :paramref:`telegram.request.BaseRequest.post.read_timeout`. Defaults to + :attr:`~telegram.request.BaseRequest.DEFAULT_NONE`. + write_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to + :paramref:`telegram.request.BaseRequest.post.write_timeout`. Defaults to + :attr:`~telegram.request.BaseRequest.DEFAULT_NONE`. + connect_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to + :paramref:`telegram.request.BaseRequest.post.connect_timeout`. Defaults to + :attr:`~telegram.request.BaseRequest.DEFAULT_NONE`. + pool_timeout (:obj:`float` | :obj:`None`, optional): Value to pass to + :paramref:`telegram.request.BaseRequest.post.pool_timeout`. Defaults to + :attr:`~telegram.request.BaseRequest.DEFAULT_NONE`. + Returns: The result of the API call. If :paramref:`return_type` is not specified, this is a :obj:`dict` or :obj:`bool`, otherwise an instance of :paramref:`return_type` or a tuple of :paramref:`return_type`. - - Raises: - :class:`telegram.error.TelegramError` """ if hasattr(self, endpoint): self._warn( @@ -985,10 +996,6 @@ async def get_me( Returns: :class:`telegram.User`: A :class:`telegram.User` instance representing that bot if the credentials are valid, :obj:`None` otherwise. - - Raises: - :class:`telegram.error.TelegramError` - """ result = await self._post( "getMe", @@ -1189,10 +1196,6 @@ async def delete_message( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "message_id": message_id} return await self._post( @@ -1249,10 +1252,6 @@ async def send_message_draft( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -1299,9 +1298,6 @@ async def delete_messages( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"chat_id": chat_id, "message_ids": message_ids} return await self._post( @@ -1378,9 +1374,6 @@ async def forward_message( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -1449,9 +1442,6 @@ async def forward_messages( Returns: tuple[:class:`telegram.Message`]: On success, a tuple of ``MessageId`` of sent messages is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -1601,9 +1591,6 @@ async def send_photo( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -1776,9 +1763,6 @@ async def send_audio( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -1944,9 +1928,6 @@ async def send_document( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2082,10 +2063,6 @@ async def send_sticker( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2275,10 +2252,6 @@ async def send_video( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2447,10 +2420,6 @@ async def send_video_note( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2627,10 +2596,6 @@ async def send_animation( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2799,10 +2764,6 @@ async def send_voice( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -2952,9 +2913,6 @@ async def send_media_group( Returns: tuple[:class:`telegram.Message`]: An array of the sent Messages. - - Raises: - :class:`telegram.error.TelegramError` """ if caption and any( [ @@ -3137,10 +3095,6 @@ async def send_location( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ if not ((latitude is not None and longitude is not None) or location): raise ValueError( @@ -3464,10 +3418,6 @@ async def send_venue( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ # The venue parameter is a convenience functionality added by us, so enforcing the # mutual exclusivity here is nothing that Telegram would handle anyway @@ -3622,10 +3572,6 @@ async def send_contact( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ # The contact parameter is a convenience functionality added by us, so enforcing the # mutual exclusivity here is nothing that Telegram would handle anyway @@ -3748,10 +3694,6 @@ async def send_game( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "game_short_name": game_short_name} @@ -3808,10 +3750,6 @@ async def send_chat_action( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -3988,10 +3926,6 @@ async def answer_inline_query( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ effective_results, next_offset = self._effective_inline_results( results=results, next_offset=next_offset, current_offset=current_offset @@ -4055,9 +3989,6 @@ async def save_prepared_inline_message( Returns: :class:`telegram.PreparedInlineMessage`: On success, the prepared message is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -4105,10 +4036,6 @@ async def get_user_profile_photos( Returns: :class:`telegram.UserProfilePhotos` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"user_id": user_id, "offset": offset, "limit": limit} @@ -4171,10 +4098,6 @@ async def get_file( Returns: :class:`telegram.File` - - Raises: - :class:`telegram.error.TelegramError` - """ # Try to get the file_id from the object, if it fails, assume it's a string with contextlib.suppress(AttributeError): @@ -4237,10 +4160,6 @@ async def ban_chat_member( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -4285,10 +4204,6 @@ async def ban_chat_sender_chat( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "sender_chat_id": sender_chat_id} @@ -4329,10 +4244,6 @@ async def unban_chat_member( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id, "only_if_banned": only_if_banned} @@ -4369,10 +4280,6 @@ async def unban_chat_sender_chat( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "sender_chat_id": sender_chat_id} @@ -4432,10 +4339,6 @@ async def answer_callback_query( Returns: :obj:`bool` On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "callback_query_id": callback_query_id, @@ -4615,10 +4518,6 @@ async def edit_message_caption( Returns: :class:`telegram.Message`: On success, if edited message is not an inline message, the edited message is returned, otherwise :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -4689,9 +4588,6 @@ async def edit_message_media( Returns: :class:`telegram.Message`: On success, if edited message is not an inline message, the edited Message is returned, otherwise :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "media": media, @@ -4750,10 +4646,6 @@ async def edit_message_reply_markup( Returns: :class:`telegram.Message`: On success, if edited message is not an inline message, the edited message is returned, otherwise :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -4834,10 +4726,6 @@ async def get_updates( Returns: tuple[:class:`telegram.Update`] - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "timeout": timeout, @@ -4984,8 +4872,7 @@ async def set_webhook( Returns: :obj:`bool` On success, :obj:`True` is returned. - Raises: - :class:`telegram.error.TelegramError` + .. _`guide to Webhooks`: https://core.telegram.org/bots/webhooks @@ -5030,10 +4917,6 @@ async def delete_webhook( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data = {"drop_pending_updates": drop_pending_updates} @@ -5064,10 +4947,6 @@ async def leave_chat( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -5103,10 +4982,6 @@ async def get_chat( Returns: :class:`telegram.ChatFullInfo` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -5146,10 +5021,6 @@ async def get_chat_administrators( 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. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} result = await self._post( @@ -5182,10 +5053,6 @@ async def get_chat_member_count( Returns: :obj:`int`: Number of members in the chat. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} return await self._post( @@ -5218,10 +5085,6 @@ async def get_chat_member( Returns: :class:`telegram.ChatMember` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id} result = await self._post( @@ -5430,10 +5293,6 @@ async def get_game_high_scores( Returns: tuple[:class:`telegram.GameHighScore`] - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "user_id": user_id, @@ -5637,10 +5496,6 @@ async def send_invoice( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -5724,10 +5579,6 @@ async def answer_shipping_query( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "shipping_query_id": shipping_query_id, @@ -5781,10 +5632,6 @@ async def answer_pre_checkout_query( Returns: :obj:`bool`: On success, :obj:`True` is returned - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "pre_checkout_query_id": pre_checkout_query_id, @@ -5826,10 +5673,6 @@ async def answer_web_app_query( Returns: :class:`telegram.SentWebAppMessage`: On success, a sent :class:`telegram.SentWebAppMessage` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "web_app_query_id": web_app_query_id, @@ -5897,9 +5740,6 @@ async def restrict_chat_member( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -6021,10 +5861,6 @@ async def promote_chat_member( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -6096,10 +5932,6 @@ async def set_chat_permissions( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -6141,10 +5973,6 @@ async def set_chat_administrator_custom_title( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id, "custom_title": custom_title} @@ -6185,10 +6013,6 @@ async def export_chat_invite_link( Returns: :obj:`str`: New invite link on success. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} return await self._post( @@ -6251,10 +6075,6 @@ async def create_chat_invite_link( Returns: :class:`telegram.ChatInviteLink` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -6328,10 +6148,6 @@ async def edit_chat_invite_link( Returns: :class:`telegram.ChatInviteLink` - - Raises: - :class:`telegram.error.TelegramError` - """ link = invite_link.invite_link if isinstance(invite_link, ChatInviteLink) else invite_link data: JSONDict = { @@ -6382,10 +6198,6 @@ async def revoke_chat_invite_link( Returns: :class:`telegram.ChatInviteLink` - - Raises: - :class:`telegram.error.TelegramError` - """ link = invite_link.invite_link if isinstance(invite_link, ChatInviteLink) else invite_link data: JSONDict = {"chat_id": chat_id, "invite_link": link} @@ -6426,9 +6238,6 @@ async def approve_chat_join_request( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id} @@ -6466,9 +6275,6 @@ async def decline_chat_join_request( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id} @@ -6512,10 +6318,6 @@ async def set_chat_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "photo": self._parse_file_input(photo)} return await self._post( @@ -6548,10 +6350,6 @@ async def delete_chat_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} return await self._post( @@ -6588,10 +6386,6 @@ async def set_chat_title( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "title": title} return await self._post( @@ -6628,10 +6422,6 @@ async def set_chat_description( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "description": description} @@ -6675,10 +6465,6 @@ async def set_user_emoji_status( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "user_id": user_id, @@ -6728,10 +6514,6 @@ async def pin_chat_message( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -6781,10 +6563,6 @@ async def unpin_chat_message( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -6824,10 +6602,6 @@ async def unpin_all_chat_messages( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} return await self._post( @@ -6857,10 +6631,6 @@ async def get_sticker_set( Returns: :class:`telegram.StickerSet` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"name": name} result = await self._post( @@ -6900,10 +6670,6 @@ async def get_custom_emoji_stickers( Returns: tuple[:class:`telegram.Sticker`] - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"custom_emoji_ids": custom_emoji_ids} result = await self._post( @@ -6956,10 +6722,6 @@ async def upload_sticker_file( Returns: :class:`telegram.File`: On success, the uploaded File is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "user_id": user_id, @@ -7015,10 +6777,6 @@ async def add_sticker_to_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "user_id": user_id, @@ -7059,10 +6817,6 @@ async def set_sticker_position_in_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "sticker": sticker if isinstance(sticker, str) else sticker.file_id, @@ -7147,9 +6901,6 @@ async def create_new_sticker_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -7191,10 +6942,6 @@ async def delete_sticker_from_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"sticker": sticker if isinstance(sticker, str) else sticker.file_id} return await self._post( @@ -7227,10 +6974,6 @@ async def delete_sticker_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"name": name} return await self._post( @@ -7300,10 +7043,6 @@ async def set_sticker_set_thumbnail( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "name": name, @@ -7346,10 +7085,6 @@ async def set_sticker_set_title( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"name": name, "title": title} return await self._post( @@ -7392,9 +7127,6 @@ async def set_sticker_emoji_list( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "sticker": sticker if isinstance(sticker, str) else sticker.file_id, @@ -7440,9 +7172,6 @@ async def set_sticker_keywords( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "sticker": sticker if isinstance(sticker, str) else sticker.file_id, @@ -7487,9 +7216,6 @@ async def set_sticker_mask_position( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "sticker": sticker if isinstance(sticker, str) else sticker.file_id, @@ -7529,10 +7255,6 @@ async def set_custom_emoji_sticker_set_thumbnail( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"name": name, "custom_emoji_id": custom_emoji_id} @@ -7576,10 +7298,6 @@ async def set_passport_data_errors( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"user_id": user_id, "errors": errors} return await self._post( @@ -7793,10 +7511,6 @@ async def send_poll( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ if correct_option_id is not None: @@ -7886,10 +7600,6 @@ async def stop_poll( Returns: :class:`telegram.Poll`: On success, the stopped Poll is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -7961,10 +7671,6 @@ async def send_checklist( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -8022,10 +7728,6 @@ async def edit_message_checklist( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -8142,10 +7844,6 @@ async def send_dice( Returns: :class:`telegram.Message`: On success, the sent Message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "emoji": emoji} @@ -8194,9 +7892,6 @@ async def get_my_default_administrator_rights( Returns: :class:`telegram.ChatAdministratorRights`: On success. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"for_channels": for_channels} @@ -8292,10 +7987,6 @@ async def get_my_commands( Returns: tuple[:class:`telegram.BotCommand`]: On success, the commands set for the bot. An empty tuple is returned if commands are not set. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"scope": scope, "language_code": language_code} @@ -8357,10 +8048,6 @@ async def set_my_commands( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ cmds = [c if isinstance(c, BotCommand) else BotCommand(c[0], c[1]) for c in commands] data: JSONDict = {"commands": cmds, "scope": scope, "language_code": language_code} @@ -8406,9 +8093,6 @@ async def delete_my_commands( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"scope": scope, "language_code": language_code} @@ -8440,10 +8124,6 @@ async def log_out( Returns: :obj:`True`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ return await self._post( "logOut", @@ -8471,10 +8151,6 @@ async def close( Returns: :obj:`True`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ return await self._post( "close", @@ -8593,10 +8269,6 @@ async def copy_message( Returns: :class:`telegram.MessageId`: On success, the :class:`telegram.MessageId` of the sent message is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ if allow_sending_without_reply is not DEFAULT_NONE and reply_parameters is not None: raise ValueError( @@ -8697,10 +8369,6 @@ async def copy_messages( Returns: tuple[:class:`telegram.MessageId`]: On success, a tuple of :class:`~telegram.MessageId` of the sent messages is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -8977,10 +8645,6 @@ async def get_forum_topic_icon_stickers( Returns: tuple[:class:`telegram.Sticker`] - - Raises: - :class:`telegram.error.TelegramError` - """ result = await self._post( "getForumTopicIconStickers", @@ -9030,9 +8694,6 @@ async def create_forum_topic( Returns: :class:`telegram.ForumTopic` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -9087,10 +8748,6 @@ async def edit_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -9133,10 +8790,6 @@ async def close_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -9177,10 +8830,6 @@ async def reopen_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -9221,10 +8870,6 @@ async def delete_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -9266,10 +8911,6 @@ async def unpin_all_forum_topic_messages( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -9308,9 +8949,6 @@ async def unpin_all_general_forum_topic_messages( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"chat_id": chat_id} @@ -9350,10 +8988,6 @@ async def edit_general_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id, "name": name} @@ -9389,10 +9023,6 @@ async def close_general_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -9429,10 +9059,6 @@ async def reopen_general_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -9469,10 +9095,6 @@ async def hide_general_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -9508,10 +9130,6 @@ async def unhide_general_forum_topic( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"chat_id": chat_id} @@ -9553,10 +9171,6 @@ async def set_my_description( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"description": description, "language_code": language_code} @@ -9598,10 +9212,6 @@ async def set_my_short_description( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"short_description": short_description, "language_code": language_code} @@ -9634,10 +9244,6 @@ async def get_my_description( Returns: :class:`telegram.BotDescription`: On success, the bot description is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data = {"language_code": language_code} return BotDescription.de_json( @@ -9673,10 +9279,6 @@ async def get_my_short_description( Returns: :class:`telegram.BotShortDescription`: On success, the bot short description is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data = {"language_code": language_code} return BotShortDescription.de_json( @@ -9723,10 +9325,6 @@ async def set_my_name( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = {"name": name, "language_code": language_code} @@ -9759,10 +9357,6 @@ async def get_my_name( Returns: :class:`telegram.BotName`: On success, the bot name is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data = {"language_code": language_code} return BotName.de_json( @@ -9802,9 +9396,6 @@ async def get_user_chat_boosts( Returns: :class:`telegram.UserChatBoosts`: On success, the object containing the list of boosts is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"chat_id": chat_id, "user_id": user_id} return UserChatBoosts.de_json( @@ -9865,9 +9456,6 @@ async def set_message_reaction( Returns: :obj:`bool` On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ allowed_reactions: set[str] = set(ReactionEmoji) parsed_reaction = ( @@ -9961,9 +9549,6 @@ async def gift_premium_subscription( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -10004,9 +9589,6 @@ async def get_business_connection( Returns: :class:`telegram.BusinessConnection`: On success, the object containing the business connection information is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"business_connection_id": business_connection_id} return BusinessConnection.de_json( @@ -10087,9 +9669,6 @@ async def get_business_account_gifts( Returns: :class:`telegram.OwnedGifts` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10138,9 +9717,6 @@ async def get_business_account_star_balance( Returns: :class:`telegram.StarAmount` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"business_connection_id": business_connection_id} return StarAmount.de_json( @@ -10185,9 +9761,6 @@ async def read_business_message( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10235,9 +9808,6 @@ async def delete_business_messages( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10317,9 +9887,6 @@ async def post_story( Returns: :class:`Story` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10397,9 +9964,6 @@ async def edit_story( Returns: :class:`Story` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10445,9 +10009,6 @@ async def delete_story( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10492,9 +10053,6 @@ async def set_business_account_name( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10535,9 +10093,6 @@ async def set_business_account_username( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10577,9 +10132,6 @@ async def set_business_account_bio( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10624,9 +10176,6 @@ async def set_business_account_gift_settings( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10671,10 +10220,6 @@ async def set_business_account_profile_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10718,9 +10263,6 @@ async def remove_business_account_profile_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10761,9 +10303,6 @@ async def convert_gift_to_stars( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10816,9 +10355,6 @@ async def upgrade_gift( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10873,9 +10409,6 @@ async def transfer_gift( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10919,9 +10452,6 @@ async def transfer_business_account_stars( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -10970,9 +10500,6 @@ async def replace_sticker_in_set( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11012,10 +10539,6 @@ async def refund_star_payment( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "user_id": user_id, @@ -11056,9 +10579,6 @@ async def get_star_transactions( Returns: :class:`telegram.StarTransactions`: On success. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = {"offset": offset, "limit": limit} @@ -11104,9 +10624,6 @@ async def edit_user_star_subscription( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11210,9 +10727,6 @@ async def send_paid_media( Returns: :class:`telegram.Message`: On success, the sent message is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { @@ -11287,10 +10801,6 @@ async def create_chat_subscription_invite_link( Returns: :class:`telegram.ChatInviteLink` - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "chat_id": chat_id, @@ -11340,10 +10850,6 @@ async def edit_chat_subscription_invite_link( Returns: :class:`telegram.ChatInviteLink` - - Raises: - :class:`telegram.error.TelegramError` - """ link = invite_link.invite_link if isinstance(invite_link, ChatInviteLink) else invite_link data: JSONDict = { @@ -11380,9 +10886,6 @@ async def get_available_gifts( Returns: :class:`telegram.Gifts` - - Raises: - :class:`telegram.error.TelegramError` """ return Gifts.de_json( await self._post( @@ -11455,9 +10958,6 @@ async def send_gift( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11502,9 +11002,6 @@ async def verify_chat( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -11544,9 +11041,6 @@ async def verify_user( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11582,9 +11076,6 @@ async def remove_chat_verification( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -11619,9 +11110,6 @@ async def remove_user_verification( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11651,9 +11139,6 @@ async def get_my_star_balance( Returns: :class:`telegram.StarAmount` - - Raises: - :class:`telegram.error.TelegramError` """ return StarAmount.de_json( await self._post( @@ -11698,9 +11183,6 @@ async def approve_suggested_post( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -11745,9 +11227,6 @@ async def decline_suggested_post( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -11807,9 +11286,6 @@ async def repost_story( Returns: :class:`telegram.Story` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "business_connection_id": business_connection_id, @@ -11878,9 +11354,6 @@ async def get_user_gifts( Returns: :class:`telegram.OwnedGifts`: The owned gifts for the user. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -11961,9 +11434,6 @@ async def get_chat_gifts( Returns: :class:`telegram.OwnedGifts`: The owned gifts for the chat. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { @@ -12011,10 +11481,6 @@ async def set_my_profile_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ data: JSONDict = { "photo": photo, @@ -12045,10 +11511,6 @@ async def remove_my_profile_photo( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` - """ return await self._post( @@ -12088,9 +11550,6 @@ async def get_user_profile_audios( Returns: :class:`telegram.UserProfileAudios` - - Raises: - :class:`telegram.error.TelegramError` """ data = { @@ -12139,9 +11598,6 @@ async def set_chat_member_tag( Returns: :obj:`bool`: On success, :obj:`True` is returned. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "chat_id": chat_id, @@ -12179,9 +11635,6 @@ async def get_managed_bot_token( Returns: :obj:`str`: The token of the managed bot. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -12217,9 +11670,6 @@ async def replace_managed_bot_token( Returns: :obj:`str`: The new token of the managed bot. - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id, @@ -12261,9 +11711,6 @@ async def save_prepared_keyboard_button( Returns: :class:`telegram.PreparedKeyboardButton` - - Raises: - :class:`telegram.error.TelegramError` """ data: JSONDict = { "user_id": user_id,