Visitar URL original
Merge pull request #367 from reo7sp/api-10.3 · reo7sp/tgbot-cpp@485d359 · GitHub
Skip to content

Commit 485d359

Browse files
authored
Merge pull request #367 from reo7sp/api-10.3
Telegram API 10.3
2 parents 76e2e85 + 734e833 commit 485d359

19 files changed

Lines changed: 2502 additions & 1057 deletions

‎AGENTS.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Repository workflow
2+
3+
- Use the repository's `make` targets for formatting, linting, generation, builds, and tests whenever a matching target exists.
4+
- Run `make api-generate` after changing the API schema, code generator, or generator configuration.
5+
- Run `make format` and `make lint`; do not invoke `clang-format` directly on generated files. `ApiMethods.cpp` and `ApiMethods.inc.h` require the dedicated formatting commands encoded in the `Makefile`.
6+
- Run the complete build and test suite with `make test`. It installs the required dependencies, builds the C++ library and tests, runs the C++ tests, and runs the API codegen tests.
7+
- Do not split a normal full verification into `make build-with-test`, `make test-only`, and `make test-api-codegen`; those targets are implementation details or for deliberately narrow reruns after `make test` has already built their prerequisites.
8+
- Do not override `BUILD_DIR` for normal builds or tests. The Conan layout writes its toolchain to the repository's standard build directory, so a custom `BUILD_DIR` can make CMake look for a toolchain that Conan did not place there.
9+
- Preserve public source compatibility when updating the Telegram Bot API. Do not reorder, remove, or change the types or defaults of existing positional `Api` method parameters, and do not remove existing fields from `*Args` structs. Append new optional parameters or expose them through `*Args`; when Telegram replaces parameters, keep the legacy API and translate it to the new wire representation. Add regression tests for the preserved signatures and translation.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
1010

1111
## State
1212

13-
- [x] Telegram Bot API 10.2.
13+
- [x] Telegram Bot API 10.3.
1414

1515

1616
## Example

‎api/codegen.yaml‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ api:
8888
args_order: [scope, language_code]
8989
editChatInviteLink:
9090
args_order: [chat_id, invite_link, expire_date, member_limit, name, creates_join_request]
91+
editEphemeralMessageMedia:
92+
supports_attach_references: true
93+
editEphemeralMessageText:
94+
args_order: [chat_id, ephemeral_message_id, receiver_user_id, text, entities, link_preview_options, parse_mode, reply_markup, rich_message]
9195
editForumTopic:
9296
args_order: [chat_id, message_thread_id, name, icon_custom_emoji_id]
9397
editMessageCaption:
@@ -133,50 +137,70 @@ api:
133137
restrictChatMember:
134138
args_order: [chat_id, user_id, permissions, until_date, use_independent_chat_permissions]
135139
sendAnimation:
136-
args_order: [chat_id, animation, duration, width, height, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id]
140+
args_order: [chat_id, animation, duration, width, height, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, show_caption_above_media, suggested_post_parameters]
141+
legacy_ephemeral_parameters: true
137142
sendAudio:
138-
args_order: [chat_id, audio, caption, duration, performer, title, thumbnail, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, business_connection_id]
143+
args_order: [chat_id, audio, caption, duration, performer, title, thumbnail, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
144+
legacy_ephemeral_parameters: true
139145
sendChatAction:
140146
args_order: [chat_id, action, message_thread_id, business_connection_id]
141147
sendContact:
142-
args_order: [chat_id, phone_number, first_name, last_name, vcard, disable_notification, reply_parameters, reply_markup, message_thread_id, protect_content, business_connection_id]
148+
args_order: [chat_id, phone_number, first_name, last_name, vcard, disable_notification, reply_parameters, reply_markup, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
149+
legacy_ephemeral_parameters: true
143150
sendDice:
144151
args_order: [chat_id, disable_notification, reply_parameters, reply_markup, emoji, message_thread_id, protect_content, business_connection_id]
145152
sendDocument:
146-
args_order: [chat_id, document, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, disable_content_type_detection, message_thread_id, protect_content, business_connection_id]
153+
args_order: [chat_id, document, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, disable_content_type_detection, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
154+
legacy_ephemeral_parameters: true
147155
sendGame:
148156
args_order: [chat_id, game_short_name, reply_parameters, reply_markup, disable_notification, message_thread_id, protect_content, business_connection_id]
149157
sendInvoice:
150158
args_order: [chat_id, title, description, payload, provider_token, currency, prices, provider_data, photo_url, photo_size, photo_width, photo_height, need_name, need_phone_number, need_email, need_shipping_address, send_phone_number_to_provider, send_email_to_provider, is_flexible, reply_parameters, reply_markup, disable_notification, message_thread_id, max_tip_amount, suggested_tip_amounts, start_parameter, protect_content]
151159
args:
152160
provider_token: {declaration_required: true}
153161
sendLocation:
154-
args_order: [chat_id, latitude, longitude, live_period, reply_parameters, reply_markup, disable_notification, horizontal_accuracy, heading, proximity_alert_radius, message_thread_id, protect_content, business_connection_id]
162+
args_order: [chat_id, latitude, longitude, live_period, reply_parameters, reply_markup, disable_notification, horizontal_accuracy, heading, proximity_alert_radius, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
163+
legacy_ephemeral_parameters: true
164+
sendLivePhoto:
165+
args_order: [chat_id, live_photo, photo, allow_paid_broadcast, business_connection_id, callback_query_id, caption, caption_entities, direct_messages_topic_id, disable_notification, has_spoiler, message_effect_id, message_thread_id, parse_mode, protect_content, receiver_user_id, reply_markup, reply_parameters, show_caption_above_media, suggested_post_parameters]
166+
legacy_ephemeral_parameters: true
155167
sendMediaGroup:
156168
args_order: [chat_id, media, disable_notification, reply_parameters, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, direct_messages_topic_id, message_effect_id]
157169
supports_attach_references: true
158170
sendPaidMedia:
159171
supports_attach_references: true
160172
sendRichMessage:
161173
supports_attach_references: true
174+
direct_exclude: [ephemeral_message_parameters]
175+
sendRichMessageDraft:
176+
args_order: [chat_id, draft_id, rich_message, message_thread_id, can_stop, keep_on_stop]
162177
sendMessage:
163-
args_order: [chat_id, text, link_preview_options, reply_parameters, reply_markup, parse_mode, disable_notification, entities, message_thread_id, protect_content, business_connection_id]
178+
args_order: [chat_id, text, link_preview_options, reply_parameters, reply_markup, parse_mode, disable_notification, entities, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
179+
legacy_ephemeral_parameters: true
180+
sendMessageDraft:
181+
args_order: [chat_id, draft_id, entities, message_thread_id, parse_mode, text, can_stop, keep_on_stop]
164182
sendPhoto:
165-
args_order: [chat_id, photo, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id]
183+
args_order: [chat_id, photo, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, show_caption_above_media, suggested_post_parameters]
184+
legacy_ephemeral_parameters: true
166185
sendPoll:
167186
args_order: [chat_id, question, options, disable_notification, reply_parameters, reply_markup, is_anonymous, type, allows_multiple_answers, correct_option_id, explanation, explanation_parse_mode, explanation_entities, open_period, close_date, is_closed, message_thread_id, protect_content, business_connection_id]
168187
args:
169188
is_anonymous: {default: true}
170189
sendSticker:
171-
args_order: [chat_id, sticker, reply_parameters, reply_markup, disable_notification, message_thread_id, protect_content, emoji, business_connection_id]
190+
args_order: [chat_id, sticker, reply_parameters, reply_markup, disable_notification, message_thread_id, protect_content, emoji, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
191+
legacy_ephemeral_parameters: true
172192
sendVenue:
173-
args_order: [chat_id, latitude, longitude, title, address, foursquare_id, foursquare_type, disable_notification, reply_parameters, reply_markup, google_place_id, google_place_type, message_thread_id, protect_content, business_connection_id]
193+
args_order: [chat_id, latitude, longitude, title, address, foursquare_id, foursquare_type, disable_notification, reply_parameters, reply_markup, google_place_id, google_place_type, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
194+
legacy_ephemeral_parameters: true
174195
sendVideo:
175-
args_order: [chat_id, video, supports_streaming, duration, width, height, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id]
196+
args_order: [chat_id, video, supports_streaming, duration, width, height, thumbnail, caption, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, has_spoiler, business_connection_id, allow_paid_broadcast, callback_query_id, cover, direct_messages_topic_id, message_effect_id, receiver_user_id, show_caption_above_media, start_timestamp, suggested_post_parameters]
197+
legacy_ephemeral_parameters: true
176198
sendVideoNote:
177-
args_order: [chat_id, video_note, reply_parameters, disable_notification, duration, length, thumbnail, reply_markup, message_thread_id, protect_content, business_connection_id]
199+
args_order: [chat_id, video_note, reply_parameters, disable_notification, duration, length, thumbnail, reply_markup, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
200+
legacy_ephemeral_parameters: true
178201
sendVoice:
179-
args_order: [chat_id, voice, caption, duration, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, business_connection_id]
202+
args_order: [chat_id, voice, caption, duration, reply_parameters, reply_markup, parse_mode, disable_notification, caption_entities, message_thread_id, protect_content, business_connection_id, allow_paid_broadcast, callback_query_id, direct_messages_topic_id, message_effect_id, receiver_user_id, suggested_post_parameters]
203+
legacy_ephemeral_parameters: true
180204
postStory:
181205
supports_attach_references: true
182206
setBusinessAccountProfilePhoto:

0 commit comments

Comments
 (0)