├── .github └── workflows │ ├── examples-config.json │ ├── run-examples.yml │ ├── run-tests.yml │ ├── tagged-release.yml │ ├── tests-config.json │ └── update-doc.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── docs ├── Makefile ├── _templates │ └── versioning.html ├── api.rst ├── api │ ├── banana.rst │ ├── banana │ │ ├── agents.rst │ │ ├── agents │ │ │ ├── beast.rst │ │ │ ├── cpr.rst │ │ │ ├── httplib.rst │ │ │ └── winapi.rst │ │ └── basic_types.rst │ ├── tg.rst │ └── tg │ │ ├── methods.rst │ │ ├── methods │ │ ├── add_sticker_to_set.rst │ │ ├── answer_callback_query.rst │ │ ├── answer_inline_query.rst │ │ ├── answer_pre_checkout_query.rst │ │ ├── answer_shipping_query.rst │ │ ├── answer_web_app_query.rst │ │ ├── approve_chat_join_request.rst │ │ ├── ban_chat_member.rst │ │ ├── ban_chat_sender_chat.rst │ │ ├── close.rst │ │ ├── close_forum_topic.rst │ │ ├── close_general_forum_topic.rst │ │ ├── copy_message.rst │ │ ├── copy_messages.rst │ │ ├── create_chat_invite_link.rst │ │ ├── create_forum_topic.rst │ │ ├── create_invoice_link.rst │ │ ├── create_new_sticker_set.rst │ │ ├── decline_chat_join_request.rst │ │ ├── delete_chat_photo.rst │ │ ├── delete_chat_sticker_set.rst │ │ ├── delete_forum_topic.rst │ │ ├── delete_message.rst │ │ ├── delete_messages.rst │ │ ├── delete_my_commands.rst │ │ ├── delete_sticker_from_set.rst │ │ ├── delete_sticker_set.rst │ │ ├── delete_webhook.rst │ │ ├── edit_chat_invite_link.rst │ │ ├── edit_forum_topic.rst │ │ ├── edit_general_forum_topic.rst │ │ ├── edit_message_caption.rst │ │ ├── edit_message_live_location.rst │ │ ├── edit_message_media.rst │ │ ├── edit_message_reply_markup.rst │ │ ├── edit_message_text.rst │ │ ├── export_chat_invite_link.rst │ │ ├── forward_message.rst │ │ ├── forward_messages.rst │ │ ├── get_chat.rst │ │ ├── get_chat_administrators.rst │ │ ├── get_chat_member.rst │ │ ├── get_chat_member_count.rst │ │ ├── get_chat_menu_button.rst │ │ ├── get_custom_emoji_stickers.rst │ │ ├── get_file.rst │ │ ├── get_forum_topic_icon_stickers.rst │ │ ├── get_game_high_scores.rst │ │ ├── get_me.rst │ │ ├── get_my_commands.rst │ │ ├── get_my_default_administrator_rights.rst │ │ ├── get_my_description.rst │ │ ├── get_my_name.rst │ │ ├── get_my_short_description.rst │ │ ├── get_sticker_set.rst │ │ ├── get_updates.rst │ │ ├── get_user_chat_boosts.rst │ │ ├── get_user_profile_photos.rst │ │ ├── get_webhook_info.rst │ │ ├── hide_general_forum_topic.rst │ │ ├── leave_chat.rst │ │ ├── log_out.rst │ │ ├── pin_chat_message.rst │ │ ├── promote_chat_member.rst │ │ ├── reopen_forum_topic.rst │ │ ├── reopen_general_forum_topic.rst │ │ ├── restrict_chat_member.rst │ │ ├── revoke_chat_invite_link.rst │ │ ├── send_animation.rst │ │ ├── send_audio.rst │ │ ├── send_chat_action.rst │ │ ├── send_contact.rst │ │ ├── send_dice.rst │ │ ├── send_document.rst │ │ ├── send_game.rst │ │ ├── send_invoice.rst │ │ ├── send_location.rst │ │ ├── send_media_group.rst │ │ ├── send_message.rst │ │ ├── send_photo.rst │ │ ├── send_poll.rst │ │ ├── send_sticker.rst │ │ ├── send_venue.rst │ │ ├── send_video.rst │ │ ├── send_video_note.rst │ │ ├── send_voice.rst │ │ ├── set_chat_administrator_custom_title.rst │ │ ├── set_chat_description.rst │ │ ├── set_chat_menu_button.rst │ │ ├── set_chat_permissions.rst │ │ ├── set_chat_photo.rst │ │ ├── set_chat_sticker_set.rst │ │ ├── set_chat_title.rst │ │ ├── set_custom_emoji_sticker_set_thumbnail.rst │ │ ├── set_game_score.rst │ │ ├── set_message_reaction.rst │ │ ├── set_my_commands.rst │ │ ├── set_my_default_administrator_rights.rst │ │ ├── set_my_description.rst │ │ ├── set_my_name.rst │ │ ├── set_my_short_description.rst │ │ ├── set_passport_data_errors.rst │ │ ├── set_sticker_emoji_list.rst │ │ ├── set_sticker_keywords.rst │ │ ├── set_sticker_mask_position.rst │ │ ├── set_sticker_position_in_set.rst │ │ ├── set_sticker_set_thumb.rst │ │ ├── set_sticker_set_thumbnail.rst │ │ ├── set_sticker_set_title.rst │ │ ├── set_webhook.rst │ │ ├── stop_message_live_location.rst │ │ ├── stop_poll.rst │ │ ├── unban_chat_member.rst │ │ ├── unban_chat_sender_chat.rst │ │ ├── unhide_general_forum_topic.rst │ │ ├── unpin_all_chat_messages.rst │ │ ├── unpin_all_forum_topic_messages.rst │ │ ├── unpin_all_general_forum_topic_messages.rst │ │ ├── unpin_chat_message.rst │ │ └── upload_sticker_file.rst │ │ ├── types.rst │ │ └── types │ │ ├── animation.rst │ │ ├── audio.rst │ │ ├── bot_command.rst │ │ ├── bot_command_scope.rst │ │ ├── bot_command_scope_all_chat_administrators.rst │ │ ├── bot_command_scope_all_group_chats.rst │ │ ├── bot_command_scope_all_private_chats.rst │ │ ├── bot_command_scope_chat.rst │ │ ├── bot_command_scope_chat_administrators.rst │ │ ├── bot_command_scope_chat_member.rst │ │ ├── bot_command_scope_default.rst │ │ ├── bot_description.rst │ │ ├── bot_name.rst │ │ ├── bot_short_description.rst │ │ ├── callback_game.rst │ │ ├── callback_query.rst │ │ ├── chat.rst │ │ ├── chat_administrator_rights.rst │ │ ├── chat_boost.rst │ │ ├── chat_boost_added.rst │ │ ├── chat_boost_removed.rst │ │ ├── chat_boost_source.rst │ │ ├── chat_boost_source_gift_code.rst │ │ ├── chat_boost_source_giveaway.rst │ │ ├── chat_boost_source_premium.rst │ │ ├── chat_boost_updated.rst │ │ ├── chat_invite_link.rst │ │ ├── chat_join_request.rst │ │ ├── chat_location.rst │ │ ├── chat_member.rst │ │ ├── chat_member_administrator.rst │ │ ├── chat_member_banned.rst │ │ ├── chat_member_left.rst │ │ ├── chat_member_member.rst │ │ ├── chat_member_owner.rst │ │ ├── chat_member_restricted.rst │ │ ├── chat_member_updated.rst │ │ ├── chat_permissions.rst │ │ ├── chat_photo.rst │ │ ├── chat_shared.rst │ │ ├── chosen_inline_result.rst │ │ ├── contact.rst │ │ ├── dice.rst │ │ ├── document.rst │ │ ├── encrypted_credentials.rst │ │ ├── encrypted_passport_element.rst │ │ ├── external_reply_info.rst │ │ ├── file.rst │ │ ├── force_reply.rst │ │ ├── forum_topic.rst │ │ ├── forum_topic_closed.rst │ │ ├── forum_topic_created.rst │ │ ├── forum_topic_edited.rst │ │ ├── forum_topic_reopened.rst │ │ ├── game.rst │ │ ├── game_high_score.rst │ │ ├── general_forum_topic_hidden.rst │ │ ├── general_forum_topic_unhidden.rst │ │ ├── giveaway.rst │ │ ├── giveaway_completed.rst │ │ ├── giveaway_created.rst │ │ ├── giveaway_winners.rst │ │ ├── inaccessible_message.rst │ │ ├── inline_keyboard_button.rst │ │ ├── inline_keyboard_markup.rst │ │ ├── inline_query.rst │ │ ├── inline_query_result.rst │ │ ├── inline_query_result_article.rst │ │ ├── inline_query_result_audio.rst │ │ ├── inline_query_result_cached_audio.rst │ │ ├── inline_query_result_cached_document.rst │ │ ├── inline_query_result_cached_gif.rst │ │ ├── inline_query_result_cached_mpeg4_gif.rst │ │ ├── inline_query_result_cached_photo.rst │ │ ├── inline_query_result_cached_sticker.rst │ │ ├── inline_query_result_cached_video.rst │ │ ├── inline_query_result_cached_voice.rst │ │ ├── inline_query_result_contact.rst │ │ ├── inline_query_result_document.rst │ │ ├── inline_query_result_game.rst │ │ ├── inline_query_result_gif.rst │ │ ├── inline_query_result_location.rst │ │ ├── inline_query_result_mpeg4_gif.rst │ │ ├── inline_query_result_photo.rst │ │ ├── inline_query_result_venue.rst │ │ ├── inline_query_result_video.rst │ │ ├── inline_query_result_voice.rst │ │ ├── inline_query_results_button.rst │ │ ├── input_contact_message_content.rst │ │ ├── input_file.rst │ │ ├── input_invoice_message_content.rst │ │ ├── input_location_message_content.rst │ │ ├── input_media.rst │ │ ├── input_media_animation.rst │ │ ├── input_media_audio.rst │ │ ├── input_media_document.rst │ │ ├── input_media_photo.rst │ │ ├── input_media_video.rst │ │ ├── input_message_content.rst │ │ ├── input_sticker.rst │ │ ├── input_text_message_content.rst │ │ ├── input_venue_message_content.rst │ │ ├── invoice.rst │ │ ├── keyboard_button.rst │ │ ├── keyboard_button_poll_type.rst │ │ ├── keyboard_button_request_chat.rst │ │ ├── keyboard_button_request_user.rst │ │ ├── keyboard_button_request_users.rst │ │ ├── labeled_price.rst │ │ ├── link_preview_options.rst │ │ ├── location.rst │ │ ├── login_url.rst │ │ ├── mask_position.rst │ │ ├── maybe_inaccessible_message.rst │ │ ├── menu_button.rst │ │ ├── menu_button_commands.rst │ │ ├── menu_button_default.rst │ │ ├── menu_button_web_app.rst │ │ ├── message.rst │ │ ├── message_auto_delete_timer_changed.rst │ │ ├── message_entity.rst │ │ ├── message_id.rst │ │ ├── message_origin.rst │ │ ├── message_origin_channel.rst │ │ ├── message_origin_chat.rst │ │ ├── message_origin_hidden_user.rst │ │ ├── message_origin_user.rst │ │ ├── message_reaction_count_updated.rst │ │ ├── message_reaction_updated.rst │ │ ├── order_info.rst │ │ ├── passport_data.rst │ │ ├── passport_element_error.rst │ │ ├── passport_element_error_data_field.rst │ │ ├── passport_element_error_file.rst │ │ ├── passport_element_error_files.rst │ │ ├── passport_element_error_front_side.rst │ │ ├── passport_element_error_reverse_side.rst │ │ ├── passport_element_error_selfie.rst │ │ ├── passport_element_error_translation_file.rst │ │ ├── passport_element_error_translation_files.rst │ │ ├── passport_element_error_unspecified.rst │ │ ├── passport_file.rst │ │ ├── photo_size.rst │ │ ├── poll.rst │ │ ├── poll_answer.rst │ │ ├── poll_option.rst │ │ ├── pre_checkout_query.rst │ │ ├── proximity_alert_triggered.rst │ │ ├── reaction_count.rst │ │ ├── reaction_type.rst │ │ ├── reaction_type_custom_emoji.rst │ │ ├── reaction_type_emoji.rst │ │ ├── reply_keyboard_markup.rst │ │ ├── reply_keyboard_remove.rst │ │ ├── reply_parameters.rst │ │ ├── response_parameters.rst │ │ ├── sent_web_app_message.rst │ │ ├── shipping_address.rst │ │ ├── shipping_option.rst │ │ ├── shipping_query.rst │ │ ├── sticker.rst │ │ ├── sticker_set.rst │ │ ├── story.rst │ │ ├── successful_payment.rst │ │ ├── switch_inline_query_chosen_chat.rst │ │ ├── text_quote.rst │ │ ├── update.rst │ │ ├── user.rst │ │ ├── user_chat_boosts.rst │ │ ├── user_profile_photos.rst │ │ ├── user_shared.rst │ │ ├── users_shared.rst │ │ ├── venue.rst │ │ ├── video.rst │ │ ├── video_chat_ended.rst │ │ ├── video_chat_participants_invited.rst │ │ ├── video_chat_scheduled.rst │ │ ├── video_chat_started.rst │ │ ├── video_note.rst │ │ ├── voice.rst │ │ ├── voice_chat_ended.rst │ │ ├── voice_chat_participants_invited.rst │ │ ├── voice_chat_scheduled.rst │ │ ├── voice_chat_started.rst │ │ ├── web_app_data.rst │ │ ├── web_app_info.rst │ │ ├── webhook_info.rst │ │ └── write_access_allowed.rst ├── conf.py ├── guide.rst ├── guide │ └── quick.rst ├── index.rst ├── make.bat ├── requirements.txt └── utils │ └── goal-note.rst ├── examples ├── CMakeLists.txt ├── agent-any-blocking.cpp ├── agent-beast-async.cpp ├── agent-beast-blocking.cpp ├── agent-beast-coro.cpp ├── agent-cpr-async.cpp ├── agent-cpr-blocking.cpp ├── agent-default-async.cpp ├── agent-default-blocking.cpp ├── agent-httplib-async.cpp ├── agent-httplib-blocking.cpp ├── agent-winapi-async.cpp ├── agent-winapi-blocking.cpp ├── custom-agent-blocking.cpp ├── examples_util.hpp ├── generic-api-call.cpp └── vcpkg.json ├── include └── banana │ ├── agent │ └── any.hpp │ ├── api.hpp │ ├── detail │ ├── api_enums.hpp │ ├── api_traits.hpp │ ├── api_types_fwd.hpp │ ├── generated │ │ ├── api.hpp │ │ ├── api_enums.hpp │ │ ├── api_traits.hpp │ │ ├── api_types_fwd.hpp │ │ ├── meta.hpp │ │ ├── types.hpp │ │ └── types_fwd.hpp │ ├── response_handler.hpp │ └── serializer.hpp │ ├── meta.hpp │ ├── types.hpp │ ├── types_fwd.hpp │ └── utils │ ├── agent.hpp │ ├── basic_types.hpp │ ├── dynamic_optional.hpp │ └── expected.hpp ├── script ├── api.json ├── api.py ├── custom2json.py ├── custom_v2.json ├── json2cpp.py ├── json2rst.py ├── load_api.py └── requirements.txt ├── source ├── CMakeLists.txt ├── agents │ ├── CMakeLists.txt │ ├── beast │ │ ├── CMakeLists.txt │ │ └── banana │ │ │ └── agent │ │ │ ├── beast.cpp │ │ │ └── beast.hpp │ ├── cpr │ │ ├── CMakeLists.txt │ │ └── banana │ │ │ └── agent │ │ │ ├── cpr.cpp │ │ │ └── cpr.hpp │ ├── default │ │ ├── CMakeLists.txt │ │ └── banana │ │ │ └── agent │ │ │ └── default.hpp │ ├── httplib │ │ ├── CMakeLists.txt │ │ └── banana │ │ │ └── agent │ │ │ ├── httplib.cpp │ │ │ └── httplib.hpp │ └── winapi │ │ ├── CMakeLists.txt │ │ └── banana │ │ └── agent │ │ ├── winapi.cpp │ │ └── winapi.hpp ├── core.cpp ├── generated │ ├── resp_impl.cxx │ └── serialize_impl.cxx └── serialization.hpp ├── tests ├── CMakeLists.txt ├── doctest.h ├── main.cpp ├── test_deserialization.cpp ├── test_dynamic_optional.cpp ├── test_serialization.cpp ├── test_serialization_generated.cpp └── util.hpp └── third_party └── json └── nlohmann └── json.hpp /.github/workflows/examples-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { "cmd": ["banana-example-agent-default-blocking"] }, 4 | { "cmd": ["banana-example-agent-default-async"] }, 5 | { "cmd": ["banana-example-agent-any-blocking"] }, 6 | { "cmd": ["banana-example-agent-cpr-blocking"] }, 7 | { "cmd": ["banana-example-agent-cpr-async"] }, 8 | { "cmd": ["banana-example-agent-winapi-blocking"], "optional": true }, 9 | { "cmd": ["banana-example-agent-winapi-async"], "optional": true }, 10 | { "cmd": ["banana-example-agent-beast-blocking"] }, 11 | { "cmd": ["banana-example-agent-beast-async"] }, 12 | { "cmd": ["banana-example-agent-beast-coro"], "optional": true }, 13 | { "cmd": ["banana-example-agent-httplib-blocking"] }, 14 | { "cmd": ["banana-example-agent-httplib-async"] }, 15 | { "cmd": ["banana-example-custom-agent-blocking"], "optional": true }, 16 | { "cmd": ["banana-example-generic-api-call"] } 17 | ] 18 | } -------------------------------------------------------------------------------- /.github/workflows/tagged-release.yml: -------------------------------------------------------------------------------- 1 | name: Tagged Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*" 7 | 8 | jobs: 9 | pre-release: 10 | runs-on: ubuntu-latest 11 | name: Publish Release ${{github.ref}} 12 | 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | 17 | - name: Publish 18 | uses: marvinpinto/action-automatic-releases@latest 19 | with: 20 | repo_token: ${{ secrets.GITHUB_TOKEN }} 21 | draft: true 22 | prerelease: false 23 | -------------------------------------------------------------------------------- /.github/workflows/tests-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { 4 | "cmd": ["banana-tests"] 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /.github/workflows/update-doc.yml: -------------------------------------------------------------------------------- 1 | name: Update Documentation 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*" 7 | branches: 8 | - master 9 | 10 | jobs: 11 | docs: 12 | runs-on: ubuntu-latest 13 | name: Build and update docs 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | with: 18 | fetch-depth: 0 19 | 20 | - name: Install python 21 | uses: actions/setup-python@v2 22 | with: 23 | python-version: '3.10' 24 | 25 | - name: Install python deps 26 | working-directory: "docs" 27 | shell: bash 28 | run: pip install -r requirements.txt 29 | 30 | - name: Clone documentation branch 31 | uses: actions/checkout@v2 32 | with: 33 | ref: "gh-pages" 34 | path: gh-pages 35 | 36 | - name: Build documentation 37 | working-directory: "docs" 38 | shell: bash 39 | run: | 40 | sphinx-multiversion . _build 41 | cp -r _build/* ../gh-pages 42 | 43 | - name: Publish Docs to gh-pages 44 | uses: peaceiris/actions-gh-pages@v3 45 | with: 46 | github_token: ${{ secrets.GITHUB_TOKEN }} 47 | publish_dir: gh-pages 48 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(banana) 3 | 4 | include(FetchContent) 5 | 6 | set(BANANA_VERSION_MAJOR 0) 7 | set(BANANA_VERSION_MINOR 5) 8 | set(BANANA_VERSION_PATCH 0) 9 | 10 | set(BANANA_ROOT_DIR ${PROJECT_SOURCE_DIR}) 11 | 12 | # === Configuration options === 13 | 14 | option(BANANA_USE_BUNDLED_CPR "Use CPR submodule for CPR agent" OFF) 15 | option(BANANA_BUILD_EXAMPLES "Build banana examples" OFF) 16 | 17 | # === Configuration logging === 18 | 19 | message(STATUS "[banana] Use bundled CPR: ${BANANA_USE_BUNDLED_CPR}") 20 | message(STATUS "[banana] Build examples: ${BANANA_BUILD_EXAMPLES}") 21 | 22 | # TODO: replace with raw curl? 23 | if(BANANA_USE_BUNDLED_CPR) 24 | # Don't build cpr tests 25 | set(BUILD_CPR_TESTS OFF CACHE BOOL "" FORCE) 26 | 27 | find_package(CURL) 28 | 29 | if(CURL_FOUND) 30 | # Use the system curl for faster builds 31 | set(USE_SYSTEM_CURL ON CACHE BOOL "" FORCE) 32 | endif() 33 | 34 | FetchContent_Declare(cpr 35 | GIT_REPOSITORY https://github.com/whoshuu/cpr.git 36 | GIT_TAG f4622efcb59d84071ae11404ae61bd821c1c344b 37 | ) 38 | FetchContent_MakeAvailable(cpr) 39 | endif() 40 | 41 | 42 | # === Library === 43 | 44 | add_subdirectory(source) 45 | 46 | # === Testing === 47 | 48 | if (${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) 49 | add_subdirectory(tests) 50 | endif() 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2021 Smertig 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_templates/versioning.html: -------------------------------------------------------------------------------- 1 | {% if versions %} 2 |
{{ _('Versions') }}
3 | 8 | {% endif %} 9 | -------------------------------------------------------------------------------- /docs/api.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api: 2 | 3 | API Reference 4 | ============= 5 | 6 | The page contains all information about API: 7 | 8 | .. toctree:: 9 | :name: api 10 | 11 | Banana API 12 | Telegram API 13 | -------------------------------------------------------------------------------- /docs/api/banana.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-banana: 2 | 3 | Banana API 4 | ========== 5 | 6 | The page contains all information about banana API: 7 | 8 | .. toctree:: 9 | :name: api_banana 10 | 11 | Banana Basic Types 12 | Banana Agents 13 | -------------------------------------------------------------------------------- /docs/api/banana/basic_types.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-banana-basic_types: 2 | 3 | Banana Basic Types 4 | ================== 5 | 6 | Basic types are the types that make up all the structures used in Telegram API including method arguments and their return values. 7 | 8 | File 9 | ``#include `` 10 | 11 | .. cpp:type:: banana::boolean_t = bool 12 | 13 | Boolean type (`true` or `false`). 14 | 15 | .. cpp:type:: banana::float_t = double 16 | 17 | Floating point type. 18 | 19 | .. cpp:type:: banana::integer_t = std::int64_t 20 | 21 | Signed 64-bit integer type. 22 | 23 | .. cpp:type:: banana::string_t = std::string 24 | 25 | Utf-8 string. 26 | 27 | .. cpp:type:: template banana::optional_t = banana::dynamic_optional 28 | 29 | Type representing a value that may not exist. 30 | 31 | .. cpp:type:: template banana::array_t = std::vector 32 | 33 | Type representing dynamically-sized array. 34 | 35 | .. cpp:type:: template banana::variant_t = std::variant 36 | 37 | Type representing the value of one of several possible types. 38 | -------------------------------------------------------------------------------- /docs/api/tg.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg: 2 | 3 | Telegram API 4 | ============ 5 | 6 | The page contains all information about telegram-specific API: 7 | 8 | .. toctree:: 9 | :name: api_tg 10 | 11 | Telegram Types 12 | Telegram Methods 13 | -------------------------------------------------------------------------------- /docs/api/tg/methods/add_sticker_to_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-add_sticker_to_set: 2 | 3 | add_sticker_to_set 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result add_sticker_to_set(Agent&& agent, add_sticker_to_set_args_t args) 9 | .. cpp:function:: template \ 10 | void add_sticker_to_set(Agent&& agent, add_sticker_to_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success. 17 | 18 | .. cpp:struct:: add_sticker_to_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`add_sticker_to_set`. 21 | 22 | 23 | .. cpp:member:: integer_t user_id 24 | 25 | User identifier of sticker set owner 26 | 27 | .. cpp:member:: string_t name 28 | 29 | Sticker set name 30 | 31 | .. cpp:member:: input_sticker_t sticker 32 | 33 | A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed. 34 | -------------------------------------------------------------------------------- /docs/api/tg/methods/answer_web_app_query.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-answer_web_app_query: 2 | 3 | answer_web_app_query 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result answer_web_app_query(Agent&& agent, answer_web_app_query_args_t args) 9 | .. cpp:function:: template \ 10 | void answer_web_app_query(Agent&& agent, answer_web_app_query_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned. 17 | 18 | .. cpp:struct:: answer_web_app_query_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`answer_web_app_query`. 21 | 22 | 23 | .. cpp:member:: string_t web_app_query_id 24 | 25 | Unique identifier for the query to be answered 26 | 27 | .. cpp:member:: inline_query_result_t result 28 | 29 | A JSON-serialized object describing the message to be sent 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/approve_chat_join_request.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-approve_chat_join_request: 2 | 3 | approve_chat_join_request 4 | ========================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result approve_chat_join_request(Agent&& agent, approve_chat_join_request_args_t args) 9 | .. cpp:function:: template \ 10 | void approve_chat_join_request(Agent&& agent, approve_chat_join_request_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. 17 | 18 | .. cpp:struct:: approve_chat_join_request_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`approve_chat_join_request`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: integer_t user_id 28 | 29 | Unique identifier of the target user 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/close.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-close: 2 | 3 | close 4 | ===== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result close(Agent&& agent) 9 | .. cpp:function:: template \ 10 | void close(Agent&& agent, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters. 17 | 18 | -------------------------------------------------------------------------------- /docs/api/tg/methods/close_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-close_forum_topic: 2 | 3 | close_forum_topic 4 | ================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result close_forum_topic(Agent&& agent, close_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void close_forum_topic(Agent&& agent, close_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to close an open 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. 17 | 18 | .. cpp:struct:: close_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`close_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | 27 | .. cpp:member:: integer_t message_thread_id 28 | 29 | Unique identifier for the target message thread of the forum topic 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/close_general_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-close_general_forum_topic: 2 | 3 | close_general_forum_topic 4 | ========================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result close_general_forum_topic(Agent&& agent, close_general_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void close_general_forum_topic(Agent&& agent, close_general_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to close an open 'General' 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. Returns True on success. 17 | 18 | .. cpp:struct:: close_general_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`close_general_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/decline_chat_join_request.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-decline_chat_join_request: 2 | 3 | decline_chat_join_request 4 | ========================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result decline_chat_join_request(Agent&& agent, decline_chat_join_request_args_t args) 9 | .. cpp:function:: template \ 10 | void decline_chat_join_request(Agent&& agent, decline_chat_join_request_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. 17 | 18 | .. cpp:struct:: decline_chat_join_request_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`decline_chat_join_request`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: integer_t user_id 28 | 29 | Unique identifier of the target user 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_chat_photo.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_chat_photo: 2 | 3 | delete_chat_photo 4 | ================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_chat_photo(Agent&& agent, delete_chat_photo_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_chat_photo(Agent&& agent, delete_chat_photo_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. 17 | 18 | .. cpp:struct:: delete_chat_photo_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_chat_photo`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_chat_sticker_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_chat_sticker_set: 2 | 3 | delete_chat_sticker_set 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_chat_sticker_set(Agent&& agent, delete_chat_sticker_set_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_chat_sticker_set(Agent&& agent, delete_chat_sticker_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. 17 | 18 | .. cpp:struct:: delete_chat_sticker_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_chat_sticker_set`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_forum_topic: 2 | 3 | delete_forum_topic 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_forum_topic(Agent&& agent, delete_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_forum_topic(Agent&& agent, delete_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | 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. 17 | 18 | .. cpp:struct:: delete_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | 27 | .. cpp:member:: integer_t message_thread_id 28 | 29 | Unique identifier for the target message thread of the forum topic 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_messages.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_messages: 2 | 3 | delete_messages 4 | =============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_messages(Agent&& agent, delete_messages_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_messages(Agent&& agent, delete_messages_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success. 17 | 18 | .. cpp:struct:: delete_messages_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_messages`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: array_t message_ids 28 | 29 | A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_my_commands.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_my_commands: 2 | 3 | delete_my_commands 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_my_commands(Agent&& agent, delete_my_commands_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_my_commands(Agent&& agent, delete_my_commands_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. 17 | 18 | .. cpp:struct:: delete_my_commands_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_my_commands`. 21 | 22 | 23 | .. cpp:member:: optional_t scope 24 | 25 | A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. 26 | 27 | .. cpp:member:: optional_t language_code 28 | 29 | A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_sticker_from_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_sticker_from_set: 2 | 3 | delete_sticker_from_set 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_sticker_from_set(Agent&& agent, delete_sticker_from_set_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_sticker_from_set(Agent&& agent, delete_sticker_from_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete a sticker from a set created by the bot. Returns True on success. 17 | 18 | .. cpp:struct:: delete_sticker_from_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_sticker_from_set`. 21 | 22 | 23 | .. cpp:member:: string_t sticker 24 | 25 | File identifier of the sticker 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_sticker_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_sticker_set: 2 | 3 | delete_sticker_set 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_sticker_set(Agent&& agent, delete_sticker_set_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_sticker_set(Agent&& agent, delete_sticker_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to delete a sticker set that was created by the bot. Returns True on success. 17 | 18 | .. cpp:struct:: delete_sticker_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_sticker_set`. 21 | 22 | 23 | .. cpp:member:: string_t name 24 | 25 | Sticker set name 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/delete_webhook.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-delete_webhook: 2 | 3 | delete_webhook 4 | ============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result delete_webhook(Agent&& agent, delete_webhook_args_t args) 9 | .. cpp:function:: template \ 10 | void delete_webhook(Agent&& agent, delete_webhook_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. 17 | 18 | .. cpp:struct:: delete_webhook_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`delete_webhook`. 21 | 22 | 23 | .. cpp:member:: optional_t drop_pending_updates 24 | 25 | Pass True to drop all pending updates 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/edit_general_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-edit_general_forum_topic: 2 | 3 | edit_general_forum_topic 4 | ======================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result edit_general_forum_topic(Agent&& agent, edit_general_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void edit_general_forum_topic(Agent&& agent, edit_general_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to edit the name of the 'General' 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. Returns True on success. 17 | 18 | .. cpp:struct:: edit_general_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`edit_general_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | 27 | .. cpp:member:: string_t name 28 | 29 | New topic name, 1-128 characters 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/export_chat_invite_link.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-export_chat_invite_link: 2 | 3 | export_chat_invite_link 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result export_chat_invite_link(Agent&& agent, export_chat_invite_link_args_t args) 9 | .. cpp:function:: template \ 10 | void export_chat_invite_link(Agent&& agent, export_chat_invite_link_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success. 17 | 18 | .. cpp:struct:: export_chat_invite_link_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`export_chat_invite_link`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_chat: 2 | 3 | get_chat 4 | ======== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_chat(Agent&& agent, get_chat_args_t args) 9 | .. cpp:function:: template \ 10 | void get_chat(Agent&& agent, get_chat_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. 17 | 18 | .. cpp:struct:: get_chat_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_chat`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_chat_administrators.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_chat_administrators: 2 | 3 | get_chat_administrators 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result, Agent&&> get_chat_administrators(Agent&& agent, get_chat_administrators_args_t args) 9 | .. cpp:function:: template \ 10 | void get_chat_administrators(Agent&& agent, get_chat_administrators_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected>``. 15 | 16 | Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects. 17 | 18 | .. cpp:struct:: get_chat_administrators_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_chat_administrators`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_chat_member.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_chat_member: 2 | 3 | get_chat_member 4 | =============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_chat_member(Agent&& agent, get_chat_member_args_t args) 9 | .. cpp:function:: template \ 10 | void get_chat_member(Agent&& agent, get_chat_member_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success. 17 | 18 | .. cpp:struct:: get_chat_member_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_chat_member`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) 26 | 27 | .. cpp:member:: integer_t user_id 28 | 29 | Unique identifier of the target user 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_chat_member_count.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_chat_member_count: 2 | 3 | get_chat_member_count 4 | ===================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_chat_member_count(Agent&& agent, get_chat_member_count_args_t args) 9 | .. cpp:function:: template \ 10 | void get_chat_member_count(Agent&& agent, get_chat_member_count_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the number of members in a chat. Returns Int on success. 17 | 18 | .. cpp:struct:: get_chat_member_count_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_chat_member_count`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_chat_menu_button.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_chat_menu_button: 2 | 3 | get_chat_menu_button 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_chat_menu_button(Agent&& agent, get_chat_menu_button_args_t args) 9 | .. cpp:function:: template \ 10 | void get_chat_menu_button(Agent&& agent, get_chat_menu_button_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success. 17 | 18 | .. cpp:struct:: get_chat_menu_button_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_chat_menu_button`. 21 | 22 | 23 | .. cpp:member:: optional_t chat_id 24 | 25 | Unique identifier for the target private chat. If not specified, default bot's menu button will be returned 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_custom_emoji_stickers.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_custom_emoji_stickers: 2 | 3 | get_custom_emoji_stickers 4 | ========================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result, Agent&&> get_custom_emoji_stickers(Agent&& agent, get_custom_emoji_stickers_args_t args) 9 | .. cpp:function:: template \ 10 | void get_custom_emoji_stickers(Agent&& agent, get_custom_emoji_stickers_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected>``. 15 | 16 | Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects. 17 | 18 | .. cpp:struct:: get_custom_emoji_stickers_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_custom_emoji_stickers`. 21 | 22 | 23 | .. cpp:member:: array_t custom_emoji_ids 24 | 25 | A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_file: 2 | 3 | get_file 4 | ======== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_file(Agent&& agent, get_file_args_t args) 9 | .. cpp:function:: template \ 10 | void get_file(Agent&& agent, get_file_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot/, where is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. 17 | 18 | .. cpp:struct:: get_file_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_file`. 21 | 22 | 23 | .. cpp:member:: string_t file_id 24 | 25 | File identifier to get information about 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_forum_topic_icon_stickers.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_forum_topic_icon_stickers: 2 | 3 | get_forum_topic_icon_stickers 4 | ============================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result, Agent&&> get_forum_topic_icon_stickers(Agent&& agent) 9 | .. cpp:function:: template \ 10 | void get_forum_topic_icon_stickers(Agent&& agent, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected>``. 15 | 16 | Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects. 17 | 18 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_me.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_me: 2 | 3 | get_me 4 | ====== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_me(Agent&& agent) 9 | .. cpp:function:: template \ 10 | void get_me(Agent&& agent, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. 17 | 18 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_my_commands.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_my_commands: 2 | 3 | get_my_commands 4 | =============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result, Agent&&> get_my_commands(Agent&& agent, get_my_commands_args_t args) 9 | .. cpp:function:: template \ 10 | void get_my_commands(Agent&& agent, get_my_commands_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected>``. 15 | 16 | Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned. 17 | 18 | .. cpp:struct:: get_my_commands_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_my_commands`. 21 | 22 | 23 | .. cpp:member:: optional_t scope 24 | 25 | A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. 26 | 27 | .. cpp:member:: optional_t language_code 28 | 29 | A two-letter ISO 639-1 language code or an empty string 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_my_default_administrator_rights.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_my_default_administrator_rights: 2 | 3 | get_my_default_administrator_rights 4 | =================================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_my_default_administrator_rights(Agent&& agent, get_my_default_administrator_rights_args_t args) 9 | .. cpp:function:: template \ 10 | void get_my_default_administrator_rights(Agent&& agent, get_my_default_administrator_rights_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success. 17 | 18 | .. cpp:struct:: get_my_default_administrator_rights_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_my_default_administrator_rights`. 21 | 22 | 23 | .. cpp:member:: optional_t for_channels 24 | 25 | Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_my_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_my_description: 2 | 3 | get_my_description 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_my_description(Agent&& agent, get_my_description_args_t args) 9 | .. cpp:function:: template \ 10 | void get_my_description(Agent&& agent, get_my_description_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the current bot description for the given user language. Returns BotDescription on success. 17 | 18 | .. cpp:struct:: get_my_description_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_my_description`. 21 | 22 | 23 | .. cpp:member:: optional_t language_code 24 | 25 | A two-letter ISO 639-1 language code or an empty string 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_my_name.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_my_name: 2 | 3 | get_my_name 4 | =========== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_my_name(Agent&& agent, get_my_name_args_t args) 9 | .. cpp:function:: template \ 10 | void get_my_name(Agent&& agent, get_my_name_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the current bot name for the given user language. Returns BotName on success. 17 | 18 | .. cpp:struct:: get_my_name_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_my_name`. 21 | 22 | 23 | .. cpp:member:: optional_t language_code 24 | 25 | A two-letter ISO 639-1 language code or an empty string 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_my_short_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_my_short_description: 2 | 3 | get_my_short_description 4 | ======================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_my_short_description(Agent&& agent, get_my_short_description_args_t args) 9 | .. cpp:function:: template \ 10 | void get_my_short_description(Agent&& agent, get_my_short_description_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. 17 | 18 | .. cpp:struct:: get_my_short_description_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_my_short_description`. 21 | 22 | 23 | .. cpp:member:: optional_t language_code 24 | 25 | A two-letter ISO 639-1 language code or an empty string 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_sticker_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_sticker_set: 2 | 3 | get_sticker_set 4 | =============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_sticker_set(Agent&& agent, get_sticker_set_args_t args) 9 | .. cpp:function:: template \ 10 | void get_sticker_set(Agent&& agent, get_sticker_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get a sticker set. On success, a StickerSet object is returned. 17 | 18 | .. cpp:struct:: get_sticker_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_sticker_set`. 21 | 22 | 23 | .. cpp:member:: string_t name 24 | 25 | Name of the sticker set 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_user_chat_boosts.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_user_chat_boosts: 2 | 3 | get_user_chat_boosts 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_user_chat_boosts(Agent&& agent, get_user_chat_boosts_args_t args) 9 | .. cpp:function:: template \ 10 | void get_user_chat_boosts(Agent&& agent, get_user_chat_boosts_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object. 17 | 18 | .. cpp:struct:: get_user_chat_boosts_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_user_chat_boosts`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the chat or username of the channel (in the format @channelusername) 26 | 27 | .. cpp:member:: integer_t user_id 28 | 29 | Unique identifier of the target user 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_user_profile_photos.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_user_profile_photos: 2 | 3 | get_user_profile_photos 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_user_profile_photos(Agent&& agent, get_user_profile_photos_args_t args) 9 | .. cpp:function:: template \ 10 | void get_user_profile_photos(Agent&& agent, get_user_profile_photos_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. 17 | 18 | .. cpp:struct:: get_user_profile_photos_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`get_user_profile_photos`. 21 | 22 | 23 | .. cpp:member:: integer_t user_id 24 | 25 | Unique identifier of the target user 26 | 27 | .. cpp:member:: optional_t offset 28 | 29 | Sequential number of the first photo to be returned. By default, all photos are returned. 30 | 31 | .. cpp:member:: optional_t limit 32 | 33 | Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. 34 | -------------------------------------------------------------------------------- /docs/api/tg/methods/get_webhook_info.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-get_webhook_info: 2 | 3 | get_webhook_info 4 | ================ 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result get_webhook_info(Agent&& agent) 9 | .. cpp:function:: template \ 10 | void get_webhook_info(Agent&& agent, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty. 17 | 18 | -------------------------------------------------------------------------------- /docs/api/tg/methods/hide_general_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-hide_general_forum_topic: 2 | 3 | hide_general_forum_topic 4 | ======================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result hide_general_forum_topic(Agent&& agent, hide_general_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void hide_general_forum_topic(Agent&& agent, hide_general_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to hide the 'General' 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. The topic will be automatically closed if it was open. Returns True on success. 17 | 18 | .. cpp:struct:: hide_general_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`hide_general_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/leave_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-leave_chat: 2 | 3 | leave_chat 4 | ========== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result leave_chat(Agent&& agent, leave_chat_args_t args) 9 | .. cpp:function:: template \ 10 | void leave_chat(Agent&& agent, leave_chat_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method for your bot to leave a group, supergroup or channel. Returns True on success. 17 | 18 | .. cpp:struct:: leave_chat_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`leave_chat`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/log_out.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-log_out: 2 | 3 | log_out 4 | ======= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result log_out(Agent&& agent) 9 | .. cpp:function:: template \ 10 | void log_out(Agent&& agent, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. 17 | 18 | -------------------------------------------------------------------------------- /docs/api/tg/methods/reopen_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-reopen_forum_topic: 2 | 3 | reopen_forum_topic 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result reopen_forum_topic(Agent&& agent, reopen_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void reopen_forum_topic(Agent&& agent, reopen_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to reopen a closed 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. 17 | 18 | .. cpp:struct:: reopen_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`reopen_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | 27 | .. cpp:member:: integer_t message_thread_id 28 | 29 | Unique identifier for the target message thread of the forum topic 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/reopen_general_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-reopen_general_forum_topic: 2 | 3 | reopen_general_forum_topic 4 | ========================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result reopen_general_forum_topic(Agent&& agent, reopen_general_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void reopen_general_forum_topic(Agent&& agent, reopen_general_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to reopen a closed 'General' 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. The topic will be automatically unhidden if it was hidden. Returns True on success. 17 | 18 | .. cpp:struct:: reopen_general_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`reopen_general_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_chat_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_chat_description: 2 | 3 | set_chat_description 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_chat_description(Agent&& agent, set_chat_description_args_t args) 9 | .. cpp:function:: template \ 10 | void set_chat_description(Agent&& agent, set_chat_description_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. 17 | 18 | .. cpp:struct:: set_chat_description_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_chat_description`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: optional_t description 28 | 29 | New chat description, 0-255 characters 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_chat_menu_button.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_chat_menu_button: 2 | 3 | set_chat_menu_button 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_chat_menu_button(Agent&& agent, set_chat_menu_button_args_t args) 9 | .. cpp:function:: template \ 10 | void set_chat_menu_button(Agent&& agent, set_chat_menu_button_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. 17 | 18 | .. cpp:struct:: set_chat_menu_button_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_chat_menu_button`. 21 | 22 | 23 | .. cpp:member:: optional_t chat_id 24 | 25 | Unique identifier for the target private chat. If not specified, default bot's menu button will be changed 26 | 27 | .. cpp:member:: optional_t menu_button 28 | 29 | A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_chat_photo.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_chat_photo: 2 | 3 | set_chat_photo 4 | ============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_chat_photo(Agent&& agent, set_chat_photo_args_t args) 9 | .. cpp:function:: template \ 10 | void set_chat_photo(Agent&& agent, set_chat_photo_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. 17 | 18 | .. cpp:struct:: set_chat_photo_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_chat_photo`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: input_file_t photo 28 | 29 | New chat photo, uploaded using multipart/form-data 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_chat_title.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_chat_title: 2 | 3 | set_chat_title 4 | ============== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_chat_title(Agent&& agent, set_chat_title_args_t args) 9 | .. cpp:function:: template \ 10 | void set_chat_title(Agent&& agent, set_chat_title_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. 17 | 18 | .. cpp:struct:: set_chat_title_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_chat_title`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: string_t title 28 | 29 | New chat title, 1-128 characters 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_custom_emoji_sticker_set_thumbnail.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_custom_emoji_sticker_set_thumbnail: 2 | 3 | set_custom_emoji_sticker_set_thumbnail 4 | ====================================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_custom_emoji_sticker_set_thumbnail(Agent&& agent, set_custom_emoji_sticker_set_thumbnail_args_t args) 9 | .. cpp:function:: template \ 10 | void set_custom_emoji_sticker_set_thumbnail(Agent&& agent, set_custom_emoji_sticker_set_thumbnail_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. 17 | 18 | .. cpp:struct:: set_custom_emoji_sticker_set_thumbnail_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_custom_emoji_sticker_set_thumbnail`. 21 | 22 | 23 | .. cpp:member:: string_t name 24 | 25 | Sticker set name 26 | 27 | .. cpp:member:: optional_t custom_emoji_id 28 | 29 | Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail. 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_my_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_my_description: 2 | 3 | set_my_description 4 | ================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_my_description(Agent&& agent, set_my_description_args_t args) 9 | .. cpp:function:: template \ 10 | void set_my_description(Agent&& agent, set_my_description_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. 17 | 18 | .. cpp:struct:: set_my_description_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_my_description`. 21 | 22 | 23 | .. cpp:member:: optional_t description 24 | 25 | New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. 26 | 27 | .. cpp:member:: optional_t language_code 28 | 29 | A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_my_name.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_my_name: 2 | 3 | set_my_name 4 | =========== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_my_name(Agent&& agent, set_my_name_args_t args) 9 | .. cpp:function:: template \ 10 | void set_my_name(Agent&& agent, set_my_name_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the bot's name. Returns True on success. 17 | 18 | .. cpp:struct:: set_my_name_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_my_name`. 21 | 22 | 23 | .. cpp:member:: optional_t name 24 | 25 | New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. 26 | 27 | .. cpp:member:: optional_t language_code 28 | 29 | A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_sticker_emoji_list.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_sticker_emoji_list: 2 | 3 | set_sticker_emoji_list 4 | ====================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_sticker_emoji_list(Agent&& agent, set_sticker_emoji_list_args_t args) 9 | .. cpp:function:: template \ 10 | void set_sticker_emoji_list(Agent&& agent, set_sticker_emoji_list_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success. 17 | 18 | .. cpp:struct:: set_sticker_emoji_list_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_sticker_emoji_list`. 21 | 22 | 23 | .. cpp:member:: string_t sticker 24 | 25 | File identifier of the sticker 26 | 27 | .. cpp:member:: array_t emoji_list 28 | 29 | A JSON-serialized list of 1-20 emoji associated with the sticker 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_sticker_keywords.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_sticker_keywords: 2 | 3 | set_sticker_keywords 4 | ==================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_sticker_keywords(Agent&& agent, set_sticker_keywords_args_t args) 9 | .. cpp:function:: template \ 10 | void set_sticker_keywords(Agent&& agent, set_sticker_keywords_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success. 17 | 18 | .. cpp:struct:: set_sticker_keywords_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_sticker_keywords`. 21 | 22 | 23 | .. cpp:member:: string_t sticker 24 | 25 | File identifier of the sticker 26 | 27 | .. cpp:member:: optional_t> keywords 28 | 29 | A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_sticker_mask_position.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_sticker_mask_position: 2 | 3 | set_sticker_mask_position 4 | ========================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_sticker_mask_position(Agent&& agent, set_sticker_mask_position_args_t args) 9 | .. cpp:function:: template \ 10 | void set_sticker_mask_position(Agent&& agent, set_sticker_mask_position_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success. 17 | 18 | .. cpp:struct:: set_sticker_mask_position_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_sticker_mask_position`. 21 | 22 | 23 | .. cpp:member:: string_t sticker 24 | 25 | File identifier of the sticker 26 | 27 | .. cpp:member:: optional_t mask_position 28 | 29 | A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position. 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_sticker_position_in_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_sticker_position_in_set: 2 | 3 | set_sticker_position_in_set 4 | =========================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_sticker_position_in_set(Agent&& agent, set_sticker_position_in_set_args_t args) 9 | .. cpp:function:: template \ 10 | void set_sticker_position_in_set(Agent&& agent, set_sticker_position_in_set_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. 17 | 18 | .. cpp:struct:: set_sticker_position_in_set_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_sticker_position_in_set`. 21 | 22 | 23 | .. cpp:member:: string_t sticker 24 | 25 | File identifier of the sticker 26 | 27 | .. cpp:member:: integer_t position 28 | 29 | New sticker position in the set, zero-based 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/set_sticker_set_title.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-set_sticker_set_title: 2 | 3 | set_sticker_set_title 4 | ===================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result set_sticker_set_title(Agent&& agent, set_sticker_set_title_args_t args) 9 | .. cpp:function:: template \ 10 | void set_sticker_set_title(Agent&& agent, set_sticker_set_title_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to set the title of a created sticker set. Returns True on success. 17 | 18 | .. cpp:struct:: set_sticker_set_title_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`set_sticker_set_title`. 21 | 22 | 23 | .. cpp:member:: string_t name 24 | 25 | Sticker set name 26 | 27 | .. cpp:member:: string_t title 28 | 29 | Sticker set title, 1-64 characters 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/unban_chat_sender_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-unban_chat_sender_chat: 2 | 3 | unban_chat_sender_chat 4 | ====================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result unban_chat_sender_chat(Agent&& agent, unban_chat_sender_chat_args_t args) 9 | .. cpp:function:: template \ 10 | void unban_chat_sender_chat(Agent&& agent, unban_chat_sender_chat_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. 17 | 18 | .. cpp:struct:: unban_chat_sender_chat_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`unban_chat_sender_chat`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | 27 | .. cpp:member:: integer_t sender_chat_id 28 | 29 | Unique identifier of the target sender chat 30 | -------------------------------------------------------------------------------- /docs/api/tg/methods/unhide_general_forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-unhide_general_forum_topic: 2 | 3 | unhide_general_forum_topic 4 | ========================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result unhide_general_forum_topic(Agent&& agent, unhide_general_forum_topic_args_t args) 9 | .. cpp:function:: template \ 10 | void unhide_general_forum_topic(Agent&& agent, unhide_general_forum_topic_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to unhide the 'General' 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. Returns True on success. 17 | 18 | .. cpp:struct:: unhide_general_forum_topic_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`unhide_general_forum_topic`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/unpin_all_chat_messages.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-unpin_all_chat_messages: 2 | 3 | unpin_all_chat_messages 4 | ======================= 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result unpin_all_chat_messages(Agent&& agent, unpin_all_chat_messages_args_t args) 9 | .. cpp:function:: template \ 10 | void unpin_all_chat_messages(Agent&& agent, unpin_all_chat_messages_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success. 17 | 18 | .. cpp:struct:: unpin_all_chat_messages_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`unpin_all_chat_messages`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target channel (in the format @channelusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/methods/unpin_all_general_forum_topic_messages.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-methods-unpin_all_general_forum_topic_messages: 2 | 3 | unpin_all_general_forum_topic_messages 4 | ====================================== 5 | 6 | .. cpp:namespace:: banana::api 7 | .. cpp:function:: template \ 8 | api_result unpin_all_general_forum_topic_messages(Agent&& agent, unpin_all_general_forum_topic_messages_args_t args) 9 | .. cpp:function:: template \ 10 | void unpin_all_general_forum_topic_messages(Agent&& agent, unpin_all_general_forum_topic_messages_args_t args, F&& callback) 11 | 12 | ``agent`` is any object satisfying :ref:`agent concept `. 13 | 14 | ``callback`` is any callable object accepting ``expected``. 15 | 16 | Use this method to clear the list of pinned messages in a General 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. 17 | 18 | .. cpp:struct:: unpin_all_general_forum_topic_messages_args_t 19 | 20 | Arguments that should be passed to :cpp:func:`unpin_all_general_forum_topic_messages`. 21 | 22 | 23 | .. cpp:member:: variant_t chat_id 24 | 25 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 26 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command: 2 | 3 | bot_command_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::bot_command_t 7 | 8 | This object represents a bot command. 9 | 10 | .. cpp:member:: string_t command 11 | 12 | Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. 13 | 14 | .. cpp:member:: string_t description 15 | 16 | Description of the command; 1-256 characters. 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope: 2 | 3 | bot_command_scope_t 4 | =================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_t 7 | 8 | This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported: BotCommandScopeDefault; BotCommandScopeAllPrivateChats; BotCommandScopeAllGroupChats; BotCommandScopeAllChatAdministrators; BotCommandScopeChat; BotCommandScopeChatAdministrators; BotCommandScopeChatMember 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_all_chat_administrators.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_all_chat_administrators: 2 | 3 | bot_command_scope_all_chat_administrators_t 4 | =========================================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_all_chat_administrators_t 7 | 8 | Represents the scope of bot commands, covering all group and supergroup chat administrators. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be all_chat_administrators 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_all_group_chats.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_all_group_chats: 2 | 3 | bot_command_scope_all_group_chats_t 4 | =================================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_all_group_chats_t 7 | 8 | Represents the scope of bot commands, covering all group and supergroup chats. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be all_group_chats 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_all_private_chats.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_all_private_chats: 2 | 3 | bot_command_scope_all_private_chats_t 4 | ===================================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_all_private_chats_t 7 | 8 | Represents the scope of bot commands, covering all private chats. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be all_private_chats 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_chat: 2 | 3 | bot_command_scope_chat_t 4 | ======================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_chat_t 7 | 8 | Represents the scope of bot commands, covering a specific chat. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be chat 13 | 14 | .. cpp:member:: variant_t chat_id 15 | 16 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_chat_administrators.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_chat_administrators: 2 | 3 | bot_command_scope_chat_administrators_t 4 | ======================================= 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_chat_administrators_t 7 | 8 | Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be chat_administrators 13 | 14 | .. cpp:member:: variant_t chat_id 15 | 16 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_chat_member.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_chat_member: 2 | 3 | bot_command_scope_chat_member_t 4 | =============================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_chat_member_t 7 | 8 | Represents the scope of bot commands, covering a specific member of a group or supergroup chat. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be chat_member 13 | 14 | .. cpp:member:: variant_t chat_id 15 | 16 | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) 17 | 18 | .. cpp:member:: integer_t user_id 19 | 20 | Unique identifier of the target user 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_command_scope_default.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_command_scope_default: 2 | 3 | bot_command_scope_default_t 4 | =========================== 5 | 6 | .. cpp:struct:: banana::api::bot_command_scope_default_t 7 | 8 | Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Scope type, must be default 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_description: 2 | 3 | bot_description_t 4 | ================= 5 | 6 | .. cpp:struct:: banana::api::bot_description_t 7 | 8 | This object represents the bot's description. 9 | 10 | .. cpp:member:: string_t description 11 | 12 | The bot's description 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_name.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_name: 2 | 3 | bot_name_t 4 | ========== 5 | 6 | .. cpp:struct:: banana::api::bot_name_t 7 | 8 | This object represents the bot's name. 9 | 10 | .. cpp:member:: string_t name 11 | 12 | The bot's name 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/bot_short_description.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-bot_short_description: 2 | 3 | bot_short_description_t 4 | ======================= 5 | 6 | .. cpp:struct:: banana::api::bot_short_description_t 7 | 8 | This object represents the bot's short description. 9 | 10 | .. cpp:member:: string_t short_description 11 | 12 | The bot's short description 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/callback_game.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-callback_game: 2 | 3 | callback_game_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::callback_game_t 7 | 8 | A placeholder, currently holds no information. Use [BotFather](https://t.me/botfather) to set up your game. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat: 2 | 3 | chat_t 4 | ====== 5 | 6 | .. cpp:struct:: banana::api::chat_t 7 | 8 | This object represents a chat. 9 | 10 | .. cpp:member:: integer_t id 11 | 12 | Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. 13 | 14 | .. cpp:member:: string_t type 15 | 16 | Type of the chat, can be either “private”, “group”, “supergroup” or “channel” 17 | 18 | .. cpp:member:: optional_t title 19 | 20 | Optional. Title, for supergroups, channels and group chats 21 | 22 | .. cpp:member:: optional_t username 23 | 24 | Optional. Username, for private chats, supergroups and channels if available 25 | 26 | .. cpp:member:: optional_t first_name 27 | 28 | Optional. First name of the other party in a private chat 29 | 30 | .. cpp:member:: optional_t last_name 31 | 32 | Optional. Last name of the other party in a private chat 33 | 34 | .. cpp:member:: optional_t is_forum 35 | 36 | Optional. True, if the supergroup chat is a forum (has topics enabled) 37 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost: 2 | 3 | chat_boost_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::chat_boost_t 7 | 8 | This object contains information about a chat boost. 9 | 10 | .. cpp:member:: string_t boost_id 11 | 12 | Unique identifier of the boost 13 | 14 | .. cpp:member:: integer_t add_date 15 | 16 | Point in time (Unix timestamp) when the chat was boosted 17 | 18 | .. cpp:member:: integer_t expiration_date 19 | 20 | Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged 21 | 22 | .. cpp:member:: chat_boost_source_t source 23 | 24 | Source of the added boost 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_added.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_added: 2 | 3 | chat_boost_added_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::chat_boost_added_t 7 | 8 | This object represents a service message about a user boosting a chat. 9 | 10 | .. cpp:member:: integer_t boost_count 11 | 12 | Number of boosts added by the user 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_removed.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_removed: 2 | 3 | chat_boost_removed_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::chat_boost_removed_t 7 | 8 | This object represents a boost removed from a chat. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat which was boosted 13 | 14 | .. cpp:member:: string_t boost_id 15 | 16 | Unique identifier of the boost 17 | 18 | .. cpp:member:: integer_t remove_date 19 | 20 | Point in time (Unix timestamp) when the boost was removed 21 | 22 | .. cpp:member:: chat_boost_source_t source 23 | 24 | Source of the removed boost 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_source.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_source: 2 | 3 | chat_boost_source_t 4 | =================== 5 | 6 | .. cpp:struct:: banana::api::chat_boost_source_t 7 | 8 | This object describes the source of a chat boost. It can be one of ChatBoostSourcePremium; ChatBoostSourceGiftCode; ChatBoostSourceGiveaway 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_source_gift_code.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_source_gift_code: 2 | 3 | chat_boost_source_gift_code_t 4 | ============================= 5 | 6 | .. cpp:struct:: banana::api::chat_boost_source_gift_code_t 7 | 8 | The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Source of the boost, always “gift_code” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | User for which the gift code was created 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_source_giveaway.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_source_giveaway: 2 | 3 | chat_boost_source_giveaway_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::chat_boost_source_giveaway_t 7 | 8 | The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Source of the boost, always “giveaway” 13 | 14 | .. cpp:member:: integer_t giveaway_message_id 15 | 16 | Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. 17 | 18 | .. cpp:member:: optional_t user 19 | 20 | Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only 21 | 22 | .. cpp:member:: optional_t prize_star_count 23 | 24 | Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only 25 | 26 | .. cpp:member:: optional_t is_unclaimed 27 | 28 | Optional. True, if the giveaway was completed, but there was no user to win the prize 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_source_premium.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_source_premium: 2 | 3 | chat_boost_source_premium_t 4 | =========================== 5 | 6 | .. cpp:struct:: banana::api::chat_boost_source_premium_t 7 | 8 | The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Source of the boost, always “premium” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | User that boosted the chat 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_boost_updated.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_boost_updated: 2 | 3 | chat_boost_updated_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::chat_boost_updated_t 7 | 8 | This object represents a boost added to a chat or changed. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat which was boosted 13 | 14 | .. cpp:member:: chat_boost_t boost 15 | 16 | Information about the chat boost 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_join_request.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_join_request: 2 | 3 | chat_join_request_t 4 | =================== 5 | 6 | .. cpp:struct:: banana::api::chat_join_request_t 7 | 8 | Represents a join request sent to a chat. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat to which the request was sent 13 | 14 | .. cpp:member:: user_t from 15 | 16 | User that sent the join request 17 | 18 | .. cpp:member:: integer_t user_chat_id 19 | 20 | Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. 21 | 22 | .. cpp:member:: integer_t date 23 | 24 | Date the request was sent in Unix time 25 | 26 | .. cpp:member:: optional_t bio 27 | 28 | Optional. Bio of the user. 29 | 30 | .. cpp:member:: optional_t invite_link 31 | 32 | Optional. Chat invite link that was used by the user to send the join request 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_location.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_location: 2 | 3 | chat_location_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::chat_location_t 7 | 8 | Represents a location to which a chat is connected. 9 | 10 | .. cpp:member:: location_t location 11 | 12 | The location to which the supergroup is connected. Can't be a live location. 13 | 14 | .. cpp:member:: string_t address 15 | 16 | Location address; 1-64 characters, as defined by the chat owner 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member: 2 | 3 | chat_member_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::chat_member_t 7 | 8 | This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: ChatMemberOwner; ChatMemberAdministrator; ChatMemberMember; ChatMemberRestricted; ChatMemberLeft; ChatMemberBanned 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member_banned.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member_banned: 2 | 3 | chat_member_banned_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::chat_member_banned_t 7 | 8 | Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. 9 | 10 | .. cpp:member:: string_t status 11 | 12 | The member's status in the chat, always “kicked” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | Information about the user 17 | 18 | .. cpp:member:: integer_t until_date 19 | 20 | Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member_left.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member_left: 2 | 3 | chat_member_left_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::chat_member_left_t 7 | 8 | Represents a chat member that isn't currently a member of the chat, but may join it themselves. 9 | 10 | .. cpp:member:: string_t status 11 | 12 | The member's status in the chat, always “left” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | Information about the user 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member_member.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member_member: 2 | 3 | chat_member_member_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::chat_member_member_t 7 | 8 | Represents a chat member that has no additional privileges or restrictions. 9 | 10 | .. cpp:member:: string_t status 11 | 12 | The member's status in the chat, always “member” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | Information about the user 17 | 18 | .. cpp:member:: optional_t until_date 19 | 20 | Optional. Date when the user's subscription will expire; Unix time 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member_owner.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member_owner: 2 | 3 | chat_member_owner_t 4 | =================== 5 | 6 | .. cpp:struct:: banana::api::chat_member_owner_t 7 | 8 | Represents a chat member that owns the chat and has all administrator privileges. 9 | 10 | .. cpp:member:: string_t status 11 | 12 | The member's status in the chat, always “creator” 13 | 14 | .. cpp:member:: user_t user 15 | 16 | Information about the user 17 | 18 | .. cpp:member:: boolean_t is_anonymous 19 | 20 | True, if the user's presence in the chat is hidden 21 | 22 | .. cpp:member:: optional_t custom_title 23 | 24 | Optional. Custom title for this user 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_member_updated.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_member_updated: 2 | 3 | chat_member_updated_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::chat_member_updated_t 7 | 8 | This object represents changes in the status of a chat member. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat the user belongs to 13 | 14 | .. cpp:member:: user_t from 15 | 16 | Performer of the action, which resulted in the change 17 | 18 | .. cpp:member:: integer_t date 19 | 20 | Date the change was done in Unix time 21 | 22 | .. cpp:member:: chat_member_t old_chat_member 23 | 24 | Previous information about the chat member 25 | 26 | .. cpp:member:: chat_member_t new_chat_member 27 | 28 | New information about the chat member 29 | 30 | .. cpp:member:: optional_t invite_link 31 | 32 | Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. 33 | 34 | .. cpp:member:: optional_t via_join_request 35 | 36 | Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator 37 | 38 | .. cpp:member:: optional_t via_chat_folder_invite_link 39 | 40 | Optional. True, if the user joined the chat via a chat folder invite link 41 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_photo.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_photo: 2 | 3 | chat_photo_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::chat_photo_t 7 | 8 | This object represents a chat photo. 9 | 10 | .. cpp:member:: string_t small_file_id 11 | 12 | File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. 13 | 14 | .. cpp:member:: string_t small_file_unique_id 15 | 16 | Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: string_t big_file_id 19 | 20 | File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. 21 | 22 | .. cpp:member:: string_t big_file_unique_id 23 | 24 | Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/chat_shared.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chat_shared: 2 | 3 | chat_shared_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::chat_shared_t 7 | 8 | This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. 9 | 10 | .. cpp:member:: integer_t request_id 11 | 12 | Identifier of the request 13 | 14 | .. cpp:member:: integer_t chat_id 15 | 16 | Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. 17 | 18 | .. cpp:member:: optional_t title 19 | 20 | Optional. Title of the chat, if the title was requested by the bot. 21 | 22 | .. cpp:member:: optional_t username 23 | 24 | Optional. Username of the chat, if the username was requested by the bot and available. 25 | 26 | .. cpp:member:: optional_t> photo 27 | 28 | Optional. Available sizes of the chat photo, if the photo was requested by the bot 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/chosen_inline_result.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-chosen_inline_result: 2 | 3 | chosen_inline_result_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::chosen_inline_result_t 7 | 8 | Represents a result of an inline query that was chosen by the user and sent to their chat partner. 9 | 10 | .. cpp:member:: string_t result_id 11 | 12 | The unique identifier for the result that was chosen 13 | 14 | .. cpp:member:: user_t from 15 | 16 | The user that chose the result 17 | 18 | .. cpp:member:: string_t query 19 | 20 | The query that was used to obtain the result 21 | 22 | .. cpp:member:: optional_t location 23 | 24 | Optional. Sender location, only for bots that require user location 25 | 26 | .. cpp:member:: optional_t inline_message_id 27 | 28 | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/contact.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-contact: 2 | 3 | contact_t 4 | ========= 5 | 6 | .. cpp:struct:: banana::api::contact_t 7 | 8 | This object represents a phone contact. 9 | 10 | .. cpp:member:: string_t phone_number 11 | 12 | Contact's phone number 13 | 14 | .. cpp:member:: string_t first_name 15 | 16 | Contact's first name 17 | 18 | .. cpp:member:: optional_t last_name 19 | 20 | Optional. Contact's last name 21 | 22 | .. cpp:member:: optional_t user_id 23 | 24 | Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. 25 | 26 | .. cpp:member:: optional_t vcard 27 | 28 | Optional. Additional data about the contact in the form of a vCard 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/dice.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-dice: 2 | 3 | dice_t 4 | ====== 5 | 6 | .. cpp:struct:: banana::api::dice_t 7 | 8 | This object represents an animated emoji that displays a random value. 9 | 10 | .. cpp:member:: string_t emoji 11 | 12 | Emoji on which the dice throw animation is based 13 | 14 | .. cpp:member:: integer_t value 15 | 16 | Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/document.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-document: 2 | 3 | document_t 4 | ========== 5 | 6 | .. cpp:struct:: banana::api::document_t 7 | 8 | This object represents a general file (as opposed to photos, voice messages and audio files). 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: optional_t thumbnail 19 | 20 | Optional. Document thumbnail as defined by the sender 21 | 22 | .. cpp:member:: optional_t file_name 23 | 24 | Optional. Original filename as defined by the sender 25 | 26 | .. cpp:member:: optional_t mime_type 27 | 28 | Optional. MIME type of the file as defined by the sender 29 | 30 | .. cpp:member:: optional_t file_size 31 | 32 | Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/encrypted_credentials.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-encrypted_credentials: 2 | 3 | encrypted_credentials_t 4 | ======================= 5 | 6 | .. cpp:struct:: banana::api::encrypted_credentials_t 7 | 8 | Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. 9 | 10 | .. cpp:member:: string_t data 11 | 12 | Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication 13 | 14 | .. cpp:member:: string_t hash 15 | 16 | Base64-encoded data hash for data authentication 17 | 18 | .. cpp:member:: string_t secret 19 | 20 | Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-file: 2 | 3 | file_t 4 | ====== 5 | 6 | .. cpp:struct:: banana::api::file_t 7 | 8 | This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. The maximum file size to download is 20 MB 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: optional_t file_size 19 | 20 | Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. 21 | 22 | .. cpp:member:: optional_t file_path 23 | 24 | Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/force_reply.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-force_reply: 2 | 3 | force_reply_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::force_reply_t 7 | 8 | Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account. 9 | 10 | .. cpp:member:: boolean_t force_reply 11 | 12 | Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' 13 | 14 | .. cpp:member:: optional_t input_field_placeholder 15 | 16 | Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters 17 | 18 | .. cpp:member:: optional_t selective 19 | 20 | Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/forum_topic.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-forum_topic: 2 | 3 | forum_topic_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::forum_topic_t 7 | 8 | This object represents a forum topic. 9 | 10 | .. cpp:member:: integer_t message_thread_id 11 | 12 | Unique identifier of the forum topic 13 | 14 | .. cpp:member:: string_t name 15 | 16 | Name of the topic 17 | 18 | .. cpp:member:: integer_t icon_color 19 | 20 | Color of the topic icon in RGB format 21 | 22 | .. cpp:member:: optional_t icon_custom_emoji_id 23 | 24 | Optional. Unique identifier of the custom emoji shown as the topic icon 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/forum_topic_closed.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-forum_topic_closed: 2 | 3 | forum_topic_closed_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::forum_topic_closed_t 7 | 8 | This object represents a service message about a forum topic closed in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/forum_topic_created.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-forum_topic_created: 2 | 3 | forum_topic_created_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::forum_topic_created_t 7 | 8 | This object represents a service message about a new forum topic created in the chat. 9 | 10 | .. cpp:member:: string_t name 11 | 12 | Name of the topic 13 | 14 | .. cpp:member:: integer_t icon_color 15 | 16 | Color of the topic icon in RGB format 17 | 18 | .. cpp:member:: optional_t icon_custom_emoji_id 19 | 20 | Optional. Unique identifier of the custom emoji shown as the topic icon 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/forum_topic_edited.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-forum_topic_edited: 2 | 3 | forum_topic_edited_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::forum_topic_edited_t 7 | 8 | This object represents a service message about an edited forum topic. 9 | 10 | .. cpp:member:: optional_t name 11 | 12 | Optional. New name of the topic, if it was edited 13 | 14 | .. cpp:member:: optional_t icon_custom_emoji_id 15 | 16 | Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/forum_topic_reopened.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-forum_topic_reopened: 2 | 3 | forum_topic_reopened_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::forum_topic_reopened_t 7 | 8 | This object represents a service message about a forum topic reopened in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/game.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-game: 2 | 3 | game_t 4 | ====== 5 | 6 | .. cpp:struct:: banana::api::game_t 7 | 8 | This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. 9 | 10 | .. cpp:member:: string_t title 11 | 12 | Title of the game 13 | 14 | .. cpp:member:: string_t description 15 | 16 | Description of the game 17 | 18 | .. cpp:member:: array_t photo 19 | 20 | Photo that will be displayed in the game message in chats. 21 | 22 | .. cpp:member:: optional_t text 23 | 24 | Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. 25 | 26 | .. cpp:member:: optional_t> text_entities 27 | 28 | Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. 29 | 30 | .. cpp:member:: optional_t animation 31 | 32 | Optional. Animation that will be displayed in the game message in chats. Upload via BotFather 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/game_high_score.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-game_high_score: 2 | 3 | game_high_score_t 4 | ================= 5 | 6 | .. cpp:struct:: banana::api::game_high_score_t 7 | 8 | This object represents one row of the high scores table for a game. 9 | 10 | .. cpp:member:: integer_t position 11 | 12 | Position in high score table for the game 13 | 14 | .. cpp:member:: user_t user 15 | 16 | User 17 | 18 | .. cpp:member:: integer_t score 19 | 20 | Score 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/general_forum_topic_hidden.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-general_forum_topic_hidden: 2 | 3 | general_forum_topic_hidden_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::general_forum_topic_hidden_t 7 | 8 | This object represents a service message about General forum topic hidden in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/general_forum_topic_unhidden.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-general_forum_topic_unhidden: 2 | 3 | general_forum_topic_unhidden_t 4 | ============================== 5 | 6 | .. cpp:struct:: banana::api::general_forum_topic_unhidden_t 7 | 8 | This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/giveaway_completed.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-giveaway_completed: 2 | 3 | giveaway_completed_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::giveaway_completed_t 7 | 8 | This object represents a service message about the completion of a giveaway without public winners. 9 | 10 | .. cpp:member:: integer_t winner_count 11 | 12 | Number of winners in the giveaway 13 | 14 | .. cpp:member:: optional_t unclaimed_prize_count 15 | 16 | Optional. Number of undistributed prizes 17 | 18 | .. cpp:member:: optional_t giveaway_message 19 | 20 | Optional. Message with the giveaway that was completed, if it wasn't deleted 21 | 22 | .. cpp:member:: optional_t is_star_giveaway 23 | 24 | Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/giveaway_created.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-giveaway_created: 2 | 3 | giveaway_created_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::giveaway_created_t 7 | 8 | This object represents a service message about the creation of a scheduled giveaway. 9 | 10 | .. cpp:member:: optional_t prize_star_count 11 | 12 | Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/inaccessible_message.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-inaccessible_message: 2 | 3 | inaccessible_message_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::inaccessible_message_t 7 | 8 | This object describes a message that was deleted or is otherwise inaccessible to the bot. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat the message belonged to 13 | 14 | .. cpp:member:: integer_t message_id 15 | 16 | Unique message identifier inside the chat 17 | 18 | .. cpp:member:: integer_t date 19 | 20 | Always 0. The field can be used to differentiate regular and inaccessible messages. 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/inline_keyboard_markup.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-inline_keyboard_markup: 2 | 3 | inline_keyboard_markup_t 4 | ======================== 5 | 6 | .. cpp:struct:: banana::api::inline_keyboard_markup_t 7 | 8 | This object represents an inline keyboard that appears right next to the message it belongs to. 9 | 10 | .. cpp:member:: array_t> inline_keyboard 11 | 12 | Array of button rows, each represented by an Array of InlineKeyboardButton objects 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/inline_query.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-inline_query: 2 | 3 | inline_query_t 4 | ============== 5 | 6 | .. cpp:struct:: banana::api::inline_query_t 7 | 8 | This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. 9 | 10 | .. cpp:member:: string_t id 11 | 12 | Unique identifier for this query 13 | 14 | .. cpp:member:: user_t from 15 | 16 | Sender 17 | 18 | .. cpp:member:: string_t query 19 | 20 | Text of the query (up to 256 characters) 21 | 22 | .. cpp:member:: string_t offset 23 | 24 | Offset of the results to be returned, can be controlled by the bot 25 | 26 | .. cpp:member:: optional_t chat_type 27 | 28 | Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat 29 | 30 | .. cpp:member:: optional_t location 31 | 32 | Optional. Sender location, only for bots that request user location 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/inline_query_result_cached_sticker.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-inline_query_result_cached_sticker: 2 | 3 | inline_query_result_cached_sticker_t 4 | ==================================== 5 | 6 | .. cpp:struct:: banana::api::inline_query_result_cached_sticker_t 7 | 8 | Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the result, must be sticker 13 | 14 | .. cpp:member:: string_t id 15 | 16 | Unique identifier for this result, 1-64 bytes 17 | 18 | .. cpp:member:: string_t sticker_file_id 19 | 20 | A valid file identifier of the sticker 21 | 22 | .. cpp:member:: optional_t reply_markup 23 | 24 | Optional. Inline keyboard attached to the message 25 | 26 | .. cpp:member:: optional_t input_message_content 27 | 28 | Optional. Content of the message to be sent instead of the sticker 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/inline_query_result_game.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-inline_query_result_game: 2 | 3 | inline_query_result_game_t 4 | ========================== 5 | 6 | .. cpp:struct:: banana::api::inline_query_result_game_t 7 | 8 | Represents a Game. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the result, must be game 13 | 14 | .. cpp:member:: string_t id 15 | 16 | Unique identifier for this result, 1-64 bytes 17 | 18 | .. cpp:member:: string_t game_short_name 19 | 20 | Short name of the game 21 | 22 | .. cpp:member:: optional_t reply_markup 23 | 24 | Optional. Inline keyboard attached to the message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_contact_message_content.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_contact_message_content: 2 | 3 | input_contact_message_content_t 4 | =============================== 5 | 6 | .. cpp:struct:: banana::api::input_contact_message_content_t 7 | 8 | Represents the content of a contact message to be sent as the result of an inline query. 9 | 10 | .. cpp:member:: string_t phone_number 11 | 12 | Contact's phone number 13 | 14 | .. cpp:member:: string_t first_name 15 | 16 | Contact's first name 17 | 18 | .. cpp:member:: optional_t last_name 19 | 20 | Optional. Contact's last name 21 | 22 | .. cpp:member:: optional_t vcard 23 | 24 | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_file: 2 | 3 | input_file_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::input_file_t 7 | 8 | This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_location_message_content.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_location_message_content: 2 | 3 | input_location_message_content_t 4 | ================================ 5 | 6 | .. cpp:struct:: banana::api::input_location_message_content_t 7 | 8 | Represents the content of a location message to be sent as the result of an inline query. 9 | 10 | .. cpp:member:: float_t latitude 11 | 12 | Latitude of the location in degrees 13 | 14 | .. cpp:member:: float_t longitude 15 | 16 | Longitude of the location in degrees 17 | 18 | .. cpp:member:: optional_t horizontal_accuracy 19 | 20 | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 21 | 22 | .. cpp:member:: optional_t live_period 23 | 24 | Optional. Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. 25 | 26 | .. cpp:member:: optional_t heading 27 | 28 | Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. 29 | 30 | .. cpp:member:: optional_t proximity_alert_radius 31 | 32 | Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_media.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_media: 2 | 3 | input_media_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::input_media_t 7 | 8 | This object represents the content of a media message to be sent. It should be one of InputMediaAnimation; InputMediaDocument; InputMediaAudio; InputMediaPhoto; InputMediaVideo 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_message_content.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_message_content: 2 | 3 | input_message_content_t 4 | ======================= 5 | 6 | .. cpp:struct:: banana::api::input_message_content_t 7 | 8 | This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types: InputTextMessageContent; InputLocationMessageContent; InputVenueMessageContent; InputContactMessageContent; InputInvoiceMessageContent 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_sticker.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_sticker: 2 | 3 | input_sticker_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::input_sticker_t 7 | 8 | This object describes a sticker to be added to a sticker set. 9 | 10 | .. cpp:member:: variant_t sticker 11 | 12 | The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://” to upload a new one using multipart/form-data under name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files » 13 | 14 | .. cpp:member:: string_t format 15 | 16 | Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video 17 | 18 | .. cpp:member:: array_t emoji_list 19 | 20 | List of 1-20 emoji associated with the sticker 21 | 22 | .. cpp:member:: optional_t mask_position 23 | 24 | Optional. Position where the mask should be placed on faces. For “mask” stickers only. 25 | 26 | .. cpp:member:: optional_t> keywords 27 | 28 | Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_text_message_content.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_text_message_content: 2 | 3 | input_text_message_content_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::input_text_message_content_t 7 | 8 | Represents the content of a text message to be sent as the result of an inline query. 9 | 10 | .. cpp:member:: string_t message_text 11 | 12 | Text of the message to be sent, 1-4096 characters 13 | 14 | .. cpp:member:: optional_t parse_mode 15 | 16 | Optional. Mode for parsing entities in the message text. See formatting options for more details. 17 | 18 | .. cpp:member:: optional_t> entities 19 | 20 | Optional. List of special entities that appear in message text, which can be specified instead of parse_mode 21 | 22 | .. cpp:member:: optional_t link_preview_options 23 | 24 | Optional. Link preview generation options for the message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/input_venue_message_content.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-input_venue_message_content: 2 | 3 | input_venue_message_content_t 4 | ============================= 5 | 6 | .. cpp:struct:: banana::api::input_venue_message_content_t 7 | 8 | Represents the content of a venue message to be sent as the result of an inline query. 9 | 10 | .. cpp:member:: float_t latitude 11 | 12 | Latitude of the venue in degrees 13 | 14 | .. cpp:member:: float_t longitude 15 | 16 | Longitude of the venue in degrees 17 | 18 | .. cpp:member:: string_t title 19 | 20 | Name of the venue 21 | 22 | .. cpp:member:: string_t address 23 | 24 | Address of the venue 25 | 26 | .. cpp:member:: optional_t foursquare_id 27 | 28 | Optional. Foursquare identifier of the venue, if known 29 | 30 | .. cpp:member:: optional_t foursquare_type 31 | 32 | Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 33 | 34 | .. cpp:member:: optional_t google_place_id 35 | 36 | Optional. Google Places identifier of the venue 37 | 38 | .. cpp:member:: optional_t google_place_type 39 | 40 | Optional. Google Places type of the venue. (See supported types.) 41 | -------------------------------------------------------------------------------- /docs/api/tg/types/invoice.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-invoice: 2 | 3 | invoice_t 4 | ========= 5 | 6 | .. cpp:struct:: banana::api::invoice_t 7 | 8 | This object contains basic information about an invoice. 9 | 10 | .. cpp:member:: string_t title 11 | 12 | Product name 13 | 14 | .. cpp:member:: string_t description 15 | 16 | Product description 17 | 18 | .. cpp:member:: string_t start_parameter 19 | 20 | Unique bot deep-linking parameter that can be used to generate this invoice 21 | 22 | .. cpp:member:: string_t currency 23 | 24 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars 25 | 26 | .. cpp:member:: integer_t total_amount 27 | 28 | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/keyboard_button_poll_type.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-keyboard_button_poll_type: 2 | 3 | keyboard_button_poll_type_t 4 | =========================== 5 | 6 | .. cpp:struct:: banana::api::keyboard_button_poll_type_t 7 | 8 | This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. 9 | 10 | .. cpp:member:: optional_t type 11 | 12 | Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/keyboard_button_request_user.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-keyboard_button_request_user: 2 | 3 | keyboard_button_request_user_t 4 | ============================== 5 | 6 | .. cpp:struct:: banana::api::keyboard_button_request_user_t 7 | 8 | This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users » 9 | 10 | .. cpp:member:: integer_t request_id 11 | 12 | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message 13 | 14 | .. cpp:member:: optional_t user_is_bot 15 | 16 | Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. 17 | 18 | .. cpp:member:: optional_t user_is_premium 19 | 20 | Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/labeled_price.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-labeled_price: 2 | 3 | labeled_price_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::labeled_price_t 7 | 8 | This object represents a portion of the price for goods or services. 9 | 10 | .. cpp:member:: string_t label 11 | 12 | Portion label 13 | 14 | .. cpp:member:: integer_t amount 15 | 16 | Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/link_preview_options.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-link_preview_options: 2 | 3 | link_preview_options_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::link_preview_options_t 7 | 8 | Describes the options used for link preview generation. 9 | 10 | .. cpp:member:: optional_t is_disabled 11 | 12 | Optional. True, if the link preview is disabled 13 | 14 | .. cpp:member:: optional_t url 15 | 16 | Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used 17 | 18 | .. cpp:member:: optional_t prefer_small_media 19 | 20 | Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview 21 | 22 | .. cpp:member:: optional_t prefer_large_media 23 | 24 | Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview 25 | 26 | .. cpp:member:: optional_t show_above_text 27 | 28 | Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/location.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-location: 2 | 3 | location_t 4 | ========== 5 | 6 | .. cpp:struct:: banana::api::location_t 7 | 8 | This object represents a point on the map. 9 | 10 | .. cpp:member:: float_t latitude 11 | 12 | Latitude as defined by the sender 13 | 14 | .. cpp:member:: float_t longitude 15 | 16 | Longitude as defined by the sender 17 | 18 | .. cpp:member:: optional_t horizontal_accuracy 19 | 20 | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 21 | 22 | .. cpp:member:: optional_t live_period 23 | 24 | Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. 25 | 26 | .. cpp:member:: optional_t heading 27 | 28 | Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. 29 | 30 | .. cpp:member:: optional_t proximity_alert_radius 31 | 32 | Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/mask_position.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-mask_position: 2 | 3 | mask_position_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::mask_position_t 7 | 8 | This object describes the position on faces where a mask should be placed by default. 9 | 10 | .. cpp:member:: string_t point 11 | 12 | The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. 13 | 14 | .. cpp:member:: float_t x_shift 15 | 16 | Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. 17 | 18 | .. cpp:member:: float_t y_shift 19 | 20 | Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. 21 | 22 | .. cpp:member:: float_t scale 23 | 24 | Mask scaling coefficient. For example, 2.0 means double size. 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/maybe_inaccessible_message.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-maybe_inaccessible_message: 2 | 3 | maybe_inaccessible_message_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::maybe_inaccessible_message_t 7 | 8 | This object describes a message that can be inaccessible to the bot. It can be one of Message; InaccessibleMessage 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/menu_button.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-menu_button: 2 | 3 | menu_button_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::menu_button_t 7 | 8 | This object describes the bot's menu button in a private chat. It should be one of MenuButtonCommands; MenuButtonWebApp; MenuButtonDefault 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/menu_button_commands.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-menu_button_commands: 2 | 3 | menu_button_commands_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::menu_button_commands_t 7 | 8 | Represents a menu button, which opens the bot's list of commands. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the button, must be commands 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/menu_button_default.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-menu_button_default: 2 | 3 | menu_button_default_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::menu_button_default_t 7 | 8 | Describes that no specific value for the menu button was set. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the button, must be default 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/menu_button_web_app.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-menu_button_web_app: 2 | 3 | menu_button_web_app_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::menu_button_web_app_t 7 | 8 | Represents a menu button, which launches a Web App. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the button, must be web_app 13 | 14 | .. cpp:member:: string_t text 15 | 16 | Text on the button 17 | 18 | .. cpp:member:: web_app_info_t web_app 19 | 20 | Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_auto_delete_timer_changed.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_auto_delete_timer_changed: 2 | 3 | message_auto_delete_timer_changed_t 4 | =================================== 5 | 6 | .. cpp:struct:: banana::api::message_auto_delete_timer_changed_t 7 | 8 | This object represents a service message about a change in auto-delete timer settings. 9 | 10 | .. cpp:member:: integer_t message_auto_delete_time 11 | 12 | New auto-delete time for messages in the chat; in seconds 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_id.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_id: 2 | 3 | message_id_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::message_id_t 7 | 8 | This object represents a unique message identifier. 9 | 10 | .. cpp:member:: integer_t message_id 11 | 12 | Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_origin.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_origin: 2 | 3 | message_origin_t 4 | ================ 5 | 6 | .. cpp:struct:: banana::api::message_origin_t 7 | 8 | This object describes the origin of a message. It can be one of MessageOriginUser; MessageOriginHiddenUser; MessageOriginChat; MessageOriginChannel 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_origin_channel.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_origin_channel: 2 | 3 | message_origin_channel_t 4 | ======================== 5 | 6 | .. cpp:struct:: banana::api::message_origin_channel_t 7 | 8 | The message was originally sent to a channel chat. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the message origin, always “channel” 13 | 14 | .. cpp:member:: integer_t date 15 | 16 | Date the message was sent originally in Unix time 17 | 18 | .. cpp:member:: chat_t chat 19 | 20 | Channel chat to which the message was originally sent 21 | 22 | .. cpp:member:: integer_t message_id 23 | 24 | Unique message identifier inside the chat 25 | 26 | .. cpp:member:: optional_t author_signature 27 | 28 | Optional. Signature of the original post author 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_origin_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_origin_chat: 2 | 3 | message_origin_chat_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::message_origin_chat_t 7 | 8 | The message was originally sent on behalf of a chat to a group chat. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the message origin, always “chat” 13 | 14 | .. cpp:member:: integer_t date 15 | 16 | Date the message was sent originally in Unix time 17 | 18 | .. cpp:member:: chat_t sender_chat 19 | 20 | Chat that sent the message originally 21 | 22 | .. cpp:member:: optional_t author_signature 23 | 24 | Optional. For messages originally sent by an anonymous chat administrator, original message author signature 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_origin_hidden_user.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_origin_hidden_user: 2 | 3 | message_origin_hidden_user_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::message_origin_hidden_user_t 7 | 8 | The message was originally sent by an unknown user. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the message origin, always “hidden_user” 13 | 14 | .. cpp:member:: integer_t date 15 | 16 | Date the message was sent originally in Unix time 17 | 18 | .. cpp:member:: string_t sender_user_name 19 | 20 | Name of the user that sent the message originally 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_origin_user.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_origin_user: 2 | 3 | message_origin_user_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::message_origin_user_t 7 | 8 | The message was originally sent by a known user. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the message origin, always “user” 13 | 14 | .. cpp:member:: integer_t date 15 | 16 | Date the message was sent originally in Unix time 17 | 18 | .. cpp:member:: user_t sender_user 19 | 20 | User that sent the message originally 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_reaction_count_updated.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_reaction_count_updated: 2 | 3 | message_reaction_count_updated_t 4 | ================================ 5 | 6 | .. cpp:struct:: banana::api::message_reaction_count_updated_t 7 | 8 | This object represents reaction changes on a message with anonymous reactions. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | The chat containing the message 13 | 14 | .. cpp:member:: integer_t message_id 15 | 16 | Unique message identifier inside the chat 17 | 18 | .. cpp:member:: integer_t date 19 | 20 | Date of the change in Unix time 21 | 22 | .. cpp:member:: array_t reactions 23 | 24 | List of reactions that are present on the message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/message_reaction_updated.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-message_reaction_updated: 2 | 3 | message_reaction_updated_t 4 | ========================== 5 | 6 | .. cpp:struct:: banana::api::message_reaction_updated_t 7 | 8 | This object represents a change of a reaction on a message performed by a user. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | The chat containing the message the user reacted to 13 | 14 | .. cpp:member:: integer_t message_id 15 | 16 | Unique identifier of the message inside the chat 17 | 18 | .. cpp:member:: integer_t date 19 | 20 | Date of the change in Unix time 21 | 22 | .. cpp:member:: array_t old_reaction 23 | 24 | Previous list of reaction types that were set by the user 25 | 26 | .. cpp:member:: array_t new_reaction 27 | 28 | New list of reaction types that have been set by the user 29 | 30 | .. cpp:member:: optional_t user 31 | 32 | Optional. The user that changed the reaction, if the user isn't anonymous 33 | 34 | .. cpp:member:: optional_t actor_chat 35 | 36 | Optional. The chat on behalf of which the reaction was changed, if the user is anonymous 37 | -------------------------------------------------------------------------------- /docs/api/tg/types/order_info.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-order_info: 2 | 3 | order_info_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::order_info_t 7 | 8 | This object represents information about an order. 9 | 10 | .. cpp:member:: optional_t name 11 | 12 | Optional. User name 13 | 14 | .. cpp:member:: optional_t phone_number 15 | 16 | Optional. User's phone number 17 | 18 | .. cpp:member:: optional_t email 19 | 20 | Optional. User email 21 | 22 | .. cpp:member:: optional_t shipping_address 23 | 24 | Optional. User shipping address 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_data.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_data: 2 | 3 | passport_data_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::passport_data_t 7 | 8 | Describes Telegram Passport data shared with the bot by the user. 9 | 10 | .. cpp:member:: array_t data 11 | 12 | Array with information about documents and other Telegram Passport elements that was shared with the bot 13 | 14 | .. cpp:member:: encrypted_credentials_t credentials 15 | 16 | Encrypted credentials required to decrypt the data 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error: 2 | 3 | passport_element_error_t 4 | ======================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_t 7 | 8 | This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of: PassportElementErrorDataField; PassportElementErrorFrontSide; PassportElementErrorReverseSide; PassportElementErrorSelfie; PassportElementErrorFile; PassportElementErrorFiles; PassportElementErrorTranslationFile; PassportElementErrorTranslationFiles; PassportElementErrorUnspecified 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_data_field.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_data_field: 2 | 3 | passport_element_error_data_field_t 4 | =================================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_data_field_t 7 | 8 | Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be data 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” 17 | 18 | .. cpp:member:: string_t field_name 19 | 20 | Name of the data field which has the error 21 | 22 | .. cpp:member:: string_t data_hash 23 | 24 | Base64-encoded data hash 25 | 26 | .. cpp:member:: string_t message 27 | 28 | Error message 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_file: 2 | 3 | passport_element_error_file_t 4 | ============================= 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_file_t 7 | 8 | Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be file 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 17 | 18 | .. cpp:member:: string_t file_hash 19 | 20 | Base64-encoded file hash 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_files.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_files: 2 | 3 | passport_element_error_files_t 4 | ============================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_files_t 7 | 8 | Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be files 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 17 | 18 | .. cpp:member:: array_t file_hashes 19 | 20 | List of base64-encoded file hashes 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_front_side.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_front_side: 2 | 3 | passport_element_error_front_side_t 4 | =================================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_front_side_t 7 | 8 | Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be front_side 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” 17 | 18 | .. cpp:member:: string_t file_hash 19 | 20 | Base64-encoded hash of the file with the front side of the document 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_reverse_side.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_reverse_side: 2 | 3 | passport_element_error_reverse_side_t 4 | ===================================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_reverse_side_t 7 | 8 | Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be reverse_side 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” 17 | 18 | .. cpp:member:: string_t file_hash 19 | 20 | Base64-encoded hash of the file with the reverse side of the document 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_selfie.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_selfie: 2 | 3 | passport_element_error_selfie_t 4 | =============================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_selfie_t 7 | 8 | Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be selfie 13 | 14 | .. cpp:member:: string_t type 15 | 16 | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” 17 | 18 | .. cpp:member:: string_t file_hash 19 | 20 | Base64-encoded hash of the file with the selfie 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_translation_file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_translation_file: 2 | 3 | passport_element_error_translation_file_t 4 | ========================================= 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_translation_file_t 7 | 8 | Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be translation_file 13 | 14 | .. cpp:member:: string_t type 15 | 16 | Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 17 | 18 | .. cpp:member:: string_t file_hash 19 | 20 | Base64-encoded file hash 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_translation_files.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_translation_files: 2 | 3 | passport_element_error_translation_files_t 4 | ========================================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_translation_files_t 7 | 8 | Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be translation_files 13 | 14 | .. cpp:member:: string_t type 15 | 16 | Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” 17 | 18 | .. cpp:member:: array_t file_hashes 19 | 20 | List of base64-encoded file hashes 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_element_error_unspecified.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_element_error_unspecified: 2 | 3 | passport_element_error_unspecified_t 4 | ==================================== 5 | 6 | .. cpp:struct:: banana::api::passport_element_error_unspecified_t 7 | 8 | Represents an issue in an unspecified place. The error is considered resolved when new data is added. 9 | 10 | .. cpp:member:: string_t source 11 | 12 | Error source, must be unspecified 13 | 14 | .. cpp:member:: string_t type 15 | 16 | Type of element of the user's Telegram Passport which has the issue 17 | 18 | .. cpp:member:: string_t element_hash 19 | 20 | Base64-encoded element hash 21 | 22 | .. cpp:member:: string_t message 23 | 24 | Error message 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/passport_file.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-passport_file: 2 | 3 | passport_file_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::passport_file_t 7 | 8 | This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: integer_t file_size 19 | 20 | File size in bytes 21 | 22 | .. cpp:member:: integer_t file_date 23 | 24 | Unix time when the file was uploaded 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/photo_size.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-photo_size: 2 | 3 | photo_size_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::photo_size_t 7 | 8 | This object represents one size of a photo or a file / sticker thumbnail. 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: integer_t width 19 | 20 | Photo width 21 | 22 | .. cpp:member:: integer_t height 23 | 24 | Photo height 25 | 26 | .. cpp:member:: optional_t file_size 27 | 28 | Optional. File size in bytes 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/poll_answer.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-poll_answer: 2 | 3 | poll_answer_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::poll_answer_t 7 | 8 | This object represents an answer of a user in a non-anonymous poll. 9 | 10 | .. cpp:member:: string_t poll_id 11 | 12 | Unique poll identifier 13 | 14 | .. cpp:member:: array_t option_ids 15 | 16 | 0-based identifiers of chosen answer options. May be empty if the vote was retracted. 17 | 18 | .. cpp:member:: optional_t voter_chat 19 | 20 | Optional. The chat that changed the answer to the poll, if the voter is anonymous 21 | 22 | .. cpp:member:: optional_t user 23 | 24 | Optional. The user that changed the answer to the poll, if the voter isn't anonymous 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/poll_option.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-poll_option: 2 | 3 | poll_option_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::poll_option_t 7 | 8 | This object contains information about one answer option in a poll. 9 | 10 | .. cpp:member:: string_t text 11 | 12 | Option text, 1-100 characters 13 | 14 | .. cpp:member:: integer_t voter_count 15 | 16 | Number of users that voted for this option 17 | 18 | .. cpp:member:: optional_t> text_entities 19 | 20 | Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/pre_checkout_query.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-pre_checkout_query: 2 | 3 | pre_checkout_query_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::pre_checkout_query_t 7 | 8 | This object contains information about an incoming pre-checkout query. 9 | 10 | .. cpp:member:: string_t id 11 | 12 | Unique query identifier 13 | 14 | .. cpp:member:: user_t from 15 | 16 | User who sent the query 17 | 18 | .. cpp:member:: string_t currency 19 | 20 | Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars 21 | 22 | .. cpp:member:: integer_t total_amount 23 | 24 | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). 25 | 26 | .. cpp:member:: string_t invoice_payload 27 | 28 | Bot-specified invoice payload 29 | 30 | .. cpp:member:: optional_t shipping_option_id 31 | 32 | Optional. Identifier of the shipping option chosen by the user 33 | 34 | .. cpp:member:: optional_t order_info 35 | 36 | Optional. Order information provided by the user 37 | -------------------------------------------------------------------------------- /docs/api/tg/types/proximity_alert_triggered.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-proximity_alert_triggered: 2 | 3 | proximity_alert_triggered_t 4 | =========================== 5 | 6 | .. cpp:struct:: banana::api::proximity_alert_triggered_t 7 | 8 | This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. 9 | 10 | .. cpp:member:: user_t traveler 11 | 12 | User that triggered the alert 13 | 14 | .. cpp:member:: user_t watcher 15 | 16 | User that set the alert 17 | 18 | .. cpp:member:: integer_t distance 19 | 20 | The distance between the users 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/reaction_count.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-reaction_count: 2 | 3 | reaction_count_t 4 | ================ 5 | 6 | .. cpp:struct:: banana::api::reaction_count_t 7 | 8 | Represents a reaction added to a message along with the number of times it was added. 9 | 10 | .. cpp:member:: reaction_type_t type 11 | 12 | Type of the reaction 13 | 14 | .. cpp:member:: integer_t total_count 15 | 16 | Number of times the reaction was added 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/reaction_type.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-reaction_type: 2 | 3 | reaction_type_t 4 | =============== 5 | 6 | .. cpp:struct:: banana::api::reaction_type_t 7 | 8 | This object describes the type of a reaction. Currently, it can be one of ReactionTypeEmoji; ReactionTypeCustomEmoji; ReactionTypePaid 9 | 10 | .. cpp:member:: variant_t __alias__ 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/reaction_type_custom_emoji.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-reaction_type_custom_emoji: 2 | 3 | reaction_type_custom_emoji_t 4 | ============================ 5 | 6 | .. cpp:struct:: banana::api::reaction_type_custom_emoji_t 7 | 8 | The reaction is based on a custom emoji. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the reaction, always “custom_emoji” 13 | 14 | .. cpp:member:: string_t custom_emoji_id 15 | 16 | Custom emoji identifier 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/reaction_type_emoji.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-reaction_type_emoji: 2 | 3 | reaction_type_emoji_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::reaction_type_emoji_t 7 | 8 | The reaction is based on an emoji. 9 | 10 | .. cpp:member:: string_t type 11 | 12 | Type of the reaction, always “emoji” 13 | 14 | .. cpp:member:: string_t emoji 15 | 16 | Reaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/response_parameters.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-response_parameters: 2 | 3 | response_parameters_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::response_parameters_t 7 | 8 | Describes why a request was unsuccessful. 9 | 10 | .. cpp:member:: optional_t migrate_to_chat_id 11 | 12 | Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. 13 | 14 | .. cpp:member:: optional_t retry_after 15 | 16 | Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/sent_web_app_message.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-sent_web_app_message: 2 | 3 | sent_web_app_message_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::sent_web_app_message_t 7 | 8 | Describes an inline message sent by a Web App on behalf of a user. 9 | 10 | .. cpp:member:: optional_t inline_message_id 11 | 12 | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/shipping_address.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-shipping_address: 2 | 3 | shipping_address_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::shipping_address_t 7 | 8 | This object represents a shipping address. 9 | 10 | .. cpp:member:: string_t country_code 11 | 12 | Two-letter ISO 3166-1 alpha-2 country code 13 | 14 | .. cpp:member:: string_t state 15 | 16 | State, if applicable 17 | 18 | .. cpp:member:: string_t city 19 | 20 | City 21 | 22 | .. cpp:member:: string_t street_line1 23 | 24 | First line for the address 25 | 26 | .. cpp:member:: string_t street_line2 27 | 28 | Second line for the address 29 | 30 | .. cpp:member:: string_t post_code 31 | 32 | Address post code 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/shipping_option.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-shipping_option: 2 | 3 | shipping_option_t 4 | ================= 5 | 6 | .. cpp:struct:: banana::api::shipping_option_t 7 | 8 | This object represents one shipping option. 9 | 10 | .. cpp:member:: string_t id 11 | 12 | Shipping option identifier 13 | 14 | .. cpp:member:: string_t title 15 | 16 | Option title 17 | 18 | .. cpp:member:: array_t prices 19 | 20 | List of price portions 21 | -------------------------------------------------------------------------------- /docs/api/tg/types/shipping_query.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-shipping_query: 2 | 3 | shipping_query_t 4 | ================ 5 | 6 | .. cpp:struct:: banana::api::shipping_query_t 7 | 8 | This object contains information about an incoming shipping query. 9 | 10 | .. cpp:member:: string_t id 11 | 12 | Unique query identifier 13 | 14 | .. cpp:member:: user_t from 15 | 16 | User who sent the query 17 | 18 | .. cpp:member:: string_t invoice_payload 19 | 20 | Bot-specified invoice payload 21 | 22 | .. cpp:member:: shipping_address_t shipping_address 23 | 24 | User specified shipping address 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/sticker_set.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-sticker_set: 2 | 3 | sticker_set_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::sticker_set_t 7 | 8 | This object represents a sticker set. 9 | 10 | .. cpp:member:: string_t name 11 | 12 | Sticker set name 13 | 14 | .. cpp:member:: string_t title 15 | 16 | Sticker set title 17 | 18 | .. cpp:member:: string_t sticker_type 19 | 20 | Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” 21 | 22 | .. cpp:member:: array_t stickers 23 | 24 | List of all set stickers 25 | 26 | .. cpp:member:: optional_t thumbnail 27 | 28 | Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/story.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-story: 2 | 3 | story_t 4 | ======= 5 | 6 | .. cpp:struct:: banana::api::story_t 7 | 8 | This object represents a story. 9 | 10 | .. cpp:member:: chat_t chat 11 | 12 | Chat that posted the story 13 | 14 | .. cpp:member:: integer_t id 15 | 16 | Unique identifier for the story in the chat 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/switch_inline_query_chosen_chat.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-switch_inline_query_chosen_chat: 2 | 3 | switch_inline_query_chosen_chat_t 4 | ================================= 5 | 6 | .. cpp:struct:: banana::api::switch_inline_query_chosen_chat_t 7 | 8 | This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. 9 | 10 | .. cpp:member:: optional_t query 11 | 12 | Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted 13 | 14 | .. cpp:member:: optional_t allow_user_chats 15 | 16 | Optional. True, if private chats with users can be chosen 17 | 18 | .. cpp:member:: optional_t allow_bot_chats 19 | 20 | Optional. True, if private chats with bots can be chosen 21 | 22 | .. cpp:member:: optional_t allow_group_chats 23 | 24 | Optional. True, if group and supergroup chats can be chosen 25 | 26 | .. cpp:member:: optional_t allow_channel_chats 27 | 28 | Optional. True, if channel chats can be chosen 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/text_quote.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-text_quote: 2 | 3 | text_quote_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::text_quote_t 7 | 8 | This object contains information about the quoted part of a message that is replied to by the given message. 9 | 10 | .. cpp:member:: string_t text 11 | 12 | Text of the quoted part of a message that is replied to by the given message 13 | 14 | .. cpp:member:: integer_t position 15 | 16 | Approximate quote position in the original message in UTF-16 code units as specified by the sender 17 | 18 | .. cpp:member:: optional_t> entities 19 | 20 | Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. 21 | 22 | .. cpp:member:: optional_t is_manual 23 | 24 | Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. 25 | -------------------------------------------------------------------------------- /docs/api/tg/types/user_chat_boosts.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-user_chat_boosts: 2 | 3 | user_chat_boosts_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::user_chat_boosts_t 7 | 8 | This object represents a list of boosts added to a chat by a user. 9 | 10 | .. cpp:member:: array_t boosts 11 | 12 | The list of boosts added to the chat by the user 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/user_profile_photos.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-user_profile_photos: 2 | 3 | user_profile_photos_t 4 | ===================== 5 | 6 | .. cpp:struct:: banana::api::user_profile_photos_t 7 | 8 | This object represent a user's profile pictures. 9 | 10 | .. cpp:member:: integer_t total_count 11 | 12 | Total number of profile pictures the target user has 13 | 14 | .. cpp:member:: array_t> photos 15 | 16 | Requested profile pictures (in up to 4 sizes each) 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/user_shared.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-user_shared: 2 | 3 | user_shared_t 4 | ============= 5 | 6 | .. cpp:struct:: banana::api::user_shared_t 7 | 8 | This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. 9 | 10 | .. cpp:member:: integer_t request_id 11 | 12 | Identifier of the request 13 | 14 | .. cpp:member:: integer_t user_id 15 | 16 | Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/users_shared.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-users_shared: 2 | 3 | users_shared_t 4 | ============== 5 | 6 | .. cpp:struct:: banana::api::users_shared_t 7 | 8 | This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. 9 | 10 | .. cpp:member:: integer_t request_id 11 | 12 | Identifier of the request 13 | 14 | .. cpp:member:: array_t users 15 | 16 | Information about users shared with the bot. 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/venue.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-venue: 2 | 3 | venue_t 4 | ======= 5 | 6 | .. cpp:struct:: banana::api::venue_t 7 | 8 | This object represents a venue. 9 | 10 | .. cpp:member:: location_t location 11 | 12 | Venue location. Can't be a live location 13 | 14 | .. cpp:member:: string_t title 15 | 16 | Name of the venue 17 | 18 | .. cpp:member:: string_t address 19 | 20 | Address of the venue 21 | 22 | .. cpp:member:: optional_t foursquare_id 23 | 24 | Optional. Foursquare identifier of the venue 25 | 26 | .. cpp:member:: optional_t foursquare_type 27 | 28 | Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) 29 | 30 | .. cpp:member:: optional_t google_place_id 31 | 32 | Optional. Google Places identifier of the venue 33 | 34 | .. cpp:member:: optional_t google_place_type 35 | 36 | Optional. Google Places type of the venue. (See supported types.) 37 | -------------------------------------------------------------------------------- /docs/api/tg/types/video_chat_ended.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-video_chat_ended: 2 | 3 | video_chat_ended_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::video_chat_ended_t 7 | 8 | This object represents a service message about a video chat ended in the chat. 9 | 10 | .. cpp:member:: integer_t duration 11 | 12 | Video chat duration in seconds 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/video_chat_participants_invited.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-video_chat_participants_invited: 2 | 3 | video_chat_participants_invited_t 4 | ================================= 5 | 6 | .. cpp:struct:: banana::api::video_chat_participants_invited_t 7 | 8 | This object represents a service message about new members invited to a video chat. 9 | 10 | .. cpp:member:: array_t users 11 | 12 | New members that were invited to the video chat 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/video_chat_scheduled.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-video_chat_scheduled: 2 | 3 | video_chat_scheduled_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::video_chat_scheduled_t 7 | 8 | This object represents a service message about a video chat scheduled in the chat. 9 | 10 | .. cpp:member:: integer_t start_date 11 | 12 | Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/video_chat_started.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-video_chat_started: 2 | 3 | video_chat_started_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::video_chat_started_t 7 | 8 | This object represents a service message about a video chat started in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/video_note.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-video_note: 2 | 3 | video_note_t 4 | ============ 5 | 6 | .. cpp:struct:: banana::api::video_note_t 7 | 8 | This object represents a video message (available in Telegram apps as of v.4.0). 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: integer_t length 19 | 20 | Video width and height (diameter of the video message) as defined by the sender 21 | 22 | .. cpp:member:: integer_t duration 23 | 24 | Duration of the video in seconds as defined by the sender 25 | 26 | .. cpp:member:: optional_t thumbnail 27 | 28 | Optional. Video thumbnail 29 | 30 | .. cpp:member:: optional_t file_size 31 | 32 | Optional. File size in bytes 33 | -------------------------------------------------------------------------------- /docs/api/tg/types/voice.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-voice: 2 | 3 | voice_t 4 | ======= 5 | 6 | .. cpp:struct:: banana::api::voice_t 7 | 8 | This object represents a voice note. 9 | 10 | .. cpp:member:: string_t file_id 11 | 12 | Identifier for this file, which can be used to download or reuse the file 13 | 14 | .. cpp:member:: string_t file_unique_id 15 | 16 | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. 17 | 18 | .. cpp:member:: integer_t duration 19 | 20 | Duration of the audio in seconds as defined by the sender 21 | 22 | .. cpp:member:: optional_t mime_type 23 | 24 | Optional. MIME type of the file as defined by the sender 25 | 26 | .. cpp:member:: optional_t file_size 27 | 28 | Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. 29 | -------------------------------------------------------------------------------- /docs/api/tg/types/voice_chat_ended.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-voice_chat_ended: 2 | 3 | voice_chat_ended_t 4 | ================== 5 | 6 | .. cpp:struct:: banana::api::voice_chat_ended_t 7 | 8 | This object represents a service message about a voice chat ended in the chat. 9 | 10 | .. cpp:member:: integer_t duration 11 | 12 | Voice chat duration; in seconds 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/voice_chat_participants_invited.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-voice_chat_participants_invited: 2 | 3 | voice_chat_participants_invited_t 4 | ================================= 5 | 6 | .. cpp:struct:: banana::api::voice_chat_participants_invited_t 7 | 8 | This object represents a service message about new members invited to a voice chat. 9 | 10 | .. cpp:member:: optional_t> users 11 | 12 | Optional. New members that were invited to the voice chat 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/voice_chat_scheduled.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-voice_chat_scheduled: 2 | 3 | voice_chat_scheduled_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::voice_chat_scheduled_t 7 | 8 | This object represents a service message about a voice chat scheduled in the chat. 9 | 10 | .. cpp:member:: integer_t start_date 11 | 12 | Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/voice_chat_started.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-voice_chat_started: 2 | 3 | voice_chat_started_t 4 | ==================== 5 | 6 | .. cpp:struct:: banana::api::voice_chat_started_t 7 | 8 | This object represents a service message about a voice chat started in the chat. Currently holds no information. 9 | -------------------------------------------------------------------------------- /docs/api/tg/types/web_app_data.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-web_app_data: 2 | 3 | web_app_data_t 4 | ============== 5 | 6 | .. cpp:struct:: banana::api::web_app_data_t 7 | 8 | Describes data sent from a Web App to the bot. 9 | 10 | .. cpp:member:: string_t data 11 | 12 | The data. Be aware that a bad client can send arbitrary data in this field. 13 | 14 | .. cpp:member:: string_t button_text 15 | 16 | Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. 17 | -------------------------------------------------------------------------------- /docs/api/tg/types/web_app_info.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-web_app_info: 2 | 3 | web_app_info_t 4 | ============== 5 | 6 | .. cpp:struct:: banana::api::web_app_info_t 7 | 8 | Describes a Web App. 9 | 10 | .. cpp:member:: string_t url 11 | 12 | An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps 13 | -------------------------------------------------------------------------------- /docs/api/tg/types/write_access_allowed.rst: -------------------------------------------------------------------------------- 1 | .. _banana-api-tg-types-write_access_allowed: 2 | 3 | write_access_allowed_t 4 | ====================== 5 | 6 | .. cpp:struct:: banana::api::write_access_allowed_t 7 | 8 | This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. 9 | 10 | .. cpp:member:: optional_t from_request 11 | 12 | Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess 13 | 14 | .. cpp:member:: optional_t web_app_name 15 | 16 | Optional. Name of the Web App, if the access was granted when the Web App was launched from a link 17 | 18 | .. cpp:member:: optional_t from_attachment_menu 19 | 20 | Optional. True, if the access was granted when the bot was added to the attachment or side menu 21 | -------------------------------------------------------------------------------- /docs/guide.rst: -------------------------------------------------------------------------------- 1 | .. _banana-guide: 2 | 3 | User Guide 4 | ========== 5 | 6 | .. toctree:: 7 | :name: guide 8 | 9 | Quick start 10 | Basic: agents 11 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to banana's documentation! 2 | ================================== 3 | 4 | 🍌 ``banana`` is a C++17 library designed to be small and minimalistic wrapper over `Telegram Bot API `_. 5 | 6 | Key features 7 | ------------ 8 | 9 | - Simple API 10 | - **Single interface for both blocking, non-blocking and even coroutine-based operations** 11 | - Generic in terms of networking backend (bundled support for :ref:`WinAPI `, :ref:`cpr ` and :ref:`boost::beast `) 12 | - Extendable (see `custom-agent example `_) 13 | - Automatically generated from `Telegram Bot API `_ 7.4 (thanks `ark0f/tg-bot-api `_) 14 | - Cross-platform (tested in CI on Windows, Linux and macOS) 15 | 16 | .. include:: utils/goal-note.rst 17 | 18 | Content 19 | ======= 20 | 21 | .. toctree:: 22 | :maxdepth: 3 23 | 24 | User Guide 25 | API Reference 26 | 27 | 28 | Indices and tables 29 | ================== 30 | 31 | * :ref:`genindex` 32 | * :ref:`modindex` 33 | * :ref:`search` 34 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==7.3.7 2 | furo==2024.4.27 3 | sphinx-multiversion==0.2.4 4 | jinja2==3.0.3 5 | -------------------------------------------------------------------------------- /docs/utils/goal-note.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | ``banana`` **is not a Telegram Bot Framework but a generic statically typed and highly-configurable thin wrapper over Telegram Bot API**. 3 | 4 | ``banana`` was designed to be both minimalistic and comprehensive at the same time. 5 | It doesn't provide high-level abstractions or even ``TelegramBot`` class. 6 | Its main goal is to allow developer to build necessary abstractions on top of the banana API, 7 | abstracting from the Telegram API implementation. 8 | 9 | You've been warned! 10 | -------------------------------------------------------------------------------- /examples/agent-cpr-async.cpp: -------------------------------------------------------------------------------- 1 | #include "examples_util.hpp" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | static_assert(std::is_same_v, std::future>); 9 | 10 | int main(int argc, const char** argv) { 11 | const auto [token, target, name, message_text] = parse_input_or_fail(argc, argv); 12 | 13 | try { 14 | banana::agent::cpr_async agent(token); 15 | 16 | std::cout << "bot name: " << banana::api::get_me(agent).get().username.value() << "\n"; 17 | std::cout << "message sent: " << banana::api::send_message(agent, { .chat_id = target, .text = message_text }).get().message_id << "\n"; 18 | } 19 | catch (std::exception& e) { 20 | std::cout << "exception while running " << name << ": " << e.what() << "\n"; 21 | return 1; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/agent-default-async.cpp: -------------------------------------------------------------------------------- 1 | #include "examples_util.hpp" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | static_assert(std::is_same_v, std::future>); 9 | 10 | int main(int argc, const char** argv) { 11 | const auto [token, target, name, message_text] = parse_input_or_fail(argc, argv); 12 | 13 | try { 14 | banana::agent::default_async agent(token); 15 | 16 | std::cout << "bot name: " << banana::api::get_me(agent).get().username.value() << "\n"; 17 | std::cout << "message sent: " << banana::api::send_message(agent, { .chat_id = target, .text = message_text }).get().message_id << "\n"; 18 | } 19 | catch (std::exception& e) { 20 | std::cout << "exception while running " << name << ": " << e.what() << "\n"; 21 | return 1; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/agent-httplib-async.cpp: -------------------------------------------------------------------------------- 1 | #include "examples_util.hpp" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | static_assert(std::is_same_v, std::future>); 9 | 10 | int main(int argc, const char** argv) { 11 | const auto [token, target, name, message_text] = parse_input_or_fail(argc, argv); 12 | 13 | try { 14 | banana::agent::httplib_async agent(token); 15 | 16 | std::cout << "bot name: " << banana::api::get_me(agent).get().username.value() << "\n"; 17 | std::cout << "message sent: " << banana::api::send_message(agent, { .chat_id = target, .text = message_text }).get().message_id << "\n"; 18 | } 19 | catch (std::exception& e) { 20 | std::cout << "exception while running " << name << ": " << e.what() << "\n"; 21 | return 1; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/agent-winapi-async.cpp: -------------------------------------------------------------------------------- 1 | #include "examples_util.hpp" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | static_assert(std::is_same_v, std::future>); 9 | 10 | int main(int argc, const char** argv) { 11 | const auto [token, target, name, message_text] = parse_input_or_fail(argc, argv); 12 | 13 | try { 14 | banana::agent::winapi_async agent(token); 15 | 16 | std::cout << "bot name: " << banana::api::get_me(agent).get().username.value() << "\n"; 17 | std::cout << "message sent: " << banana::api::send_message(agent, { .chat_id = target, .text = message_text }).get().message_id << "\n"; 18 | } 19 | catch (std::exception& e) { 20 | std::cout << "exception while running " << name << ": " << e.what() << "\n"; 21 | return 1; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/generic-api-call.cpp: -------------------------------------------------------------------------------- 1 | #include "examples_util.hpp" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, const char** argv) { 9 | const auto [token, target, name, message_text] = parse_input_or_fail(argc, argv); 10 | 11 | try { 12 | banana::agent::default_blocking agent(token); 13 | 14 | std::cout << "1. " << banana::api::send_message(agent, /* banana::api::send_message_args_t */{ .chat_id = target, .text = message_text + " (simple)" }).message_id << "\n"; 15 | 16 | auto args = banana::api::send_message_args_t{ .chat_id = target, .text = message_text + " (generic)" }; 17 | std::cout << "2. " << banana::api::call(agent, std::move(args)).message_id << "\n"; 18 | 19 | auto serialized_args = banana::serialize_args(banana::api::send_message_args_t{ .chat_id = target, .text = message_text + " (generic, pre-serialized)" }); 20 | std::cout << "3.1. " << banana::api::call(agent, serialized_args).message_id << "\n"; 21 | std::cout << "3.2. " << banana::api::call(agent, serialized_args).message_id << "\n"; 22 | } 23 | catch (std::exception& e) { 24 | std::cout << "exception while running " << name << ": " << e.what() << "\n"; 25 | return 1; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "banana-examples", 3 | "version-string" : "1.0.0", 4 | "builtin-baseline" : "c591ac6466a55ef0a05a3d56bb1489ca36e50102", 5 | "dependencies" : [ { 6 | "name" : "cpr", 7 | "version>=" : "1.10.5#2" 8 | }, { 9 | "name" : "boost-beast", 10 | "version>=" : "1.84.0#1" 11 | }, { 12 | "name" : "openssl", 13 | "version>=" : "3.3.0" 14 | }, { 15 | "name" : "cpp-httplib", 16 | "version>=" : "0.15.3" 17 | } ] 18 | } -------------------------------------------------------------------------------- /include/banana/agent/any.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace banana::agent { 6 | 7 | template 8 | struct basic_any { 9 | template 10 | /* implicit */ basic_any(Agent agent) : do_request([agent = std::move(agent)](std::string_view method, std::string body) mutable -> R { return agent.do_request(method, std::move(body)); }) { 11 | // nothing 12 | } 13 | 14 | // Note: member-function simulation 15 | std::function do_request; 16 | }; 17 | 18 | template 19 | basic_any(Agent agent) -> basic_any(), std::declval()))>; 20 | 21 | using any_blocking = meta::make_blocking>; 22 | using any_blocking_monadic = meta::make_blocking_monadic>>; 23 | 24 | } // namespace banana::agent 25 | -------------------------------------------------------------------------------- /include/banana/detail/api_enums.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace banana::api { 4 | 5 | #include "generated/api_enums.hpp" 6 | 7 | } // namespace banana::api 8 | -------------------------------------------------------------------------------- /include/banana/detail/api_traits.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace banana::meta { 9 | 10 | template 11 | struct api_traits { 12 | // exposition only 13 | static inline constexpr std::string_view native_name = "getFooBar"; 14 | static inline constexpr std::string_view pretty_name = "get_foo_bar"; 15 | 16 | using request_type = void; 17 | using response_type = void; 18 | }; 19 | 20 | namespace detail { 21 | 22 | template 23 | struct by_request_type_impl; 24 | 25 | } // namespace detail 26 | 27 | #include "generated/api_traits.hpp" 28 | 29 | template 30 | using api_traits_by_request = typename detail::by_request_type_impl::type; 31 | 32 | } // namespace banana::meta 33 | -------------------------------------------------------------------------------- /include/banana/detail/api_types_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace banana::api { 4 | 5 | #include "generated/api_types_fwd.hpp" 6 | 7 | } // namespace banana::api 8 | -------------------------------------------------------------------------------- /include/banana/detail/response_handler.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace banana { 9 | 10 | template 11 | struct response_handler { 12 | std::string_view method; 13 | 14 | expected process(expected response) const; 15 | }; 16 | 17 | template 18 | expected deserialize(expected response) { 19 | return response_handler{ Traits::pretty_name }.process(response); 20 | } 21 | 22 | } // namespace banana 23 | -------------------------------------------------------------------------------- /include/banana/detail/serializer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace banana { 6 | 7 | template 8 | struct serialized_args_t { 9 | std::string data; 10 | }; 11 | 12 | template 13 | serialized_args_t serialize_args(T value); 14 | 15 | template 16 | expected deserialize_response(std::string_view json_response); 17 | 18 | } // namespace banana 19 | -------------------------------------------------------------------------------- /include/banana/meta.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace banana::meta { 7 | 8 | template 9 | struct reflector; 10 | 11 | template 12 | constexpr bool is_reflectable_v = false; 13 | 14 | template 15 | constexpr std::string_view name_of = ""; 16 | 17 | #include "detail/generated/meta.hpp" 18 | 19 | } // namespace banana::meta 20 | -------------------------------------------------------------------------------- /include/banana/types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace banana::api { 7 | 8 | #include "detail/generated/types.hpp" 9 | 10 | } // namespace banana::api 11 | -------------------------------------------------------------------------------- /include/banana/types_fwd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace banana::api { 4 | 5 | #include "detail/generated/types_fwd.hpp" 6 | 7 | } // namespace banana::api 8 | -------------------------------------------------------------------------------- /include/banana/utils/basic_types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "dynamic_optional.hpp" 9 | 10 | namespace banana { 11 | 12 | using string_t = std::string; 13 | using boolean_t = bool; 14 | using integer_t = std::int64_t; 15 | using float_t = double; 16 | 17 | template 18 | using array_t = std::vector; 19 | 20 | template 21 | using variant_t = std::variant; 22 | 23 | template 24 | using optional_t = dynamic_optional; 25 | 26 | } // namespace banana 27 | -------------------------------------------------------------------------------- /script/load_api.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | API_URL = 'https://ark0f.github.io/tg-bot-api/custom_v2.json' 4 | 5 | r = requests.get(API_URL) 6 | with open('custom_v2.json', 'w', encoding='utf8') as file: 7 | file.write(r.text) 8 | -------------------------------------------------------------------------------- /script/requirements.txt: -------------------------------------------------------------------------------- 1 | marko==1.0.3 2 | inflection==0.5.1 3 | networkx==2.5 4 | requests==2.31.0 5 | -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(banana-core) 2 | 3 | add_library(banana STATIC core.cpp) 4 | target_include_directories(banana PRIVATE ${BANANA_ROOT_DIR}/third_party/json) 5 | target_include_directories(banana PUBLIC ${BANANA_ROOT_DIR}/include) 6 | target_compile_features(banana PUBLIC cxx_std_17) 7 | target_compile_definitions(banana PUBLIC 8 | BANANA_VERSION_MAJOR=${BANANA_VERSION_MAJOR} 9 | BANANA_VERSION_MINOR=${BANANA_VERSION_MINOR} 10 | BANANA_VERSION_PATCH=${BANANA_VERSION_PATCH} 11 | ) 12 | 13 | if (MSVC) 14 | target_compile_options(banana PUBLIC /bigobj) 15 | endif() 16 | 17 | # === Agents === 18 | 19 | add_subdirectory(agents) 20 | -------------------------------------------------------------------------------- /source/agents/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(banana-agents) 2 | 3 | add_subdirectory(cpr) 4 | add_subdirectory(winapi) 5 | add_subdirectory(default) 6 | add_subdirectory(beast) 7 | add_subdirectory(httplib) 8 | -------------------------------------------------------------------------------- /source/agents/beast/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # boost::beast agent 2 | 3 | project(banana-beast-agent) 4 | 5 | add_library(banana-beast INTERFACE) 6 | target_sources(banana-beast INTERFACE ${PROJECT_SOURCE_DIR}/banana/agent/beast.cpp) 7 | target_include_directories(banana-beast INTERFACE ${PROJECT_SOURCE_DIR}) 8 | target_link_libraries(banana-beast INTERFACE banana) 9 | 10 | if (BANANA_ENABLE_CORO) 11 | target_compile_definitions(banana-beast INTERFACE BANANA_BEAST_ENABLE_CORO) 12 | endif() 13 | -------------------------------------------------------------------------------- /source/agents/cpr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CPR agent 2 | 3 | project(banana-cpr-agent) 4 | 5 | add_library(banana-cpr INTERFACE) 6 | target_sources(banana-cpr INTERFACE ${PROJECT_SOURCE_DIR}/banana/agent/cpr.cpp) 7 | target_include_directories(banana-cpr INTERFACE ${PROJECT_SOURCE_DIR}) 8 | target_link_libraries(banana-cpr INTERFACE banana) 9 | 10 | if(BANANA_USE_BUNDLED_CPR) 11 | target_link_libraries(banana-cpr INTERFACE cpr::cpr) 12 | endif() 13 | -------------------------------------------------------------------------------- /source/agents/cpr/banana/agent/cpr.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace banana::agent { 6 | 7 | // TODO: proxy support 8 | class basic_cpr_monadic { 9 | struct proxy_t { 10 | std::string url; // IP:port 11 | std::string cred; // log:pass 12 | }; 13 | 14 | std::string m_token; 15 | std::string m_api_path = "https://api.telegram.org"; 16 | std::optional m_proxy; 17 | 18 | public: 19 | explicit basic_cpr_monadic(std::string token); 20 | 21 | expected do_request(std::string_view method, std::string body); 22 | }; 23 | 24 | using basic_cpr = meta::unwrap_blocking; 25 | 26 | using cpr_blocking_monadic = meta::make_blocking_monadic; 27 | using cpr_blocking = meta::make_blocking; 28 | using cpr_async = meta::wrap_async; 29 | 30 | } // namespace banana::agent 31 | -------------------------------------------------------------------------------- /source/agents/default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Default agent 2 | 3 | project(banana-default-agent) 4 | 5 | add_library(banana-default INTERFACE) 6 | 7 | if (WIN32) 8 | target_link_libraries(banana-default INTERFACE banana-winapi) 9 | else() 10 | target_link_libraries(banana-default INTERFACE banana-cpr) 11 | endif() 12 | 13 | target_include_directories(banana-default INTERFACE ${PROJECT_SOURCE_DIR}) 14 | -------------------------------------------------------------------------------- /source/agents/default/banana/agent/default.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef WIN32 4 | #include 5 | namespace banana::agent { 6 | using default_blocking_monadic = winapi_blocking_monadic; 7 | using default_blocking = winapi_blocking; 8 | using default_async = winapi_async; 9 | } // namespace banana::agent 10 | #else 11 | #include 12 | namespace banana::agent { 13 | using default_blocking_monadic = cpr_blocking_monadic; 14 | using default_blocking = cpr_blocking; 15 | using default_async = cpr_async; 16 | } // namespace banana::agent 17 | #endif 18 | -------------------------------------------------------------------------------- /source/agents/httplib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # cpp-httplib agent 2 | 3 | project(banana-httplib-agent) 4 | 5 | add_library(banana-httplib INTERFACE) 6 | target_sources(banana-httplib INTERFACE ${PROJECT_SOURCE_DIR}/banana/agent/httplib.cpp) 7 | target_include_directories(banana-httplib INTERFACE ${PROJECT_SOURCE_DIR}) 8 | target_link_libraries(banana-httplib INTERFACE banana) 9 | -------------------------------------------------------------------------------- /source/agents/httplib/banana/agent/httplib.cpp: -------------------------------------------------------------------------------- 1 | #include "httplib.hpp" 2 | 3 | #include 4 | 5 | namespace banana::agent { 6 | 7 | basic_httplib_monadic::basic_httplib_monadic(std::string token) : m_client(m_api_path), m_token(std::move(token)) { 8 | } 9 | 10 | expected basic_httplib_monadic::do_request(std::string_view method, std::string body) { 11 | std::string url; 12 | url += "/bot"; 13 | url += m_token; 14 | url += "/"; 15 | url += method; 16 | 17 | auto response = m_client.Post(url, body, "application/json"); 18 | if (!response) { 19 | return error_t<>{ to_string(response.error()) }; 20 | } 21 | 22 | return expected(std::move(response.value().body)); 23 | } 24 | 25 | } // namespace banana::agent 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /source/agents/httplib/banana/agent/httplib.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace httplib { class Client; } 8 | 9 | namespace banana::agent { 10 | 11 | class basic_httplib_monadic { 12 | std::string m_token; 13 | std::string m_api_path = "https://api.telegram.org"; 14 | httplib::Client m_client; 15 | 16 | public: 17 | explicit basic_httplib_monadic(std::string token); 18 | 19 | expected do_request(std::string_view method, std::string body); 20 | }; 21 | 22 | using basic_httplib = meta::unwrap_blocking; 23 | 24 | using httplib_blocking_monadic = meta::make_blocking_monadic; 25 | using httplib_blocking = meta::make_blocking; 26 | using httplib_async = meta::wrap_async; 27 | 28 | } // namespace banana::agent 29 | -------------------------------------------------------------------------------- /source/agents/winapi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # WINAPI agent 2 | 3 | project(banana-winapi-agent) 4 | 5 | if(WIN32) 6 | add_library(banana-winapi INTERFACE) 7 | target_sources(banana-winapi INTERFACE ${PROJECT_SOURCE_DIR}/banana/agent/winapi.cpp) 8 | target_include_directories(banana-winapi INTERFACE ${PROJECT_SOURCE_DIR}) 9 | target_link_libraries(banana-winapi INTERFACE banana Wininet.lib) 10 | endif() 11 | -------------------------------------------------------------------------------- /source/agents/winapi/banana/agent/winapi.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace banana::agent { 6 | 7 | class basic_winapi_monadic { 8 | std::string m_token; 9 | std::string m_api_path = "api.telegram.org"; 10 | 11 | public: 12 | explicit basic_winapi_monadic(std::string token); 13 | 14 | expected do_request(std::string_view method, std::string body); 15 | }; 16 | 17 | using basic_winapi = meta::unwrap_blocking; 18 | 19 | using winapi_blocking_monadic = meta::make_blocking_monadic; 20 | using winapi_blocking = meta::make_blocking; 21 | using winapi_async = meta::wrap_async; 22 | 23 | } // namespace banana::agent 24 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(banana-tests) 2 | 3 | add_executable(banana-tests 4 | main.cpp 5 | test_serialization.cpp 6 | test_serialization_generated.cpp 7 | test_deserialization.cpp 8 | test_dynamic_optional.cpp 9 | ) 10 | 11 | target_link_libraries(banana-tests PRIVATE banana) 12 | target_compile_features(banana-tests PUBLIC cxx_std_17) 13 | 14 | # For CI - get rid of Debug/Release intermediate directories 15 | set_target_properties(banana-tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) 16 | 17 | if(MSVC) 18 | target_compile_options(banana-tests PRIVATE /W4 /WX) 19 | else() 20 | target_compile_options(banana-tests PRIVATE -Wall -Werror) 21 | endif() -------------------------------------------------------------------------------- /tests/main.cpp: -------------------------------------------------------------------------------- 1 | #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN 2 | 3 | #include "doctest.h" 4 | -------------------------------------------------------------------------------- /tests/test_deserialization.cpp: -------------------------------------------------------------------------------- 1 | #include "doctest.h" 2 | 3 | #include 4 | 5 | TEST_CASE("basic deserialization") { 6 | const auto result = banana::deserialize_response(R"json( 7 | { 8 | "message_id": 42, 9 | "date": 123456789, 10 | "chat": { 11 | "id": 102, 12 | "type": "private" 13 | } 14 | } 15 | )json").value(); 16 | 17 | CHECK(result.message_id == 42); 18 | CHECK(result.date == 123456789); 19 | CHECK(result.chat.id == 102); 20 | CHECK(result.chat.type == "private"); 21 | 22 | CHECK(!result.audio.has_value()); 23 | CHECK(!result.chat.title.has_value()); 24 | } 25 | 26 | TEST_CASE("variant deserialization") { 27 | const auto result = banana::deserialize_response>(R"json( 28 | [{ 29 | "update_id": 42, 30 | "removed_chat_boost": { 31 | "chat": { 32 | "id": 102, 33 | "type": "private" 34 | }, 35 | "boost_id": "42", 36 | "remove_date": 0, 37 | "source": { 38 | "source": "gift_code", 39 | "user": { 40 | "id": 102, 41 | "is_bot": false, 42 | "first_name": "Alex" 43 | } 44 | } 45 | } 46 | }] 47 | )json").value(); 48 | 49 | auto removed_chat_boost = result[0].removed_chat_boost.value(); 50 | CHECK(std::holds_alternative(removed_chat_boost.source)); 51 | } -------------------------------------------------------------------------------- /tests/test_dynamic_optional.cpp: -------------------------------------------------------------------------------- 1 | #include "doctest.h" 2 | 3 | #include 4 | 5 | TEST_CASE("dynamic_optional") { 6 | banana::dynamic_optional i = 42; 7 | CHECK(i == 42); 8 | CHECK(42 == i); 9 | CHECK(i == i); 10 | 11 | CHECK(i != std::nullopt); 12 | CHECK(std::nullopt != i); 13 | 14 | CHECK(!(i != i)); 15 | 16 | CHECK(i != 43); 17 | CHECK(43 != i); 18 | 19 | i = std::nullopt; 20 | 21 | CHECK(i != 42); 22 | CHECK(42 != i); 23 | CHECK(i == i); 24 | 25 | CHECK(i == std::nullopt); 26 | CHECK(std::nullopt == i); 27 | 28 | CHECK(!(i != i)); 29 | 30 | CHECK(i != 43); 31 | CHECK(43 != i); 32 | } -------------------------------------------------------------------------------- /tests/test_serialization.cpp: -------------------------------------------------------------------------------- 1 | #include "doctest.h" 2 | 3 | #include 4 | 5 | TEST_CASE("basic serialization") { 6 | const banana::api::send_message_args_t args = { 7 | 42, 8 | "Hello, world!" 9 | }; 10 | 11 | const auto result = banana::serialize_args(args); 12 | CHECK_EQ(result.data, R"json({"chat_id":42,"text":"Hello, world!"})json"); 13 | } -------------------------------------------------------------------------------- /tests/test_serialization_generated.cpp: -------------------------------------------------------------------------------- 1 | #include "doctest.h" 2 | #include "util.hpp" 3 | 4 | #include 5 | 6 | #include 7 | 8 | template 9 | void test_method() { 10 | using traits_t = banana::meta::api_traits; 11 | using request_t = typename traits_t::request_type; 12 | 13 | INFO("Testing serialization of ", traits_t::pretty_name, " arguments"); 14 | 15 | request_t request = {}; 16 | const auto result = banana::serialize_args(request); 17 | } 18 | 19 | TEST_CASE("generated serialization") { 20 | for_each_method([](auto method) { 21 | test_method(); 22 | }); 23 | } -------------------------------------------------------------------------------- /tests/util.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | template 8 | void for_each_method_impl(F callback, std::index_sequence) { 9 | constexpr auto min = banana::api::method_traits::first_method; 10 | 11 | (callback(std::integral_constant(static_cast(min) + I)>{}), ...); 12 | } 13 | 14 | template 15 | void for_each_method(F callback) { 16 | constexpr auto min = banana::api::method_traits::first_method; 17 | constexpr auto max = banana::api::method_traits::last_method; 18 | constexpr auto count = static_cast(max) - static_cast(min) + 1; 19 | 20 | for_each_method_impl(std::move(callback), std::make_index_sequence()); 21 | } --------------------------------------------------------------------------------