From f50e0587255f7ad1c75b2a69c43b207ea933815a Mon Sep 17 00:00:00 2001 From: Alexey Berezin <101830798+berezzin@users.noreply.github.com> Date: Thu, 30 May 2024 20:58:51 +0300 Subject: [PATCH 1/9] Fixed bug with wrong MarkdownV2 custom emoji parsing (#1497) * fixed bug with wrong markdownv2 custom emoji parsing * added changelog of 1496 issue * Update CHANGES/1496.bugfix.rst --------- Co-authored-by: Alex Root Junior --- CHANGES/1496.bugfix.rst | 1 + aiogram/utils/text_decorations.py | 2 +- tests/test_utils/test_text_decorations.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 CHANGES/1496.bugfix.rst diff --git a/CHANGES/1496.bugfix.rst b/CHANGES/1496.bugfix.rst new file mode 100644 index 00000000..02d44dbf --- /dev/null +++ b/CHANGES/1496.bugfix.rst @@ -0,0 +1 @@ +Fixed wrong :code:`MarkdownV2` custom emoji parsing in :code:`aiogram.utils.text_decorations` diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index 58d6c0f4..ae6227d3 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -253,7 +253,7 @@ class MarkdownDecoration(TextDecoration): return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value) def custom_emoji(self, value: str, custom_emoji_id: str) -> str: - return self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}") + return f'!{self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}")}' def blockquote(self, value: str) -> str: return "\n".join(f">{line}" for line in value.splitlines()) diff --git a/tests/test_utils/test_text_decorations.py b/tests/test_utils/test_text_decorations.py index 6a177ab3..2696f078 100644 --- a/tests/test_utils/test_text_decorations.py +++ b/tests/test_utils/test_text_decorations.py @@ -99,7 +99,7 @@ class TestTextDecoration: [ markdown_decoration, MessageEntity(type="custom_emoji", offset=0, length=5, custom_emoji_id="42"), - "[test](tg://emoji?id=42)", + "![test](tg://emoji?id=42)", ], [ markdown_decoration, From b08ba78898a8c7a610cea27ea4e0937268369aa5 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Fri, 31 May 2024 20:07:11 +0300 Subject: [PATCH 2/9] Added full support of Bot API 7.4 (#1498) * Added full support of Bot API 7.4 * Added changelog --- .butcher/enums/ContentType.yml | 2 + .butcher/methods/copyMessage/default.yml | 1 + .butcher/methods/copyMessage/entity.json | 8 + .../methods/createInvoiceLink/entity.json | 68 +-- .../methods/editMessageCaption/default.yml | 1 + .../methods/editMessageCaption/entity.json | 8 + .../methods/refundStarPayment/entity.json | 33 + .butcher/methods/sendAnimation/default.yml | 1 + .butcher/methods/sendAnimation/entity.json | 16 + .butcher/methods/sendAudio/entity.json | 8 + .butcher/methods/sendContact/entity.json | 8 + .butcher/methods/sendDice/entity.json | 8 + .butcher/methods/sendDocument/entity.json | 8 + .butcher/methods/sendGame/entity.json | 8 + .butcher/methods/sendInvoice/entity.json | 76 +-- .butcher/methods/sendLocation/entity.json | 8 + .butcher/methods/sendMediaGroup/entity.json | 8 + .butcher/methods/sendMessage/entity.json | 8 + .butcher/methods/sendPhoto/default.yml | 1 + .butcher/methods/sendPhoto/entity.json | 16 + .butcher/methods/sendPoll/entity.json | 8 + .butcher/methods/sendSticker/entity.json | 8 + .butcher/methods/sendVenue/entity.json | 8 + .butcher/methods/sendVideo/default.yml | 1 + .butcher/methods/sendVideo/entity.json | 16 + .butcher/methods/sendVideoNote/entity.json | 8 + .butcher/methods/sendVoice/entity.json | 8 + .butcher/schema/schema.json | 574 ++++++++++++++---- .butcher/types/ChatFullInfo/entity.json | 6 +- .butcher/types/ChatMemberUpdated/entity.json | 6 +- .../types/InlineKeyboardButton/entity.json | 12 +- .../InlineQueryResultCachedGif/default.yml | 1 + .../InlineQueryResultCachedGif/entity.json | 8 + .../default.yml | 1 + .../entity.json | 8 + .../InlineQueryResultCachedPhoto/default.yml | 1 + .../InlineQueryResultCachedPhoto/entity.json | 8 + .../InlineQueryResultCachedVideo/default.yml | 1 + .../InlineQueryResultCachedVideo/entity.json | 8 + .../types/InlineQueryResultGif/default.yml | 1 + .../types/InlineQueryResultGif/entity.json | 8 + .../InlineQueryResultMpeg4Gif/default.yml | 1 + .../InlineQueryResultMpeg4Gif/entity.json | 8 + .../types/InlineQueryResultPhoto/default.yml | 1 + .../types/InlineQueryResultPhoto/entity.json | 8 + .../types/InlineQueryResultVideo/default.yml | 1 + .../types/InlineQueryResultVideo/entity.json | 8 + .../InputInvoiceMessageContent/entity.json | 68 +-- .../types/InputMediaAnimation/default.yml | 1 + .../types/InputMediaAnimation/entity.json | 8 + .butcher/types/InputMediaPhoto/default.yml | 1 + .butcher/types/InputMediaPhoto/entity.json | 8 + .butcher/types/InputMediaVideo/default.yml | 1 + .butcher/types/InputMediaVideo/entity.json | 8 + .butcher/types/Invoice/entity.json | 6 +- .butcher/types/KeyboardButton/entity.json | 6 +- .butcher/types/Message/entity.json | 16 + .butcher/types/MessageEntity/entity.json | 6 +- .butcher/types/PreCheckoutQuery/entity.json | 6 +- .butcher/types/SuccessfulPayment/entity.json | 6 +- .butcher/types/Update/entity.json | 6 +- CHANGES/1498.feature.rst | 1 + aiogram/client/bot.py | 152 ++++- aiogram/client/default.py | 2 + aiogram/enums/message_entity_type.py | 1 + aiogram/methods/__init__.py | 2 + aiogram/methods/copy_message.py | 6 + aiogram/methods/create_invoice_link.py | 28 +- aiogram/methods/edit_message_caption.py | 6 + aiogram/methods/refund_star_payment.py | 42 ++ aiogram/methods/send_animation.py | 10 + aiogram/methods/send_audio.py | 4 + aiogram/methods/send_contact.py | 4 + aiogram/methods/send_dice.py | 4 + aiogram/methods/send_document.py | 4 + aiogram/methods/send_game.py | 4 + aiogram/methods/send_invoice.py | 32 +- aiogram/methods/send_location.py | 4 + aiogram/methods/send_media_group.py | 4 + aiogram/methods/send_message.py | 4 + aiogram/methods/send_photo.py | 10 + aiogram/methods/send_poll.py | 4 + aiogram/methods/send_sticker.py | 4 + aiogram/methods/send_venue.py | 4 + aiogram/methods/send_video.py | 10 + aiogram/methods/send_video_note.py | 4 + aiogram/methods/send_voice.py | 4 + aiogram/types/chat_full_info.py | 2 +- aiogram/types/chat_join_request.py | 184 +++++- aiogram/types/chat_member_updated.py | 94 ++- aiogram/types/inline_keyboard_button.py | 4 +- .../types/inline_query_result_cached_gif.py | 6 + .../inline_query_result_cached_mpeg4_gif.py | 6 + .../types/inline_query_result_cached_photo.py | 6 + .../types/inline_query_result_cached_video.py | 6 + aiogram/types/inline_query_result_gif.py | 6 + .../types/inline_query_result_mpeg4_gif.py | 6 + aiogram/types/inline_query_result_photo.py | 6 + aiogram/types/inline_query_result_video.py | 6 + .../types/input_invoice_message_content.py | 28 +- aiogram/types/input_media_animation.py | 6 + aiogram/types/input_media_photo.py | 6 + aiogram/types/input_media_video.py | 6 + aiogram/types/invoice.py | 2 +- aiogram/types/keyboard_button.py | 2 +- aiogram/types/message.py | 206 ++++++- aiogram/types/message_entity.py | 2 +- aiogram/types/pre_checkout_query.py | 2 +- aiogram/types/successful_payment.py | 2 +- aiogram/types/update.py | 2 +- aiogram/utils/formatting.py | 12 + aiogram/utils/text_decorations.py | 11 + docs/api/methods/index.rst | 1 + docs/api/methods/refund_star_payment.rst | 45 ++ docs/utils/formatting.rst | 6 + .../test_methods/test_refund_star_payment.py | 16 + tests/test_utils/test_formatting.py | 10 + tests/test_utils/test_text_decorations.py | 10 + 118 files changed, 1821 insertions(+), 409 deletions(-) create mode 100644 .butcher/methods/refundStarPayment/entity.json create mode 100644 CHANGES/1498.feature.rst create mode 100644 aiogram/methods/refund_star_payment.py create mode 100644 docs/api/methods/refund_star_payment.rst create mode 100644 tests/test_api/test_methods/test_refund_star_payment.py diff --git a/.butcher/enums/ContentType.yml b/.butcher/enums/ContentType.yml index fdebf066..321d6b92 100644 --- a/.butcher/enums/ContentType.yml +++ b/.butcher/enums/ContentType.yml @@ -41,3 +41,5 @@ extract: - sender_business_bot - is_from_offline - has_media_spoiler + - effect_id + - show_caption_above_media diff --git a/.butcher/methods/copyMessage/default.yml b/.butcher/methods/copyMessage/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/copyMessage/default.yml +++ b/.butcher/methods/copyMessage/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/copyMessage/entity.json b/.butcher/methods/copyMessage/entity.json index bcf1a586..b9efc617 100644 --- a/.butcher/methods/copyMessage/entity.json +++ b/.butcher/methods/copyMessage/entity.json @@ -67,6 +67,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "html_description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified.\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, diff --git a/.butcher/methods/createInvoiceLink/entity.json b/.butcher/methods/createInvoiceLink/entity.json index 14bed157..0bd239b0 100644 --- a/.butcher/methods/createInvoiceLink/entity.json +++ b/.butcher/methods/createInvoiceLink/entity.json @@ -37,34 +37,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via BotFather", - "html_description": "Payment provider token, obtained via BotFather", - "rst_description": "Payment provider token, obtained via `BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount" }, { @@ -118,57 +118,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to the provider", - "html_description": "Pass True if the user's phone number should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to the provider", - "html_description": "Pass True if the user's email address should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" } ], diff --git a/.butcher/methods/editMessageCaption/default.yml b/.butcher/methods/editMessageCaption/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/methods/editMessageCaption/default.yml +++ b/.butcher/methods/editMessageCaption/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/editMessageCaption/entity.json b/.butcher/methods/editMessageCaption/entity.json index 15126a36..570815c7 100644 --- a/.butcher/methods/editMessageCaption/entity.json +++ b/.butcher/methods/editMessageCaption/entity.json @@ -59,6 +59,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "html_description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages.\n", + "name": "show_caption_above_media" + }, { "type": "InlineKeyboardMarkup", "required": false, diff --git a/.butcher/methods/refundStarPayment/entity.json b/.butcher/methods/refundStarPayment/entity.json new file mode 100644 index 00000000..f48ba9e2 --- /dev/null +++ b/.butcher/methods/refundStarPayment/entity.json @@ -0,0 +1,33 @@ +{ + "meta": {}, + "group": { + "title": "Payments", + "anchor": "payments" + }, + "object": { + "anchor": "refundstarpayment", + "name": "refundStarPayment", + "description": "Refunds a successful payment in Telegram Stars. Returns True on success.", + "html_description": "

Refunds a successful payment in Telegram Stars. Returns True on success.

", + "rst_description": "Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Identifier of the user whose payment will be refunded", + "html_description": "Identifier of the user whose payment will be refunded", + "rst_description": "Identifier of the user whose payment will be refunded\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Telegram payment identifier", + "html_description": "Telegram payment identifier", + "rst_description": "Telegram payment identifier\n", + "name": "telegram_payment_charge_id" + } + ], + "category": "methods" + } +} diff --git a/.butcher/methods/sendAnimation/default.yml b/.butcher/methods/sendAnimation/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendAnimation/default.yml +++ b/.butcher/methods/sendAnimation/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendAnimation/entity.json b/.butcher/methods/sendAnimation/entity.json index dbba06a6..987e6fec 100644 --- a/.butcher/methods/sendAnimation/entity.json +++ b/.butcher/methods/sendAnimation/entity.json @@ -99,6 +99,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -123,6 +131,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendAudio/entity.json b/.butcher/methods/sendAudio/entity.json index 0d23ce57..bc81c541 100644 --- a/.butcher/methods/sendAudio/entity.json +++ b/.butcher/methods/sendAudio/entity.json @@ -115,6 +115,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendContact/entity.json b/.butcher/methods/sendContact/entity.json index 4bb9a05b..315b35b9 100644 --- a/.butcher/methods/sendContact/entity.json +++ b/.butcher/methods/sendContact/entity.json @@ -83,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendDice/entity.json b/.butcher/methods/sendDice/entity.json index 602a206d..d2faf000 100644 --- a/.butcher/methods/sendDice/entity.json +++ b/.butcher/methods/sendDice/entity.json @@ -59,6 +59,14 @@ "rst_description": "Protects the contents of the sent message from forwarding\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendDocument/entity.json b/.butcher/methods/sendDocument/entity.json index 86618480..ca887f8e 100644 --- a/.butcher/methods/sendDocument/entity.json +++ b/.butcher/methods/sendDocument/entity.json @@ -99,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendGame/entity.json b/.butcher/methods/sendGame/entity.json index 2b56c023..0d83c915 100644 --- a/.butcher/methods/sendGame/entity.json +++ b/.butcher/methods/sendGame/entity.json @@ -59,6 +59,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendInvoice/entity.json b/.butcher/methods/sendInvoice/entity.json index d51a042c..23eaaca8 100644 --- a/.butcher/methods/sendInvoice/entity.json +++ b/.butcher/methods/sendInvoice/entity.json @@ -53,34 +53,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount" }, { @@ -142,57 +142,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Pass True if the user's phone number should be sent to provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Pass True if the user's email address should be sent to provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" }, { @@ -211,6 +211,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendLocation/entity.json b/.butcher/methods/sendLocation/entity.json index 1364f263..0685980e 100644 --- a/.butcher/methods/sendLocation/entity.json +++ b/.butcher/methods/sendLocation/entity.json @@ -99,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendMediaGroup/entity.json b/.butcher/methods/sendMediaGroup/entity.json index 88a4d07a..91734565 100644 --- a/.butcher/methods/sendMediaGroup/entity.json +++ b/.butcher/methods/sendMediaGroup/entity.json @@ -59,6 +59,14 @@ "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendMessage/entity.json b/.butcher/methods/sendMessage/entity.json index ba6b39c1..60ec3634 100644 --- a/.butcher/methods/sendMessage/entity.json +++ b/.butcher/methods/sendMessage/entity.json @@ -83,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendPhoto/default.yml b/.butcher/methods/sendPhoto/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendPhoto/default.yml +++ b/.butcher/methods/sendPhoto/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendPhoto/entity.json b/.butcher/methods/sendPhoto/entity.json index e40a1727..b7c6cdff 100644 --- a/.butcher/methods/sendPhoto/entity.json +++ b/.butcher/methods/sendPhoto/entity.json @@ -67,6 +67,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -91,6 +99,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendPoll/entity.json b/.butcher/methods/sendPoll/entity.json index b67cd201..106a6eac 100644 --- a/.butcher/methods/sendPoll/entity.json +++ b/.butcher/methods/sendPoll/entity.json @@ -163,6 +163,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendSticker/entity.json b/.butcher/methods/sendSticker/entity.json index 9943ba8e..e14bac32 100644 --- a/.butcher/methods/sendSticker/entity.json +++ b/.butcher/methods/sendSticker/entity.json @@ -67,6 +67,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendVenue/entity.json b/.butcher/methods/sendVenue/entity.json index 9580be75..18b869d1 100644 --- a/.butcher/methods/sendVenue/entity.json +++ b/.butcher/methods/sendVenue/entity.json @@ -115,6 +115,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendVideo/default.yml b/.butcher/methods/sendVideo/default.yml index 4f6fbe94..50d7b57d 100644 --- a/.butcher/methods/sendVideo/default.yml +++ b/.butcher/methods/sendVideo/default.yml @@ -1,2 +1,3 @@ parse_mode: parse_mode protect_content: protect_content +show_caption_above_media: show_caption_above_media diff --git a/.butcher/methods/sendVideo/entity.json b/.butcher/methods/sendVideo/entity.json index 3d78154b..b6f21f09 100644 --- a/.butcher/methods/sendVideo/entity.json +++ b/.butcher/methods/sendVideo/entity.json @@ -99,6 +99,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -131,6 +139,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendVideoNote/entity.json b/.butcher/methods/sendVideoNote/entity.json index 618b5493..a9529783 100644 --- a/.butcher/methods/sendVideoNote/entity.json +++ b/.butcher/methods/sendVideoNote/entity.json @@ -83,6 +83,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/methods/sendVoice/entity.json b/.butcher/methods/sendVoice/entity.json index 1c8e7f41..e3464acd 100644 --- a/.butcher/methods/sendVoice/entity.json +++ b/.butcher/methods/sendVoice/entity.json @@ -91,6 +91,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/schema/schema.json b/.butcher/schema/schema.json index 2964e91a..a50ca8b3 100644 --- a/.butcher/schema/schema.json +++ b/.butcher/schema/schema.json @@ -1,7 +1,7 @@ { "api": { - "version": "7.3", - "release_date": "2024-05-06" + "version": "7.4", + "release_date": "2024-05-28" }, "items": [ { @@ -65,9 +65,9 @@ }, { "type": "Message", - "description": "New non-service message from a connected business account", - "html_description": "Optional. New non-service message from a connected business account", - "rst_description": "*Optional*. New non-service message from a connected business account\n", + "description": "New message from a connected business account", + "html_description": "Optional. New message from a connected business account", + "rst_description": "*Optional*. New message from a connected business account\n", "name": "business_message", "required": false }, @@ -815,9 +815,9 @@ }, { "type": "True", - "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators", - "html_description": "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators", - "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators\n", + "description": "True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "html_description": "Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators\n", "name": "join_by_request", "required": false }, @@ -1159,6 +1159,14 @@ "name": "link_preview_options", "required": false }, + { + "type": "String", + "description": "Unique identifier of the message effect added to the message", + "html_description": "Optional. Unique identifier of the message effect added to the message", + "rst_description": "*Optional*. Unique identifier of the message effect added to the message\n", + "name": "effect_id", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -1247,6 +1255,14 @@ "name": "caption_entities", "required": false }, + { + "type": "True", + "description": "True, if the caption must be shown above the message media", + "html_description": "Optional. True, if the caption must be shown above the message media", + "rst_description": "*Optional*. True, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "True", "description": "True, if the message media is covered by a spoiler animation", @@ -1680,9 +1696,9 @@ "annotations": [ { "type": "String", - "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", - "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", - "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", + "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", + "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", + "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", "name": "type", "required": true }, @@ -4253,9 +4269,9 @@ { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", @@ -4545,9 +4561,9 @@ { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. You must use exactly one of the optional fields.", - "html_description": "

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

", - "rst_description": "This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields.", + "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", "annotations": [ { "type": "String", @@ -4623,9 +4639,9 @@ }, { "type": "Boolean", - "description": "Specify True, to send a Pay button.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "html_description": "Optional. Specify True, to send a Pay button.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", + "description": "Specify True, to send a Pay button. Substrings '' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "html_description": "Optional. Specify True, to send a Pay button. Substrings “\"⭐\"/” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", "name": "pay", "required": false } @@ -5135,9 +5151,9 @@ }, { "type": "Boolean", - "description": "True, if the user joined the chat after sending a direct join request and being approved by an administrator", - "html_description": "Optional. True, if the user joined the chat after sending a direct join request and being approved by an administrator", - "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request and being approved by an administrator\n", + "description": "True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "html_description": "Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator\n", "name": "via_join_request", "required": false }, @@ -6925,6 +6941,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Boolean", "description": "Pass True if the photo needs to be covered with a spoiler animation", @@ -6991,6 +7015,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", @@ -7089,6 +7121,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Animation width", @@ -7394,6 +7434,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7592,6 +7640,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "html_description": "Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified.\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -7756,6 +7812,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -7780,6 +7844,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -7910,6 +7982,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8024,6 +8104,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8138,6 +8226,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -8170,6 +8266,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8284,6 +8388,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Pass True, if the caption must be shown above the message media", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media" + }, { "type": "Boolean", "required": false, @@ -8308,6 +8420,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8414,6 +8534,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8512,6 +8640,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8586,6 +8722,14 @@ "rst_description": "Protects the contents of the sent messages from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8692,6 +8836,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8822,6 +8974,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -8920,6 +9080,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -9098,6 +9266,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -9172,6 +9348,14 @@ "rst_description": "Protects the contents of the sent message from forwarding\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -11088,6 +11272,14 @@ "rst_description": "A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*\n", "name": "caption_entities" }, + { + "type": "Boolean", + "required": false, + "description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "html_description": "Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.", + "rst_description": "Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages.\n", + "name": "show_caption_above_media" + }, { "type": "InlineKeyboardMarkup", "required": false, @@ -11751,6 +11943,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -12567,6 +12767,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -12689,6 +12897,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -12811,6 +13027,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -12909,6 +13133,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", @@ -13733,6 +13965,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -13815,6 +14055,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -13897,6 +14145,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -14127,6 +14383,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", @@ -14560,33 +14824,33 @@ }, { "type": "String", - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token", - "required": true + "required": false }, { "type": "String", - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency", "required": true }, { "type": "Array of LabeledPrice", - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices", "required": true }, { "type": "Integer", - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount", "required": false }, @@ -14640,57 +14904,57 @@ }, { "type": "Boolean", - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Optional. Pass True if you require the user's full name to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Optional. Pass True if you require the user's phone number to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Optional. Pass True if you require the user's email address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Optional. Pass True if you require the user's shipping address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Optional. Pass True if the user's phone number should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Optional. Pass True if the user's email address should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Optional. Pass True if the final price depends on the shipping method", - "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible", "required": false } @@ -14847,34 +15111,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount" }, { @@ -14936,57 +15200,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Pass True if the user's phone number should be sent to provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Pass True if the user's email address should be sent to provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" }, { @@ -15005,6 +15269,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, @@ -15057,34 +15329,34 @@ }, { "type": "String", - "required": true, - "description": "Payment provider token, obtained via BotFather", - "html_description": "Payment provider token, obtained via BotFather", - "rst_description": "Payment provider token, obtained via `BotFather `_\n", + "required": false, + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token" }, { "type": "String", "required": true, - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency" }, { "type": "Array of LabeledPrice", "required": true, - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices" }, { "type": "Integer", "required": false, - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount" }, { @@ -15138,57 +15410,57 @@ { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Pass True if you require the user's full name to complete the order", - "rst_description": "Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Pass True if you require the user's phone number to complete the order", - "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Pass True if you require the user's email address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email" }, { "type": "Boolean", "required": false, - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Pass True if you require the user's shipping address to complete the order", - "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's phone number should be sent to the provider", - "html_description": "Pass True if the user's phone number should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the user's email address should be sent to the provider", - "html_description": "Pass True if the user's email address should be sent to the provider", - "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider" }, { "type": "Boolean", "required": false, - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Pass True if the final price depends on the shipping method", - "rst_description": "Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible" } ], @@ -15270,6 +15542,32 @@ ], "category": "methods" }, + { + "anchor": "refundstarpayment", + "name": "refundStarPayment", + "description": "Refunds a successful payment in Telegram Stars. Returns True on success.", + "html_description": "

Refunds a successful payment in Telegram Stars. Returns True on success.

", + "rst_description": "Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success.", + "annotations": [ + { + "type": "Integer", + "required": true, + "description": "Identifier of the user whose payment will be refunded", + "html_description": "Identifier of the user whose payment will be refunded", + "rst_description": "Identifier of the user whose payment will be refunded\n", + "name": "user_id" + }, + { + "type": "String", + "required": true, + "description": "Telegram payment identifier", + "html_description": "Telegram payment identifier", + "rst_description": "Telegram payment identifier\n", + "name": "telegram_payment_charge_id" + } + ], + "category": "methods" + }, { "anchor": "labeledprice", "name": "LabeledPrice", @@ -15329,9 +15627,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -15489,9 +15787,9 @@ "annotations": [ { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -15613,9 +15911,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, @@ -16336,6 +16634,14 @@ "rst_description": "Protects the contents of the sent message from forwarding and saving\n", "name": "protect_content" }, + { + "type": "String", + "required": false, + "description": "Unique identifier of the message effect to be added to the message; for private chats only", + "html_description": "Unique identifier of the message effect to be added to the message; for private chats only", + "rst_description": "Unique identifier of the message effect to be added to the message; for private chats only\n", + "name": "message_effect_id" + }, { "type": "ReplyParameters", "required": false, diff --git a/.butcher/types/ChatFullInfo/entity.json b/.butcher/types/ChatFullInfo/entity.json index bb1fe44a..1b3045e3 100644 --- a/.butcher/types/ChatFullInfo/entity.json +++ b/.butcher/types/ChatFullInfo/entity.json @@ -221,9 +221,9 @@ }, { "type": "True", - "description": "True, if all users directly joining the supergroup need to be approved by supergroup administrators", - "html_description": "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators", - "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators\n", + "description": "True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "html_description": "Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators", + "rst_description": "*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators\n", "name": "join_by_request", "required": false }, diff --git a/.butcher/types/ChatMemberUpdated/entity.json b/.butcher/types/ChatMemberUpdated/entity.json index 0e5f0451..e76773dc 100644 --- a/.butcher/types/ChatMemberUpdated/entity.json +++ b/.butcher/types/ChatMemberUpdated/entity.json @@ -61,9 +61,9 @@ }, { "type": "Boolean", - "description": "True, if the user joined the chat after sending a direct join request and being approved by an administrator", - "html_description": "Optional. True, if the user joined the chat after sending a direct join request and being approved by an administrator", - "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request and being approved by an administrator\n", + "description": "True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "html_description": "Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator", + "rst_description": "*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator\n", "name": "via_join_request", "required": false }, diff --git a/.butcher/types/InlineKeyboardButton/entity.json b/.butcher/types/InlineKeyboardButton/entity.json index 2603d708..7b502151 100644 --- a/.butcher/types/InlineKeyboardButton/entity.json +++ b/.butcher/types/InlineKeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "inlinekeyboardbutton", "name": "InlineKeyboardButton", - "description": "This object represents one button of an inline keyboard. You must use exactly one of the optional fields.", - "html_description": "

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

", - "rst_description": "This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields.", + "description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", + "html_description": "

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

", + "rst_description": "This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.", "annotations": [ { "type": "String", @@ -85,9 +85,9 @@ }, { "type": "Boolean", - "description": "Specify True, to send a Pay button.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "html_description": "Optional. Specify True, to send a Pay button.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", - "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", + "description": "Specify True, to send a Pay button. Substrings '' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "html_description": "Optional. Specify True, to send a Pay button. Substrings “\"⭐\"/” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
\n
\nNOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.", + "rst_description": "*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.\n\n\n\n**NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.\n", "name": "pay", "required": false } diff --git a/.butcher/types/InlineQueryResultCachedGif/default.yml b/.butcher/types/InlineQueryResultCachedGif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedGif/default.yml +++ b/.butcher/types/InlineQueryResultCachedGif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedGif/entity.json b/.butcher/types/InlineQueryResultCachedGif/entity.json index 51c90620..2c342fa8 100644 --- a/.butcher/types/InlineQueryResultCachedGif/entity.json +++ b/.butcher/types/InlineQueryResultCachedGif/entity.json @@ -67,6 +67,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml b/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml +++ b/.butcher/types/InlineQueryResultCachedMpeg4Gif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json index bd91435e..70c6c36c 100644 --- a/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json +++ b/.butcher/types/InlineQueryResultCachedMpeg4Gif/entity.json @@ -67,6 +67,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedPhoto/default.yml b/.butcher/types/InlineQueryResultCachedPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedPhoto/default.yml +++ b/.butcher/types/InlineQueryResultCachedPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedPhoto/entity.json b/.butcher/types/InlineQueryResultCachedPhoto/entity.json index d0bc2b9b..8060ce8a 100644 --- a/.butcher/types/InlineQueryResultCachedPhoto/entity.json +++ b/.butcher/types/InlineQueryResultCachedPhoto/entity.json @@ -75,6 +75,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultCachedVideo/default.yml b/.butcher/types/InlineQueryResultCachedVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultCachedVideo/default.yml +++ b/.butcher/types/InlineQueryResultCachedVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultCachedVideo/entity.json b/.butcher/types/InlineQueryResultCachedVideo/entity.json index 2b35ddc6..2fe47f84 100644 --- a/.butcher/types/InlineQueryResultCachedVideo/entity.json +++ b/.butcher/types/InlineQueryResultCachedVideo/entity.json @@ -75,6 +75,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultGif/default.yml b/.butcher/types/InlineQueryResultGif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultGif/default.yml +++ b/.butcher/types/InlineQueryResultGif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultGif/entity.json b/.butcher/types/InlineQueryResultGif/entity.json index 7824368a..7c104615 100644 --- a/.butcher/types/InlineQueryResultGif/entity.json +++ b/.butcher/types/InlineQueryResultGif/entity.json @@ -107,6 +107,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/default.yml b/.butcher/types/InlineQueryResultMpeg4Gif/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultMpeg4Gif/default.yml +++ b/.butcher/types/InlineQueryResultMpeg4Gif/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json index c365a134..fa4c3e81 100644 --- a/.butcher/types/InlineQueryResultMpeg4Gif/entity.json +++ b/.butcher/types/InlineQueryResultMpeg4Gif/entity.json @@ -107,6 +107,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultPhoto/default.yml b/.butcher/types/InlineQueryResultPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultPhoto/default.yml +++ b/.butcher/types/InlineQueryResultPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultPhoto/entity.json b/.butcher/types/InlineQueryResultPhoto/entity.json index 67130359..94f9867a 100644 --- a/.butcher/types/InlineQueryResultPhoto/entity.json +++ b/.butcher/types/InlineQueryResultPhoto/entity.json @@ -99,6 +99,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "InlineKeyboardMarkup", "description": "Inline keyboard attached to the message", diff --git a/.butcher/types/InlineQueryResultVideo/default.yml b/.butcher/types/InlineQueryResultVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InlineQueryResultVideo/default.yml +++ b/.butcher/types/InlineQueryResultVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InlineQueryResultVideo/entity.json b/.butcher/types/InlineQueryResultVideo/entity.json index 7164306c..77910b7c 100644 --- a/.butcher/types/InlineQueryResultVideo/entity.json +++ b/.butcher/types/InlineQueryResultVideo/entity.json @@ -83,6 +83,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", diff --git a/.butcher/types/InputInvoiceMessageContent/entity.json b/.butcher/types/InputInvoiceMessageContent/entity.json index 27195732..bed9e656 100644 --- a/.butcher/types/InputInvoiceMessageContent/entity.json +++ b/.butcher/types/InputInvoiceMessageContent/entity.json @@ -37,33 +37,33 @@ }, { "type": "String", - "description": "Payment provider token, obtained via @BotFather", - "html_description": "Payment provider token, obtained via @BotFather", - "rst_description": "Payment provider token, obtained via `@BotFather `_\n", + "description": "Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "html_description": "Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.", + "rst_description": "*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.\n", "name": "provider_token", - "required": true + "required": false }, { "type": "String", - "description": "Three-letter ISO 4217 currency code, see more on currencies", - "html_description": "Three-letter ISO 4217 currency code, see more on currencies", - "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_\n", + "description": "Three-letter ISO 4217 currency code, see more on currencies. Pass 'XTR' for payments in Telegram Stars.", + "html_description": "Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.", + "rst_description": "Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.\n", "name": "currency", "required": true }, { "type": "Array of LabeledPrice", - "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)", - "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)\n", + "description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "html_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.", + "rst_description": "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.\n", "name": "prices", "required": true }, { "type": "Integer", - "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "html_description": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0", - "rst_description": "*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0\n", + "description": "The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "html_description": "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.", + "rst_description": "*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.\n", "name": "max_tip_amount", "required": false }, @@ -117,57 +117,57 @@ }, { "type": "Boolean", - "description": "Pass True if you require the user's full name to complete the order", - "html_description": "Optional. Pass True if you require the user's full name to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order\n", + "description": "Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_name", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's phone number to complete the order", - "html_description": "Optional. Pass True if you require the user's phone number to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order\n", + "description": "Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_phone_number", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's email address to complete the order", - "html_description": "Optional. Pass True if you require the user's email address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order\n", + "description": "Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_email", "required": false }, { "type": "Boolean", - "description": "Pass True if you require the user's shipping address to complete the order", - "html_description": "Optional. Pass True if you require the user's shipping address to complete the order", - "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order\n", + "description": "Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.\n", "name": "need_shipping_address", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's phone number should be sent to provider", - "html_description": "Optional. Pass True if the user's phone number should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to provider\n", + "description": "Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_phone_number_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the user's email address should be sent to provider", - "html_description": "Optional. Pass True if the user's email address should be sent to provider", - "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to provider\n", + "description": "Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.\n", "name": "send_email_to_provider", "required": false }, { "type": "Boolean", - "description": "Pass True if the final price depends on the shipping method", - "html_description": "Optional. Pass True if the final price depends on the shipping method", - "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method\n", + "description": "Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "html_description": "Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.", + "rst_description": "*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.\n", "name": "is_flexible", "required": false } diff --git a/.butcher/types/InputMediaAnimation/default.yml b/.butcher/types/InputMediaAnimation/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaAnimation/default.yml +++ b/.butcher/types/InputMediaAnimation/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaAnimation/entity.json b/.butcher/types/InputMediaAnimation/entity.json index 1bd2e3b4..e311a1ee 100644 --- a/.butcher/types/InputMediaAnimation/entity.json +++ b/.butcher/types/InputMediaAnimation/entity.json @@ -59,6 +59,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Animation width", diff --git a/.butcher/types/InputMediaPhoto/default.yml b/.butcher/types/InputMediaPhoto/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaPhoto/default.yml +++ b/.butcher/types/InputMediaPhoto/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaPhoto/entity.json b/.butcher/types/InputMediaPhoto/entity.json index 3437668f..4fe1e134 100644 --- a/.butcher/types/InputMediaPhoto/entity.json +++ b/.butcher/types/InputMediaPhoto/entity.json @@ -51,6 +51,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Boolean", "description": "Pass True if the photo needs to be covered with a spoiler animation", diff --git a/.butcher/types/InputMediaVideo/default.yml b/.butcher/types/InputMediaVideo/default.yml index d56d5759..a6b90bc0 100644 --- a/.butcher/types/InputMediaVideo/default.yml +++ b/.butcher/types/InputMediaVideo/default.yml @@ -1 +1,2 @@ parse_mode: parse_mode +show_caption_above_media: show_caption_above_media diff --git a/.butcher/types/InputMediaVideo/entity.json b/.butcher/types/InputMediaVideo/entity.json index 3bfbb06a..f1dc1989 100644 --- a/.butcher/types/InputMediaVideo/entity.json +++ b/.butcher/types/InputMediaVideo/entity.json @@ -59,6 +59,14 @@ "name": "caption_entities", "required": false }, + { + "type": "Boolean", + "description": "Pass True, if the caption must be shown above the message media", + "html_description": "Optional. Pass True, if the caption must be shown above the message media", + "rst_description": "*Optional*. Pass :code:`True`, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "Integer", "description": "Video width", diff --git a/.butcher/types/Invoice/entity.json b/.butcher/types/Invoice/entity.json index 2ae83aa4..d53aa161 100644 --- a/.butcher/types/Invoice/entity.json +++ b/.butcher/types/Invoice/entity.json @@ -37,9 +37,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/KeyboardButton/entity.json b/.butcher/types/KeyboardButton/entity.json index fe33466a..f98688ff 100644 --- a/.butcher/types/KeyboardButton/entity.json +++ b/.butcher/types/KeyboardButton/entity.json @@ -7,9 +7,9 @@ "object": { "anchor": "keyboardbutton", "name": "KeyboardButton", - "description": "This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", - "html_description": "

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", - "rst_description": "This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", + "description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.\nNote: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.", + "html_description": "

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

", + "rst_description": "This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text.\n**Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*.", "annotations": [ { "type": "String", diff --git a/.butcher/types/Message/entity.json b/.butcher/types/Message/entity.json index 4eaf9a3f..229c9c7d 100644 --- a/.butcher/types/Message/entity.json +++ b/.butcher/types/Message/entity.json @@ -211,6 +211,14 @@ "name": "link_preview_options", "required": false }, + { + "type": "String", + "description": "Unique identifier of the message effect added to the message", + "html_description": "Optional. Unique identifier of the message effect added to the message", + "rst_description": "*Optional*. Unique identifier of the message effect added to the message\n", + "name": "effect_id", + "required": false + }, { "type": "Animation", "description": "Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set", @@ -299,6 +307,14 @@ "name": "caption_entities", "required": false }, + { + "type": "True", + "description": "True, if the caption must be shown above the message media", + "html_description": "Optional. True, if the caption must be shown above the message media", + "rst_description": "*Optional*. True, if the caption must be shown above the message media\n", + "name": "show_caption_above_media", + "required": false + }, { "type": "True", "description": "True, if the message media is covered by a spoiler animation", diff --git a/.butcher/types/MessageEntity/entity.json b/.butcher/types/MessageEntity/entity.json index 8de41cef..1ffb569b 100644 --- a/.butcher/types/MessageEntity/entity.json +++ b/.butcher/types/MessageEntity/entity.json @@ -13,9 +13,9 @@ "annotations": [ { "type": "String", - "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", - "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", - "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", + "description": "Type of the entity. Currently, can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames), 'custom_emoji' (for inline custom emoji stickers)", + "html_description": "Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)", + "rst_description": "Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)\n", "name": "type", "required": true }, diff --git a/.butcher/types/PreCheckoutQuery/entity.json b/.butcher/types/PreCheckoutQuery/entity.json index 5fb05a1c..9a8218e9 100644 --- a/.butcher/types/PreCheckoutQuery/entity.json +++ b/.butcher/types/PreCheckoutQuery/entity.json @@ -29,9 +29,9 @@ }, { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/SuccessfulPayment/entity.json b/.butcher/types/SuccessfulPayment/entity.json index bbe8b21c..b555d08b 100644 --- a/.butcher/types/SuccessfulPayment/entity.json +++ b/.butcher/types/SuccessfulPayment/entity.json @@ -13,9 +13,9 @@ "annotations": [ { "type": "String", - "description": "Three-letter ISO 4217 currency code", - "html_description": "Three-letter ISO 4217 currency code", - "rst_description": "Three-letter ISO 4217 `currency `_ code\n", + "description": "Three-letter ISO 4217 currency code, or 'XTR' for payments in Telegram Stars", + "html_description": "Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars", + "rst_description": "Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_\n", "name": "currency", "required": true }, diff --git a/.butcher/types/Update/entity.json b/.butcher/types/Update/entity.json index e28a0d4e..ce43e9f9 100644 --- a/.butcher/types/Update/entity.json +++ b/.butcher/types/Update/entity.json @@ -61,9 +61,9 @@ }, { "type": "Message", - "description": "New non-service message from a connected business account", - "html_description": "Optional. New non-service message from a connected business account", - "rst_description": "*Optional*. New non-service message from a connected business account\n", + "description": "New message from a connected business account", + "html_description": "Optional. New message from a connected business account", + "rst_description": "*Optional*. New message from a connected business account\n", "name": "business_message", "required": false }, diff --git a/CHANGES/1498.feature.rst b/CHANGES/1498.feature.rst new file mode 100644 index 00000000..cdb2fc64 --- /dev/null +++ b/CHANGES/1498.feature.rst @@ -0,0 +1 @@ +Added full support of `Bot API 7.4 `_ diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index 94ffa3dc..59b8f2a9 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -145,6 +145,7 @@ from ..methods import ( UnpinAllGeneralForumTopicMessages, UnpinChatMessage, UploadStickerFile, + RefundStarPayment, ) from ..types import ( BotCommand, @@ -845,6 +846,9 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -867,6 +871,7 @@ class Bot: :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param reply_parameters: Description of the message to reply to @@ -885,6 +890,7 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, @@ -960,9 +966,9 @@ class Bot: title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -987,23 +993,23 @@ class Bot: :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. :param photo_url: URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param request_timeout: Request timeout :return: Returns the created invoice link as *String* on success. """ @@ -1012,9 +1018,9 @@ class Bot: title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, @@ -1342,6 +1348,9 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, request_timeout: Optional[int] = None, ) -> Union[Message, bool]: @@ -1356,6 +1365,7 @@ class Bot: :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 `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages. :param reply_markup: A JSON-serialized object for an `inline keyboard `_. :param request_timeout: Request timeout :return: 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. @@ -1368,6 +1378,7 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, ) return await self(call, request_timeout=request_timeout) @@ -2183,9 +2194,13 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2210,9 +2225,11 @@ class Bot: :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2233,9 +2250,11 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2258,6 +2277,7 @@ class Bot: thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2285,6 +2305,7 @@ class Bot: :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2307,6 +2328,7 @@ class Bot: thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2358,6 +2380,7 @@ class Bot: vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2380,6 +2403,7 @@ class Bot: :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2398,6 +2422,7 @@ class Bot: vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2413,6 +2438,7 @@ class Bot: emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2432,6 +2458,7 @@ class Bot: :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2447,6 +2474,7 @@ class Bot: emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2467,6 +2495,7 @@ class Bot: disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2491,6 +2520,7 @@ class Bot: :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2511,6 +2541,7 @@ class Bot: disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2526,6 +2557,7 @@ class Bot: message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -2543,6 +2575,7 @@ class Bot: :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2558,6 +2591,7 @@ class Bot: message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2571,10 +2605,10 @@ class Bot: title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], message_thread_id: Optional[int] = None, + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -2592,6 +2626,7 @@ class Bot: is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -2607,11 +2642,11 @@ class Bot: :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -2619,15 +2654,16 @@ class Bot: :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2641,10 +2677,10 @@ class Bot: title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -2662,6 +2698,7 @@ class Bot: is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2682,6 +2719,7 @@ class Bot: proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2706,6 +2744,7 @@ class Bot: :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2726,6 +2765,7 @@ class Bot: proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2741,6 +2781,7 @@ class Bot: message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -2757,6 +2798,7 @@ class Bot: :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -2771,6 +2813,7 @@ class Bot: message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -2790,6 +2833,7 @@ class Bot: ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2815,6 +2859,7 @@ class Bot: :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2834,6 +2879,7 @@ class Bot: link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2851,9 +2897,13 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2874,9 +2924,11 @@ class Bot: :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2893,9 +2945,11 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2924,6 +2978,7 @@ class Bot: is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2956,6 +3011,7 @@ class Bot: :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2984,6 +3040,7 @@ class Bot: is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3000,6 +3057,7 @@ class Bot: emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3020,6 +3078,7 @@ class Bot: :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3036,6 +3095,7 @@ class Bot: emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3058,6 +3118,7 @@ class Bot: google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3084,6 +3145,7 @@ class Bot: :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3106,6 +3168,7 @@ class Bot: google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3126,10 +3189,14 @@ class Bot: caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3154,10 +3221,12 @@ class Bot: :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3178,10 +3247,12 @@ class Bot: caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3200,6 +3271,7 @@ class Bot: thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3222,6 +3294,7 @@ class Bot: :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3240,6 +3313,7 @@ class Bot: thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3259,6 +3333,7 @@ class Bot: duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3282,6 +3357,7 @@ class Bot: :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3301,6 +3377,7 @@ class Bot: duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -4489,3 +4566,26 @@ class Bot: sticker=sticker, ) return await self(call, request_timeout=request_timeout) + + async def refund_star_payment( + self, + user_id: int, + telegram_payment_charge_id: str, + request_timeout: Optional[int] = None, + ) -> bool: + """ + Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#refundstarpayment + + :param user_id: Identifier of the user whose payment will be refunded + :param telegram_payment_charge_id: Telegram payment identifier + :param request_timeout: Request timeout + :return: Returns :code:`True` on success. + """ + + call = RefundStarPayment( + user_id=user_id, + telegram_payment_charge_id=telegram_payment_charge_id, + ) + return await self(call, request_timeout=request_timeout) diff --git a/aiogram/client/default.py b/aiogram/client/default.py index 74954e52..6c857be0 100644 --- a/aiogram/client/default.py +++ b/aiogram/client/default.py @@ -58,6 +58,8 @@ class DefaultBotProperties: """Prefer large media in link preview.""" link_preview_show_above_text: Optional[bool] = None """Show link preview above text.""" + show_caption_above_media: Optional[bool] = None + """Show caption above media.""" def __post_init__(self) -> None: has_any_link_preview_option = any( diff --git a/aiogram/enums/message_entity_type.py b/aiogram/enums/message_entity_type.py index 81bddd81..b67dc039 100644 --- a/aiogram/enums/message_entity_type.py +++ b/aiogram/enums/message_entity_type.py @@ -21,6 +21,7 @@ class MessageEntityType(str, Enum): STRIKETHROUGH = "strikethrough" SPOILER = "spoiler" BLOCKQUOTE = "blockquote" + EXPANDABLE_BLOCKQUOTE = "expandable_blockquote" CODE = "code" PRE = "pre" TEXT_LINK = "text_link" diff --git a/aiogram/methods/__init__.py b/aiogram/methods/__init__.py index cd9692e2..e31b679f 100644 --- a/aiogram/methods/__init__.py +++ b/aiogram/methods/__init__.py @@ -120,6 +120,7 @@ from .unpin_all_forum_topic_messages import UnpinAllForumTopicMessages from .unpin_all_general_forum_topic_messages import UnpinAllGeneralForumTopicMessages from .unpin_chat_message import UnpinChatMessage from .upload_sticker_file import UploadStickerFile +from .refund_star_payment import RefundStarPayment __all__ = ( "AddStickerToSet", @@ -187,6 +188,7 @@ __all__ = ( "LogOut", "PinChatMessage", "PromoteChatMember", + "RefundStarPayment", "ReopenForumTopic", "ReopenGeneralForumTopic", "ReplaceStickerInSet", diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py index c820a7db..2614ddbf 100644 --- a/aiogram/methods/copy_message.py +++ b/aiogram/methods/copy_message.py @@ -41,6 +41,8 @@ class CopyMessage(TelegramMethod[MessageId]): """Mode for parsing entities in the new caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified.""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") @@ -78,6 +80,9 @@ class CopyMessage(TelegramMethod[MessageId]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -100,6 +105,7 @@ class CopyMessage(TelegramMethod[MessageId]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, diff --git a/aiogram/methods/create_invoice_link.py b/aiogram/methods/create_invoice_link.py index 361ea31a..2068f759 100644 --- a/aiogram/methods/create_invoice_link.py +++ b/aiogram/methods/create_invoice_link.py @@ -22,14 +22,14 @@ class CreateInvoiceLink(TelegramMethod[str]): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.""" + provider_token: Optional[str] = None + """Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.""" max_tip_amount: Optional[int] = None - """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0""" + """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.""" suggested_tip_amounts: Optional[List[int]] = None """A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.""" provider_data: Optional[str] = None @@ -43,19 +43,19 @@ class CreateInvoiceLink(TelegramMethod[str]): photo_height: Optional[int] = None """Photo height""" need_name: Optional[bool] = None - """Pass :code:`True` if you require the user's full name to complete the order""" + """Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """Pass :code:`True` if you require the user's phone number to complete the order""" + """Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """Pass :code:`True` if you require the user's email address to complete the order""" + """Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """Pass :code:`True` if you require the user's shipping address to complete the order""" + """Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's phone number should be sent to the provider""" + """Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's email address should be sent to the provider""" + """Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """Pass :code:`True` if the final price depends on the shipping method""" + """Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -67,9 +67,9 @@ class CreateInvoiceLink(TelegramMethod[str]): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -94,9 +94,9 @@ class CreateInvoiceLink(TelegramMethod[str]): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, diff --git a/aiogram/methods/edit_message_caption.py b/aiogram/methods/edit_message_caption.py index 53dff16e..e18b50a9 100644 --- a/aiogram/methods/edit_message_caption.py +++ b/aiogram/methods/edit_message_caption.py @@ -29,6 +29,8 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): """Mode for parsing entities in the message caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages.""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_.""" @@ -45,6 +47,9 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, **__pydantic_kwargs: Any, ) -> None: @@ -59,6 +64,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, **__pydantic_kwargs, ) diff --git a/aiogram/methods/refund_star_payment.py b/aiogram/methods/refund_star_payment.py new file mode 100644 index 00000000..495cc9e0 --- /dev/null +++ b/aiogram/methods/refund_star_payment.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +from .base import TelegramMethod + + +class RefundStarPayment(TelegramMethod[bool]): + """ + Refunds a successful payment in `Telegram Stars `_. Returns :code:`True` on success. + + Source: https://core.telegram.org/bots/api#refundstarpayment + """ + + __returning__ = bool + __api_method__ = "refundStarPayment" + + user_id: int + """Identifier of the user whose payment will be refunded""" + telegram_payment_charge_id: str + """Telegram payment identifier""" + + if TYPE_CHECKING: + # DO NOT EDIT MANUALLY!!! + # This section was auto-generated via `butcher` + + def __init__( + __pydantic__self__, + *, + user_id: int, + telegram_payment_charge_id: str, + **__pydantic_kwargs: Any, + ) -> None: + # DO NOT EDIT MANUALLY!!! + # This method was auto-generated via `butcher` + # Is needed only for type checking and IDE support without any additional plugins + + super().__init__( + user_id=user_id, + telegram_payment_charge_id=telegram_payment_charge_id, + **__pydantic_kwargs, + ) diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py index 75dc3a50..0baab73a 100644 --- a/aiogram/methods/send_animation.py +++ b/aiogram/methods/send_animation.py @@ -50,12 +50,16 @@ class SendAnimation(TelegramMethod[Message]): """Mode for parsing entities in the animation caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """Pass :code:`True`, if the caption must be shown above the message media""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the animation needs to be covered with a spoiler animation""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -93,9 +97,13 @@ class SendAnimation(TelegramMethod[Message]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -120,9 +128,11 @@ class SendAnimation(TelegramMethod[Message]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py index 8a6af799..b15824a1 100644 --- a/aiogram/methods/send_audio.py +++ b/aiogram/methods/send_audio.py @@ -55,6 +55,8 @@ class SendAudio(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -94,6 +96,7 @@ class SendAudio(TelegramMethod[Message]): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -120,6 +123,7 @@ class SendAudio(TelegramMethod[Message]): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py index 4f2435e7..6c14d56f 100644 --- a/aiogram/methods/send_contact.py +++ b/aiogram/methods/send_contact.py @@ -44,6 +44,8 @@ class SendContact(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -79,6 +81,7 @@ class SendContact(TelegramMethod[Message]): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -101,6 +104,7 @@ class SendContact(TelegramMethod[Message]): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py index bf49b5fc..42d2bf57 100644 --- a/aiogram/methods/send_dice.py +++ b/aiogram/methods/send_dice.py @@ -38,6 +38,8 @@ class SendDice(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -70,6 +72,7 @@ class SendDice(TelegramMethod[Message]): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -89,6 +92,7 @@ class SendDice(TelegramMethod[Message]): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py index d8279f18..411165d3 100644 --- a/aiogram/methods/send_document.py +++ b/aiogram/methods/send_document.py @@ -50,6 +50,8 @@ class SendDocument(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -87,6 +89,7 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -111,6 +114,7 @@ class SendDocument(TelegramMethod[Message]): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py index 3fc546c3..eb963303 100644 --- a/aiogram/methods/send_game.py +++ b/aiogram/methods/send_game.py @@ -31,6 +31,8 @@ class SendGame(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None @@ -61,6 +63,7 @@ class SendGame(TelegramMethod[Message]): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -78,6 +81,7 @@ class SendGame(TelegramMethod[Message]): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py index 7e0d7955..108219ef 100644 --- a/aiogram/methods/send_invoice.py +++ b/aiogram/methods/send_invoice.py @@ -27,16 +27,16 @@ class SendInvoice(TelegramMethod[Message]): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `@BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.""" message_thread_id: Optional[int] = None """Unique identifier for the target message thread (topic) of the forum; for forum supergroups only""" + provider_token: Optional[str] = None + """Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.""" max_tip_amount: Optional[int] = None - """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0""" + """The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.""" suggested_tip_amounts: Optional[List[int]] = None """A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.""" start_parameter: Optional[str] = None @@ -52,23 +52,25 @@ class SendInvoice(TelegramMethod[Message]): photo_height: Optional[int] = None """Photo height""" need_name: Optional[bool] = None - """Pass :code:`True` if you require the user's full name to complete the order""" + """Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """Pass :code:`True` if you require the user's phone number to complete the order""" + """Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """Pass :code:`True` if you require the user's email address to complete the order""" + """Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """Pass :code:`True` if you require the user's shipping address to complete the order""" + """Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's phone number should be sent to provider""" + """Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """Pass :code:`True` if the user's email address should be sent to provider""" + """Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """Pass :code:`True` if the final price depends on the shipping method""" + """Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[InlineKeyboardMarkup] = None @@ -97,10 +99,10 @@ class SendInvoice(TelegramMethod[Message]): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], message_thread_id: Optional[int] = None, + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -118,6 +120,7 @@ class SendInvoice(TelegramMethod[Message]): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -133,10 +136,10 @@ class SendInvoice(TelegramMethod[Message]): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -154,6 +157,7 @@ class SendInvoice(TelegramMethod[Message]): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py index e425fbad..d33f6769 100644 --- a/aiogram/methods/send_location.py +++ b/aiogram/methods/send_location.py @@ -48,6 +48,8 @@ class SendLocation(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -85,6 +87,7 @@ class SendLocation(TelegramMethod[Message]): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -109,6 +112,7 @@ class SendLocation(TelegramMethod[Message]): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py index 58e44946..f8c081a3 100644 --- a/aiogram/methods/send_media_group.py +++ b/aiogram/methods/send_media_group.py @@ -42,6 +42,8 @@ class SendMediaGroup(TelegramMethod[List[Message]]): """Sends messages `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent messages from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" allow_sending_without_reply: Optional[bool] = Field( @@ -72,6 +74,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -88,6 +91,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py index be9cae31..caf28525 100644 --- a/aiogram/methods/send_message.py +++ b/aiogram/methods/send_message.py @@ -46,6 +46,8 @@ class SendMessage(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -90,6 +92,7 @@ class SendMessage(TelegramMethod[Message]): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -115,6 +118,7 @@ class SendMessage(TelegramMethod[Message]): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py index 75270bfe..3ba7da12 100644 --- a/aiogram/methods/send_photo.py +++ b/aiogram/methods/send_photo.py @@ -42,12 +42,16 @@ class SendPhoto(TelegramMethod[Message]): """Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """Pass :code:`True`, if the caption must be shown above the message media""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the photo needs to be covered with a spoiler animation""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -81,9 +85,13 @@ class SendPhoto(TelegramMethod[Message]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -104,9 +112,11 @@ class SendPhoto(TelegramMethod[Message]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py index 9ac92aca..e791b70f 100644 --- a/aiogram/methods/send_poll.py +++ b/aiogram/methods/send_poll.py @@ -67,6 +67,8 @@ class SendPoll(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -112,6 +114,7 @@ class SendPoll(TelegramMethod[Message]): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -144,6 +147,7 @@ class SendPoll(TelegramMethod[Message]): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py index 47cba3b0..236792bf 100644 --- a/aiogram/methods/send_sticker.py +++ b/aiogram/methods/send_sticker.py @@ -41,6 +41,8 @@ class SendSticker(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -74,6 +76,7 @@ class SendSticker(TelegramMethod[Message]): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -94,6 +97,7 @@ class SendSticker(TelegramMethod[Message]): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py index 4c40c0d9..04ebcee7 100644 --- a/aiogram/methods/send_venue.py +++ b/aiogram/methods/send_venue.py @@ -52,6 +52,8 @@ class SendVenue(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -91,6 +93,7 @@ class SendVenue(TelegramMethod[Message]): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -117,6 +120,7 @@ class SendVenue(TelegramMethod[Message]): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index 6f030930..33fb7aa3 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -50,6 +50,8 @@ class SendVideo(TelegramMethod[Message]): """Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """Pass :code:`True`, if the caption must be shown above the message media""" has_spoiler: Optional[bool] = None """Pass :code:`True` if the video needs to be covered with a spoiler animation""" supports_streaming: Optional[bool] = None @@ -58,6 +60,8 @@ class SendVideo(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -95,10 +99,14 @@ class SendVideo(TelegramMethod[Message]): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -123,10 +131,12 @@ class SendVideo(TelegramMethod[Message]): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py index 14a6cafc..43d685b4 100644 --- a/aiogram/methods/send_video_note.py +++ b/aiogram/methods/send_video_note.py @@ -45,6 +45,8 @@ class SendVideoNote(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -80,6 +82,7 @@ class SendVideoNote(TelegramMethod[Message]): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -102,6 +105,7 @@ class SendVideoNote(TelegramMethod[Message]): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py index cd43a946..ccb27d3b 100644 --- a/aiogram/methods/send_voice.py +++ b/aiogram/methods/send_voice.py @@ -48,6 +48,8 @@ class SendVoice(TelegramMethod[Message]): """Sends the message `silently `_. Users will receive a notification with no sound.""" protect_content: Optional[Union[bool, Default]] = Default("protect_content") """Protects the contents of the sent message from forwarding and saving""" + message_effect_id: Optional[str] = None + """Unique identifier of the message effect to be added to the message; for private chats only""" reply_parameters: Optional[ReplyParameters] = None """Description of the message to reply to""" reply_markup: Optional[ @@ -84,6 +86,7 @@ class SendVoice(TelegramMethod[Message]): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -107,6 +110,7 @@ class SendVoice(TelegramMethod[Message]): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/types/chat_full_info.py b/aiogram/types/chat_full_info.py index 7ec46f25..4c5e446f 100644 --- a/aiogram/types/chat_full_info.py +++ b/aiogram/types/chat_full_info.py @@ -78,7 +78,7 @@ class ChatFullInfo(Chat): join_to_send_messages: Optional[bool] = None """*Optional*. :code:`True`, if users need to join the supergroup before they can send messages""" join_by_request: Optional[bool] = None - """*Optional*. :code:`True`, if all users directly joining the supergroup need to be approved by supergroup administrators""" + """*Optional*. :code:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators""" description: Optional[str] = None """*Optional*. Description, for groups, supergroups and channel chats""" invite_link: Optional[str] = None diff --git a/aiogram/types/chat_join_request.py b/aiogram/types/chat_join_request.py index df4d4b38..4a128f17 100644 --- a/aiogram/types/chat_join_request.py +++ b/aiogram/types/chat_join_request.py @@ -167,6 +167,7 @@ class ChatJoinRequest(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -196,6 +197,7 @@ class ChatJoinRequest(TelegramObject): :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -218,6 +220,7 @@ class ChatJoinRequest(TelegramObject): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -238,6 +241,7 @@ class ChatJoinRequest(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -267,6 +271,7 @@ class ChatJoinRequest(TelegramObject): :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -289,6 +294,7 @@ class ChatJoinRequest(TelegramObject): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -309,9 +315,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -340,9 +350,11 @@ class ChatJoinRequest(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -366,9 +378,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -388,9 +402,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -419,9 +437,11 @@ class ChatJoinRequest(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -445,9 +465,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -469,6 +491,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -500,6 +523,7 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -525,6 +549,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -546,6 +571,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -577,6 +603,7 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -602,6 +629,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -619,6 +647,7 @@ class ChatJoinRequest(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -645,6 +674,7 @@ class ChatJoinRequest(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -666,6 +696,7 @@ class ChatJoinRequest(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -683,6 +714,7 @@ class ChatJoinRequest(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -709,6 +741,7 @@ class ChatJoinRequest(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -730,6 +763,7 @@ class ChatJoinRequest(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -749,6 +783,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -777,6 +812,7 @@ class ChatJoinRequest(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -800,6 +836,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -819,6 +856,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -847,6 +885,7 @@ class ChatJoinRequest(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -870,6 +909,7 @@ class ChatJoinRequest(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -884,6 +924,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -905,6 +946,7 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -923,6 +965,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -937,6 +980,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -958,6 +1002,7 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -976,6 +1021,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -988,10 +1034,10 @@ class ChatJoinRequest(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], message_thread_id: Optional[int] = None, + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1009,6 +1055,7 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1028,11 +1075,11 @@ class ChatJoinRequest(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -1040,15 +1087,16 @@ class ChatJoinRequest(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1065,10 +1113,10 @@ class ChatJoinRequest(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1086,6 +1134,7 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1098,10 +1147,10 @@ class ChatJoinRequest(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], message_thread_id: Optional[int] = None, + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1119,6 +1168,7 @@ class ChatJoinRequest(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1138,11 +1188,11 @@ class ChatJoinRequest(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -1150,15 +1200,16 @@ class ChatJoinRequest(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1175,10 +1226,10 @@ class ChatJoinRequest(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1196,6 +1247,7 @@ class ChatJoinRequest(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1215,6 +1267,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1243,6 +1296,7 @@ class ChatJoinRequest(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1266,6 +1320,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1285,6 +1340,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1313,6 +1369,7 @@ class ChatJoinRequest(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1336,6 +1393,7 @@ class ChatJoinRequest(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1350,6 +1408,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -1370,6 +1429,7 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1387,6 +1447,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1400,6 +1461,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -1420,6 +1482,7 @@ class ChatJoinRequest(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1437,6 +1500,7 @@ class ChatJoinRequest(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1451,9 +1515,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1478,9 +1546,11 @@ class ChatJoinRequest(TelegramObject): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1500,9 +1570,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1518,9 +1590,13 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1545,9 +1621,11 @@ class ChatJoinRequest(TelegramObject): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1567,9 +1645,11 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1597,6 +1677,7 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1633,6 +1714,7 @@ class ChatJoinRequest(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1664,6 +1746,7 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1691,6 +1774,7 @@ class ChatJoinRequest(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1727,6 +1811,7 @@ class ChatJoinRequest(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1758,6 +1843,7 @@ class ChatJoinRequest(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1772,6 +1858,7 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1795,6 +1882,7 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1813,6 +1901,7 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1827,6 +1916,7 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1850,6 +1940,7 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1868,6 +1959,7 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1883,6 +1975,7 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1907,6 +2000,7 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1926,6 +2020,7 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1941,6 +2036,7 @@ class ChatJoinRequest(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1965,6 +2061,7 @@ class ChatJoinRequest(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1984,6 +2081,7 @@ class ChatJoinRequest(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2005,6 +2103,7 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2035,6 +2134,7 @@ class ChatJoinRequest(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2060,6 +2160,7 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2081,6 +2182,7 @@ class ChatJoinRequest(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2111,6 +2213,7 @@ class ChatJoinRequest(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2136,6 +2239,7 @@ class ChatJoinRequest(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2155,10 +2259,14 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2187,10 +2295,12 @@ class ChatJoinRequest(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2214,10 +2324,12 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2237,10 +2349,14 @@ class ChatJoinRequest(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2269,10 +2385,12 @@ class ChatJoinRequest(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2296,10 +2414,12 @@ class ChatJoinRequest(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2317,6 +2437,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2343,6 +2464,7 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2364,6 +2486,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2381,6 +2504,7 @@ class ChatJoinRequest(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2407,6 +2531,7 @@ class ChatJoinRequest(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2428,6 +2553,7 @@ class ChatJoinRequest(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2446,6 +2572,7 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2473,6 +2600,7 @@ class ChatJoinRequest(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2495,6 +2623,7 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2513,6 +2642,7 @@ class ChatJoinRequest(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2540,6 +2670,7 @@ class ChatJoinRequest(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2562,6 +2693,7 @@ class ChatJoinRequest(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/types/chat_member_updated.py b/aiogram/types/chat_member_updated.py index bf177b2c..48c3e9db 100644 --- a/aiogram/types/chat_member_updated.py +++ b/aiogram/types/chat_member_updated.py @@ -88,7 +88,7 @@ class ChatMemberUpdated(TelegramObject): invite_link: Optional[ChatInviteLink] = None """*Optional*. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.""" via_join_request: Optional[bool] = None - """*Optional*. True, if the user joined the chat after sending a direct join request and being approved by an administrator""" + """*Optional*. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator""" via_chat_folder_invite_link: Optional[bool] = None """*Optional*. True, if the user joined the chat via a chat folder invite link""" @@ -151,6 +151,7 @@ class ChatMemberUpdated(TelegramObject): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -180,6 +181,7 @@ class ChatMemberUpdated(TelegramObject): :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -202,6 +204,7 @@ class ChatMemberUpdated(TelegramObject): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -222,9 +225,13 @@ class ChatMemberUpdated(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -253,9 +260,11 @@ class ChatMemberUpdated(TelegramObject): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -279,9 +288,11 @@ class ChatMemberUpdated(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -303,6 +314,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -334,6 +346,7 @@ class ChatMemberUpdated(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -359,6 +372,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -376,6 +390,7 @@ class ChatMemberUpdated(TelegramObject): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -402,6 +417,7 @@ class ChatMemberUpdated(TelegramObject): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -423,6 +439,7 @@ class ChatMemberUpdated(TelegramObject): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -442,6 +459,7 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -470,6 +488,7 @@ class ChatMemberUpdated(TelegramObject): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -493,6 +512,7 @@ class ChatMemberUpdated(TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -507,6 +527,7 @@ class ChatMemberUpdated(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -528,6 +549,7 @@ class ChatMemberUpdated(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -546,6 +568,7 @@ class ChatMemberUpdated(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -558,10 +581,10 @@ class ChatMemberUpdated(TelegramObject): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], message_thread_id: Optional[int] = None, + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -579,6 +602,7 @@ class ChatMemberUpdated(TelegramObject): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -598,11 +622,11 @@ class ChatMemberUpdated(TelegramObject): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -610,15 +634,16 @@ class ChatMemberUpdated(TelegramObject): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -635,10 +660,10 @@ class ChatMemberUpdated(TelegramObject): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, message_thread_id=message_thread_id, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -656,6 +681,7 @@ class ChatMemberUpdated(TelegramObject): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -675,6 +701,7 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -703,6 +730,7 @@ class ChatMemberUpdated(TelegramObject): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -726,6 +754,7 @@ class ChatMemberUpdated(TelegramObject): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -740,6 +769,7 @@ class ChatMemberUpdated(TelegramObject): message_thread_id: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -760,6 +790,7 @@ class ChatMemberUpdated(TelegramObject): :param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for forum supergroups only :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -777,6 +808,7 @@ class ChatMemberUpdated(TelegramObject): message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -791,9 +823,13 @@ class ChatMemberUpdated(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -818,9 +854,11 @@ class ChatMemberUpdated(TelegramObject): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -840,9 +878,11 @@ class ChatMemberUpdated(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -870,6 +910,7 @@ class ChatMemberUpdated(TelegramObject): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -906,6 +947,7 @@ class ChatMemberUpdated(TelegramObject): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -937,6 +979,7 @@ class ChatMemberUpdated(TelegramObject): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -951,6 +994,7 @@ class ChatMemberUpdated(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -974,6 +1018,7 @@ class ChatMemberUpdated(TelegramObject): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -992,6 +1037,7 @@ class ChatMemberUpdated(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1007,6 +1053,7 @@ class ChatMemberUpdated(TelegramObject): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1031,6 +1078,7 @@ class ChatMemberUpdated(TelegramObject): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1050,6 +1098,7 @@ class ChatMemberUpdated(TelegramObject): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1071,6 +1120,7 @@ class ChatMemberUpdated(TelegramObject): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1101,6 +1151,7 @@ class ChatMemberUpdated(TelegramObject): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1126,6 +1177,7 @@ class ChatMemberUpdated(TelegramObject): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1145,10 +1197,14 @@ class ChatMemberUpdated(TelegramObject): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1177,10 +1233,12 @@ class ChatMemberUpdated(TelegramObject): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1204,10 +1262,12 @@ class ChatMemberUpdated(TelegramObject): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1225,6 +1285,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1251,6 +1312,7 @@ class ChatMemberUpdated(TelegramObject): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1272,6 +1334,7 @@ class ChatMemberUpdated(TelegramObject): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1290,6 +1353,7 @@ class ChatMemberUpdated(TelegramObject): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1317,6 +1381,7 @@ class ChatMemberUpdated(TelegramObject): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1339,6 +1404,7 @@ class ChatMemberUpdated(TelegramObject): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, diff --git a/aiogram/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py index 7d799e85..96b4a745 100644 --- a/aiogram/types/inline_keyboard_button.py +++ b/aiogram/types/inline_keyboard_button.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: class InlineKeyboardButton(MutableTelegramObject): """ - This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. + This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton """ @@ -37,7 +37,7 @@ class InlineKeyboardButton(MutableTelegramObject): callback_game: Optional[CallbackGame] = None """*Optional*. Description of the game that will be launched when the user presses the button.""" pay: Optional[bool] = None - """*Optional*. Specify :code:`True`, to send a `Pay button `_.""" + """*Optional*. Specify :code:`True`, to send a `Pay button `_. Substrings '⭐' and 'XTR' in the buttons's text will be replaced with a Telegram Star icon.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! diff --git a/aiogram/types/inline_query_result_cached_gif.py b/aiogram/types/inline_query_result_cached_gif.py index c9d6a76e..277454c9 100644 --- a/aiogram/types/inline_query_result_cached_gif.py +++ b/aiogram/types/inline_query_result_cached_gif.py @@ -37,6 +37,8 @@ class InlineQueryResultCachedGif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -64,6 +66,9 @@ class InlineQueryResultCachedGif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -88,6 +93,7 @@ class InlineQueryResultCachedGif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py index 7c35c813..ec043864 100644 --- a/aiogram/types/inline_query_result_cached_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_cached_mpeg4_gif.py @@ -37,6 +37,8 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -64,6 +66,9 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -88,6 +93,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_photo.py b/aiogram/types/inline_query_result_cached_photo.py index aa6b68bb..f40b203a 100644 --- a/aiogram/types/inline_query_result_cached_photo.py +++ b/aiogram/types/inline_query_result_cached_photo.py @@ -39,6 +39,8 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -67,6 +69,9 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -92,6 +97,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_cached_video.py b/aiogram/types/inline_query_result_cached_video.py index ea6cb0d5..4095ab99 100644 --- a/aiogram/types/inline_query_result_cached_video.py +++ b/aiogram/types/inline_query_result_cached_video.py @@ -39,6 +39,8 @@ class InlineQueryResultCachedVideo(InlineQueryResult): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -67,6 +69,9 @@ class InlineQueryResultCachedVideo(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -92,6 +97,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py index 8c2da639..3ad0eef8 100644 --- a/aiogram/types/inline_query_result_gif.py +++ b/aiogram/types/inline_query_result_gif.py @@ -48,6 +48,8 @@ class InlineQueryResultGif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -80,6 +82,9 @@ class InlineQueryResultGif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -109,6 +114,7 @@ class InlineQueryResultGif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py index 35f5d17c..6ca282e1 100644 --- a/aiogram/types/inline_query_result_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_mpeg4_gif.py @@ -47,6 +47,8 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -79,6 +81,9 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -108,6 +113,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_photo.py b/aiogram/types/inline_query_result_photo.py index b0b9fd03..02f68415 100644 --- a/aiogram/types/inline_query_result_photo.py +++ b/aiogram/types/inline_query_result_photo.py @@ -45,6 +45,8 @@ class InlineQueryResultPhoto(InlineQueryResult): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" reply_markup: Optional[InlineKeyboardMarkup] = None """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[ @@ -76,6 +78,9 @@ class InlineQueryResultPhoto(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, input_message_content: Optional[ Union[ @@ -104,6 +109,7 @@ class InlineQueryResultPhoto(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, input_message_content=input_message_content, **__pydantic_kwargs, diff --git a/aiogram/types/inline_query_result_video.py b/aiogram/types/inline_query_result_video.py index d7fd7eed..52332fd7 100644 --- a/aiogram/types/inline_query_result_video.py +++ b/aiogram/types/inline_query_result_video.py @@ -43,6 +43,8 @@ class InlineQueryResultVideo(InlineQueryResult): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" video_width: Optional[int] = None """*Optional*. Video width""" video_height: Optional[int] = None @@ -80,6 +82,9 @@ class InlineQueryResultVideo(InlineQueryResult): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), video_width: Optional[int] = None, video_height: Optional[int] = None, video_duration: Optional[int] = None, @@ -110,6 +115,7 @@ class InlineQueryResultVideo(InlineQueryResult): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, video_width=video_width, video_height=video_height, video_duration=video_duration, diff --git a/aiogram/types/input_invoice_message_content.py b/aiogram/types/input_invoice_message_content.py index af298dec..0dbb6d27 100644 --- a/aiogram/types/input_invoice_message_content.py +++ b/aiogram/types/input_invoice_message_content.py @@ -21,14 +21,14 @@ class InputInvoiceMessageContent(InputMessageContent): """Product description, 1-255 characters""" payload: str """Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.""" - provider_token: str - """Payment provider token, obtained via `@BotFather `_""" currency: str - """Three-letter ISO 4217 currency code, see `more on currencies `_""" + """Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_.""" prices: List[LabeledPrice] - """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)""" + """Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_.""" + provider_token: Optional[str] = None + """*Optional*. Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_.""" max_tip_amount: Optional[int] = None - """*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0""" + """*Optional*. The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_.""" suggested_tip_amounts: Optional[List[int]] = None """*Optional*. A JSON-serialized array of suggested amounts of tip in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*.""" provider_data: Optional[str] = None @@ -42,19 +42,19 @@ class InputInvoiceMessageContent(InputMessageContent): photo_height: Optional[int] = None """*Optional*. Photo height""" need_name: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's full name to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_.""" need_phone_number: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's phone number to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_.""" need_email: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's email address to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_.""" need_shipping_address: Optional[bool] = None - """*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order""" + """*Optional*. Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_.""" send_phone_number_to_provider: Optional[bool] = None - """*Optional*. Pass :code:`True` if the user's phone number should be sent to provider""" + """*Optional*. Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" send_email_to_provider: Optional[bool] = None - """*Optional*. Pass :code:`True` if the user's email address should be sent to provider""" + """*Optional*. Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_.""" is_flexible: Optional[bool] = None - """*Optional*. Pass :code:`True` if the final price depends on the shipping method""" + """*Optional*. Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_.""" if TYPE_CHECKING: # DO NOT EDIT MANUALLY!!! @@ -66,9 +66,9 @@ class InputInvoiceMessageContent(InputMessageContent): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, provider_data: Optional[str] = None, @@ -93,9 +93,9 @@ class InputInvoiceMessageContent(InputMessageContent): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, provider_data=provider_data, diff --git a/aiogram/types/input_media_animation.py b/aiogram/types/input_media_animation.py index 9dcf0a9e..a0251f23 100644 --- a/aiogram/types/input_media_animation.py +++ b/aiogram/types/input_media_animation.py @@ -30,6 +30,8 @@ class InputMediaAnimation(InputMedia): """*Optional*. Mode for parsing entities in the animation caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" width: Optional[int] = None """*Optional*. Animation width""" height: Optional[int] = None @@ -52,6 +54,9 @@ class InputMediaAnimation(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), width: Optional[int] = None, height: Optional[int] = None, duration: Optional[int] = None, @@ -69,6 +74,7 @@ class InputMediaAnimation(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, width=width, height=height, duration=duration, diff --git a/aiogram/types/input_media_photo.py b/aiogram/types/input_media_photo.py index ecb3c91d..19daa261 100644 --- a/aiogram/types/input_media_photo.py +++ b/aiogram/types/input_media_photo.py @@ -28,6 +28,8 @@ class InputMediaPhoto(InputMedia): """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" has_spoiler: Optional[bool] = None """*Optional*. Pass :code:`True` if the photo needs to be covered with a spoiler animation""" @@ -43,6 +45,9 @@ class InputMediaPhoto(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, **__pydantic_kwargs: Any, ) -> None: @@ -56,6 +61,7 @@ class InputMediaPhoto(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, **__pydantic_kwargs, ) diff --git a/aiogram/types/input_media_video.py b/aiogram/types/input_media_video.py index b44f6a76..6f1e3263 100644 --- a/aiogram/types/input_media_video.py +++ b/aiogram/types/input_media_video.py @@ -30,6 +30,8 @@ class InputMediaVideo(InputMedia): """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" + show_caption_above_media: Optional[Union[bool, Default]] = Default("show_caption_above_media") + """*Optional*. Pass :code:`True`, if the caption must be shown above the message media""" width: Optional[int] = None """*Optional*. Video width""" height: Optional[int] = None @@ -54,6 +56,9 @@ class InputMediaVideo(InputMedia): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), width: Optional[int] = None, height: Optional[int] = None, duration: Optional[int] = None, @@ -72,6 +77,7 @@ class InputMediaVideo(InputMedia): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, width=width, height=height, duration=duration, diff --git a/aiogram/types/invoice.py b/aiogram/types/invoice.py index f451ead0..7c70f0ba 100644 --- a/aiogram/types/invoice.py +++ b/aiogram/types/invoice.py @@ -19,7 +19,7 @@ class Invoice(TelegramObject): start_parameter: str """Unique bot deep-linking parameter that can be used to generate this invoice""" currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" diff --git a/aiogram/types/keyboard_button.py b/aiogram/types/keyboard_button.py index a0aa2bb2..0cf7d58d 100644 --- a/aiogram/types/keyboard_button.py +++ b/aiogram/types/keyboard_button.py @@ -16,7 +16,7 @@ if TYPE_CHECKING: class KeyboardButton(MutableTelegramObject): """ - This object represents one button of the reply keyboard. For simple text buttons, *String* can be used instead of this object to specify the button text. The optional fields *web_app*, *request_users*, *request_chat*, *request_contact*, *request_location*, and *request_poll* are mutually exclusive. + This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, *String* can be used instead of this object to specify the button text. **Note:** *request_users* and *request_chat* options will only work in Telegram versions released after 3 February, 2023. Older clients will display *unsupported message*. Source: https://core.telegram.org/bots/api#keyboardbutton diff --git a/aiogram/types/message.py b/aiogram/types/message.py index d96febc7..2b4b34ef 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -176,6 +176,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text""" link_preview_options: Optional[LinkPreviewOptions] = None """*Optional*. Options used for link preview generation for the message, if it is a text message and link preview options were changed""" + effect_id: Optional[str] = None + """*Optional*. Unique identifier of the message effect added to the message""" animation: Optional[Animation] = None """*Optional*. Message is an animation, information about the animation. For backward compatibility, when this field is set, the *document* field will also be set""" audio: Optional[Audio] = None @@ -198,6 +200,8 @@ class Message(MaybeInaccessibleMessage): """*Optional*. Caption for the animation, audio, document, photo, video or voice""" caption_entities: Optional[List[MessageEntity]] = None """*Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption""" + show_caption_above_media: Optional[bool] = None + """*Optional*. True, if the caption must be shown above the message media""" has_media_spoiler: Optional[bool] = None """*Optional*. :code:`True`, if the message media is covered by a spoiler animation""" contact: Optional[Contact] = None @@ -363,6 +367,7 @@ class Message(MaybeInaccessibleMessage): text: Optional[str] = None, entities: Optional[List[MessageEntity]] = None, link_preview_options: Optional[LinkPreviewOptions] = None, + effect_id: Optional[str] = None, animation: Optional[Animation] = None, audio: Optional[Audio] = None, document: Optional[Document] = None, @@ -374,6 +379,7 @@ class Message(MaybeInaccessibleMessage): voice: Optional[Voice] = None, caption: Optional[str] = None, caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[bool] = None, has_media_spoiler: Optional[bool] = None, contact: Optional[Contact] = None, dice: Optional[Dice] = None, @@ -458,6 +464,7 @@ class Message(MaybeInaccessibleMessage): text=text, entities=entities, link_preview_options=link_preview_options, + effect_id=effect_id, animation=animation, audio=audio, document=document, @@ -469,6 +476,7 @@ class Message(MaybeInaccessibleMessage): voice=voice, caption=caption, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_media_spoiler=has_media_spoiler, contact=contact, dice=dice, @@ -660,9 +668,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -691,9 +703,11 @@ class Message(MaybeInaccessibleMessage): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -721,9 +735,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -740,9 +756,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -771,9 +791,11 @@ class Message(MaybeInaccessibleMessage): :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the animation needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -801,9 +823,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -823,6 +847,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -854,6 +879,7 @@ class Message(MaybeInaccessibleMessage): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -883,6 +909,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -901,6 +928,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -932,6 +960,7 @@ class Message(MaybeInaccessibleMessage): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -961,6 +990,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -976,6 +1006,7 @@ class Message(MaybeInaccessibleMessage): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1002,6 +1033,7 @@ class Message(MaybeInaccessibleMessage): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1027,6 +1059,7 @@ class Message(MaybeInaccessibleMessage): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1041,6 +1074,7 @@ class Message(MaybeInaccessibleMessage): vcard: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1067,6 +1101,7 @@ class Message(MaybeInaccessibleMessage): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1092,6 +1127,7 @@ class Message(MaybeInaccessibleMessage): vcard=vcard, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1109,6 +1145,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1137,6 +1174,7 @@ class Message(MaybeInaccessibleMessage): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1164,6 +1202,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1180,6 +1219,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1208,6 +1248,7 @@ class Message(MaybeInaccessibleMessage): :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1235,6 +1276,7 @@ class Message(MaybeInaccessibleMessage): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1247,6 +1289,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1268,6 +1311,7 @@ class Message(MaybeInaccessibleMessage): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1290,6 +1334,7 @@ class Message(MaybeInaccessibleMessage): game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1301,6 +1346,7 @@ class Message(MaybeInaccessibleMessage): game_short_name: str, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1322,6 +1368,7 @@ class Message(MaybeInaccessibleMessage): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `@BotFather `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1344,6 +1391,7 @@ class Message(MaybeInaccessibleMessage): game_short_name=game_short_name, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1356,9 +1404,9 @@ class Message(MaybeInaccessibleMessage): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1376,6 +1424,7 @@ class Message(MaybeInaccessibleMessage): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1397,10 +1446,10 @@ class Message(MaybeInaccessibleMessage): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -1408,15 +1457,16 @@ class Message(MaybeInaccessibleMessage): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1439,9 +1489,9 @@ class Message(MaybeInaccessibleMessage): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1459,6 +1509,7 @@ class Message(MaybeInaccessibleMessage): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1470,9 +1521,9 @@ class Message(MaybeInaccessibleMessage): title: str, description: str, payload: str, - provider_token: str, currency: str, prices: List[LabeledPrice], + provider_token: Optional[str] = None, max_tip_amount: Optional[int] = None, suggested_tip_amounts: Optional[List[int]] = None, start_parameter: Optional[str] = None, @@ -1490,6 +1541,7 @@ class Message(MaybeInaccessibleMessage): is_flexible: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[InlineKeyboardMarkup] = None, allow_sending_without_reply: Optional[bool] = None, @@ -1511,10 +1563,10 @@ class Message(MaybeInaccessibleMessage): :param title: Product name, 1-32 characters :param description: Product description, 1-255 characters :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - :param provider_token: Payment provider token, obtained via `@BotFather `_ - :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_ - :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 + :param currency: Three-letter ISO 4217 currency code, see `more on currencies `_. Pass 'XTR' for payments in `Telegram Stars `_. + :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in `Telegram Stars `_. + :param provider_token: Payment provider token, obtained via `@BotFather `_. Pass an empty string for payments in `Telegram Stars `_. + :param max_tip_amount: The maximum accepted amount for tips in the *smallest units* of the currency (integer, **not** float/double). For example, for a maximum tip of :code:`US$ 1.45` pass :code:`max_tip_amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in `Telegram Stars `_. :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the *smallest units* of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed *max_tip_amount*. :param start_parameter: Unique deep-linking parameter. If left empty, **forwarded copies** of the sent message will have a *Pay* button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a *URL* button with a deep link to the bot (instead of a *Pay* button), with the value used as the start parameter :param provider_data: JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. @@ -1522,15 +1574,16 @@ class Message(MaybeInaccessibleMessage): :param photo_size: Photo size in bytes :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass :code:`True` if you require the user's full name to complete the order - :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order - :param need_email: Pass :code:`True` if you require the user's email address to complete the order - :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to provider - :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to provider - :param is_flexible: Pass :code:`True` if the final price depends on the shipping method + :param need_name: Pass :code:`True` if you require the user's full name to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_phone_number: Pass :code:`True` if you require the user's phone number to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_email: Pass :code:`True` if you require the user's email address to complete the order. Ignored for payments in `Telegram Stars `_. + :param need_shipping_address: Pass :code:`True` if you require the user's shipping address to complete the order. Ignored for payments in `Telegram Stars `_. + :param send_phone_number_to_provider: Pass :code:`True` if the user's phone number should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param send_email_to_provider: Pass :code:`True` if the user's email address should be sent to the provider. Ignored for payments in `Telegram Stars `_. + :param is_flexible: Pass :code:`True` if the final price depends on the shipping method. Ignored for payments in `Telegram Stars `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1553,9 +1606,9 @@ class Message(MaybeInaccessibleMessage): title=title, description=description, payload=payload, - provider_token=provider_token, currency=currency, prices=prices, + provider_token=provider_token, max_tip_amount=max_tip_amount, suggested_tip_amounts=suggested_tip_amounts, start_parameter=start_parameter, @@ -1573,6 +1626,7 @@ class Message(MaybeInaccessibleMessage): is_flexible=is_flexible, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1590,6 +1644,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1618,6 +1673,7 @@ class Message(MaybeInaccessibleMessage): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1645,6 +1701,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1661,6 +1718,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1689,6 +1747,7 @@ class Message(MaybeInaccessibleMessage): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1716,6 +1775,7 @@ class Message(MaybeInaccessibleMessage): proximity_alert_radius=proximity_alert_radius, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1728,6 +1788,7 @@ class Message(MaybeInaccessibleMessage): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, **kwargs: Any, @@ -1748,6 +1809,7 @@ class Message(MaybeInaccessibleMessage): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :return: instance of method :class:`aiogram.methods.send_media_group.SendMediaGroup` @@ -1769,6 +1831,7 @@ class Message(MaybeInaccessibleMessage): media=media, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, **kwargs, @@ -1779,6 +1842,7 @@ class Message(MaybeInaccessibleMessage): media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, allow_sending_without_reply: Optional[bool] = None, reply_to_message_id: Optional[int] = None, @@ -1799,6 +1863,7 @@ class Message(MaybeInaccessibleMessage): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent messages from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found :param reply_to_message_id: If the messages are a reply, ID of the original message @@ -1820,6 +1885,7 @@ class Message(MaybeInaccessibleMessage): media=media, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, allow_sending_without_reply=allow_sending_without_reply, reply_to_message_id=reply_to_message_id, @@ -1836,6 +1902,7 @@ class Message(MaybeInaccessibleMessage): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1865,6 +1932,7 @@ class Message(MaybeInaccessibleMessage): :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1891,6 +1959,7 @@ class Message(MaybeInaccessibleMessage): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1908,6 +1977,7 @@ class Message(MaybeInaccessibleMessage): ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -1937,6 +2007,7 @@ class Message(MaybeInaccessibleMessage): :param link_preview_options: Link preview generation options for the message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -1963,6 +2034,7 @@ class Message(MaybeInaccessibleMessage): link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -1977,9 +2049,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2004,9 +2080,11 @@ class Message(MaybeInaccessibleMessage): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2030,9 +2108,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2045,9 +2125,13 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2072,9 +2156,11 @@ class Message(MaybeInaccessibleMessage): :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the photo needs to be covered with a spoiler animation :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2098,9 +2184,11 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2126,6 +2214,7 @@ class Message(MaybeInaccessibleMessage): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2162,6 +2251,7 @@ class Message(MaybeInaccessibleMessage): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2197,6 +2287,7 @@ class Message(MaybeInaccessibleMessage): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2221,6 +2312,7 @@ class Message(MaybeInaccessibleMessage): is_closed: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2257,6 +2349,7 @@ class Message(MaybeInaccessibleMessage): :param is_closed: Pass :code:`True` if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2292,6 +2385,7 @@ class Message(MaybeInaccessibleMessage): is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2304,6 +2398,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2327,6 +2422,7 @@ class Message(MaybeInaccessibleMessage): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2349,6 +2445,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2360,6 +2457,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2383,6 +2481,7 @@ class Message(MaybeInaccessibleMessage): :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '⚽', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '⚽', and values 1-64 for '🎰'. Defaults to '🎲' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2405,6 +2504,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2418,6 +2518,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2442,6 +2543,7 @@ class Message(MaybeInaccessibleMessage): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2465,6 +2567,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2477,6 +2580,7 @@ class Message(MaybeInaccessibleMessage): emoji: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2501,6 +2605,7 @@ class Message(MaybeInaccessibleMessage): :param emoji: Emoji associated with the sticker; only for just uploaded stickers :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2524,6 +2629,7 @@ class Message(MaybeInaccessibleMessage): emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2543,6 +2649,7 @@ class Message(MaybeInaccessibleMessage): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2573,6 +2680,7 @@ class Message(MaybeInaccessibleMessage): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2602,6 +2710,7 @@ class Message(MaybeInaccessibleMessage): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2620,6 +2729,7 @@ class Message(MaybeInaccessibleMessage): google_place_type: Optional[str] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2650,6 +2760,7 @@ class Message(MaybeInaccessibleMessage): :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2679,6 +2790,7 @@ class Message(MaybeInaccessibleMessage): google_place_type=google_place_type, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2696,10 +2808,14 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2728,10 +2844,12 @@ class Message(MaybeInaccessibleMessage): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2759,10 +2877,12 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2779,10 +2899,14 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), has_spoiler: Optional[bool] = None, supports_streaming: Optional[bool] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2811,10 +2935,12 @@ class Message(MaybeInaccessibleMessage): :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media :param has_spoiler: Pass :code:`True` if the video needs to be covered with a spoiler animation :param supports_streaming: Pass :code:`True` if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2842,10 +2968,12 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2861,6 +2989,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2887,6 +3016,7 @@ class Message(MaybeInaccessibleMessage): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2912,6 +3042,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2926,6 +3057,7 @@ class Message(MaybeInaccessibleMessage): thumbnail: Optional[InputFile] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -2952,6 +3084,7 @@ class Message(MaybeInaccessibleMessage): :param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More information on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -2977,6 +3110,7 @@ class Message(MaybeInaccessibleMessage): thumbnail=thumbnail, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -2993,6 +3127,7 @@ class Message(MaybeInaccessibleMessage): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3020,6 +3155,7 @@ class Message(MaybeInaccessibleMessage): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3046,6 +3182,7 @@ class Message(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3061,6 +3198,7 @@ class Message(MaybeInaccessibleMessage): duration: Optional[int] = None, disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), + message_effect_id: Optional[str] = None, reply_parameters: Optional[ReplyParameters] = None, reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] @@ -3088,6 +3226,7 @@ class Message(MaybeInaccessibleMessage): :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving + :param message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only :param reply_parameters: Description of the message to reply to :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove a reply keyboard or to force a reply from the user :param allow_sending_without_reply: Pass :code:`True` if the message should be sent even if the specified replied-to message is not found @@ -3114,6 +3253,7 @@ class Message(MaybeInaccessibleMessage): duration=duration, disable_notification=disable_notification, protect_content=protect_content, + message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, allow_sending_without_reply=allow_sending_without_reply, @@ -3132,6 +3272,7 @@ class Message(MaybeInaccessibleMessage): message_thread_id: Optional[int] = None, business_connection_id: Optional[str] = None, parse_mode: Optional[str] = None, + message_effect_id: Optional[str] = None, ) -> Union[ ForwardMessage, SendAnimation, @@ -3167,7 +3308,9 @@ class Message(MaybeInaccessibleMessage): :param reply_markup: :param allow_sending_without_reply: :param message_thread_id: + :param business_connection_id: :param parse_mode: + :param message_effect_id: :return: """ from ..methods import ( @@ -3200,6 +3343,7 @@ class Message(MaybeInaccessibleMessage): # when sending a copy, we don't need any parse mode # because all entities are already prepared "parse_mode": parse_mode, + "message_effect_id": message_effect_id or self.effect_id, } if self.text: @@ -3319,6 +3463,9 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), disable_notification: Optional[bool] = None, protect_content: Optional[Union[bool, Default]] = Default("protect_content"), reply_parameters: Optional[ReplyParameters] = None, @@ -3345,6 +3492,7 @@ class Message(MaybeInaccessibleMessage): :param caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept :param parse_mode: Mode for parsing entities in the new caption. See `formatting options `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media. Ignored if a new caption isn't specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param protect_content: Protects the contents of the sent message from forwarding and saving :param reply_parameters: Description of the message to reply to @@ -3370,6 +3518,7 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, protect_content=protect_content, reply_parameters=reply_parameters, @@ -3700,6 +3849,9 @@ class Message(MaybeInaccessibleMessage): caption: Optional[str] = None, parse_mode: Optional[Union[str, Default]] = Default("parse_mode"), caption_entities: Optional[List[MessageEntity]] = None, + show_caption_above_media: Optional[Union[bool, Default]] = Default( + "show_caption_above_media" + ), reply_markup: Optional[InlineKeyboardMarkup] = None, **kwargs: Any, ) -> EditMessageCaption: @@ -3718,6 +3870,7 @@ class Message(MaybeInaccessibleMessage): :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 `_ for more details. :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of *parse_mode* + :param show_caption_above_media: Pass :code:`True`, if the caption must be shown above the message media. Supported only for animation, photo and video messages. :param reply_markup: A JSON-serialized object for an `inline keyboard `_. :return: instance of method :class:`aiogram.methods.edit_message_caption.EditMessageCaption` """ @@ -3737,6 +3890,7 @@ class Message(MaybeInaccessibleMessage): caption=caption, parse_mode=parse_mode, caption_entities=caption_entities, + show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, **kwargs, ).as_(self._bot) diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index b1c08ffc..ee774b09 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -17,7 +17,7 @@ class MessageEntity(MutableTelegramObject): """ type: str - """Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)""" + """Type of the entity. Currently, can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'spoiler' (spoiler message), 'blockquote' (block quotation), 'expandable_blockquote' (collapsed-by-default block quotation), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_), 'custom_emoji' (for inline custom emoji stickers)""" offset: int """Offset in `UTF-16 code units `_ to the start of the entity""" length: int diff --git a/aiogram/types/pre_checkout_query.py b/aiogram/types/pre_checkout_query.py index 6c10650f..7733113f 100644 --- a/aiogram/types/pre_checkout_query.py +++ b/aiogram/types/pre_checkout_query.py @@ -24,7 +24,7 @@ class PreCheckoutQuery(TelegramObject): from_user: User = Field(..., alias="from") """User who sent the query""" currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" invoice_payload: str diff --git a/aiogram/types/successful_payment.py b/aiogram/types/successful_payment.py index 97dcefe5..c6543cec 100644 --- a/aiogram/types/successful_payment.py +++ b/aiogram/types/successful_payment.py @@ -16,7 +16,7 @@ class SuccessfulPayment(TelegramObject): """ currency: str - """Three-letter ISO 4217 `currency `_ code""" + """Three-letter ISO 4217 `currency `_ code, or 'XTR' for payments in `Telegram Stars `_""" total_amount: int """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" invoice_payload: str diff --git a/aiogram/types/update.py b/aiogram/types/update.py index 57ef2df5..0533996d 100644 --- a/aiogram/types/update.py +++ b/aiogram/types/update.py @@ -46,7 +46,7 @@ class Update(TelegramObject): business_connection: Optional[BusinessConnection] = None """*Optional*. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot""" business_message: Optional[Message] = None - """*Optional*. New non-service message from a connected business account""" + """*Optional*. New message from a connected business account""" edited_business_message: Optional[Message] = None """*Optional*. New version of a message from a connected business account""" deleted_business_messages: Optional[BusinessMessagesDeleted] = None diff --git a/aiogram/utils/formatting.py b/aiogram/utils/formatting.py index 9aa3466e..145eadcf 100644 --- a/aiogram/utils/formatting.py +++ b/aiogram/utils/formatting.py @@ -442,6 +442,17 @@ class BlockQuote(Text): type = MessageEntityType.BLOCKQUOTE +class ExpandableBlockQuote(Text): + """ + Expandable block quote element. + + Will be wrapped into :obj:`aiogram.types.message_entity.MessageEntity` + with type :obj:`aiogram.enums.message_entity_type.MessageEntityType.EXPANDABLE_BLOCKQUOTE` + """ + + type = MessageEntityType.EXPANDABLE_BLOCKQUOTE + + NODE_TYPES: Dict[Optional[str], Type[Text]] = { Text.type: Text, HashTag.type: HashTag, @@ -461,6 +472,7 @@ NODE_TYPES: Dict[Optional[str], Type[Text]] = { TextMention.type: TextMention, CustomEmoji.type: CustomEmoji, BlockQuote.type: BlockQuote, + ExpandableBlockQuote.type: ExpandableBlockQuote, } diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index ae6227d3..440fffa6 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -57,6 +57,7 @@ class TextDecoration(ABC): MessageEntityType.STRIKETHROUGH, MessageEntityType.SPOILER, MessageEntityType.BLOCKQUOTE, + MessageEntityType.EXPANDABLE_BLOCKQUOTE, }: return cast(str, getattr(self, entity.type)(value=text)) if entity.type == MessageEntityType.PRE: @@ -172,6 +173,10 @@ class TextDecoration(ABC): def blockquote(self, value: str) -> str: pass + @abstractmethod + def expandable_blockquote(self, value: str) -> str: + pass + class HtmlDecoration(TextDecoration): BOLD_TAG = "b" @@ -218,6 +223,9 @@ class HtmlDecoration(TextDecoration): def blockquote(self, value: str) -> str: return f"<{self.BLOCKQUOTE_TAG}>{value}" + def expandable_blockquote(self, value: str) -> str: + return f"<{self.BLOCKQUOTE_TAG} expandable>{value}" + class MarkdownDecoration(TextDecoration): MARKDOWN_QUOTE_PATTERN: Pattern[str] = re.compile(r"([_*\[\]()~`>#+\-=|{}.!\\])") @@ -258,6 +266,9 @@ class MarkdownDecoration(TextDecoration): def blockquote(self, value: str) -> str: return "\n".join(f">{line}" for line in value.splitlines()) + def expandable_blockquote(self, value: str) -> str: + return "\n".join(f">{line}" for line in value.splitlines()) + "||" + html_decoration = HtmlDecoration() markdown_decoration = MarkdownDecoration() diff --git a/docs/api/methods/index.rst b/docs/api/methods/index.rst index 3eda4ce7..2325a0c6 100644 --- a/docs/api/methods/index.rst +++ b/docs/api/methods/index.rst @@ -161,6 +161,7 @@ Payments answer_pre_checkout_query answer_shipping_query create_invoice_link + refund_star_payment send_invoice Getting updates diff --git a/docs/api/methods/refund_star_payment.rst b/docs/api/methods/refund_star_payment.rst new file mode 100644 index 00000000..1248d500 --- /dev/null +++ b/docs/api/methods/refund_star_payment.rst @@ -0,0 +1,45 @@ +################# +refundStarPayment +################# + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.refund_star_payment + :members: + :member-order: bysource + :undoc-members: True + :exclude-members: model_config,model_fields + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.refund_star_payment(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.refund_star_payment import RefundStarPayment` +- alias: :code:`from aiogram.methods import RefundStarPayment` + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(RefundStarPayment(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return RefundStarPayment(...) diff --git a/docs/utils/formatting.rst b/docs/utils/formatting.rst index 898c1d13..9f3a0572 100644 --- a/docs/utils/formatting.rst +++ b/docs/utils/formatting.rst @@ -197,3 +197,9 @@ Available elements .. autoclass:: aiogram.utils.formatting.CustomEmoji :show-inheritance: + +.. autoclass:: aiogram.utils.formatting.BlockQuote + :show-inheritance: + +.. autoclass:: aiogram.utils.formatting.ExpandableBlockQuote + :show-inheritance: diff --git a/tests/test_api/test_methods/test_refund_star_payment.py b/tests/test_api/test_methods/test_refund_star_payment.py new file mode 100644 index 00000000..4e83f940 --- /dev/null +++ b/tests/test_api/test_methods/test_refund_star_payment.py @@ -0,0 +1,16 @@ +from aiogram.enums import StickerFormat +from aiogram.methods import AddStickerToSet, RefundStarPayment +from aiogram.types import InputSticker +from tests.mocked_bot import MockedBot + + +class TestRefundStarPayment: + async def test_bot_method(self, bot: MockedBot): + prepare_result = bot.add_result_for(RefundStarPayment, ok=True, result=True) + + response: bool = await bot.refund_star_payment( + user_id=42, + telegram_payment_charge_id="12345", + ) + request = bot.get_request() + assert response == prepare_result.result diff --git a/tests/test_utils/test_formatting.py b/tests/test_utils/test_formatting.py index b39ceb32..0c857680 100644 --- a/tests/test_utils/test_formatting.py +++ b/tests/test_utils/test_formatting.py @@ -29,6 +29,8 @@ from aiogram.utils.formatting import ( as_numbered_list, as_numbered_section, as_section, + BlockQuote, + ExpandableBlockQuote, ) from aiogram.utils.text_decorations import html_decoration @@ -105,6 +107,14 @@ class TestNode: CustomEmoji("test", custom_emoji_id="42"), 'test', ], + [ + BlockQuote("test"), + "
test
", + ], + [ + ExpandableBlockQuote("test"), + "
test
", + ], ], ) def test_render_plain_only(self, node: Text, result: str): diff --git a/tests/test_utils/test_text_decorations.py b/tests/test_utils/test_text_decorations.py index 2696f078..50623447 100644 --- a/tests/test_utils/test_text_decorations.py +++ b/tests/test_utils/test_text_decorations.py @@ -71,6 +71,11 @@ class TestTextDecoration: MessageEntity(type="blockquote", offset=0, length=5), "
test
", ], + [ + html_decoration, + MessageEntity(type="expandable_blockquote", offset=0, length=5), + "
test
", + ], [markdown_decoration, MessageEntity(type="bold", offset=0, length=5), "*test*"], [markdown_decoration, MessageEntity(type="italic", offset=0, length=5), "_\rtest_\r"], [markdown_decoration, MessageEntity(type="code", offset=0, length=5), "`test`"], @@ -116,6 +121,11 @@ class TestTextDecoration: MessageEntity(type="blockquote", offset=0, length=5), ">test", ], + [ + markdown_decoration, + MessageEntity(type="expandable_blockquote", offset=0, length=5), + ">test||", + ], ], ) def test_apply_single_entity( From e3dc7d576bd6e2aa3377b4776647341109ef66cf Mon Sep 17 00:00:00 2001 From: sdmway Date: Fri, 31 May 2024 11:11:21 -0600 Subject: [PATCH 3/9] misc: code consistency and bot instance creation (#1482) * misc: code consistency and bot instance creation * Changelog for aiogram#1482 * misc: consistency of comments and dispatcher instance creation * misc: removed routers example * Update CHANGES/1482.misc.rst --------- Co-authored-by: Alex Root Junior --- CHANGES/1482.misc.rst | 1 + examples/echo_bot.py | 2 ++ examples/echo_bot_webhook.py | 11 ++++++----- examples/echo_bot_webhook_ssl.py | 9 +++++---- examples/error_handling.py | 9 ++++++--- examples/finite_state_machine.py | 7 ++++++- examples/multi_file_bot/bot.py | 6 ++++-- examples/multi_file_bot/handlers/start.py | 4 ++-- examples/quiz_scene.py | 10 +++++----- examples/scene.py | 12 +++++++++--- examples/specify_updates.py | 5 +++-- examples/web_app/handlers.py | 4 ++-- examples/web_app/main.py | 4 +++- 13 files changed, 54 insertions(+), 30 deletions(-) create mode 100644 CHANGES/1482.misc.rst diff --git a/CHANGES/1482.misc.rst b/CHANGES/1482.misc.rst new file mode 100644 index 00000000..782a76b3 --- /dev/null +++ b/CHANGES/1482.misc.rst @@ -0,0 +1 @@ +Improved code consistency and readability in code examples by refactoring imports, adjusting the base webhook URL, modifying bot instance initialization to utilize DefaultBotProperties, and updating router message handlers. diff --git a/examples/echo_bot.py b/examples/echo_bot.py index 2808de7f..6a720ddb 100644 --- a/examples/echo_bot.py +++ b/examples/echo_bot.py @@ -13,6 +13,7 @@ from aiogram.types import Message TOKEN = getenv("BOT_TOKEN") # All handlers should be attached to the Router (or Dispatcher) + dp = Dispatcher() @@ -47,6 +48,7 @@ async def echo_handler(message: Message) -> None: async def main() -> None: # Initialize Bot instance with default bot properties which will be passed to all API calls bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/echo_bot_webhook.py b/examples/echo_bot_webhook.py index 1fa56c3d..056c3f71 100644 --- a/examples/echo_bot_webhook.py +++ b/examples/echo_bot_webhook.py @@ -7,7 +7,8 @@ from os import getenv from aiohttp import web -from aiogram import Bot, Dispatcher, Router, types +from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import CommandStart from aiogram.types import Message @@ -29,7 +30,7 @@ WEBHOOK_PATH = "/webhook" WEBHOOK_SECRET = "my-secret" # Base URL for webhook will be used to generate webhook URL for Telegram, # in this example it is used public DNS with HTTPS support -BASE_WEBHOOK_URL = "https://aiogram.dev/" +BASE_WEBHOOK_URL = "https://aiogram.dev" # All handlers should be attached to the Router (or Dispatcher) router = Router() @@ -49,7 +50,7 @@ async def command_start_handler(message: Message) -> None: @router.message() -async def echo_handler(message: types.Message) -> None: +async def echo_handler(message: Message) -> None: """ Handler will forward receive a message back to the sender @@ -78,8 +79,8 @@ def main() -> None: # Register startup hook to initialize webhook dp.startup.register(on_startup) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # Create aiohttp.web.Application instance app = web.Application() diff --git a/examples/echo_bot_webhook_ssl.py b/examples/echo_bot_webhook_ssl.py index ad41bc4d..45c75015 100644 --- a/examples/echo_bot_webhook_ssl.py +++ b/examples/echo_bot_webhook_ssl.py @@ -8,7 +8,8 @@ from os import getenv from aiohttp import web -from aiogram import Bot, Dispatcher, Router, types +from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import CommandStart from aiogram.types import FSInputFile, Message @@ -54,7 +55,7 @@ async def command_start_handler(message: Message) -> None: @router.message() -async def echo_handler(message: types.Message) -> None: +async def echo_handler(message: Message) -> None: """ Handler will forward receive a message back to the sender @@ -89,8 +90,8 @@ def main() -> None: # Register startup hook to initialize webhook dp.startup.register(on_startup) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # Create aiohttp.web.Application instance app = web.Application() diff --git a/examples/error_handling.py b/examples/error_handling.py index 83b5500d..fca83f82 100644 --- a/examples/error_handling.py +++ b/examples/error_handling.py @@ -1,8 +1,11 @@ import asyncio import html import logging +from os import getenv from aiogram import Bot, Dispatcher, types +from aiogram.client.default import DefaultBotProperties +from aiogram.enums import ParseMode from aiogram.filters import ( Command, CommandObject, @@ -11,7 +14,7 @@ from aiogram.filters import ( ) from aiogram.types import ErrorEvent -TOKEN = "42:TOKEN" +TOKEN = getenv("BOT_TOKEN") dp = Dispatcher() @@ -99,8 +102,8 @@ async def handle_set_name(message: types.Message, command: CommandObject) -> Non async def main() -> None: - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode="HTML") + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/finite_state_machine.py b/examples/finite_state_machine.py index 2905ec5b..f371d2ca 100644 --- a/examples/finite_state_machine.py +++ b/examples/finite_state_machine.py @@ -5,6 +5,7 @@ from os import getenv from typing import Any, Dict from aiogram import Bot, Dispatcher, F, Router, html +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import Command, CommandStart from aiogram.fsm.context import FSMContext @@ -124,10 +125,14 @@ async def show_summary(message: Message, data: Dict[str, Any], positive: bool = async def main(): - bot = Bot(token=TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + dp = Dispatcher() + dp.include_router(form_router) + # Start event dispatching await dp.start_polling(bot) diff --git a/examples/multi_file_bot/bot.py b/examples/multi_file_bot/bot.py index 927b52a0..0f1ba083 100644 --- a/examples/multi_file_bot/bot.py +++ b/examples/multi_file_bot/bot.py @@ -6,6 +6,7 @@ from handlers.echo import echo_router from handlers.start import start_router from aiogram import Bot, Dispatcher +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode # Bot token can be obtained via https://t.me/BotFather @@ -21,8 +22,9 @@ async def main() -> None: echo_router, ) - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) + # And the run events dispatching await dp.start_polling(bot) diff --git a/examples/multi_file_bot/handlers/start.py b/examples/multi_file_bot/handlers/start.py index 804268c3..3e95f2ab 100644 --- a/examples/multi_file_bot/handlers/start.py +++ b/examples/multi_file_bot/handlers/start.py @@ -1,11 +1,11 @@ from aiogram import Router -from aiogram.filters import Command +from aiogram.filters import CommandStart from aiogram.types import Message start_router = Router() -@start_router.message(Command("start")) +@start_router.message(CommandStart()) async def command_start_handler(message: Message) -> None: """ This handler receives messages with `/start` command diff --git a/examples/quiz_scene.py b/examples/quiz_scene.py index 343fef75..b07888df 100644 --- a/examples/quiz_scene.py +++ b/examples/quiz_scene.py @@ -289,13 +289,13 @@ def create_dispatcher(): async def main(): - dispatcher = create_dispatcher() - bot = Bot(TOKEN) - await dispatcher.start_polling(bot) + dp = create_dispatcher() + bot = Bot(token=TOKEN) + await dp.start_polling(bot) if __name__ == "__main__": - logging.basicConfig(level=logging.INFO) - asyncio.run(main()) # Alternatively, you can use aiogram-cli: # `aiogram run polling quiz_scene:create_dispatcher --log-level info --token BOT_TOKEN` + logging.basicConfig(level=logging.INFO) + asyncio.run(main()) diff --git a/examples/scene.py b/examples/scene.py index 090c64c2..ab83bd44 100644 --- a/examples/scene.py +++ b/examples/scene.py @@ -16,6 +16,8 @@ from aiogram.types import ( ReplyKeyboardRemove, ) +TOKEN = getenv("BOT_TOKEN") + BUTTON_CANCEL = KeyboardButton(text="❌ Cancel") BUTTON_BACK = KeyboardButton(text="🔙 Back") @@ -195,9 +197,13 @@ def create_dispatcher() -> Dispatcher: return dispatcher +def main() -> None: + dp = create_dispatcher() + bot = Bot(token=TOKEN) + dp.run_polling(bot) + + if __name__ == "__main__": # Recommended to use CLI instead of this snippet. # `aiogram run polling scene_example:create_dispatcher --token BOT_TOKEN --log-level info` - dp = create_dispatcher() - bot = Bot(token=getenv("TELEGRAM_TOKEN")) - dp.run_polling() + main() diff --git a/examples/specify_updates.py b/examples/specify_updates.py index 56571f1a..c25613a2 100644 --- a/examples/specify_updates.py +++ b/examples/specify_updates.py @@ -4,6 +4,7 @@ import sys from os import getenv from aiogram import Bot, Dispatcher, Router +from aiogram.client.default import DefaultBotProperties from aiogram.enums import ParseMode from aiogram.filters import LEAVE_TRANSITION, ChatMemberUpdatedFilter, CommandStart from aiogram.types import ( @@ -78,8 +79,8 @@ async def my_chat_member_change(chat_member: ChatMemberUpdated, bot: Bot) -> Non async def main() -> None: - # Initialize Bot instance with a default parse mode which will be passed to all API calls - bot = Bot(TOKEN, parse_mode=ParseMode.HTML) + # Initialize Bot instance with default bot properties which will be passed to all API calls + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) dp = Dispatcher() diff --git a/examples/web_app/handlers.py b/examples/web_app/handlers.py index 5896c0b2..843f4c63 100644 --- a/examples/web_app/handlers.py +++ b/examples/web_app/handlers.py @@ -1,5 +1,5 @@ from aiogram import Bot, F, Router -from aiogram.filters import Command +from aiogram.filters import Command, CommandStart from aiogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup, @@ -11,7 +11,7 @@ from aiogram.types import ( my_router = Router() -@my_router.message(Command("start")) +@my_router.message(CommandStart()) async def command_start(message: Message, bot: Bot, base_url: str): await bot.set_chat_menu_button( chat_id=message.chat.id, diff --git a/examples/web_app/main.py b/examples/web_app/main.py index db148153..06b64566 100644 --- a/examples/web_app/main.py +++ b/examples/web_app/main.py @@ -8,6 +8,8 @@ from handlers import my_router from routes import check_data_handler, demo_handler, send_message_handler from aiogram import Bot, Dispatcher +from aiogram.client.default import DefaultBotProperties +from aiogram.enums.parse_mode import ParseMode from aiogram.types import MenuButtonWebApp, WebAppInfo from aiogram.webhook.aiohttp_server import SimpleRequestHandler, setup_application @@ -24,7 +26,7 @@ async def on_startup(bot: Bot, base_url: str): def main(): - bot = Bot(token=TOKEN, parse_mode="HTML") + bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) dispatcher = Dispatcher() dispatcher["base_url"] = APP_BASE_URL dispatcher.startup.register(on_startup) From e224bb162d81d868ea03dde41cea21a23d7b7c18 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Fri, 31 May 2024 20:22:51 +0300 Subject: [PATCH 4/9] Bump changelog and API version --- .apiversion | 2 +- CHANGES.rst | 34 ++++++++++++++++++++++++++++++++++ CHANGES/1434.feature.rst | 1 - CHANGES/1482.misc.rst | 1 - CHANGES/1494.removal.rst | 2 -- CHANGES/1496.bugfix.rst | 1 - CHANGES/1498.feature.rst | 1 - README.rst | 4 ++-- aiogram/__meta__.py | 2 +- 9 files changed, 38 insertions(+), 10 deletions(-) delete mode 100644 CHANGES/1434.feature.rst delete mode 100644 CHANGES/1482.misc.rst delete mode 100644 CHANGES/1494.removal.rst delete mode 100644 CHANGES/1496.bugfix.rst delete mode 100644 CHANGES/1498.feature.rst diff --git a/.apiversion b/.apiversion index f9941623..37722ebb 100644 --- a/.apiversion +++ b/.apiversion @@ -1 +1 @@ -7.3 +7.4 diff --git a/CHANGES.rst b/CHANGES.rst index dff4ab72..eea2e11c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,40 @@ Changelog .. towncrier release notes start +3.5.0 (2024-05-31) +=================== + +Features +-------- + +- Added new storage :code:`aiogram.fsm.storage.MongoStorage` for Finite State Machine based on Mongo DB (using :code:`motor` library) + `#1434 `_ +- Added full support of `Bot API 7.4 `_ + `#1498 `_ + + +Bugfixes +-------- + +- Fixed wrong :code:`MarkdownV2` custom emoji parsing in :code:`aiogram.utils.text_decorations` + `#1496 `_ + + +Deprecations and Removals +------------------------- + +- Removed deprecated arguments from Bot class + :code:`parse_mode`, :code:`disable_web_page_preview`, :code:`protect_content` as previously announced in v3.4.0. + `#1494 `_ + + +Misc +---- + +- Improved code consistency and readability in code examples by refactoring imports, adjusting the base webhook URL, modifying bot instance initialization to utilize DefaultBotProperties, and updating router message handlers. + `#1482 `_ + + 3.6.0 (2024-05-06) =================== diff --git a/CHANGES/1434.feature.rst b/CHANGES/1434.feature.rst deleted file mode 100644 index 1d6fcf6a..00000000 --- a/CHANGES/1434.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added new storage :code:`aiogram.fsm.storage.MongoStorage` for Finite State Machine based on Mongo DB (using :code:`motor` library) diff --git a/CHANGES/1482.misc.rst b/CHANGES/1482.misc.rst deleted file mode 100644 index 782a76b3..00000000 --- a/CHANGES/1482.misc.rst +++ /dev/null @@ -1 +0,0 @@ -Improved code consistency and readability in code examples by refactoring imports, adjusting the base webhook URL, modifying bot instance initialization to utilize DefaultBotProperties, and updating router message handlers. diff --git a/CHANGES/1494.removal.rst b/CHANGES/1494.removal.rst deleted file mode 100644 index 935d2f0a..00000000 --- a/CHANGES/1494.removal.rst +++ /dev/null @@ -1,2 +0,0 @@ -Removed deprecated arguments from Bot class -:code:`parse_mode`, :code:`disable_web_page_preview`, :code:`protect_content` as previously announced in v3.4.0. diff --git a/CHANGES/1496.bugfix.rst b/CHANGES/1496.bugfix.rst deleted file mode 100644 index 02d44dbf..00000000 --- a/CHANGES/1496.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed wrong :code:`MarkdownV2` custom emoji parsing in :code:`aiogram.utils.text_decorations` diff --git a/CHANGES/1498.feature.rst b/CHANGES/1498.feature.rst deleted file mode 100644 index cdb2fc64..00000000 --- a/CHANGES/1498.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added full support of `Bot API 7.4 `_ diff --git a/README.rst b/README.rst index 2a8c00b1..cacc6908 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,7 @@ aiogram :alt: Codecov **aiogram** is a modern and fully asynchronous framework for -`Telegram Bot API `_ written in Python 3.8 using +`Telegram Bot API `_ written in Python 3.8+ using `asyncio `_ and `aiohttp `_. @@ -52,7 +52,7 @@ Features - Asynchronous (`asyncio docs `_, :pep:`492`) - Has type hints (:pep:`484`) and can be used with `mypy `_ - Supports `PyPy `_ -- Supports `Telegram Bot API 7.3 `_ and gets fast updates to the latest versions of the Bot API +- Supports `Telegram Bot API 7.4 `_ and gets fast updates to the latest versions of the Bot API - Telegram Bot API integration code was `autogenerated `_ and can be easily re-generated when API gets updated - Updates router (Blueprints) - Has Finite State Machine diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index 0ffde7a1..008ad63f 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ __version__ = "3.7.0" -__api_version__ = "7.3" +__api_version__ = "7.4" From 0c2ef663da8c3b6560014de68be3f74ed9da6fda Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Fri, 31 May 2024 21:01:55 +0300 Subject: [PATCH 5/9] Fixed version number in changelog --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index eea2e11c..e31ca83a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,7 +16,7 @@ Changelog .. towncrier release notes start -3.5.0 (2024-05-31) +3.7.0 (2024-05-31) =================== Features From afd1e6da74c9478acb42e250b2a4e27f42d04cf5 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 1 Jun 2024 01:56:38 +0300 Subject: [PATCH 6/9] Added MongoDB dependency to ReadTheDocs configuration (#1502) * Add MongoDB dependency to ReadTheDocs configuration An update has been made to the ReadTheDocs configuration file to include MongoDB as an additional dependency on installation. This change addresses issues with the MongoStorage section in the documentation. * Rename changelog file --- .readthedocs.yml | 2 +- CHANGES/1501.doc.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 CHANGES/1501.doc.rst diff --git a/.readthedocs.yml b/.readthedocs.yml index b61b3f17..90f0fc0a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,7 +6,7 @@ build: python: "3.11" jobs: post_install: - - pip install .[docs,redis] + - pip install .[docs,redis,mongo] sphinx: configuration: docs/conf.py diff --git a/CHANGES/1501.doc.rst b/CHANGES/1501.doc.rst new file mode 100644 index 00000000..780dd167 --- /dev/null +++ b/CHANGES/1501.doc.rst @@ -0,0 +1 @@ +Fixed MongoStorage section in the documentation by adding extra dependency to ReadTheDocs configuration. From b64587d4a7da757dd6f6bb99641e991d5ebe1ac4 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sat, 1 Jun 2024 01:58:32 +0300 Subject: [PATCH 7/9] Bump version --- aiogram/__meta__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index 008ad63f..926f549a 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.7.0" +__version__ = "3.7.1" __api_version__ = "7.4" From 0335bb14fcacdd07d271709b783dca105952719b Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sat, 1 Jun 2024 02:29:17 +0300 Subject: [PATCH 8/9] Small changes in the changelog --- CHANGES.rst | 2 +- aiogram/__meta__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e31ca83a..2ed0a519 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,7 +12,7 @@ Changelog WARNING: Don't drop the next directive! -.. towncrier-draft-entries:: |release| [UNRELEASED DRAFT] +.. towncrier-draft-entries:: [UPCOMING UPDATE] .. towncrier release notes start diff --git a/aiogram/__meta__.py b/aiogram/__meta__.py index 926f549a..008ad63f 100644 --- a/aiogram/__meta__.py +++ b/aiogram/__meta__.py @@ -1,2 +1,2 @@ -__version__ = "3.7.1" +__version__ = "3.7.0" __api_version__ = "7.4" From 69c359d23aa6b947972d7a5721fa4131153ad075 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Fri, 7 Jun 2024 18:52:02 +0300 Subject: [PATCH 9/9] Add Dependencies to migrations guide (#1504) * Add Dependencies to migrations guide * Added changelog --- CHANGES/1504.doc.rst | 1 + docs/migration_2_to_3.rst | 94 +++++++++++++++++++++------------------ 2 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 CHANGES/1504.doc.rst diff --git a/CHANGES/1504.doc.rst b/CHANGES/1504.doc.rst new file mode 100644 index 00000000..323ee342 --- /dev/null +++ b/CHANGES/1504.doc.rst @@ -0,0 +1 @@ +Added information about dependency changes to the :code:`2.x --> 3.x` migration guide. diff --git a/docs/migration_2_to_3.rst b/docs/migration_2_to_3.rst index f8c0753c..1ce8bd21 100644 --- a/docs/migration_2_to_3.rst +++ b/docs/migration_2_to_3.rst @@ -6,9 +6,9 @@ Migration FAQ (2.x -> 3.0) This guide is still in progress. -This version introduces numerous breaking changes and architectural improvements. -It helps reduce the count of global variables in your code, provides useful mechanisms -to modularize your code, and enables the creation of shareable modules via packages on PyPI. +This version introduces numerous breaking changes and architectural improvements. +It helps reduce the count of global variables in your code, provides useful mechanisms +to modularize your code, and enables the creation of shareable modules via packages on PyPI. It also makes middlewares and filters more controllable, among other improvements. @@ -16,18 +16,26 @@ On this page, you can read about the changes made in relation to the last stable .. note:: - This page more closely resembles a detailed changelog than a migration guide, + This page more closely resembles a detailed changelog than a migration guide, but it will be updated in the future. Feel free to contribute to this page, if you find something that is not mentioned here. +Dependencies +========== + +- The dependencies required for :code:`i18n` are no longer part of the default package. + If your application uses translation functionality, be sure to add an optional dependency: + + :code:`pip install aiogram[i18n]` + Dispatcher ========== -- The :class:`Dispatcher` class no longer accepts a `Bot` instance in its initializer. - Instead, the `Bot` instance should be passed to the dispatcher only for starting polling - or handling events from webhooks. This approach also allows for the use of multiple bot +- The :class:`Dispatcher` class no longer accepts a `Bot` instance in its initializer. + Instead, the `Bot` instance should be passed to the dispatcher only for starting polling + or handling events from webhooks. This approach also allows for the use of multiple bot instances simultaneously ("multibot"). - :class:`Dispatcher` now can be extended with another Dispatcher-like thing named :class:`Router` (:ref:`Read more » `). @@ -35,11 +43,11 @@ Dispatcher - Removed the **_handler** suffix from all event handler decorators and registering methods. (:ref:`Read more » `) - The Executor has been entirely removed; you can now use the Dispatcher directly to start poll the API or handle webhooks from it. -- The throttling method has been completely removed; you can now use middlewares to control +- The throttling method has been completely removed; you can now use middlewares to control the execution context and implement any throttling mechanism you desire. - Removed global context variables from the API types, Bot and Dispatcher object, - From now on, if you want to access the current bot instance within handlers or filters, - you should accept the argument :code:`bot: Bot` and use it instead of :code:`Bot.get_current()`. + From now on, if you want to access the current bot instance within handlers or filters, + you should accept the argument :code:`bot: Bot` and use it instead of :code:`Bot.get_current()`. In middlewares, it can be accessed via :code:`data["bot"]`. - To skip pending updates, you should now call the :class:`aiogram.methods.delete_webhook.DeleteWebhook` method directly, rather than passing :code:`skip_updates=True` to the start polling method. @@ -49,18 +57,18 @@ Filtering events ================ - Keyword filters can no longer be used; use filters explicitly. (`Read more » `_) -- Due to the removal of keyword filters, all previously enabled-by-default filters - (such as state and content_type) are now disabled. +- Due to the removal of keyword filters, all previously enabled-by-default filters + (such as state and content_type) are now disabled. You must specify them explicitly if you wish to use them. For example instead of using :code:`@dp.message_handler(content_types=ContentType.PHOTO)` you should use :code:`@router.message(F.photo)` - Most common filters have been replaced with the "magic filter." (:ref:`Read more » `) -- By default, the message handler now receives any content type. +- By default, the message handler now receives any content type. If you want a specific one, simply add the appropriate filters (Magic or any other). -- The state filter is no longer enabled by default. This means that if you used :code:`state="*"` - in v2, you should not pass any state filter in v3. +- The state filter is no longer enabled by default. This means that if you used :code:`state="*"` + in v2, you should not pass any state filter in v3. Conversely, if the state was not specified in v2, you will now need to specify it in v3. -- Added the possibility to register global filters for each router, which helps to reduce code +- Added the possibility to register global filters for each router, which helps to reduce code repetition and provides an easier way to control the purpose of each router. @@ -68,18 +76,18 @@ Filtering events Bot API ======= -- All API methods are now classes with validation, implemented via - `pydantic `. +- All API methods are now classes with validation, implemented via + `pydantic `. These API calls are also available as methods in the Bot class. -- More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package. +- More pre-defined Enums have been added and moved to the `aiogram.enums` sub-package. For example, the chat type enum is now :class:`aiogram.enums.ChatType` instead of :class:`aiogram.types.chat.ChatType`. -- The HTTP client session has been separated into a container that can be reused +- The HTTP client session has been separated into a container that can be reused across different Bot instances within the application. -- API Exceptions are no longer classified by specific messages, - as Telegram has no documented error codes. - However, all errors are classified by HTTP status codes, and for each method, - only one type of error can be associated with a given code. - Therefore, in most cases, you should check only the error type (by status code) +- API Exceptions are no longer classified by specific messages, + as Telegram has no documented error codes. + However, all errors are classified by HTTP status codes, and for each method, + only one type of error can be associated with a given code. + Therefore, in most cases, you should check only the error type (by status code) without inspecting the error message. @@ -87,12 +95,12 @@ Bot API Middlewares =========== -- Middlewares can now control an execution context, e.g., using context managers. +- Middlewares can now control an execution context, e.g., using context managers. (:ref:`Read more » `) - All contextual data is now shared end-to-end between middlewares, filters, and handlers. For example now you can easily pass some data into context inside middleware and get it in the filters layer as the same way as in the handlers via keyword arguments. -- Added a mechanism named **flags** that helps customize handler behavior +- Added a mechanism named **flags** that helps customize handler behavior in conjunction with middlewares. (:ref:`Read more » `) @@ -116,24 +124,24 @@ Callbacks data Finite State machine ==================== -- State filters will no longer be automatically added to all handlers; +- State filters will no longer be automatically added to all handlers; you will need to specify the state if you want to use it. -- Added the possibility to change the FSM strategy. For example, - if you want to control the state for each user based on chat topics rather than +- Added the possibility to change the FSM strategy. For example, + if you want to control the state for each user based on chat topics rather than the user in a chat, you can specify this in the Dispatcher. - Now :class:`aiogram.fsm.state.State` and :class:`aiogram.fsm.state.StateGroup` don't have helper methods like :code:`.set()`, :code:`.next()`, etc. - Instead, you should set states by passing them directly to :class:`aiogram.fsm.context.FSMContext` (:ref:`Read more » `) -- The state proxy is deprecated; you should update the state data by calling +- The state proxy is deprecated; you should update the state data by calling :code:`state.set_data(...)` and :code:`state.get_data()` respectively. Sending Files ============= -- From now on, you should wrap files in an InputFile object before sending them, +- From now on, you should wrap files in an InputFile object before sending them, instead of passing the IO object directly to the API method. (:ref:`Read more » `) @@ -154,7 +162,7 @@ Telegram API Server Telegram objects transformation (to dict, to json, from json) ============================================================= -- Methods :class:`TelegramObject.to_object()`, :class:`TelegramObject.to_json()` and :class:`TelegramObject.to_python()` +- Methods :class:`TelegramObject.to_object()`, :class:`TelegramObject.to_json()` and :class:`TelegramObject.to_python()` have been removed due to the use of `pydantic `_ models. - :class:`TelegramObject.to_object()` should be replaced by :class:`TelegramObject.model_validate()` (`Read more `_) @@ -172,19 +180,19 @@ Here are some usage examples: # Version 2.x message_dict = {"id": 42, ...} message_obj = Message.to_object(message_dict) - print(message_obj) + print(message_obj) # id=42 name='n' ... print(type(message_obj)) # - + # Version 3.x message_dict = {"id": 42, ...} message_obj = Message.model_validate(message_dict) - print(message_obj) + print(message_obj) # id=42 name='n' ... print(type(message_obj)) # - + - Creating a json representation of an object .. code-block:: @@ -192,14 +200,14 @@ Here are some usage examples: async def handler(message: Message) -> None: # Version 2.x message_json = message.as_json() - print(message_json) + print(message_json) # {"id": 42, ...} print(type(message_json)) # - + # Version 3.x message_json = message.model_dump_json() - print(message_json) + print(message_json) # {"id": 42, ...} print(type(message_json)) # @@ -211,14 +219,14 @@ Here are some usage examples: async def handler(message: Message) -> None: # Version 2.x message_dict = message.to_python() - print(message_dict) + print(message_dict) # {"id": 42, ...} print(type(message_dict)) # - + # Version 3.x message_dict = message.model_dump() - print(message_dict) + print(message_dict) # {"id": 42, ...} print(type(message_dict)) #