diff --git a/api.json b/api.json index e1ccba6..3e7bf3d 100644 --- a/api.json +++ b/api.json @@ -1,6 +1,6 @@ { - "version": "Bot API 9.2", - "release_date": "August 15, 2025", + "version": "Bot API 9.3", + "release_date": "December 31, 2025", "methods": { "getUpdates": { "href": "https://core.telegram.org/bots/api#getupdates", @@ -185,7 +185,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -298,7 +298,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -336,6 +336,13 @@ "required": false, "description": "Protects the contents of the forwarded message from forwarding and saving" }, + "message_effect_id": { + "type": [ + "String" + ], + "required": false, + "description": "Unique identifier of the message effect to be added to the message; only available when forwarding to private chats" + }, "suggested_post_parameters": { "type": [ "SuggestedPostParameters" @@ -374,7 +381,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -436,7 +443,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -516,6 +523,13 @@ "required": false, "description": "Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance" }, + "message_effect_id": { + "type": [ + "String" + ], + "required": false, + "description": "Unique identifier of the message effect to be added to the message; only available when copying to private chats" + }, "suggested_post_parameters": { "type": [ "SuggestedPostParameters" @@ -564,7 +578,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -640,7 +654,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -776,7 +790,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -926,7 +940,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1062,7 +1076,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1248,7 +1262,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1412,7 +1426,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1540,7 +1554,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1662,7 +1676,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1676,7 +1690,7 @@ "Integer" ], "required": true, - "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-10000" + "description": "The number of Telegram Stars that must be paid to buy access to the media; 1-25000" }, "media": { "type": [ @@ -1796,7 +1810,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -1878,7 +1892,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -2012,7 +2026,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -2160,7 +2174,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -2280,7 +2294,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "question": { "type": [ @@ -2523,7 +2537,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -2593,6 +2607,59 @@ } } }, + "sendMessageDraft": { + "href": "https://core.telegram.org/bots/api#sendmessagedraft", + "description": [ + "Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success." + ], + "returns": [ + "True" + ], + "parameters": { + "chat_id": { + "type": [ + "Integer" + ], + "required": true, + "description": "Unique identifier for the target private chat" + }, + "message_thread_id": { + "type": [ + "Integer" + ], + "required": false, + "description": "Unique identifier for the target message thread" + }, + "draft_id": { + "type": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated" + }, + "text": { + "type": [ + "String" + ], + "required": true, + "description": "Text of the message to be sent, 1-4096 characters after entities parsing" + }, + "parse_mode": { + "type": [ + "String" + ], + "required": false, + "description": "Mode for parsing entities in the message text. See formatting options for more details." + }, + "entities": { + "type": [ + "Array" + ], + "required": false, + "description": "A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode" + } + } + }, "sendChatAction": { "href": "https://core.telegram.org/bots/api#sendchataction", "description": [ @@ -2623,7 +2690,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread; for supergroups only" + "description": "Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only" }, "action": { "type": [ @@ -2934,7 +3001,7 @@ "Boolean" ], "required": false, - "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics" + "description": "Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators" }, "can_promote_members": { "type": [ @@ -3792,7 +3859,7 @@ "editForumTopic": { "href": "https://core.telegram.org/bots/api#editforumtopic", "description": [ - "Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success." + "Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success." ], "returns": [ "True" @@ -3884,7 +3951,7 @@ "deleteForumTopic": { "href": "https://core.telegram.org/bots/api#deleteforumtopic", "description": [ - "Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success." + "Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success." ], "returns": [ "True" @@ -3910,7 +3977,7 @@ "unpinAllForumTopicMessages": { "href": "https://core.telegram.org/bots/api#unpinallforumtopicmessages", "description": [ - "Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success." + "Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success." ], "returns": [ "True" @@ -4477,7 +4544,7 @@ "String" ], "required": true, - "description": "Identifier of the gift" + "description": "Identifier of the gift; limited gifts can't be sent to channel chats" }, "pay_for_upgrade": { "type": [ @@ -4957,12 +5024,19 @@ "required": false, "description": "Pass True to exclude gifts that can be purchased an unlimited number of times" }, - "exclude_limited": { + "exclude_limited_upgradable": { "type": [ "Boolean" ], "required": false, - "description": "Pass True to exclude gifts that can be purchased a limited number of times" + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique" + }, + "exclude_limited_non_upgradable": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique" }, "exclude_unique": { "type": [ @@ -4971,6 +5045,13 @@ "required": false, "description": "Pass True to exclude unique gifts" }, + "exclude_from_blockchain": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram" + }, "sort_by_price": { "type": [ "Boolean" @@ -4994,6 +5075,165 @@ } } }, + "getUserGifts": { + "href": "https://core.telegram.org/bots/api#getusergifts", + "description": [ + "Returns the gifts owned and hosted by a user. Returns OwnedGifts on success." + ], + "returns": [], + "parameters": { + "user_id": { + "type": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the user" + }, + "exclude_unlimited": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased an unlimited number of times" + }, + "exclude_limited_upgradable": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique" + }, + "exclude_limited_non_upgradable": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique" + }, + "exclude_from_blockchain": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram" + }, + "exclude_unique": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude unique gifts" + }, + "sort_by_price": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination." + }, + "offset": { + "type": [ + "String" + ], + "required": false, + "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results" + }, + "limit": { + "type": [ + "Integer" + ], + "required": false, + "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100" + } + } + }, + "getChatGifts": { + "href": "https://core.telegram.org/bots/api#getchatgifts", + "description": [ + "Returns the gifts owned by a chat. Returns OwnedGifts on success." + ], + "returns": [], + "parameters": { + "chat_id": { + "type": [ + "Integer", + "String" + ], + "required": true, + "description": "Unique identifier for the target chat or username of the target channel (in the format @channelusername)" + }, + "exclude_unsaved": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel." + }, + "exclude_saved": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel." + }, + "exclude_unlimited": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased an unlimited number of times" + }, + "exclude_limited_upgradable": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique" + }, + "exclude_limited_non_upgradable": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique" + }, + "exclude_from_blockchain": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram" + }, + "exclude_unique": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to exclude unique gifts" + }, + "sort_by_price": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to sort results by gift price instead of send date. Sorting is applied before pagination." + }, + "offset": { + "type": [ + "String" + ], + "required": false, + "description": "Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results" + }, + "limit": { + "type": [ + "Integer" + ], + "required": false, + "description": "The maximum number of gifts to be returned; 1-100. Defaults to 100" + } + } + }, "convertGiftToStars": { "href": "https://core.telegram.org/bots/api#convertgifttostars", "description": [ @@ -5171,6 +5411,59 @@ } } }, + "repostStory": { + "href": "https://core.telegram.org/bots/api#repoststory", + "description": [ + "Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success." + ], + "returns": [ + "Story" + ], + "parameters": { + "business_connection_id": { + "type": [ + "String" + ], + "required": true, + "description": "Unique identifier of the business connection" + }, + "from_chat_id": { + "type": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the chat which posted the story that should be reposted" + }, + "from_story_id": { + "type": [ + "Integer" + ], + "required": true, + "description": "Unique identifier of the story that should be reposted" + }, + "active_period": { + "type": [ + "Integer" + ], + "required": true, + "description": "Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400" + }, + "post_to_chat_page": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True to keep the story accessible after it expires" + }, + "protect_content": { + "type": [ + "Boolean" + ], + "required": false, + "description": "Pass True if the content of the story must be protected from forwarding and screenshotting" + } + } + }, "editStory": { "href": "https://core.telegram.org/bots/api#editstory", "description": [ @@ -5880,7 +6173,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -6529,7 +6822,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "direct_messages_topic_id": { "type": [ @@ -7117,7 +7410,7 @@ "Integer" ], "required": false, - "description": "Unique identifier for the target message thread (topic) of the forum; for forum supergroups only" + "description": "Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only" }, "game_short_name": { "type": [ @@ -7569,6 +7862,12 @@ "Boolean" ], "description": "Optional. True, if the bot has a main Web App. Returned only in getMe." + }, + "has_topics_enabled": { + "type": [ + "Boolean" + ], + "description": "Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe." } } }, @@ -7915,6 +8214,24 @@ "ChatLocation" ], "description": "Optional. For supergroups, the location to which the supergroup is connected" + }, + "rating": { + "type": [ + "UserRating" + ], + "description": "Optional. For private chats, the rating of the user if any" + }, + "unique_gift_colors": { + "type": [ + "UniqueGiftColors" + ], + "description": "Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews" + }, + "paid_message_star_count": { + "type": [ + "Integer" + ], + "description": "Optional. The number of Telegram Stars a general user have to pay to send a message to the chat" } } }, @@ -7934,7 +8251,7 @@ "type": [ "Integer" ], - "description": "Optional. Unique identifier of a message thread to which the message belongs; for supergroups only" + "description": "Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only" }, "direct_messages_topic": { "type": [ @@ -7994,7 +8311,7 @@ "type": [ "True" ], - "description": "Optional. True, if the message is sent to a forum topic" + "description": "Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot" }, "is_automatic_forward": { "type": [ @@ -8350,6 +8667,12 @@ ], "description": "Optional. Service message: a unique gift was sent or received" }, + "gift_upgrade_sent": { + "type": [ + "GiftInfo" + ], + "description": "Optional. Service message: upgrade of a gift was purchased after the gift was sent" + }, "connected_website": { "type": [ "String" @@ -9775,7 +10098,13 @@ "type": [ "User" ], - "description": "Optional. User that completed the task; omitted if the task wasn't completed" + "description": "Optional. User that completed the task; omitted if the task wasn't completed by a user" + }, + "completed_by_chat": { + "type": [ + "Chat" + ], + "description": "Optional. Chat that completed the task; omitted if the task wasn't completed by a chat" }, "completion_date": { "type": [ @@ -10380,6 +10709,12 @@ "String" ], "description": "Optional. Unique identifier of the custom emoji shown as the topic icon" + }, + "is_name_implicit": { + "type": [ + "True" + ], + "description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot" } } }, @@ -12511,6 +12846,38 @@ } } }, + "UserRating": { + "href": "https://core.telegram.org/bots/api#userrating", + "description": [ + "This object describes the rating of a user based on their Telegram Star spendings." + ], + "fields": { + "level": { + "type": [ + "Integer" + ], + "description": "Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern." + }, + "rating": { + "type": [ + "Integer" + ], + "description": "Numerical value of the user's rating; the higher the rating, the better" + }, + "current_level_rating": { + "type": [ + "Integer" + ], + "description": "The rating value required to get the current level" + }, + "next_level_rating": { + "type": [ + "Integer" + ], + "description": "Optional. The rating value required to get to the next level; omitted if the maximum level was reached" + } + } + }, "StoryAreaPosition": { "href": "https://core.telegram.org/bots/api#storyareaposition", "description": [ @@ -12980,6 +13347,38 @@ "String" ], "description": "Optional. Unique identifier of the custom emoji shown as the topic icon" + }, + "is_name_implicit": { + "type": [ + "True" + ], + "description": "Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot" + } + } + }, + "GiftBackground": { + "href": "https://core.telegram.org/bots/api#giftbackground", + "description": [ + "This object describes the background of a gift." + ], + "fields": { + "center_color": { + "type": [ + "Integer" + ], + "description": "Center color of the background in RGB format" + }, + "edge_color": { + "type": [ + "Integer" + ], + "description": "Edge color of the background in RGB format" + }, + "text_color": { + "type": [ + "Integer" + ], + "description": "Text color of the background in RGB format" } } }, @@ -13013,17 +13412,53 @@ ], "description": "Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one" }, + "is_premium": { + "type": [ + "True" + ], + "description": "Optional. True, if the gift can only be purchased by Telegram Premium subscribers" + }, + "has_colors": { + "type": [ + "True" + ], + "description": "Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance" + }, "total_count": { "type": [ "Integer" ], - "description": "Optional. The total number of the gifts of this type that can be sent; for limited gifts only" + "description": "Optional. The total number of gifts of this type that can be sent by all users; for limited gifts only" }, "remaining_count": { "type": [ "Integer" ], - "description": "Optional. The number of remaining gifts of this type that can be sent; for limited gifts only" + "description": "Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only" + }, + "personal_total_count": { + "type": [ + "Integer" + ], + "description": "Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only" + }, + "personal_remaining_count": { + "type": [ + "Integer" + ], + "description": "Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only" + }, + "background": { + "type": [ + "GiftBackground" + ], + "description": "Optional. Background of the gift" + }, + "unique_gift_variant_count": { + "type": [ + "Integer" + ], + "description": "Optional. The total number of different unique gifts that can be obtained by upgrading the gift" }, "publisher_chat": { "type": [ @@ -13157,12 +13592,62 @@ } } }, + "UniqueGiftColors": { + "href": "https://core.telegram.org/bots/api#uniquegiftcolors", + "description": [ + "This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift." + ], + "fields": { + "model_custom_emoji_id": { + "type": [ + "String" + ], + "description": "Custom emoji identifier of the unique gift's model" + }, + "symbol_custom_emoji_id": { + "type": [ + "String" + ], + "description": "Custom emoji identifier of the unique gift's symbol" + }, + "light_theme_main_color": { + "type": [ + "Integer" + ], + "description": "Main color used in light themes; RGB format" + }, + "light_theme_other_colors": { + "type": [ + "Array" + ], + "description": "List of 1-3 additional colors used in light themes; RGB format" + }, + "dark_theme_main_color": { + "type": [ + "Integer" + ], + "description": "Main color used in dark themes; RGB format" + }, + "dark_theme_other_colors": { + "type": [ + "Array" + ], + "description": "List of 1-3 additional colors used in dark themes; RGB format" + } + } + }, "UniqueGift": { "href": "https://core.telegram.org/bots/api#uniquegift", "description": [ "This object describes a unique gift that was upgraded from a regular gift." ], "fields": { + "gift_id": { + "type": [ + "String" + ], + "description": "Identifier of the regular gift from which the gift was upgraded" + }, "base_name": { "type": [ "String" @@ -13199,6 +13684,24 @@ ], "description": "Backdrop of the gift" }, + "is_premium": { + "type": [ + "True" + ], + "description": "Optional. True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers" + }, + "is_from_blockchain": { + "type": [ + "True" + ], + "description": "Optional. True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram" + }, + "colors": { + "type": [ + "UniqueGiftColors" + ], + "description": "Optional. The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only" + }, "publisher_chat": { "type": [ "Chat" @@ -13235,7 +13738,13 @@ "type": [ "Integer" ], - "description": "Optional. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift" + "description": "Optional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift" + }, + "is_upgrade_separate": { + "type": [ + "True" + ], + "description": "Optional. True, if the gift's upgrade was purchased after the gift was sent" }, "can_be_upgraded": { "type": [ @@ -13260,6 +13769,12 @@ "True" ], "description": "Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them" + }, + "unique_gift_number": { + "type": [ + "Integer" + ], + "description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift" } } }, @@ -13279,13 +13794,19 @@ "type": [ "String" ], - "description": "Origin of the gift. Currently, either \u201cupgrade\u201d for gifts upgraded from regular gifts, \u201ctransfer\u201d for gifts transferred from other users or channels, or \u201cresale\u201d for gifts bought from other users" + "description": "Origin of the gift. Currently, either \u201cupgrade\u201d for gifts upgraded from regular gifts, \u201ctransfer\u201d for gifts transferred from other users or channels, \u201cresale\u201d for gifts bought from other users, \u201cgifted_upgrade\u201d for upgrades purchased after the gift was sent, or \u201coffer\u201d for gifts bought or sold through gift purchase offers" + }, + "last_resale_currency": { + "type": [ + "String" + ], + "description": "Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of \u201cXTR\u201d for Telegram Stars or \u201cTON\u201d for toncoins." }, - "last_resale_star_count": { + "last_resale_amount": { "type": [ "Integer" ], - "description": "Optional. For gifts bought from other users, the price paid for the gift" + "description": "Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins" }, "owned_gift_id": { "type": [ @@ -13394,13 +13915,25 @@ "type": [ "Integer" ], - "description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars" + "description": "Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only" }, "prepaid_upgrade_star_count": { "type": [ "Integer" ], - "description": "Optional. Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift" + "description": "Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift" + }, + "is_upgrade_separate": { + "type": [ + "True" + ], + "description": "Optional. True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only" + }, + "unique_gift_number": { + "type": [ + "Integer" + ], + "description": "Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift" } } }, @@ -13522,6 +14055,12 @@ "Boolean" ], "description": "True, if a Telegram Premium subscription is accepted" + }, + "gifts_from_channels": { + "type": [ + "Boolean" + ], + "description": "True, if transfers of unique gifts from channels are accepted" } } }, diff --git a/src/Foundation/HasTelegramMethods.php b/src/Foundation/HasTelegramMethods.php index 1c389b1..0dabd61 100644 --- a/src/Foundation/HasTelegramMethods.php +++ b/src/Foundation/HasTelegramMethods.php @@ -91,7 +91,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _string_ `$text` __Required: Yes__. Text of the message to be sent, 1-4096 characters after entities parsing * - _string_ `$parse_mode` __Required: Optional__. Mode for parsing entities in the message text. See formatting options for more details. @@ -112,12 +112,13 @@ * * Parameters: * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat * - _int|string_ `$from_chat_id` __Required: Yes__. Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) * - _int_ `$video_start_timestamp` __Required: Optional__. New start timestamp for the forwarded video in the message * - _bool_ `$disable_notification` __Required: Optional__. Sends the message silently. Users will receive a notification with no sound. * - _bool_ `$protect_content` __Required: Optional__. Protects the contents of the forwarded message from forwarding and saving + * - _string_ `$message_effect_id` __Required: Optional__. Unique identifier of the message effect to be added to the message; only available when forwarding to private chats * - _SuggestedPostParameters_ `$suggested_post_parameters` __Required: Optional__. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only * - _int_ `$message_id` __Required: Yes__. Message identifier in the chat specified in from_chat_id * @@ -128,7 +129,7 @@ * * Parameters: * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat * - _int|string_ `$from_chat_id` __Required: Yes__. Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) * - _int[]_ `$message_ids` __Required: Yes__. A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. @@ -142,7 +143,7 @@ * * Parameters: * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _int|string_ `$from_chat_id` __Required: Yes__. Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) * - _int_ `$message_id` __Required: Yes__. Message identifier in the chat specified in from_chat_id @@ -154,6 +155,7 @@ * - _bool_ `$disable_notification` __Required: Optional__. Sends the message silently. Users will receive a notification with no sound. * - _bool_ `$protect_content` __Required: Optional__. Protects the contents of the sent message from forwarding and saving * - _bool_ `$allow_paid_broadcast` __Required: Optional__. Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance + * - _string_ `$message_effect_id` __Required: Optional__. Unique identifier of the message effect to be added to the message; only available when copying to private chats * - _SuggestedPostParameters_ `$suggested_post_parameters` __Required: Optional__. A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. * - _ReplyParameters_ `$reply_parameters` __Required: Optional__. Description of the message to reply to * - _InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply_ `$reply_markup` __Required: Optional__. 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 @@ -165,7 +167,7 @@ * * Parameters: * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat * - _int|string_ `$from_chat_id` __Required: Yes__. Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) * - _int[]_ `$message_ids` __Required: Yes__. A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. @@ -181,7 +183,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$photo` __Required: Yes__. Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files » * - _string_ `$caption` __Required: Optional__. Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing @@ -207,7 +209,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$audio` __Required: Yes__. Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » * - _string_ `$caption` __Required: Optional__. Audio caption, 0-1024 characters after entities parsing @@ -233,7 +235,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$document` __Required: Yes__. File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » * - _InputFile|string_ `$thumbnail` __Required: Optional__. 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 . More information on Sending Files » @@ -257,7 +259,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$video` __Required: Yes__. Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files » * - _int_ `$duration` __Required: Optional__. Duration of sent video in seconds @@ -288,7 +290,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$animation` __Required: Yes__. Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files » * - _int_ `$duration` __Required: Optional__. Duration of sent animation in seconds @@ -316,7 +318,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$voice` __Required: Yes__. Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files » * - _string_ `$caption` __Required: Optional__. Voice message caption, 0-1024 characters after entities parsing @@ -339,7 +341,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$video_note` __Required: Yes__. Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported * - _int_ `$duration` __Required: Optional__. Duration of sent video in seconds @@ -361,9 +363,9 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat - * - _int_ `$star_count` __Required: Yes__. The number of Telegram Stars that must be paid to buy access to the media; 1-10000 + * - _int_ `$star_count` __Required: Yes__. The number of Telegram Stars that must be paid to buy access to the media; 1-25000 * - _InputPaidMedia[]_ `$media` __Required: Yes__. A JSON-serialized array describing the media to be sent; up to 10 items * - _string_ `$payload` __Required: Optional__. Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. * - _string_ `$caption` __Required: Optional__. Media caption, 0-1024 characters after entities parsing @@ -385,7 +387,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat * - _InputMedia[]_ `$media` __Required: Yes__. A JSON-serialized array describing messages to be sent, must include 2-10 items * - _bool_ `$disable_notification` __Required: Optional__. Sends messages silently. Users will receive a notification with no sound. @@ -402,7 +404,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _float_ `$latitude` __Required: Yes__. Latitude of the location * - _float_ `$longitude` __Required: Yes__. Longitude of the location @@ -426,7 +428,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _float_ `$latitude` __Required: Yes__. Latitude of the venue * - _float_ `$longitude` __Required: Yes__. Longitude of the venue @@ -452,7 +454,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _string_ `$phone_number` __Required: Yes__. Contact's phone number * - _string_ `$first_name` __Required: Yes__. Contact's first name @@ -474,7 +476,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername). Polls can't be sent to channel direct messages chats. - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _string_ `$question` __Required: Yes__. Poll question, 1-300 characters * - _string_ `$question_parse_mode` __Required: Optional__. Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed * - _MessageEntity[]_ `$question_entities` __Required: Optional__. A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode @@ -519,7 +521,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _string_ `$emoji` __Required: Optional__. 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 “” * - _bool_ `$disable_notification` __Required: Optional__. Sends the message silently. Users will receive a notification with no sound. @@ -531,6 +533,19 @@ * - _InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply_ `$reply_markup` __Required: Optional__. 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 * * + * @method PromiseInterface|true sendMessageDraft(...$parameters) Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success. + * + * {@see https://core.telegram.org/bots/api#sendmessagedraft} + * + * Parameters: + * - _int_ `$chat_id` __Required: Yes__. Unique identifier for the target private chat + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread + * - _int_ `$draft_id` __Required: Yes__. Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated + * - _string_ `$text` __Required: Yes__. Text of the message to be sent, 1-4096 characters after entities parsing + * - _string_ `$parse_mode` __Required: Optional__. Mode for parsing entities in the message text. See formatting options for more details. + * - _MessageEntity[]_ `$entities` __Required: Optional__. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode + * + * * @method PromiseInterface|true sendChatAction(...$parameters) Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. * * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. @@ -540,7 +555,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the action will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported. - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread; for supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only * - _string_ `$action` __Required: Yes__. Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. * * @@ -629,7 +644,7 @@ * - _bool_ `$can_manage_chat` __Required: Optional__. Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. * - _bool_ `$can_delete_messages` __Required: Optional__. Pass True if the administrator can delete messages of other users * - _bool_ `$can_manage_video_chats` __Required: Optional__. Pass True if the administrator can manage video chats - * - _bool_ `$can_restrict_members` __Required: Optional__. Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics + * - _bool_ `$can_restrict_members` __Required: Optional__. Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators * - _bool_ `$can_promote_members` __Required: Optional__. Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him) * - _bool_ `$can_change_info` __Required: Optional__. Pass True if the administrator can change chat title, photo and other settings * - _bool_ `$can_invite_users` __Required: Optional__. Pass True if the administrator can invite new users to the chat @@ -898,7 +913,7 @@ * - _string_ `$icon_custom_emoji_id` __Required: Optional__. Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. * * - * @method PromiseInterface|true editForumTopic(...$parameters) Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. + * @method PromiseInterface|true editForumTopic(...$parameters) Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. * * {@see https://core.telegram.org/bots/api#editforumtopic} * @@ -927,7 +942,7 @@ * - _int_ `$message_thread_id` __Required: Yes__. Unique identifier for the target message thread of the forum topic * * - * @method PromiseInterface|true deleteForumTopic(...$parameters) Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. + * @method PromiseInterface|true deleteForumTopic(...$parameters) Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. * * {@see https://core.telegram.org/bots/api#deleteforumtopic} * @@ -936,7 +951,7 @@ * - _int_ `$message_thread_id` __Required: Yes__. Unique identifier for the target message thread of the forum topic * * - * @method PromiseInterface|true unpinAllForumTopicMessages(...$parameters) Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. + * @method PromiseInterface|true unpinAllForumTopicMessages(...$parameters) Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success. * * {@see https://core.telegram.org/bots/api#unpinallforumtopicmessages} * @@ -1146,7 +1161,7 @@ * Parameters: * - _int_ `$user_id` __Required: Optional__. Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. * - _int|string_ `$chat_id` __Required: Optional__. Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift. - * - _string_ `$gift_id` __Required: Yes__. Identifier of the gift + * - _string_ `$gift_id` __Required: Yes__. Identifier of the gift; limited gifts can't be sent to channel chats * - _bool_ `$pay_for_upgrade` __Required: Optional__. Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver * - _string_ `$text` __Required: Optional__. Text that will be shown along with the gift; 0-128 characters * - _string_ `$text_parse_mode` __Required: Optional__. Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. @@ -1302,13 +1317,49 @@ * - _bool_ `$exclude_unsaved` __Required: Optional__. Pass True to exclude gifts that aren't saved to the account's profile page * - _bool_ `$exclude_saved` __Required: Optional__. Pass True to exclude gifts that are saved to the account's profile page * - _bool_ `$exclude_unlimited` __Required: Optional__. Pass True to exclude gifts that can be purchased an unlimited number of times - * - _bool_ `$exclude_limited` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times + * - _bool_ `$exclude_limited_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique + * - _bool_ `$exclude_limited_non_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique * - _bool_ `$exclude_unique` __Required: Optional__. Pass True to exclude unique gifts + * - _bool_ `$exclude_from_blockchain` __Required: Optional__. Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram * - _bool_ `$sort_by_price` __Required: Optional__. Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. * - _string_ `$offset` __Required: Optional__. Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results * - _int_ `$limit` __Required: Optional__. The maximum number of gifts to be returned; 1-100. Defaults to 100 * * + * @method PromiseInterface getUserGifts(...$parameters) Returns the gifts owned and hosted by a user. Returns OwnedGifts on success. + * + * {@see https://core.telegram.org/bots/api#getusergifts} + * + * Parameters: + * - _int_ `$user_id` __Required: Yes__. Unique identifier of the user + * - _bool_ `$exclude_unlimited` __Required: Optional__. Pass True to exclude gifts that can be purchased an unlimited number of times + * - _bool_ `$exclude_limited_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique + * - _bool_ `$exclude_limited_non_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique + * - _bool_ `$exclude_from_blockchain` __Required: Optional__. Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram + * - _bool_ `$exclude_unique` __Required: Optional__. Pass True to exclude unique gifts + * - _bool_ `$sort_by_price` __Required: Optional__. Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. + * - _string_ `$offset` __Required: Optional__. Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results + * - _int_ `$limit` __Required: Optional__. The maximum number of gifts to be returned; 1-100. Defaults to 100 + * + * + * @method PromiseInterface getChatGifts(...$parameters) Returns the gifts owned by a chat. Returns OwnedGifts on success. + * + * {@see https://core.telegram.org/bots/api#getchatgifts} + * + * Parameters: + * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * - _bool_ `$exclude_unsaved` __Required: Optional__. Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel. + * - _bool_ `$exclude_saved` __Required: Optional__. Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel. + * - _bool_ `$exclude_unlimited` __Required: Optional__. Pass True to exclude gifts that can be purchased an unlimited number of times + * - _bool_ `$exclude_limited_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique + * - _bool_ `$exclude_limited_non_upgradable` __Required: Optional__. Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique + * - _bool_ `$exclude_from_blockchain` __Required: Optional__. Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram + * - _bool_ `$exclude_unique` __Required: Optional__. Pass True to exclude unique gifts + * - _bool_ `$sort_by_price` __Required: Optional__. Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. + * - _string_ `$offset` __Required: Optional__. Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results + * - _int_ `$limit` __Required: Optional__. The maximum number of gifts to be returned; 1-100. Defaults to 100 + * + * * @method PromiseInterface|true convertGiftToStars(...$parameters) Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. * * {@see https://core.telegram.org/bots/api#convertgifttostars} @@ -1356,6 +1407,19 @@ * - _bool_ `$protect_content` __Required: Optional__. Pass True if the content of the story must be protected from forwarding and screenshotting * * + * @method PromiseInterface|Story repostStory(...$parameters) Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success. + * + * {@see https://core.telegram.org/bots/api#repoststory} + * + * Parameters: + * - _string_ `$business_connection_id` __Required: Yes__. Unique identifier of the business connection + * - _int_ `$from_chat_id` __Required: Yes__. Unique identifier of the chat which posted the story that should be reposted + * - _int_ `$from_story_id` __Required: Yes__. Unique identifier of the story that should be reposted + * - _int_ `$active_period` __Required: Yes__. Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 + * - _bool_ `$post_to_chat_page` __Required: Optional__. Pass True to keep the story accessible after it expires + * - _bool_ `$protect_content` __Required: Optional__. Pass True if the content of the story must be protected from forwarding and screenshotting + * + * * @method PromiseInterface|Story editStory(...$parameters) Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. * * {@see https://core.telegram.org/bots/api#editstory} @@ -1534,7 +1598,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _InputFile|string_ `$sticker` __Required: Yes__. Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL. * - _string_ `$emoji` __Required: Optional__. Emoji associated with the sticker; only for just uploaded stickers @@ -1729,7 +1793,7 @@ * * Parameters: * - _int|string_ `$chat_id` __Required: Yes__. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _int_ `$direct_messages_topic_id` __Required: Optional__. Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * - _string_ `$title` __Required: Yes__. Product name, 1-32 characters * - _string_ `$description` __Required: Yes__. Product description, 1-255 characters @@ -1860,7 +1924,7 @@ * Parameters: * - _string_ `$business_connection_id` __Required: Optional__. Unique identifier of the business connection on behalf of which the message will be sent * - _int_ `$chat_id` __Required: Yes__. Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats. - * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * - _int_ `$message_thread_id` __Required: Optional__. Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * - _string_ `$game_short_name` __Required: Yes__. Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather. * - _bool_ `$disable_notification` __Required: Optional__. Sends the message silently. Users will receive a notification with no sound. * - _bool_ `$protect_content` __Required: Optional__. Protects the contents of the sent message from forwarding and saving diff --git a/src/Helpers.php b/src/Helpers.php index 5fcfc96..44d7631 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -144,7 +144,7 @@ function multipart(array $data, array &$files = []): array return $data['contents']; }; - $walk = function (array &$data) use (&$extract, &$result, &$walk) { + $walk = function (array &$data) use (&$extract, &$walk) { foreach ($data as $key => $value) { if (is_a($value, InputFile::class)) { $data[$key] = $extract($value); diff --git a/src/Methods/CloseMethod.php b/src/Methods/CloseMethod.php index 882cb0b..62ae9e4 100644 --- a/src/Methods/CloseMethod.php +++ b/src/Methods/CloseMethod.php @@ -14,8 +14,4 @@ class CloseMethod extends TelegramMethod { protected string $method = 'close'; protected array $expect = ['true']; - - public function __construct() - { - } } diff --git a/src/Methods/CopyMessageMethod.php b/src/Methods/CopyMessageMethod.php index 9063b7c..4da3b49 100644 --- a/src/Methods/CopyMessageMethod.php +++ b/src/Methods/CopyMessageMethod.php @@ -15,7 +15,7 @@ * Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * @property-read int|string $from_chat_id Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) * @property-read int $message_id Message identifier in the chat specified in from_chat_id @@ -27,6 +27,7 @@ * @property-read ?bool $disable_notification Sends the message silently. Users will receive a notification with no sound. * @property-read ?bool $protect_content Protects the contents of the sent message from forwarding and saving * @property-read ?bool $allow_paid_broadcast Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance + * @property-read ?string $message_effect_id Unique identifier of the message effect to be added to the message; only available when copying to private chats * @property-read ?SuggestedPostParameters $suggested_post_parameters A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined. * @property-read ?ReplyParameters $reply_parameters Description of the message to reply to * @property-read null|InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply $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 @@ -52,6 +53,7 @@ public function __construct( public readonly ?bool $disable_notification, public readonly ?bool $protect_content, public readonly ?bool $allow_paid_broadcast, + public readonly ?string $message_effect_id, public readonly ?SuggestedPostParameters $suggested_post_parameters, public readonly ?ReplyParameters $reply_parameters, public readonly null|InlineKeyboardMarkup|ReplyKeyboardMarkup|ReplyKeyboardRemove|ForceReply $reply_markup, diff --git a/src/Methods/CopyMessagesMethod.php b/src/Methods/CopyMessagesMethod.php index 5c9ec59..7f0f13e 100644 --- a/src/Methods/CopyMessagesMethod.php +++ b/src/Methods/CopyMessagesMethod.php @@ -8,7 +8,7 @@ * Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat * @property-read int|string $from_chat_id Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) * @property-read int[] $message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. diff --git a/src/Methods/DeleteForumTopicMethod.php b/src/Methods/DeleteForumTopicMethod.php index ab6cd96..69feded 100644 --- a/src/Methods/DeleteForumTopicMethod.php +++ b/src/Methods/DeleteForumTopicMethod.php @@ -5,7 +5,7 @@ use WeStacks\TeleBot\Foundation\TelegramMethod; /** - * Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. + * Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) * @property-read int $message_thread_id Unique identifier for the target message thread of the forum topic diff --git a/src/Methods/EditForumTopicMethod.php b/src/Methods/EditForumTopicMethod.php index 520780c..9411d90 100644 --- a/src/Methods/EditForumTopicMethod.php +++ b/src/Methods/EditForumTopicMethod.php @@ -5,7 +5,7 @@ use WeStacks\TeleBot\Foundation\TelegramMethod; /** - * Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. + * Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) * @property-read int $message_thread_id Unique identifier for the target message thread of the forum topic diff --git a/src/Methods/ForwardMessageMethod.php b/src/Methods/ForwardMessageMethod.php index 96d1ae3..8733431 100644 --- a/src/Methods/ForwardMessageMethod.php +++ b/src/Methods/ForwardMessageMethod.php @@ -9,12 +9,13 @@ * Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat * @property-read int|string $from_chat_id Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) * @property-read ?int $video_start_timestamp New start timestamp for the forwarded video in the message * @property-read ?bool $disable_notification Sends the message silently. Users will receive a notification with no sound. * @property-read ?bool $protect_content Protects the contents of the forwarded message from forwarding and saving + * @property-read ?string $message_effect_id Unique identifier of the message effect to be added to the message; only available when forwarding to private chats * @property-read ?SuggestedPostParameters $suggested_post_parameters A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only * @property-read int $message_id Message identifier in the chat specified in from_chat_id * @@ -33,6 +34,7 @@ public function __construct( public readonly ?int $video_start_timestamp, public readonly ?bool $disable_notification, public readonly ?bool $protect_content, + public readonly ?string $message_effect_id, public readonly ?SuggestedPostParameters $suggested_post_parameters, public readonly int $message_id, ) { diff --git a/src/Methods/ForwardMessagesMethod.php b/src/Methods/ForwardMessagesMethod.php index 0ef3d0f..8a65e37 100644 --- a/src/Methods/ForwardMessagesMethod.php +++ b/src/Methods/ForwardMessagesMethod.php @@ -8,7 +8,7 @@ * Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat * @property-read int|string $from_chat_id Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) * @property-read int[] $message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. diff --git a/src/Methods/GetAvailableGiftsMethod.php b/src/Methods/GetAvailableGiftsMethod.php index 96716bd..124c9be 100644 --- a/src/Methods/GetAvailableGiftsMethod.php +++ b/src/Methods/GetAvailableGiftsMethod.php @@ -14,8 +14,4 @@ class GetAvailableGiftsMethod extends TelegramMethod { protected string $method = 'getAvailableGifts'; protected array $expect = []; - - public function __construct() - { - } } diff --git a/src/Methods/GetBusinessAccountGiftsMethod.php b/src/Methods/GetBusinessAccountGiftsMethod.php index 289d73c..b7c5b9f 100644 --- a/src/Methods/GetBusinessAccountGiftsMethod.php +++ b/src/Methods/GetBusinessAccountGiftsMethod.php @@ -11,8 +11,10 @@ * @property-read ?bool $exclude_unsaved Pass True to exclude gifts that aren't saved to the account's profile page * @property-read ?bool $exclude_saved Pass True to exclude gifts that are saved to the account's profile page * @property-read ?bool $exclude_unlimited Pass True to exclude gifts that can be purchased an unlimited number of times - * @property-read ?bool $exclude_limited Pass True to exclude gifts that can be purchased a limited number of times + * @property-read ?bool $exclude_limited_upgradable Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique + * @property-read ?bool $exclude_limited_non_upgradable Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique * @property-read ?bool $exclude_unique Pass True to exclude unique gifts + * @property-read ?bool $exclude_from_blockchain Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram * @property-read ?bool $sort_by_price Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. * @property-read ?string $offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results * @property-read ?int $limit The maximum number of gifts to be returned; 1-100. Defaults to 100 @@ -29,8 +31,10 @@ public function __construct( public readonly ?bool $exclude_unsaved, public readonly ?bool $exclude_saved, public readonly ?bool $exclude_unlimited, - public readonly ?bool $exclude_limited, + public readonly ?bool $exclude_limited_upgradable, + public readonly ?bool $exclude_limited_non_upgradable, public readonly ?bool $exclude_unique, + public readonly ?bool $exclude_from_blockchain, public readonly ?bool $sort_by_price, public readonly ?string $offset, public readonly ?int $limit, diff --git a/src/Methods/GetChatGiftsMethod.php b/src/Methods/GetChatGiftsMethod.php new file mode 100644 index 0000000..5fa9f0d --- /dev/null +++ b/src/Methods/GetChatGiftsMethod.php @@ -0,0 +1,43 @@ +” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » diff --git a/src/Methods/SendGameMethod.php b/src/Methods/SendGameMethod.php index a45db14..85cb9ea 100644 --- a/src/Methods/SendGameMethod.php +++ b/src/Methods/SendGameMethod.php @@ -11,7 +11,7 @@ * * @property-read ?string $business_connection_id Unique identifier of the business connection on behalf of which the message will be sent * @property-read int $chat_id Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats. - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read string $game_short_name Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather. * @property-read ?bool $disable_notification Sends the message silently. Users will receive a notification with no sound. * @property-read ?bool $protect_content Protects the contents of the sent message from forwarding and saving diff --git a/src/Methods/SendGiftMethod.php b/src/Methods/SendGiftMethod.php index ccffca4..c7fe874 100644 --- a/src/Methods/SendGiftMethod.php +++ b/src/Methods/SendGiftMethod.php @@ -10,7 +10,7 @@ * * @property-read ?int $user_id Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. * @property-read null|int|string $chat_id Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift. - * @property-read string $gift_id Identifier of the gift + * @property-read string $gift_id Identifier of the gift; limited gifts can't be sent to channel chats * @property-read ?bool $pay_for_upgrade Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver * @property-read ?string $text Text that will be shown along with the gift; 0-128 characters * @property-read ?string $text_parse_mode Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. diff --git a/src/Methods/SendInvoiceMethod.php b/src/Methods/SendInvoiceMethod.php index a993caf..98096a6 100644 --- a/src/Methods/SendInvoiceMethod.php +++ b/src/Methods/SendInvoiceMethod.php @@ -12,7 +12,7 @@ * Use this method to send invoices. On success, the sent Message is returned. * * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * @property-read string $title Product name, 1-32 characters * @property-read string $description Product description, 1-255 characters diff --git a/src/Methods/SendLocationMethod.php b/src/Methods/SendLocationMethod.php index 7fefa29..d11b702 100644 --- a/src/Methods/SendLocationMethod.php +++ b/src/Methods/SendLocationMethod.php @@ -15,7 +15,7 @@ * * @property-read ?string $business_connection_id Unique identifier of the business connection on behalf of which the message will be sent * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat * @property-read float $latitude Latitude of the location * @property-read float $longitude Longitude of the location diff --git a/src/Methods/SendMediaGroupMethod.php b/src/Methods/SendMediaGroupMethod.php index 0a5e14e..b7fe2e9 100644 --- a/src/Methods/SendMediaGroupMethod.php +++ b/src/Methods/SendMediaGroupMethod.php @@ -11,7 +11,7 @@ * * @property-read ?string $business_connection_id Unique identifier of the business connection on behalf of which the message will be sent * @property-read int|string $chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) - * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of the forum; for forum supergroups only + * @property-read ?int $message_thread_id Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only * @property-read ?int $direct_messages_topic_id Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat * @property-read InputMedia[] $media A JSON-serialized array describing messages to be sent, must include 2-10 items * @property-read ?bool $disable_notification Sends messages silently. Users will receive a notification with no sound. diff --git a/src/Methods/SendMessageDraftMethod.php b/src/Methods/SendMessageDraftMethod.php new file mode 100644 index 0000000..591d322 --- /dev/null +++ b/src/Methods/SendMessageDraftMethod.php @@ -0,0 +1,34 @@ +