diff --git a/.github/workflows/telebot.yml b/.github/workflows/telebot.yml index d4353b8..57876c7 100644 --- a/.github/workflows/telebot.yml +++ b/.github/workflows/telebot.yml @@ -6,12 +6,12 @@ jobs: build: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v3 - name: prepare - run: sudo apt install -y pkg-config libcurl4-openssl-dev libjson-c-dev cmake binutils make - - name: cmake + run: sudo apt update && sudo apt install -y pkg-config libcurl4-openssl-dev libjson-c-dev cmake binutils make + - name: cmake run: mkdir -p build && cd build && cmake .. - name: make run: cd build && make diff --git a/.gitignore b/.gitignore index 5360e2c..480919d 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ build # CLion projects .idea + diff --git a/CMakeLists.txt b/CMakeLists.txt index 028955c..df04af4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}/bin") SET(INCLUDEDIR "${PREFIX}/include/${PROJECT_NAME}") SET(LIBDIR "${PREFIX}/lib") -SET(VERSION 4.7.1) +SET(VERSION 9.4) SET(CMAKE_MACOSX_RPATH 1) @@ -14,9 +14,13 @@ SET(SRCS src/telebot-parser.c src/telebot-core.c src/telebot.c + src/telebot-inline.c + src/telebot-forums.c + src/telebot-payments.c + src/telebot-passport.c + src/telebot-games.c ) -ADD_DEFINITIONS("-DDEBUG=0") INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) SET(DEPENDENTS "libcurl json-c") INCLUDE(FindPkgConfig) @@ -25,7 +29,16 @@ pkg_check_modules(PKGS REQUIRED ${DEPENDENTS}) FOREACH(flag ${PKGS_CFLAGS}) SET(EXTRA_LIB_CFLAGS "${EXTRA_LIB_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_LIB_CFLAGS} -Werror -Wall -Wno-unused-function -O2" ) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_LIB_CFLAGS} -Werror -Wall -Wno-unused-function" ) + +#Debug option +IF(DEBUG) + MESSAGE("Build debug version") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + ADD_DEFINITIONS("-DDEBUG") +ELSE(DEBUG) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") +ENDIF(DEBUG) # libtelebot ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) @@ -36,7 +49,7 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) # package configuration CONFIGURE_FILE(telebot.pc.in telebot.pc @ONLY) -# echobot (test) +# testbot (test) ADD_SUBDIRECTORY(test) # CMake Policy (CMP0002) @@ -50,5 +63,11 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-methods.h ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-types.h ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-core.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-stickers.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-inline.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-forums.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-payments.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-passport.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/telebot-games.h DESTINATION include/telebot/) diff --git a/Doxyconf b/Doxyconf index 0f7dafe..a5abe33 100644 --- a/Doxyconf +++ b/Doxyconf @@ -38,7 +38,7 @@ PROJECT_NAME = "Telebot" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.7.0 +PROJECT_NUMBER = 9.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = docs # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -743,7 +743,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = include +INPUT = README.md include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/README.md b/README.md index d83e1a4..c676037 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,32 @@ To build the library run following commands: ```sh cd [your repository] -mkdir -p Build && cd Build -cmake ../ +mkdir -p build && cd build +cmake .. make ``` +For debug build +```sh +mkdir -p build && cd build +cmake .. -DDEBUG=1 +make +``` + +## Testing + +Place Telegam Bot API Token in `.token` file in the root folder of the repository, and run as below +```sh +./build/test/testbot +``` +
Sample Following sample creates a simple dummy bot which echoes back the messages sent to it. -The [same example](test/echobot.c) is built as `echobot` executable under `Build/test` folder. The -executable expects and reads bot token from `.token` file on the same location. +A more comprehensive [test bot](test/testbot.c) is built as `testbot` executable under `Build/test` folder. +It supports various commands to test APIs, polls, custom keyboards, and multimedia sending. +The executable expects and reads bot token from `.token` file on the same location. ```c #include diff --git a/docs/annotated.html b/docs/annotated.html index 8569816..018d693 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,64 +57,161 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Class List
+
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Ctelebot_animationThis object represents a video file
 Ctelebot_audioThis object represents an audio file to be treated as music by the Telegram clients
 Ctelebot_bot_commandThis object represents a bot command
 Ctelebot_callback_queryThis object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present
 Ctelebot_chatThis object represents a chat
 Ctelebot_chat_memberThis object contains information about one member of a chat
 Ctelebot_chat_permissionsDescribes actions that a non-administrator user is allowed to take in a chat
 Ctelebot_chat_photoThis object represents a chat photo
 Ctelebot_contactThis object represents a phone contact
 Ctelebot_core_handlerThis object represents a core telebot handler
 Ctelebot_core_responseThis object represents a telegram bot response
 Ctelebot_diceThis object represents a dice with random value from 1 to 6
 Ctelebot_documentThis object represents a general file (as opposed to photos, voice messages and audio files)
 Ctelebot_fileThis object represents a file ready to be downloaded
 Ctelebot_force_replyUpon 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
 Ctelebot_keyboard_buttonThis object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive
 Ctelebot_keyboard_button_poll_typeThis object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed
 Ctelebot_locationThis object represents a point on the map
 Ctelebot_mask_positionThis object describes the position on faces where a mask should be placed by default
 Ctelebot_messageThis object represents a message
 Ctelebot_message_entityThis object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc
 Ctelebot_photoThis object represents one size of a photo or a file / sticker thumbnail
 Ctelebot_pollThis object contains information about a poll
 Ctelebot_poll_answerThis object represents an answer of a user in a non-anonymous poll
 Ctelebot_poll_optionThis object contains information about one answer option in a poll
 Ctelebot_reply_keyboard_markupThis object represents a custom keyboard with reply options
 Ctelebot_reply_keyboard_removeUpon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t)
 Ctelebot_response_paramtersContains information about why a request was unsuccessful
 Ctelebot_stickerThis object represents a sticker
 Ctelebot_sticker_setThis object represents a sticker set
 Ctelebot_updateThis object represents an incoming update
 Ctelebot_userThis object represents a Telegram user or bot
 Ctelebot_user_profile_photosThis object represent a user's profile pictures
 Ctelebot_venueThis object represents a venue
 Ctelebot_videoThis object represents a video file
 Ctelebot_video_noteThis object represents a video message (available in Telegram apps as of v.4.0)
 Ctelebot_voiceThis object represents a voice note
 Ctelebot_webhook_infoThi object represetns information about the current status of a webhook
 Ctelebot_affiliate_infoContains information about the affiliate that received a commission
 Ctelebot_animationThis object represents a video file
 Ctelebot_audioThis object represents an audio file to be treated as music by the Telegram clients
 Ctelebot_birthdateDescribes the birthdate of a user
 Ctelebot_bot_commandThis object represents a bot command
 Ctelebot_business_bot_rightsRepresents the rights of a business bot
 Ctelebot_business_connectionDescribes the connection of the bot with a business account
 Ctelebot_business_introContains information about the start page settings of a Telegram Business account
 Ctelebot_business_locationContains information about the location of a Telegram Business account
 Ctelebot_business_messages_deletedThis object is received when messages are deleted from a connected business account
 Ctelebot_business_opening_hoursDescribes the opening hours of a business
 Ctelebot_business_opening_hours_intervalDescribes an interval of time during which a business is open
 Ctelebot_callback_gameA placeholder, currently holds no information. Use BotFather to set up your game
 Ctelebot_callback_queryThis object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present
 Ctelebot_chatThis object represents a chat
 Ctelebot_chat_backgroundThis object represents a chat background
 Ctelebot_chat_boostThis object contains information about a chat boost
 Ctelebot_chat_boost_addedThis object represents a service message about a user boosting a chat
 Ctelebot_chat_boost_removedThis object represents a boost removed from a chat
 Ctelebot_chat_boost_sourceThis object represents the source of a chat boost
 Ctelebot_chat_boost_updatedThis object represents a boost added to a chat
 Ctelebot_chat_invite_linkThis object represents a chat invite link
 Ctelebot_chat_join_requestThis object represents a join request sent to a chat
 Ctelebot_chat_locationThi object represetns information about the current status of a webhook
 Ctelebot_chat_memberThis object contains information about one member of a chat
 Ctelebot_chat_member_updatedThis object represents changes in the status of a chat member
 Ctelebot_chat_permissionsDescribes actions that a non-administrator user is allowed to take in a chat
 Ctelebot_chat_photoThis object represents a chat photo
 Ctelebot_chat_sharedThis object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button
 Ctelebot_chosen_inline_resultRepresents a result of an inline query that was chosen by the user and sent to their chat partner
 Ctelebot_contactThis object represents a phone contact
 Ctelebot_copy_text_buttonThis object represents an inline keyboard button that copies specified text to the clipboard
 Ctelebot_diceThis object represents a dice with random value from 1 to 6
 Ctelebot_documentThis object represents a general file (as opposed to photos, voice messages and audio files)
 Ctelebot_encrypted_credentialsThis object represents credentials required to decrypt the data
 Ctelebot_encrypted_passport_elementThis object represents one element of the Telegram Passport data
 Ctelebot_external_reply_infoThis object contains information about the message that is being replied to, which may come from another chat or forum topic
 Ctelebot_fileThis object represents a file ready to be downloaded
 Ctelebot_force_replyUpon 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
 Ctelebot_forum_topicThis object represents a forum topic
 Ctelebot_forum_topic_closedThis object represents a service message about a forum topic closed in the chat
 Ctelebot_forum_topic_createdThis object represents a service message about a new forum topic created in the chat
 Ctelebot_forum_topic_editedThis object represents a service message about a forum topic edited in the chat
 Ctelebot_forum_topic_reopenedThis object represents a service message about a forum topic reopened in the chat
 Ctelebot_gameThis object represents a game
 Ctelebot_game_high_scoreThis object represents a game high score row
 Ctelebot_general_forum_topic_hiddenThis object represents a service message about a general forum topic hidden in the chat
 Ctelebot_general_forum_topic_unhiddenThis object represents a service message about a general forum topic unhidden in the chat
 Ctelebot_giftThis object represents a gift that can be sent by the bot
 Ctelebot_gift_infoDescribes a regular gift that was sent or received
 Ctelebot_giftsThis object represent a list of gifts
 Ctelebot_giveawayThis object represents a message about a scheduled giveaway
 Ctelebot_giveaway_completedThis object represents a service message about the completion of a giveaway without public winners
 Ctelebot_giveaway_createdThis object represents a service message about the creation of a scheduled giveaway
 Ctelebot_giveaway_winnersThis object represents a message about the completion of a giveaway with public winners
 Ctelebot_inline_keyboard_buttonThis object represents one button of an inline keyboard. You must use exactly one of the optional fields
 Ctelebot_inline_keyboard_markupThis object represents an inline keyboard that appears right next to the message it belongs to
 Ctelebot_inline_queryThis object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results
 Ctelebot_invoiceThis object contains basic information about an invoice
 Ctelebot_keyboard_buttonThis object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive
 Ctelebot_keyboard_button_poll_typeThis object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed
 Ctelebot_keyboard_button_request_chatThis object defines the criteria used to request a suitable chat
 Ctelebot_keyboard_button_request_usersThis object defines the criteria used to request suitable users
 Ctelebot_link_preview_optionsDescribes the options used for link preview generation
 Ctelebot_locationThis object represents a point on the map
 Ctelebot_login_urlThis object represents a parameter of the inline keyboard button used to automatically authorize a user
 Ctelebot_mask_positionThis object describes the position on faces where a mask should be placed by default
 Ctelebot_messageThis object represents a message
 Ctelebot_message_auto_delete_timer_changedThis object represents a service message about a change in auto-delete timer settings
 Ctelebot_message_entityThis object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc
 Ctelebot_message_originThis object describes the origin of a message
 Ctelebot_message_reaction_count_updatedThis object represents reaction changes on a message with anonymous reactions
 Ctelebot_message_reaction_updatedThis object represents a change of a reaction on a message performed by a user
 Ctelebot_order_infoThis object represents information about an order
 Ctelebot_paid_mediaThis object describes paid media
 Ctelebot_paid_media_infoDescribes the paid media added to a message
 Ctelebot_paid_media_purchasedThis object contains information about a paid media purchase
 Ctelebot_passport_dataContains information about Telegram Passport data which was shared with the bot by the user
 Ctelebot_passport_element_errorThis object represents an error in the Telegram Passport element
 Ctelebot_passport_fileThis object represents an internal identifier of a user in Telegram Passport
 Ctelebot_photoThis object represents one size of a photo or a file / sticker thumbnail
 Ctelebot_pollThis object contains information about a poll
 Ctelebot_poll_answerThis object represents an answer of a user in a non-anonymous poll
 Ctelebot_poll_optionThis object contains information about one answer option in a poll
 Ctelebot_pre_checkout_queryThis object contains information about an incoming pre-checkout query
 Ctelebot_prepared_inline_messageThis object represents a prepared inline message
 Ctelebot_proximity_alert_triggeredThis object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location
 Ctelebot_reaction_countThis object represents a reaction count
 Ctelebot_reaction_typeThis object represents a reaction type
 Ctelebot_refunded_paymentThis object represents a service message about a refunded payment
 Ctelebot_reply_keyboard_markupThis object represents a custom keyboard with reply options
 Ctelebot_reply_keyboard_removeUpon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t)
 Ctelebot_response_paramtersContains information about why a request was unsuccessful
 Ctelebot_revenue_withdrawal_stateThis object describes the state of a revenue withdrawal operation
 Ctelebot_sent_web_app_messageThis object represents a message sent via a Web App
 Ctelebot_shared_userThis object contains information about a user that was shared with the bot
 Ctelebot_shipping_addressThis object represents a shipping address
 Ctelebot_shipping_queryThis object contains information about an incoming shipping query
 Ctelebot_star_amountDescribes an amount of Telegram Stars
 Ctelebot_star_transactionDescribes a Telegram Star transaction
 Ctelebot_star_transactionsContains a list of Telegram Star transactions
 Ctelebot_stickerThis object represents a sticker
 Ctelebot_sticker_setThis object represents a sticker set
 Ctelebot_storyThis object contains information about a story
 Ctelebot_successful_paymentThis object contains basic information about a successful payment
 Ctelebot_switch_inline_query_chosen_chatThis object represents an inline button that switches the current user to inline mode in a chosen chat
 Ctelebot_text_quoteThis object contains information about the quoted part of a message that is replied to by the given message
 Ctelebot_transaction_partnerThis object describes the source of a transaction
 Ctelebot_unique_giftThis object describes a unique gift that was upgraded from a regular gift
 Ctelebot_unique_gift_infoDescribes a unique gift that was sent or received
 Ctelebot_updateThis object represents an incoming update
 Ctelebot_userThis object represents a Telegram user or bot
 Ctelebot_user_chat_boostsThis object represents a list of user chat boosts
 Ctelebot_user_giftThis object represents a gift received by a user
 Ctelebot_user_giftsThis object represents a list of gifts received by a user
 Ctelebot_user_profile_audiosThis object represents a list of user profile audios
 Ctelebot_user_profile_photosThis object represent a user's profile pictures
 Ctelebot_user_sharedThis object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button
 Ctelebot_users_sharedThis object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button
 Ctelebot_venueThis object represents a venue
 Ctelebot_videoThis object represents a video file
 Ctelebot_video_chat_endedThis object represents a service message about a video chat ended in the chat
 Ctelebot_video_chat_participants_invitedThis object represents a service message about new members invited to a video chat
 Ctelebot_video_chat_scheduledThis object represents a service message about a video chat scheduled in the chat
 Ctelebot_video_chat_startedThis object represents a service message about a video chat started in the chat
 Ctelebot_video_noteThis object represents a video message (available in Telegram apps as of v.4.0)
 Ctelebot_voiceThis object represents a voice note
 Ctelebot_web_app_dataThis object represents data sent by a Web App to the bot
 Ctelebot_web_app_infoDescribes a Web App
 Ctelebot_webhook_infoThi object represetns information about the current status of a webhook
 Ctelebot_write_access_allowedThis object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link
diff --git a/docs/bc_sd.png b/docs/bc_sd.png new file mode 100644 index 0000000..31ca888 Binary files /dev/null and b/docs/bc_sd.png differ diff --git a/docs/bdwn.png b/docs/bdwn.png deleted file mode 100644 index 940a0b9..0000000 Binary files a/docs/bdwn.png and /dev/null differ diff --git a/docs/classes.html b/docs/classes.html index 4f42ce3..3452936 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Index @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,36 +57,32 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Class Index
+
Class Index
- - - - - - - - - - - -
  t  
-
telebot_chat_permissions   telebot_force_reply   telebot_poll   telebot_update   
telebot_chat_photo   telebot_keyboard_button   telebot_poll_answer   telebot_user   
telebot_animation   telebot_contact   telebot_keyboard_button_poll_type   telebot_poll_option   telebot_user_profile_photos   
telebot_audio   telebot_core_handler   telebot_location   telebot_reply_keyboard_markup   telebot_venue   
telebot_bot_command   telebot_core_response   telebot_mask_position   telebot_reply_keyboard_remove   telebot_video   
telebot_callback_query   telebot_dice   telebot_message   telebot_response_paramters   telebot_video_note   
telebot_chat   telebot_document   telebot_message_entity   telebot_sticker   telebot_voice   
telebot_chat_member   telebot_file   telebot_photo   telebot_sticker_set   telebot_webhook_info   
- + +
+
+
T
+
telebot_affiliate_info
telebot_animation
telebot_audio
telebot_birthdate
telebot_bot_command
telebot_business_bot_rights
telebot_business_connection
telebot_business_intro
telebot_business_location
telebot_business_messages_deleted
telebot_business_opening_hours
telebot_business_opening_hours_interval
telebot_callback_game
telebot_callback_query
telebot_chat
telebot_chat_background
telebot_chat_boost
telebot_chat_boost_added
telebot_chat_boost_removed
telebot_chat_boost_source
telebot_chat_boost_updated
telebot_chat_invite_link
telebot_chat_join_request
telebot_chat_location
telebot_chat_member
telebot_chat_member_updated
telebot_chat_permissions
telebot_chat_photo
telebot_chat_shared
telebot_chosen_inline_result
telebot_contact
telebot_copy_text_button
telebot_dice
telebot_document
telebot_encrypted_credentials
telebot_encrypted_passport_element
telebot_external_reply_info
telebot_file
telebot_force_reply
telebot_forum_topic
telebot_forum_topic_closed
telebot_forum_topic_created
telebot_forum_topic_edited
telebot_forum_topic_reopened
telebot_game
telebot_game_high_score
telebot_general_forum_topic_hidden
telebot_general_forum_topic_unhidden
telebot_gift
telebot_gift_info
telebot_gifts
telebot_giveaway
telebot_giveaway_completed
telebot_giveaway_created
telebot_giveaway_winners
telebot_inline_keyboard_button
telebot_inline_keyboard_markup
telebot_inline_query
telebot_invoice
telebot_keyboard_button
telebot_keyboard_button_poll_type
telebot_keyboard_button_request_chat
telebot_keyboard_button_request_users
telebot_link_preview_options
telebot_location
telebot_login_url
telebot_mask_position
telebot_message
telebot_message_auto_delete_timer_changed
telebot_message_entity
telebot_message_origin
telebot_message_reaction_count_updated
telebot_message_reaction_updated
telebot_order_info
telebot_paid_media
telebot_paid_media_info
telebot_paid_media_purchased
telebot_passport_data
telebot_passport_element_error
telebot_passport_file
telebot_photo
telebot_poll
telebot_poll_answer
telebot_poll_option
telebot_pre_checkout_query
telebot_prepared_inline_message
telebot_proximity_alert_triggered
telebot_reaction_count
telebot_reaction_type
telebot_refunded_payment
telebot_reply_keyboard_markup
telebot_reply_keyboard_remove
telebot_response_paramters
telebot_revenue_withdrawal_state
telebot_sent_web_app_message
telebot_shared_user
telebot_shipping_address
telebot_shipping_query
telebot_star_amount
telebot_star_transaction
telebot_star_transactions
telebot_sticker
telebot_sticker_set
telebot_story
telebot_successful_payment
telebot_switch_inline_query_chosen_chat
telebot_text_quote
telebot_transaction_partner
telebot_unique_gift
telebot_unique_gift_info
telebot_update
telebot_user
telebot_user_chat_boosts
telebot_user_gift
telebot_user_gifts
telebot_user_profile_audios
telebot_user_profile_photos
telebot_user_shared
telebot_users_shared
telebot_venue
telebot_video
telebot_video_chat_ended
telebot_video_chat_participants_invited
telebot_video_chat_scheduled
telebot_video_chat_started
telebot_video_note
telebot_voice
telebot_web_app_data
telebot_web_app_info
telebot_webhook_info
telebot_write_access_allowed
+
diff --git a/docs/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/dir_d44c64559bbebec7f509842c48db8b23.html index a5c6d30..2790c50 100644 --- a/docs/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/docs/dir_d44c64559bbebec7f509842c48db8b23.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include Directory Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
include Directory Reference
+
include Directory Reference
- - + - + + + + + + + + + + + + + - + + + + + + + - + + + +

+

Files

file  telebot-common.h [code]
 telebot-common.h
 This file contains telegram bot common defintions.
 
file  telebot-methods.h [code]
 telebot-core.h
 This file contains core API for the telegram bot interface.
 
 telebot-forums.h
 This file contains forums feature of telegram bot.
 
 telebot-games.h
 This file contains games feature of telegram bot.
 
 telebot-inline.h
 This file contains inline mode feature of telegram bot.
 
 telebot-methods.h
 This file contains methods used to create telegram bot.
 
file  telebot-stickers.h [code]
 telebot-passport.h
 This file contains Telegram Passport feature of telegram bot.
 
 telebot-payments.h
 This file contains payments feature of telegram bot.
 
 telebot-stickers.h
 This file contains stickers feature of telegram bot.
 
file  telebot-types.h [code]
 telebot-types.h
 This file contains types used to create telegram bot.
 
 telebot.h
 This file includes all the header files of the telegram bot library.
 
diff --git a/docs/doc.png b/docs/doc.png deleted file mode 100644 index 17edabf..0000000 Binary files a/docs/doc.png and /dev/null differ diff --git a/docs/doc.svg b/docs/doc.svg new file mode 100644 index 0000000..0b928a5 --- /dev/null +++ b/docs/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/docd.svg b/docs/docd.svg new file mode 100644 index 0000000..ac18b27 --- /dev/null +++ b/docs/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/doxygen.css b/docs/doxygen.css index 4f1ab91..009a9b5 100644 --- a/docs/doxygen.css +++ b/docs/doxygen.css @@ -1,29 +1,378 @@ -/* The standard CSS for doxygen 1.8.13 */ - -body, table, div, p, dl { - font: 400 14px/22px Roboto,sans-serif; +/* The standard CSS for doxygen 1.9.8*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; +--fold-line-color: #808080; +--fold-minus-image: url('minus.svg'); +--fold-plus-image: url('plus.svg'); +--fold-minus-image-relpath: url('../../minus.svg'); +--fold-plus-image-relpath: url('../../plus.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; +--fold-minus-image: url('minusd.svg'); +--fold-plus-image: url('plusd.svg'); +--fold-minus-image-relpath: url('../../minusd.svg'); +--fold-plus-image-relpath: url('../../plusd.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); } -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; } /* @group Heading Levels */ -h1.groupheader { - font-size: 150%; -} - .title { - font: 400 14px/28px Roboto,sans-serif; + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; font-size: 150%; font-weight: bold; margin: 10px 2px; } +h1.groupheader { + font-size: 150%; +} + h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); font-size: 150%; font-weight: normal; margin-top: 1.75em; @@ -46,24 +395,22 @@ h1, h2, h3, h4, h5, h6 { } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; + text-shadow: 0 0 15px var(--glow-color); } dt { font-weight: bold; } -div.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; -} - p.startli, p.startdd { margin-top: 2px; } +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + p.starttd { margin-top: 0px; } @@ -80,6 +427,15 @@ p.endtd { margin-bottom: 2px; } +p.interli { +} + +p.interdd { +} + +p.intertd { +} + /* @end */ caption { @@ -87,59 +443,120 @@ caption { } span.legend { - font-size: 70%; - text-align: center; + font-size: 70%; + text-align: center; } h3.version { - font-size: 90%; - text-align: center; + font-size: 90%; + text-align: center; } -div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; } -div.qindex, div.navpath { +td.navtabHL a, td.navtabHL a:visited { + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; width: 100%; line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); } -div.navtab { - margin-right: 15px; +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; } -/* @group Link Styling */ +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} -a { - color: #3D578C; - font-weight: normal; +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ text-decoration: none; } -.contents a:visited { - color: #4665A2; +.classindex dl { + padding: 25px; + column-count:1 } -a:hover { - text-decoration: underline; +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; } -a.qindex { - font-weight: bold; +.classindex dl.even { + background-color: var(--index-even-item-bg-color); } -a.qindexHL { - font-weight: bold; - background-color: #9CAFD4; - color: #ffffff; - border: 1px double #869DCA; +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); } -.contents a.qindexHL:visited { - color: #ffffff; +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +a:hover { + text-decoration: underline; } a.el { @@ -150,12 +567,39 @@ a.elRef { } a.code, a.code:visited, a.line, a.line:visited { - color: #4665A2; + color: var(--code-link-color); } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { - color: #4665A2; -} + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } /* @end */ @@ -163,31 +607,62 @@ dl.el { margin-left: -1cm; } +ul { + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; - font-family: monospace, fixed; + font-family: var(--font-family-monospace); font-size: 105%; } div.fragment { - padding: 0px; - margin: 4px 8px 4px 2px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); } div.line { - font-family: monospace, fixed; + font-family: var(--font-family-monospace); font-size: 13px; min-height: 13px; - line-height: 1.0; + line-height: 1.2; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ @@ -216,24 +691,40 @@ div.line:after { } div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); } +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} span.lineno { padding-right: 4px; + margin-right: 9px; text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); white-space: pre; } -span.lineno a { - background-color: #D8D8D8; +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); } span.lineno a:hover { - background-color: #C8C8C8; + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); } .lineno { @@ -245,24 +736,6 @@ span.lineno a:hover { user-select: none; } -div.ah, span.ah { - background-color: black; - font-weight: bold; - color: #ffffff; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); -} - div.classindex ul { list-style: none; padding-left: 0; @@ -284,8 +757,7 @@ div.groupText { } body { - background-color: white; - color: black; + color: var(--page-foreground-color); margin: 0; } @@ -295,36 +767,22 @@ div.contents { margin-right: 8px; } -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; +p.formulaDsp { + text-align: center; } -tr.memlist { - background-color: #EEF1F7; +img.dark-mode-visible { + display: none; } - -p.formulaDsp { - text-align: center; +img.light-mode-visible { + display: none; } img.formulaDsp { } -img.formulaInl { +img.formulaInl, img.inline { vertical-align: middle; } @@ -347,82 +805,74 @@ address.footer { img.footer { border: 0px; vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; } /* @group Code Colorization */ span.keyword { - color: #008000 + color: var(--code-keyword-color); } span.keywordtype { - color: #604020 + color: var(--code-type-keyword-color); } span.keywordflow { - color: #e08000 + color: var(--code-flow-keyword-color); } span.comment { - color: #800000 + color: var(--code-comment-color); } span.preprocessor { - color: #806020 + color: var(--code-preprocessor-color); } span.stringliteral { - color: #002080 + color: var(--code-string-literal-color); } span.charliteral { - color: #008080 + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); } span.vhdldigit { - color: #ff00ff + color: var(--code-vhdl-digit-color); } span.vhdlchar { - color: #000000 + color: var(--code-vhdl-char-color); } span.vhdlkeyword { - color: #700070 + color: var(--code-vhdl-keyword-color); } span.vhdllogic { - color: #ff0000 + color: var(--code-vhdl-logic-color); } blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - td.tiny { font-size: 75%; } @@ -430,18 +880,19 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid var(--table-cell-border-color); } th.dirtab { - background: #EBEFF6; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid var(--separator-color); } hr.footer { @@ -469,14 +920,14 @@ table.memberdecls { } .memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: var(--memdecl-background-color); border: none; margin: 4px; padding: 1px 0 0 8px; @@ -484,11 +935,11 @@ table.memberdecls { .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; - color: #555; + color: var(--memdecl-foreground-color); } .memSeparator { - border-bottom: 1px solid #DEE4F0; + border-bottom: 1px solid var(--memdecl-separator-color); line-height: 1px; margin: 0px; padding: 0px; @@ -498,12 +949,12 @@ table.memberdecls { white-space: nowrap; } -.memItemRight { +.memItemRight, .memTemplItemRight { width: 100%; } .memTemplParams { - color: #4665A2; + color: var(--memdecl-template-color); white-space: nowrap; font-size: 80%; } @@ -516,15 +967,15 @@ table.memberdecls { .memtitle { padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); border-top-right-radius: 4px; border-top-left-radius: 4px; margin-bottom: -1px; - background-image: url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat: repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); line-height: 1.25; font-weight: 300; float:left; @@ -539,20 +990,11 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: var(--memdef-template-color); font-weight: normal; margin-left: 9px; } -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - .mempage { width: 100%; } @@ -571,7 +1013,7 @@ table.memberdecls { } .memitem.glow { - box-shadow: 0 0 15px cyan; + box-shadow: 0 0 15px var(--glow-color); } .memname { @@ -584,41 +1026,32 @@ table.memberdecls { } .memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 0px 6px 0px; - color: #253555; + color: var(--memdef-proto-text-color); font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; - /* opera specific markup */ + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - } .overload { - font-family: "courier new",courier,monospace; + font-family: var(--font-family-monospace); font-size: 65%; } .memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); padding: 6px 10px 2px 10px; - background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; - background-color: #FFFFFF; + background-color: var(--memdef-doc-background-color); /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; @@ -651,7 +1084,7 @@ dl.reflist dd { } .paramname { - color: #602020; + color: var(--memdef-param-name-color); white-space: nowrap; } .paramname em { @@ -664,20 +1097,20 @@ dl.reflist dd { .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; -} +} -.params .paramname, .retval .paramname { +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { font-weight: bold; vertical-align: top; } - -.params .paramtype { + +.params .paramtype, .tparams .paramtype { font-style: italic; vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); vertical-align: top; } @@ -701,13 +1134,13 @@ span.mlabels { } span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); text-shadow: none; - color: white; + color: var(--label-foreground-color); margin-right: 4px; padding: 2px 3px; border-radius: 3px; @@ -724,8 +1157,8 @@ span.mlabel { div.directory { margin: 10px 0px; - border-top: 1px solid #9CAFD4; - border-bottom: 1px solid #9CAFD4; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); width: 100%; } @@ -761,9 +1194,14 @@ div.directory { border-left: 1px solid rgba(0,0,0,0.05); } +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + .directory tr.even { padding-left: 6px; - background-color: #F7F8FB; + background-color: var(--index-even-item-bg-color); } .directory img { @@ -781,11 +1219,11 @@ div.directory { cursor: pointer; padding-left: 2px; padding-right: 2px; - color: #3D578C; + color: var(--page-link-color); } .arrow { - color: #9CAFD4; + color: var(--nav-arrow-color); -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; @@ -799,14 +1237,15 @@ div.directory { } .icon { - font-family: Arial, Helvetica; + font-family: var(--font-family-icon); + line-height: normal; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; - background-color: #728DC1; - color: white; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); text-align: center; border-radius: 4px; margin-left: 2px; @@ -823,8 +1262,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderopen.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-open-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -834,8 +1272,7 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('folderclosed.png'); - background-position: 0px -4px; + background-image:var(--icon-folder-closed-image); background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -845,17 +1282,13 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:url('doc.png'); + background-image:var(--icon-doc-image); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } -table.directory { - font: 400 14px Roboto,sans-serif; -} - /* @end */ div.dynheader { @@ -870,7 +1303,7 @@ div.dynheader { address { font-style: normal; - color: #2A3D61; + color: var(--footer-foreground-color); } table.doxtable caption { @@ -884,28 +1317,23 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { - /*width: 100%;*/ margin-bottom: 10px; - border: 1px solid #A8B8D9; + border: 1px solid var(--memdef-border-color); border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } @@ -915,8 +1343,8 @@ table.fieldtable { .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); vertical-align: top; } @@ -925,14 +1353,13 @@ table.fieldtable { } .fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - /*width: 100%;*/ + border-bottom: 1px solid var(--memdef-border-color); } .fieldtable td.fielddoc p:first-child { margin-top: 0px; -} - +} + .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } @@ -942,22 +1369,18 @@ table.fieldtable { } .fieldtable th { - background-image:url('nav_f.png'); + background-image: var(--memdef-title-gradient-image); background-repeat:repeat-x; - background-color: #E2E8F2; + background-color: var(--memdef-title-background-color); font-size: 90%; - color: #253555; + color: var(--memdef-proto-text-color); padding-bottom: 4px; padding-top: 5px; text-align:left; font-weight: 400; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; + border-bottom: 1px solid var(--memdef-border-color); } @@ -965,7 +1388,7 @@ table.fieldtable { top: 0px; left: 10px; height: 36px; - background-image: url('tab_b.png'); + background-image: var(--nav-gradient-image); z-index: 101; overflow: hidden; font-size: 13px; @@ -974,13 +1397,13 @@ table.fieldtable { .navpath ul { font-size: 11px; - background-image:url('tab_b.png'); + background-image: var(--nav-gradient-image); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); overflow:hidden; margin:0px; padding:0px; @@ -992,10 +1415,10 @@ table.fieldtable { float:left; padding-left:10px; padding-right:15px; - background-image:url('bc_s.png'); + background-image:var(--nav-breadcrumb-image); background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--nav-foreground-color); } .navpath li.navelem a @@ -1004,15 +1427,16 @@ table.fieldtable { display:block; text-decoration: none; outline: none; - color: #283A5D; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; } .navpath li.navelem a:hover { - color:#6884BD; + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); } .navpath li.footer @@ -1024,7 +1448,7 @@ table.fieldtable { background-image:none; background-repeat:no-repeat; background-position:right; - color:#364D7C; + color: var(--footer-foreground-color); font-size: 8pt; } @@ -1036,7 +1460,7 @@ div.summary padding-right: 5px; width: 50%; text-align: right; -} +} div.summary a { @@ -1051,7 +1475,7 @@ table.classindex margin-right: 3%; width: 94%; border: 0; - border-spacing: 0; + border-spacing: 0; padding: 0; } @@ -1069,11 +1493,11 @@ div.ingroups a div.header { - background-image:url('nav_h.png'); + background-image: var(--header-gradient-image); background-repeat:repeat-x; - background-color: #F9FAFC; + background-color: var(--header-background-color); margin: 0px; - border-bottom: 1px solid #C4CFE5; + border-bottom: 1px solid var(--header-separator-color); } div.headertitle @@ -1081,72 +1505,68 @@ div.headertitle padding: 5px 5px 5px 10px; } -dl -{ - padding: 0 0 0 10px; +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; } -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ -dl.section -{ +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { margin-left: 0px; padding-left: 0px; } -dl.note -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #D0C000; +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; } -dl.warning, dl.attention -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #FF0000; +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; } -dl.pre, dl.post, dl.invariant -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00D000; +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; } -dl.deprecated -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #505050; +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; } -dl.todo -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #00C0E0; +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; } -dl.test -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #3030E0; +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; } -dl.bug -{ - margin-left:-7px; - padding-left: 3px; - border-left:4px solid; - border-color: #C08050; +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; } dl.section dd { @@ -1154,6 +1574,11 @@ dl.section dd { } +#projectrow +{ + height: 56px; +} + #projectlogo { text-align: center; @@ -1169,25 +1594,29 @@ dl.section dd { #projectalign { vertical-align: middle; + padding-left: 0.5em; } #projectname { - font: 300% Tahoma, Arial,sans-serif; + font-size: 200%; + font-family: var(--font-family-title); margin: 0px; padding: 2px 0px; } - + #projectbrief { - font: 120% Tahoma, Arial,sans-serif; + font-size: 90%; + font-family: var(--font-family-title); margin: 0px; padding: 0px; } #projectnumber { - font: 50% Tahoma, Arial,sans-serif; + font-size: 50%; + font-family: 50% var(--font-family-title); margin: 0px; padding: 0px; } @@ -1197,7 +1626,8 @@ dl.section dd { padding: 0px; margin: 0px; width: 100%; - border-bottom: 1px solid #5373B4; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); } .image @@ -1230,32 +1660,29 @@ dl.section dd { font-weight: bold; } -div.zoom -{ - border: 1px solid #90A5CE; -} - dl.citelist { margin-bottom:50px; } dl.citelist dt { - color:#334975; + color:var(--citation-label-color); float:left; font-weight:bold; margin-right:10px; padding:5px; + text-align:right; + width:52px; } dl.citelist dd { - margin:2px 0; + margin:2px 0 2px 72px; padding:5px 0; } div.toc { padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); border-radius: 7px 7px 7px 7px; float: right; height: auto; @@ -1264,16 +1691,16 @@ div.toc { } div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); margin-top: 5px; padding-left: 10px; padding-top: 2px; } div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); border-bottom: 0 none; margin: 0; } @@ -1282,7 +1709,7 @@ div.toc ul { list-style: none outside none; border: medium none; padding: 0px; -} +} div.toc li.level1 { margin-left: 0px; @@ -1293,16 +1720,26 @@ div.toc li.level2 { } div.toc li.level3 { - margin-left: 30px; + margin-left: 15px; } div.toc li.level4 { - margin-left: 45px; + margin-left: 15px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; } .inherit_header { font-weight: bold; - color: gray; + color: var(--inherit-header-color); cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; @@ -1334,11 +1771,12 @@ tr.heading h2 { #powerTip { cursor: default; - white-space: nowrap; - background-color: white; - border: 1px solid gray; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); border-radius: 4px 4px 4px 4px; - box-shadow: 1px 1px 7px gray; + box-shadow: var(--tooltip-shadow); display: none; font-size: smaller; max-width: 80%; @@ -1349,7 +1787,7 @@ tr.heading h2 { } #powerTip div.ttdoc { - color: grey; + color: var(--tooltip-doc-color); font-style: italic; } @@ -1357,18 +1795,24 @@ tr.heading h2 { font-weight: bold; } +#powerTip a { + color: var(--tooltip-link-color); +} + #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { - color: #006318; + color: var(--tooltip-declaration-color); } #powerTip div { margin: 0px; padding: 0px; - font: 12px/16px Roboto,sans-serif; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; } #powerTip:before, #powerTip:after { @@ -1413,12 +1857,12 @@ tr.heading h2 { } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: #ffffff; + border-top-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } -#powerTip.n:before { - border-top-color: #808080; +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1441,13 +1885,13 @@ tr.heading h2 { } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: #ffffff; + border-bottom-color: var(--tooltip-background-color); border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { - border-bottom-color: #808080; + border-bottom-color: var(--tooltip-border-color); border-width: 11px; margin: 0px -11px; } @@ -1468,13 +1912,13 @@ tr.heading h2 { left: 100%; } #powerTip.e:after { - border-left-color: #ffffff; + border-left-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { - border-left-color: #808080; + border-left-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1484,13 +1928,13 @@ tr.heading h2 { right: 100%; } #powerTip.w:after { - border-right-color: #ffffff; + border-right-color: var(--tooltip-border-color); border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { - border-right-color: #808080; + border-right-color: var(--tooltip-border-color); border-width: 11px; top: 50%; margin-top: -11px; @@ -1517,7 +1961,6 @@ tr.heading h2 { /* @group Markdown */ -/* table.markdownTable { border-collapse:collapse; margin-top: 4px; @@ -1525,72 +1968,78 @@ table.markdownTable { } table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; + border: 1px solid var(--table-cell-border-color); padding: 3px 7px 2px; } -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; +table.markdownTable tr { } -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); font-size: 110%; padding-bottom: 4px; padding-top: 5px; } -th.markdownTableHeadLeft { +th.markdownTableHeadLeft, td.markdownTableBodyLeft { text-align: left } -th.markdownTableHeadRight { +th.markdownTableHeadRight, td.markdownTableBodyRight { text-align: right } -th.markdownTableHeadCenter { +th.markdownTableHeadCenter, td.markdownTableBodyCenter { text-align: center } -*/ -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; +tt, code, kbd, samp +{ + display: inline-block; } +/* @end */ -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; +u { + text-decoration: underline; } -table.markdownTable tr { +details>summary { + list-style-type: none; } -th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; +details > summary::-webkit-details-marker { + display: none; } -th.markdownTableHeadLeft, td.markdownTableBodyLeft { - text-align: left +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; } -th.markdownTableHeadRight, td.markdownTableBodyRight { - text-align: right +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; } -th.markdownTableHeadCenter, td.markdownTableBodyCenter { - text-align: center +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); } +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} -/* @end */ diff --git a/docs/doxygen.png b/docs/doxygen.png deleted file mode 100644 index 3ff17d8..0000000 Binary files a/docs/doxygen.png and /dev/null differ diff --git a/docs/doxygen.svg b/docs/doxygen.svg new file mode 100644 index 0000000..79a7635 --- /dev/null +++ b/docs/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/dynsections.js b/docs/dynsections.js index 85e1836..b73c828 100644 --- a/docs/dynsections.js +++ b/docs/dynsections.js @@ -1,3 +1,27 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ function toggleVisibility(linkObj) { var base = $(linkObj).attr('id'); @@ -15,7 +39,7 @@ function toggleVisibility(linkObj) summary.hide(); $(linkObj).removeClass('closed').addClass('opened'); $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } + } return false; } @@ -23,6 +47,8 @@ function updateStripes() { $('table.directory tr'). removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); } function toggleLevel(level) @@ -95,3 +121,72 @@ function toggleInherit(id) } } +var opened=true; +// in case HTML_COLORSTYLE is LIGHT or DARK the vars will be replaced, so we write them out explicitly and use double quotes +var plusImg = [ "var(--fold-plus-image)", "var(--fold-plus-image-relpath)" ]; +var minusImg = [ "var(--fold-minus-image)", "var(--fold-minus-image-relpath)" ]; + +// toggle all folding blocks +function codefold_toggle_all(relPath) { + if (opened) { + $('#fold_all').css('background-image',plusImg[relPath]); + $('div[id^=foldopen]').hide(); + $('div[id^=foldclosed]').show(); + } else { + $('#fold_all').css('background-image',minusImg[relPath]); + $('div[id^=foldopen]').show(); + $('div[id^=foldclosed]').hide(); + } + opened=!opened; +} + +// toggle single folding block +function codefold_toggle(id) { + $('#foldopen'+id).toggle(); + $('#foldclosed'+id).toggle(); +} +function init_codefold(relPath) { + $('span[class=lineno]').css( + {'padding-right':'4px', + 'margin-right':'2px', + 'display':'inline-block', + 'width':'54px', + 'background':'linear-gradient(var(--fold-line-color),var(--fold-line-color)) no-repeat 46px/2px 100%' + }); + // add global toggle to first line + $('span[class=lineno]:first').append(''); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + var id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + var start = $(this).attr('data-start'); + var end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + var line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); +} + +/* @license-end */ diff --git a/docs/files.html b/docs/files.html index 579c266..0959c88 100644 --- a/docs/files.html +++ b/docs/files.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,33 +57,42 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
File List
+
File List
Here is a list of all documented files with brief descriptions:
[detail level 12]
- - - - - - + + + + + + + + + + +
  include
 telebot-common.hThis file contains telegram bot common defintions
 telebot-core.h
 telebot-methods.hThis file contains methods used to create telegram bot
 telebot-stickers.hThis file contains stickers feature of telegram bot
 telebot-types.hThis file contains types used to create telegram bot
 telebot.h
 telebot-common.hThis file contains telegram bot common defintions
 telebot-core.hThis file contains core API for the telegram bot interface
 telebot-forums.hThis file contains forums feature of telegram bot
 telebot-games.hThis file contains games feature of telegram bot
 telebot-inline.hThis file contains inline mode feature of telegram bot
 telebot-methods.hThis file contains methods used to create telegram bot
 telebot-passport.hThis file contains Telegram Passport feature of telegram bot
 telebot-payments.hThis file contains payments feature of telegram bot
 telebot-stickers.hThis file contains stickers feature of telegram bot
 telebot-types.hThis file contains types used to create telegram bot
 telebot.hThis file includes all the header files of the telegram bot library
diff --git a/docs/folderclosed.png b/docs/folderclosed.png deleted file mode 100644 index bb8ab35..0000000 Binary files a/docs/folderclosed.png and /dev/null differ diff --git a/docs/folderclosed.svg b/docs/folderclosed.svg new file mode 100644 index 0000000..b04bed2 --- /dev/null +++ b/docs/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/docs/folderclosedd.svg b/docs/folderclosedd.svg new file mode 100644 index 0000000..52f0166 --- /dev/null +++ b/docs/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/docs/folderopen.png b/docs/folderopen.png deleted file mode 100644 index d6c7f67..0000000 Binary files a/docs/folderopen.png and /dev/null differ diff --git a/docs/folderopen.svg b/docs/folderopen.svg new file mode 100644 index 0000000..f6896dd --- /dev/null +++ b/docs/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/docs/folderopend.svg b/docs/folderopend.svg new file mode 100644 index 0000000..2d1f06e --- /dev/null +++ b/docs/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docs/functions.html b/docs/functions.html index 6e456f8..defd86d 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,43 +57,50 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- a -

diff --git a/docs/functions_b.html b/docs/functions_b.html index ad5c0c6..ff6b916 100644 --- a/docs/functions_b.html +++ b/docs/functions_b.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,28 +57,46 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- b -

diff --git a/docs/functions_c.html b/docs/functions_c.html index 177f806..afd8737 100644 --- a/docs/functions_c.html +++ b/docs/functions_c.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,123 +57,91 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- c -

diff --git a/docs/functions_d.html b/docs/functions_d.html index 59d2420..521889a 100644 --- a/docs/functions_d.html +++ b/docs/functions_d.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,49 +57,39 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- d -

diff --git a/docs/functions_e.html b/docs/functions_e.html index e1adc3d..f9c16ee 100644 --- a/docs/functions_e.html +++ b/docs/functions_e.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,37 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- e -

diff --git a/docs/functions_f.html b/docs/functions_f.html index 36eb732..b0c7955 100644 --- a/docs/functions_f.html +++ b/docs/functions_f.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,98 +57,54 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- f -

diff --git a/docs/functions_g.html b/docs/functions_g.html index 5492ee9..fdf0648 100644 --- a/docs/functions_g.html +++ b/docs/functions_g.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,31 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- g -

diff --git a/docs/functions_h.html b/docs/functions_h.html index 321318f..a11096a 100644 --- a/docs/functions_h.html +++ b/docs/functions_h.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,31 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- h -

diff --git a/docs/functions_i.html b/docs/functions_i.html index db8c97e..6a3316f 100644 --- a/docs/functions_i.html +++ b/docs/functions_i.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,53 +57,55 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- i -

diff --git a/docs/functions_j.html b/docs/functions_j.html new file mode 100644 index 0000000..ab0df22 --- /dev/null +++ b/docs/functions_j.html @@ -0,0 +1,85 @@ + + + + + + + +Telebot: Class Members + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- j -

+
+ + + + diff --git a/docs/functions_k.html b/docs/functions_k.html index a8c9630..24cde10 100644 --- a/docs/functions_k.html +++ b/docs/functions_k.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,28 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- k -

diff --git a/docs/functions_l.html b/docs/functions_l.html index a28e6f9..e655990 100644 --- a/docs/functions_l.html +++ b/docs/functions_l.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,56 +57,42 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- l -

diff --git a/docs/functions_m.html b/docs/functions_m.html index 11c9caf..a88f1fb 100644 --- a/docs/functions_m.html +++ b/docs/functions_m.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,52 +57,45 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- m -

diff --git a/docs/functions_n.html b/docs/functions_n.html index 981c68d..e17718e 100644 --- a/docs/functions_n.html +++ b/docs/functions_n.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,34 +57,35 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- n -

diff --git a/docs/functions_o.html b/docs/functions_o.html index 386580f..24b3a63 100644 --- a/docs/functions_o.html +++ b/docs/functions_o.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,34 +57,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- o -

diff --git a/docs/functions_p.html b/docs/functions_p.html index 326e4b7..aa12dee 100644 --- a/docs/functions_p.html +++ b/docs/functions_p.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,61 +57,57 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- p -

diff --git a/docs/functions_q.html b/docs/functions_q.html index 39f838a..348fb3e 100644 --- a/docs/functions_q.html +++ b/docs/functions_q.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,30 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- q -

diff --git a/docs/functions_r.html b/docs/functions_r.html index 99e24d9..4404186 100644 --- a/docs/functions_r.html +++ b/docs/functions_r.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,46 +57,53 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- r -

diff --git a/docs/functions_s.html b/docs/functions_s.html index 8dc748a..93a397c 100644 --- a/docs/functions_s.html +++ b/docs/functions_s.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,66 +57,66 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- s -

diff --git a/docs/functions_t.html b/docs/functions_t.html index 724b8f0..8a14170 100644 --- a/docs/functions_t.html +++ b/docs/functions_t.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,57 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- t -

diff --git a/docs/functions_u.html b/docs/functions_u.html index b3760a3..edbfbe9 100644 --- a/docs/functions_u.html +++ b/docs/functions_u.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,47 +57,44 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- u -

diff --git a/docs/functions_v.html b/docs/functions_v.html index d902cca..3e583e0 100644 --- a/docs/functions_v.html +++ b/docs/functions_v.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,43 +57,40 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- v -

diff --git a/docs/functions_vars.html b/docs/functions_vars.html index 70770c0..bd9c280 100644 --- a/docs/functions_vars.html +++ b/docs/functions_vars.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,43 +57,50 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- a -

diff --git a/docs/functions_vars_b.html b/docs/functions_vars_b.html index b410e51..c9f56ea 100644 --- a/docs/functions_vars_b.html +++ b/docs/functions_vars_b.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,28 +57,46 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- b -

diff --git a/docs/functions_vars_c.html b/docs/functions_vars_c.html index 9995dda..26625b3 100644 --- a/docs/functions_vars_c.html +++ b/docs/functions_vars_c.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,123 +57,91 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- c -

diff --git a/docs/functions_vars_d.html b/docs/functions_vars_d.html index 561030d..3e2b512 100644 --- a/docs/functions_vars_d.html +++ b/docs/functions_vars_d.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,49 +57,39 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- d -

diff --git a/docs/functions_vars_e.html b/docs/functions_vars_e.html index 9a4d417..13487db 100644 --- a/docs/functions_vars_e.html +++ b/docs/functions_vars_e.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,37 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- e -

diff --git a/docs/functions_vars_f.html b/docs/functions_vars_f.html index 95ce9b6..7bd255b 100644 --- a/docs/functions_vars_f.html +++ b/docs/functions_vars_f.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,98 +57,54 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- f -

diff --git a/docs/functions_vars_g.html b/docs/functions_vars_g.html index 38a1b35..1667d24 100644 --- a/docs/functions_vars_g.html +++ b/docs/functions_vars_g.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,31 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- g -

diff --git a/docs/functions_vars_h.html b/docs/functions_vars_h.html index cec222c..322c6c9 100644 --- a/docs/functions_vars_h.html +++ b/docs/functions_vars_h.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,31 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- h -

diff --git a/docs/functions_vars_i.html b/docs/functions_vars_i.html index 9a79303..7ac1c99 100644 --- a/docs/functions_vars_i.html +++ b/docs/functions_vars_i.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,53 +57,55 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- i -

diff --git a/docs/functions_vars_j.html b/docs/functions_vars_j.html new file mode 100644 index 0000000..54a4b11 --- /dev/null +++ b/docs/functions_vars_j.html @@ -0,0 +1,85 @@ + + + + + + + +Telebot: Class Members - Variables + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented variables with links to the class documentation for each member:
+ +

- j -

+
+ + + + diff --git a/docs/functions_vars_k.html b/docs/functions_vars_k.html index f611a5c..c008966 100644 --- a/docs/functions_vars_k.html +++ b/docs/functions_vars_k.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,28 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- k -

diff --git a/docs/functions_vars_l.html b/docs/functions_vars_l.html index 48c4bab..4be2210 100644 --- a/docs/functions_vars_l.html +++ b/docs/functions_vars_l.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,56 +57,42 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- l -

diff --git a/docs/functions_vars_m.html b/docs/functions_vars_m.html index 2269ecb..7f3fbbb 100644 --- a/docs/functions_vars_m.html +++ b/docs/functions_vars_m.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,52 +57,45 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- m -

diff --git a/docs/functions_vars_n.html b/docs/functions_vars_n.html index 659b6a5..65c1db5 100644 --- a/docs/functions_vars_n.html +++ b/docs/functions_vars_n.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,34 +57,35 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- n -

diff --git a/docs/functions_vars_o.html b/docs/functions_vars_o.html index beccd7e..21f7033 100644 --- a/docs/functions_vars_o.html +++ b/docs/functions_vars_o.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,34 +57,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- o -

diff --git a/docs/functions_vars_p.html b/docs/functions_vars_p.html index 0d4079b..4a17a70 100644 --- a/docs/functions_vars_p.html +++ b/docs/functions_vars_p.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,61 +57,57 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- p -

diff --git a/docs/functions_vars_q.html b/docs/functions_vars_q.html index a39556d..8e6876c 100644 --- a/docs/functions_vars_q.html +++ b/docs/functions_vars_q.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,30 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- q -

diff --git a/docs/functions_vars_r.html b/docs/functions_vars_r.html index 7f02be9..8aaa461 100644 --- a/docs/functions_vars_r.html +++ b/docs/functions_vars_r.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,46 +57,53 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- r -

diff --git a/docs/functions_vars_s.html b/docs/functions_vars_s.html index 74db042..e3dea09 100644 --- a/docs/functions_vars_s.html +++ b/docs/functions_vars_s.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,66 +57,66 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- s -

diff --git a/docs/functions_vars_t.html b/docs/functions_vars_t.html index cf0876c..aec0139 100644 --- a/docs/functions_vars_t.html +++ b/docs/functions_vars_t.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,57 +57,41 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- t -

diff --git a/docs/functions_vars_u.html b/docs/functions_vars_u.html index 1780b18..da2c2aa 100644 --- a/docs/functions_vars_u.html +++ b/docs/functions_vars_u.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,47 +57,44 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- u -

diff --git a/docs/functions_vars_v.html b/docs/functions_vars_v.html index 6d0e36f..4ed5b0f 100644 --- a/docs/functions_vars_v.html +++ b/docs/functions_vars_v.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,43 +57,40 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- v -

diff --git a/docs/functions_vars_w.html b/docs/functions_vars_w.html index 3ea1396..dfdea96 100644 --- a/docs/functions_vars_w.html +++ b/docs/functions_vars_w.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,28 +57,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- w -

diff --git a/docs/functions_vars_x.html b/docs/functions_vars_x.html index e120724..c8532cb 100644 --- a/docs/functions_vars_x.html +++ b/docs/functions_vars_x.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,28 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- x -

diff --git a/docs/functions_vars_y.html b/docs/functions_vars_y.html index 68d465e..f62c73b 100644 --- a/docs/functions_vars_y.html +++ b/docs/functions_vars_y.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members - Variables @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,29 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented variables with links to the class documentation for each member:
-

- y -

diff --git a/docs/functions_w.html b/docs/functions_w.html index be5aa7c..0b521bc 100644 --- a/docs/functions_w.html +++ b/docs/functions_w.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,28 +57,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- w -

diff --git a/docs/functions_x.html b/docs/functions_x.html index f38778f..831b8d8 100644 --- a/docs/functions_x.html +++ b/docs/functions_x.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,28 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- x -

diff --git a/docs/functions_y.html b/docs/functions_y.html index c1c6064..e07e02b 100644 --- a/docs/functions_y.html +++ b/docs/functions_y.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Class Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,25 +57,29 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented class members with links to the class documentation for each member:
-

- y -

diff --git a/docs/globals.html b/docs/globals.html index f519101..e008452 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,397 +57,474 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
Here is a list of all documented file members with links to the documentation:
-

- t -

diff --git a/docs/globals_enum.html b/docs/globals_enum.html index 79eb0f2..ed73a3e 100644 --- a/docs/globals_enum.html +++ b/docs/globals_enum.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,26 +57,27 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/docs/globals_eval.html b/docs/globals_eval.html index 3563810..5b81218 100644 --- a/docs/globals_eval.html +++ b/docs/globals_eval.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,74 +57,55 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
diff --git a/docs/globals_func.html b/docs/globals_func.html index 47caa7f..13441c9 100644 --- a/docs/globals_func.html +++ b/docs/globals_func.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,223 +57,307 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented functions with links to the documentation:
-

- t -

diff --git a/docs/globals_type.html b/docs/globals_type.html index c3c1e5a..92bd64e 100644 --- a/docs/globals_type.html +++ b/docs/globals_type.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: File Members @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,136 +57,162 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-  +
Here is a list of all documented typedefs with links to the documentation:
-

- t -

diff --git a/docs/group__TELEBOT__API.html b/docs/group__TELEBOT__API.html index 0c97be0..7d414cc 100644 --- a/docs/group__TELEBOT__API.html +++ b/docs/group__TELEBOT__API.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Simple Telegram Bot API @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -54,9 +57,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -66,46 +76,291 @@ Typedefs | Enumerations | Functions
-
-
Simple Telegram Bot API
+
Simple Telegram Bot API

Simplified APIs to create telegram bot. More...

- - + - + + + + + + + + + + - + + + + + + + - + + + +

+

Files

file  telebot-common.h
file  telebot-common.h
 This file contains telegram bot common defintions.
 
file  telebot-methods.h
file  telebot-forums.h
 This file contains forums feature of telegram bot.
 
file  telebot-games.h
 This file contains games feature of telegram bot.
 
file  telebot-inline.h
 This file contains inline mode feature of telegram bot.
 
file  telebot-methods.h
 This file contains methods used to create telegram bot.
 
file  telebot-stickers.h
file  telebot-passport.h
 This file contains Telegram Passport feature of telegram bot.
 
file  telebot-payments.h
 This file contains payments feature of telegram bot.
 
file  telebot-stickers.h
 This file contains stickers feature of telegram bot.
 
file  telebot-types.h
file  telebot-types.h
 This file contains types used to create telegram bot.
 
file  telebot.h
 This file includes all the header files of the telegram bot library.
 
- - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -118,6 +373,21 @@ + + + + + + + + + + + + + + + @@ -163,6 +433,15 @@ + + + + + + + + + @@ -170,7 +449,7 @@ - + @@ -193,416 +472,1131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+

Classes

struct  telebot_mask_position
 This object describes the position on faces where a mask should be placed by default. More...
 
struct  telebot_sticker
 This object represents a sticker. More...
 
struct  telebot_sticker_set
 This object represents a sticker set. More...
 
struct  telebot_birthdate
 Describes the birthdate of a user. More...
 
struct  telebot_business_intro
 Contains information about the start page settings of a Telegram Business account. More...
 
struct  telebot_business_location
 Contains information about the location of a Telegram Business account. More...
 
struct  telebot_business_opening_hours_interval
 Describes an interval of time during which a business is open. More...
 
struct  telebot_business_opening_hours
 Describes the opening hours of a business. More...
 
struct  telebot_business_bot_rights
 Represents the rights of a business bot. More...
 
struct  telebot_business_connection
 Describes the connection of the bot with a business account. More...
 
struct  telebot_business_messages_deleted
 This object is received when messages are deleted from a connected business account. More...
 
struct  telebot_user
 This object represents a Telegram user or bot. More...
 
struct  telebot_chat
 This object represents a chat. More...
 
struct  telebot_game
 This object represents a game. More...
 
struct  telebot_shipping_address
 This object represents a shipping address. More...
 
struct  telebot_order_info
 This object represents information about an order. More...
 
struct  telebot_invoice
 This object contains basic information about an invoice. More...
 
struct  telebot_successful_payment
 This object contains basic information about a successful payment. More...
 
struct  telebot_passport_file
 This object represents an internal identifier of a user in Telegram Passport. More...
 
struct  telebot_encrypted_passport_element
 This object represents one element of the Telegram Passport data. More...
 
struct  telebot_encrypted_credentials
 This object represents credentials required to decrypt the data. More...
 
struct  telebot_passport_data
 Contains information about Telegram Passport data which was shared with the bot by the user. More...
 
struct  telebot_proximity_alert_triggered
 This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location. More...
 
struct  telebot_forum_topic_created
 This object represents a service message about a new forum topic created in the chat. More...
 
struct  telebot_forum_topic_closed
 This object represents a service message about a forum topic closed in the chat. More...
 
struct  telebot_forum_topic_reopened
 This object represents a service message about a forum topic reopened in the chat. More...
 
struct  telebot_video_chat_scheduled
 This object represents a service message about a video chat scheduled in the chat. More...
 
struct  telebot_video_chat_started
 This object represents a service message about a video chat started in the chat. More...
 
struct  telebot_video_chat_ended
 This object represents a service message about a video chat ended in the chat. More...
 
struct  telebot_video_chat_participants_invited
 This object represents a service message about new members invited to a video chat. More...
 
struct  telebot_web_app_data
 This object represents data sent by a Web App to the bot. More...
 
struct  telebot_callback_game
 A placeholder, currently holds no information. Use BotFather to set up your game. More...
 
struct  telebot_login_url
 This object represents a parameter of the inline keyboard button used to automatically authorize a user. More...
 
struct  telebot_switch_inline_query_chosen_chat
 This object represents an inline button that switches the current user to inline mode in a chosen chat. More...
 
struct  telebot_copy_text_button
 This object represents an inline keyboard button that copies specified text to the clipboard. More...
 
struct  telebot_inline_keyboard_button
 This object represents one button of an inline keyboard. You must use exactly one of the optional fields. More...
 
struct  telebot_inline_keyboard_markup
 This object represents an inline keyboard that appears right next to the message it belongs to. More...
 
struct  telebot_forum_topic_edited
 This object represents a service message about a forum topic edited in the chat. More...
 
struct  telebot_general_forum_topic_hidden
 This object represents a service message about a general forum topic hidden in the chat. More...
 
struct  telebot_general_forum_topic_unhidden
 This object represents a service message about a general forum topic unhidden in the chat. More...
 
struct  telebot_write_access_allowed
 This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. More...
 
struct  telebot_user_shared
 This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. More...
 
struct  telebot_chat_shared
 This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. More...
 
struct  telebot_chat_invite_link
 This object represents a chat invite link. More...
 
struct  telebot_chat_member_updated
 This object represents changes in the status of a chat member. More...
 
struct  telebot_chat_join_request
 This object represents a join request sent to a chat. More...
 
struct  telebot_message_reaction_updated
 This object represents a change of a reaction on a message performed by a user. More...
 
struct  telebot_message_reaction_count_updated
 This object represents reaction changes on a message with anonymous reactions. More...
 
struct  telebot_reaction_type
 This object represents a reaction type. More...
 
struct  telebot_reaction_count
 This object represents a reaction count. More...
 
struct  telebot_chat_boost_updated
 This object represents a boost added to a chat. More...
 
struct  telebot_chat_boost
 This object contains information about a chat boost. More...
 
struct  telebot_chat_boost_source
 This object represents the source of a chat boost. More...
 
struct  telebot_chat_boost_removed
 This object represents a boost removed from a chat. More...
 
struct  telebot_message_origin
 This object describes the origin of a message. More...
 
struct  telebot_text_quote
 This object contains information about the quoted part of a message that is replied to by the given message. More...
 
struct  telebot_story
 This object contains information about a story. More...
 
struct  telebot_external_reply_info
 This object contains information about the message that is being replied to, which may come from another chat or forum topic. More...
 
struct  telebot_link_preview_options
 Describes the options used for link preview generation. More...
 
struct  telebot_paid_media
 This object describes paid media. More...
 
struct  telebot_paid_media_info
 Describes the paid media added to a message. More...
 
struct  telebot_giveaway
 This object represents a message about a scheduled giveaway. More...
 
struct  telebot_giveaway_winners
 This object represents a message about the completion of a giveaway with public winners. More...
 
struct  telebot_refunded_payment
 This object represents a service message about a refunded payment. More...
 
struct  telebot_users_shared
 This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. More...
 
struct  telebot_shared_user
 This object contains information about a user that was shared with the bot. More...
 
struct  telebot_gift
 This object represents a gift that can be sent by the bot. More...
 
struct  telebot_gift_info
 Describes a regular gift that was sent or received. More...
 
struct  telebot_unique_gift_info
 Describes a unique gift that was sent or received. More...
 
struct  telebot_unique_gift
 This object describes a unique gift that was upgraded from a regular gift. More...
 
struct  telebot_chat_boost_added
 This object represents a service message about a user boosting a chat. More...
 
struct  telebot_chat_background
 This object represents a chat background. More...
 
struct  telebot_giveaway_created
 This object represents a service message about the creation of a scheduled giveaway. More...
 
struct  telebot_giveaway_completed
 This object represents a service message about the completion of a giveaway without public winners. More...
 
struct  telebot_star_amount
 Describes an amount of Telegram Stars. More...
 
struct  telebot_affiliate_info
 Contains information about the affiliate that received a commission. More...
 
struct  telebot_revenue_withdrawal_state
 This object describes the state of a revenue withdrawal operation. More...
 
struct  telebot_transaction_partner
 This object describes the source of a transaction. More...
 
struct  telebot_star_transaction
 Describes a Telegram Star transaction. More...
 
struct  telebot_star_transactions
 Contains a list of Telegram Star transactions. More...
 
struct  telebot_paid_media_purchased
 This object contains information about a paid media purchase. More...
 
struct  telebot_passport_element_error
 This object represents an error in the Telegram Passport element. More...
 
struct  telebot_game_high_score
 This object represents a game high score row. More...
 
struct  telebot_message
 This object represents a message. More...
 
struct  telebot_audio
 This object represents an audio file to be treated as music by the Telegram clients. More...
 
struct  telebot_gifts
 This object represent a list of gifts. More...
 
struct  telebot_user_profile_audios
 This object represents a list of user profile audios. More...
 
struct  telebot_user_gift
 This object represents a gift received by a user. More...
 
struct  telebot_user_gifts
 This object represents a list of gifts received by a user. More...
 
struct  telebot_user_chat_boosts
 This object represents a list of user chat boosts. More...
 
struct  telebot_document
 This object represents a general file (as opposed to photos, voice messages and audio files). More...
 
struct  telebot_keyboard_button_poll_type
 This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. More...
 
struct  telebot_keyboard_button_request_users
 This object defines the criteria used to request suitable users. More...
 
struct  telebot_keyboard_button_request_chat
 This object defines the criteria used to request a suitable chat. More...
 
struct  telebot_web_app_info
 Describes a Web App. More...
 
struct  telebot_keyboard_button
 This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive. More...
 
 This object represents a custom keyboard with reply options. More...
 
struct  telebot_reply_keyboard_remove
 Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). More...
 Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). More...
 
struct  telebot_callback_query
 This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. More...
struct  telebot_response_paramters
 Contains information about why a request was unsuccessful. More...
 
struct  telebot_inline_query
 This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. More...
 
struct  telebot_chosen_inline_result
 Represents a result of an inline query that was chosen by the user and sent to their chat partner. More...
 
struct  telebot_shipping_query
 This object contains information about an incoming shipping query. More...
 
struct  telebot_pre_checkout_query
 This object contains information about an incoming pre-checkout query. More...
 
struct  telebot_mask_position
 This object describes the position on faces where a mask should be placed by default. More...
 
struct  telebot_sticker
 This object represents a sticker. More...
 
struct  telebot_forum_topic
 This object represents a forum topic. More...
 
struct  telebot_prepared_inline_message
 This object represents a prepared inline message. More...
 
struct  telebot_sent_web_app_message
 This object represents a message sent via a Web App. More...
 
struct  telebot_update
 This object represents an incoming update. More...
 
struct  telebot_webhook_info
 Thi object represetns information about the current status of a webhook. More...
 
struct  telebot_chat_location
 Thi object represetns information about the current status of a webhook. More...
 
struct  telebot_message_auto_delete_timer_changed
 This object represents a service message about a change in auto-delete timer settings. More...
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+

Typedefs

-typedef struct telebot_mask_position telebot_mask_position_t
 This object describes the position on faces where a mask should be placed by default.
 
-typedef struct telebot_sticker telebot_sticker_t
 This object represents a sticker.
 
-typedef struct telebot_sticker_set telebot_sticker_set_t
 This object represents a sticker set.
 
-typedef enum telebot_update_type telebot_update_type_e
 Enumerations of telegram update types.
 
-typedef struct telebot_user telebot_user_t
 This object represents a Telegram user or bot.
 
-typedef struct telebot_chat telebot_chat_t
 This object represents a chat.
 
-typedef struct telebot_message telebot_message_t
 This object represents a message.
 
-typedef struct telebot_message_entity telebot_message_entity_t
 This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
 
-typedef struct telebot_photo telebot_photo_t
 This object represents one size of a photo or a file / sticker thumbnail.
 
-typedef struct telebot_audio telebot_audio_t
 This object represents an audio file to be treated as music by the Telegram clients.
 
-typedef struct telebot_document telebot_document_t
 This object represents a general file (as opposed to photos, voice messages and audio files).
 
-typedef struct telebot_video telebot_video_t
 This object represents a video file.
 
-typedef struct telebot_animation telebot_animation_t
 This object represents a video file.
 
-typedef struct telebot_voice telebot_voice_t
 This object represents a voice note.
 
-typedef struct telebot_video_note telebot_video_note_t
 This object represents a video message (available in Telegram apps as of v.4.0).
 
-typedef struct telebot_contact telebot_contact_t
 This object represents a phone contact.
 
-typedef struct telebot_location telebot_location_t
 This object represents a point on the map.
 
-typedef struct telebot_venue telebot_venue_t
 This object represents a venue.
 
-typedef struct telebot_poll_option telebot_poll_option_t
 This object contains information about one answer option in a poll.
 
-typedef struct telebot_poll_answer telebot_poll_answer_t
 This object represents an answer of a user in a non-anonymous poll.
 
-typedef struct telebot_poll telebot_poll_t
 This object contains information about a poll.
 
-typedef struct telebot_dice telebot_dice_t
 This object represents a dice with random value from 1 to 6.
 
-typedef struct telebot_user_profile_photos telebot_user_profile_photos_t
 This object represent a user's profile pictures.
 
typedef struct telebot_file telebot_file_t
 This object represents a file ready to be downloaded. More...
 
-typedef struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
 This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
 
-typedef struct telebot_keyboard_button telebot_keyboard_button_t
 This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
 
-typedef struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
 This object represents a custom keyboard with reply options.
 
-typedef struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
 Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).
 
-typedef struct telebot_callback_query telebot_callback_query_t
 This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
 
-typedef struct telebot_force_reply telebot_force_reply_t
 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.
 
-typedef struct telebot_chat_photo telebot_chat_photo_t
 This object represents a chat photo.
 
-typedef struct telebot_chat_member telebot_chat_member_t
 This object contains information about one member of a chat.
 
-typedef struct telebot_chat_permissions telebot_chat_permissions_t
 Describes actions that a non-administrator user is allowed to take in a chat.
 
-typedef struct telebot_bot_command telebot_bot_command_t
 This object represents a bot command.
 
-typedef struct telebot_response_paramters telebot_response_paramters_t
 Contains information about why a request was unsuccessful.
 
-typedef struct telebot_update telebot_update_t
 This object represents an incoming update.
 
-typedef struct telebot_webhook_info telebot_webhook_info_t
 Thi object represetns information about the current status of a webhook.
 
-typedef struct telebot_handler_s * telebot_handler_t
 This is opaque object to represent a telebot handler.
 
+typedef struct telebot_sticker_set telebot_sticker_set_t
 This object represents a sticker set.
 
+typedef enum telebot_update_type telebot_update_type_e
 Enumerations of telegram update types.
 
+typedef struct telebot_birthdate telebot_birthdate_t
 Describes the birthdate of a user.
 
+typedef struct telebot_business_intro telebot_business_intro_t
 Contains information about the start page settings of a Telegram Business account.
 
+typedef struct telebot_business_location telebot_business_location_t
 Contains information about the location of a Telegram Business account.
 
+typedef struct telebot_business_opening_hours_interval telebot_business_opening_hours_interval_t
 Describes an interval of time during which a business is open.
 
+typedef struct telebot_business_opening_hours telebot_business_opening_hours_t
 Describes the opening hours of a business.
 
+typedef struct telebot_business_bot_rights telebot_business_bot_rights_t
 Represents the rights of a business bot.
 
+typedef struct telebot_business_connection telebot_business_connection_t
 Describes the connection of the bot with a business account.
 
+typedef struct telebot_business_messages_deleted telebot_business_messages_deleted_t
 This object is received when messages are deleted from a connected business account.
 
+typedef struct telebot_user telebot_user_t
 This object represents a Telegram user or bot.
 
+typedef struct telebot_chat telebot_chat_t
 This object represents a chat.
 
+typedef struct telebot_game telebot_game_t
 This object represents a game.
 
+typedef struct telebot_shipping_address telebot_shipping_address_t
 This object represents a shipping address.
 
+typedef struct telebot_order_info telebot_order_info_t
 This object represents information about an order.
 
+typedef struct telebot_invoice telebot_invoice_t
 This object contains basic information about an invoice.
 
+typedef struct telebot_successful_payment telebot_successful_payment_t
 This object contains basic information about a successful payment.
 
+typedef struct telebot_passport_file telebot_passport_file_t
 This object represents an internal identifier of a user in Telegram Passport.
 
+typedef struct telebot_encrypted_passport_element telebot_encrypted_passport_element_t
 This object represents one element of the Telegram Passport data.
 
+typedef struct telebot_encrypted_credentials telebot_encrypted_credentials_t
 This object represents credentials required to decrypt the data.
 
+typedef struct telebot_passport_data telebot_passport_data_t
 Contains information about Telegram Passport data which was shared with the bot by the user.
 
+typedef struct telebot_proximity_alert_triggered telebot_proximity_alert_triggered_t
 This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location.
 
+typedef struct telebot_forum_topic_created telebot_forum_topic_created_t
 This object represents a service message about a new forum topic created in the chat.
 
+typedef struct telebot_forum_topic_closed telebot_forum_topic_closed_t
 This object represents a service message about a forum topic closed in the chat.
 
+typedef struct telebot_forum_topic_reopened telebot_forum_topic_reopened_t
 This object represents a service message about a forum topic reopened in the chat.
 
+typedef struct telebot_video_chat_scheduled telebot_video_chat_scheduled_t
 This object represents a service message about a video chat scheduled in the chat.
 
+typedef struct telebot_video_chat_started telebot_video_chat_started_t
 This object represents a service message about a video chat started in the chat.
 
+typedef struct telebot_video_chat_ended telebot_video_chat_ended_t
 This object represents a service message about a video chat ended in the chat.
 
+typedef struct telebot_video_chat_participants_invited telebot_video_chat_participants_invited_t
 This object represents a service message about new members invited to a video chat.
 
+typedef struct telebot_web_app_data telebot_web_app_data_t
 This object represents data sent by a Web App to the bot.
 
+typedef struct telebot_callback_game telebot_callback_game_t
 A placeholder, currently holds no information. Use BotFather to set up your game.
 
+typedef struct telebot_login_url telebot_login_url_t
 This object represents a parameter of the inline keyboard button used to automatically authorize a user.
 
+typedef struct telebot_switch_inline_query_chosen_chat telebot_switch_inline_query_chosen_chat_t
 This object represents an inline button that switches the current user to inline mode in a chosen chat.
 
+typedef struct telebot_copy_text_button telebot_copy_text_button_t
 This object represents an inline keyboard button that copies specified text to the clipboard.
 
+typedef struct telebot_inline_keyboard_button telebot_inline_keyboard_button_t
 This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
 
+typedef struct telebot_inline_keyboard_markup telebot_inline_keyboard_markup_t
 This object represents an inline keyboard that appears right next to the message it belongs to.
 
+typedef struct telebot_forum_topic_edited telebot_forum_topic_edited_t
 This object represents a service message about a forum topic edited in the chat.
 
+typedef struct telebot_general_forum_topic_hidden telebot_general_forum_topic_hidden_t
 This object represents a service message about a general forum topic hidden in the chat.
 
+typedef struct telebot_general_forum_topic_unhidden telebot_general_forum_topic_unhidden_t
 This object represents a service message about a general forum topic unhidden in the chat.
 
+typedef struct telebot_write_access_allowed telebot_write_access_allowed_t
 This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.
 
+typedef struct telebot_user_shared telebot_user_shared_t
 This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
 
+typedef struct telebot_chat_shared telebot_chat_shared_t
 This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
 
+typedef struct telebot_chat_invite_link telebot_chat_invite_link_t
 This object represents a chat invite link.
 
+typedef struct telebot_chat_member_updated telebot_chat_member_updated_t
 This object represents changes in the status of a chat member.
 
+typedef struct telebot_chat_join_request telebot_chat_join_request_t
 This object represents a join request sent to a chat.
 
+typedef struct telebot_message_reaction_updated telebot_message_reaction_updated_t
 This object represents a change of a reaction on a message performed by a user.
 
+typedef struct telebot_message_reaction_count_updated telebot_message_reaction_count_updated_t
 This object represents reaction changes on a message with anonymous reactions.
 
+typedef struct telebot_reaction_type telebot_reaction_type_t
 This object represents a reaction type.
 
+typedef struct telebot_reaction_count telebot_reaction_count_t
 This object represents a reaction count.
 
+typedef struct telebot_chat_boost_updated telebot_chat_boost_updated_t
 This object represents a boost added to a chat.
 
+typedef struct telebot_chat_boost telebot_chat_boost_t
 This object contains information about a chat boost.
 
+typedef struct telebot_chat_boost_source telebot_chat_boost_source_t
 This object represents the source of a chat boost.
 
+typedef struct telebot_chat_boost_removed telebot_chat_boost_removed_t
 This object represents a boost removed from a chat.
 
+typedef struct telebot_message_origin telebot_message_origin_t
 This object describes the origin of a message.
 
+typedef struct telebot_text_quote telebot_text_quote_t
 This object contains information about the quoted part of a message that is replied to by the given message.
 
+typedef struct telebot_story telebot_story_t
 This object contains information about a story.
 
+typedef struct telebot_external_reply_info telebot_external_reply_info_t
 This object contains information about the message that is being replied to, which may come from another chat or forum topic.
 
+typedef struct telebot_link_preview_options telebot_link_preview_options_t
 Describes the options used for link preview generation.
 
+typedef struct telebot_paid_media telebot_paid_media_t
 This object describes paid media.
 
+typedef struct telebot_paid_media_info telebot_paid_media_info_t
 Describes the paid media added to a message.
 
+typedef struct telebot_giveaway telebot_giveaway_t
 This object represents a message about a scheduled giveaway.
 
+typedef struct telebot_giveaway_winners telebot_giveaway_winners_t
 This object represents a message about the completion of a giveaway with public winners.
 
+typedef struct telebot_refunded_payment telebot_refunded_payment_t
 This object represents a service message about a refunded payment.
 
+typedef struct telebot_users_shared telebot_users_shared_t
 This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
 
+typedef struct telebot_shared_user telebot_shared_user_t
 This object contains information about a user that was shared with the bot.
 
+typedef struct telebot_gift telebot_gift_t
 This object represents a gift that can be sent by the bot.
 
+typedef struct telebot_gift_info telebot_gift_info_t
 Describes a regular gift that was sent or received.
 
+typedef struct telebot_unique_gift_info telebot_unique_gift_info_t
 Describes a unique gift that was sent or received.
 
+typedef struct telebot_unique_gift telebot_unique_gift_t
 This object describes a unique gift that was upgraded from a regular gift.
 
+typedef struct telebot_chat_boost_added telebot_chat_boost_added_t
 This object represents a service message about a user boosting a chat.
 
+typedef struct telebot_chat_background telebot_chat_background_t
 This object represents a chat background.
 
+typedef struct telebot_giveaway_created telebot_giveaway_created_t
 This object represents a service message about the creation of a scheduled giveaway.
 
+typedef struct telebot_giveaway_completed telebot_giveaway_completed_t
 This object represents a service message about the completion of a giveaway without public winners.
 
+typedef struct telebot_star_amount telebot_star_amount_t
 Describes an amount of Telegram Stars.
 
+typedef struct telebot_affiliate_info telebot_affiliate_info_t
 Contains information about the affiliate that received a commission.
 
+typedef struct telebot_revenue_withdrawal_state telebot_revenue_withdrawal_state_t
 This object describes the state of a revenue withdrawal operation.
 
+typedef struct telebot_transaction_partner telebot_transaction_partner_t
 This object describes the source of a transaction.
 
+typedef struct telebot_star_transaction telebot_star_transaction_t
 Describes a Telegram Star transaction.
 
+typedef struct telebot_star_transactions telebot_star_transactions_t
 Contains a list of Telegram Star transactions.
 
+typedef struct telebot_paid_media_purchased telebot_paid_media_purchased_t
 This object contains information about a paid media purchase.
 
+typedef struct telebot_passport_element_error telebot_passport_element_error_t
 This object represents an error in the Telegram Passport element.
 
+typedef struct telebot_game_high_score telebot_game_high_score_t
 This object represents a game high score row.
 
+typedef struct telebot_message telebot_message_t
 This object represents a message.
 
+typedef struct telebot_message_entity telebot_message_entity_t
 This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
 
+typedef struct telebot_photo telebot_photo_t
 This object represents one size of a photo or a file / sticker thumbnail.
 
+typedef struct telebot_audio telebot_audio_t
 This object represents an audio file to be treated as music by the Telegram clients.
 
+typedef struct telebot_gifts telebot_gifts_t
 This object represent a list of gifts.
 
+typedef struct telebot_user_profile_audios telebot_user_profile_audios_t
 This object represents a list of user profile audios.
 
+typedef struct telebot_user_gift telebot_user_gift_t
 This object represents a gift received by a user.
 
+typedef struct telebot_user_gifts telebot_user_gifts_t
 This object represents a list of gifts received by a user.
 
+typedef struct telebot_user_chat_boosts telebot_user_chat_boosts_t
 This object represents a list of user chat boosts.
 
+typedef struct telebot_document telebot_document_t
 This object represents a general file (as opposed to photos, voice messages and audio files).
 
+typedef struct telebot_video telebot_video_t
 This object represents a video file.
 
+typedef struct telebot_animation telebot_animation_t
 This object represents a video file.
 
+typedef struct telebot_voice telebot_voice_t
 This object represents a voice note.
 
+typedef struct telebot_video_note telebot_video_note_t
 This object represents a video message (available in Telegram apps as of v.4.0).
 
+typedef struct telebot_contact telebot_contact_t
 This object represents a phone contact.
 
+typedef struct telebot_location telebot_location_t
 This object represents a point on the map.
 
+typedef struct telebot_venue telebot_venue_t
 This object represents a venue.
 
+typedef struct telebot_poll_option telebot_poll_option_t
 This object contains information about one answer option in a poll.
 
+typedef struct telebot_poll_answer telebot_poll_answer_t
 This object represents an answer of a user in a non-anonymous poll.
 
+typedef struct telebot_poll telebot_poll_t
 This object contains information about a poll.
 
+typedef struct telebot_dice telebot_dice_t
 This object represents a dice with random value from 1 to 6.
 
+typedef struct telebot_user_profile_photos telebot_user_profile_photos_t
 This object represent a user's profile pictures.
 
typedef struct telebot_file telebot_file_t
 This object represents a file ready to be downloaded.
 
+typedef struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
 This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
 
+typedef struct telebot_keyboard_button_request_users telebot_keyboard_button_request_users_t
 This object defines the criteria used to request suitable users.
 
+typedef struct telebot_keyboard_button_request_chat telebot_keyboard_button_request_chat_t
 This object defines the criteria used to request a suitable chat.
 
+typedef struct telebot_web_app_info telebot_web_app_info_t
 Describes a Web App.
 
+typedef struct telebot_keyboard_button telebot_keyboard_button_t
 This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
 
+typedef struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
 This object represents a custom keyboard with reply options.
 
+typedef struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
 Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).
 
+typedef struct telebot_callback_query telebot_callback_query_t
 This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
 
+typedef struct telebot_force_reply telebot_force_reply_t
 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.
 
+typedef struct telebot_chat_photo telebot_chat_photo_t
 This object represents a chat photo.
 
+typedef struct telebot_chat_member telebot_chat_member_t
 This object contains information about one member of a chat.
 
+typedef struct telebot_chat_permissions telebot_chat_permissions_t
 Describes actions that a non-administrator user is allowed to take in a chat.
 
+typedef struct telebot_bot_command telebot_bot_command_t
 This object represents a bot command.
 
+typedef struct telebot_response_paramters telebot_response_paramters_t
 Contains information about why a request was unsuccessful.
 
+typedef struct telebot_inline_query telebot_inline_query_t
 This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
 
+typedef struct telebot_chosen_inline_result telebot_chosen_inline_result_t
 Represents a result of an inline query that was chosen by the user and sent to their chat partner.
 
+typedef struct telebot_shipping_query telebot_shipping_query_t
 This object contains information about an incoming shipping query.
 
+typedef struct telebot_pre_checkout_query telebot_pre_checkout_query_t
 This object contains information about an incoming pre-checkout query.
 
+typedef struct telebot_mask_position telebot_mask_position_t
 This object describes the position on faces where a mask should be placed by default.
 
+typedef struct telebot_sticker telebot_sticker_t
 This object represents a sticker.
 
+typedef struct telebot_forum_topic telebot_forum_topic_t
 This object represents a forum topic.
 
+typedef struct telebot_prepared_inline_message telebot_prepared_inline_message_t
 This object represents a prepared inline message.
 
+typedef struct telebot_sent_web_app_message telebot_sent_web_app_message_t
 This object represents a message sent via a Web App.
 
+typedef struct telebot_update telebot_update_t
 This object represents an incoming update.
 
+typedef struct telebot_webhook_info telebot_webhook_info_t
 Thi object represetns information about the current status of a webhook.
 
+typedef struct telebot_chat_location telebot_chat_location_t
 Thi object represetns information about the current status of a webhook.
 
+typedef struct telebot_message_auto_delete_timer_changed telebot_message_auto_delete_timer_changed_t
 This object represents a service message about a change in auto-delete timer settings.
 
+typedef struct telebot_handler * telebot_handler_t
 This is opaque object to represent a telebot handler.
 
- - - + } + - - + } +

+

Enumerations

enum  telebot_error_e {
-  TELEBOT_ERROR_NONE = 0, -TELEBOT_ERROR_OPERATION_FAILED = -1, -TELEBOT_ERROR_NOT_SUPPORTED = -2, -TELEBOT_ERROR_OUT_OF_MEMORY = -3, +
enum  telebot_error_e {
+  TELEBOT_ERROR_NONE = 0 +, TELEBOT_ERROR_OPERATION_FAILED = -1 +, TELEBOT_ERROR_NOT_SUPPORTED = -2 +, TELEBOT_ERROR_OUT_OF_MEMORY = -3 +,
+  TELEBOT_ERROR_NO_CONNECTION = -4 +, TELEBOT_ERROR_INVALID_PARAMETER = -5
-  TELEBOT_ERROR_NO_CONNECTION = -4, -TELEBOT_ERROR_INVALID_PARAMETER = -5 -
- }
 Enumerations of error code for telebot programming interface. More...
 Enumerations of error code for telebot programming interface. More...
 
enum  telebot_update_type {
-  TELEBOT_UPDATE_TYPE_MESSAGE = 0, -TELEBOT_UPDATE_TYPE_EDITED_MESSAGE, -TELEBOT_UPDATE_TYPE_CHANNEL_POST, -TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST, -
-  TELEBOT_UPDATE_TYPE_INLINE_QUERY, -TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT, -TELEBOT_UPDATE_TYPE_CALLBACK_QUERY, -TELEBOT_UPDATE_TYPE_SHIPPING_QUERY, -
-  TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY, -TELEBOT_UPDATE_TYPE_POLL, -TELEBOT_UPDATE_TYPE_POLL_ANSWER, -TELEBOT_UPDATE_TYPE_MAX +
enum  telebot_update_type {
+  TELEBOT_UPDATE_TYPE_MESSAGE = 0 +, TELEBOT_UPDATE_TYPE_EDITED_MESSAGE +, TELEBOT_UPDATE_TYPE_CHANNEL_POST +, TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST +,
+  TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION +, TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE +, TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE +, TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES +,
+  TELEBOT_UPDATE_TYPE_MESSAGE_REACTION +, TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT +, TELEBOT_UPDATE_TYPE_INLINE_QUERY +, TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT +,
+  TELEBOT_UPDATE_TYPE_CALLBACK_QUERY +, TELEBOT_UPDATE_TYPE_SHIPPING_QUERY +, TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY +, TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA +,
+  TELEBOT_UPDATE_TYPE_POLL +, TELEBOT_UPDATE_TYPE_POLL_ANSWER +, TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER +, TELEBOT_UPDATE_TYPE_CHAT_MEMBER +,
+  TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST +, TELEBOT_UPDATE_TYPE_CHAT_BOOST +, TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST +, TELEBOT_UPDATE_TYPE_MAX
- }
 Enumerations of telegram update types. More...
 Enumerations of telegram update types. More...
 
- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + +

+

Functions

telebot_error_e telebot_create (telebot_handler_t *handle, char *token)
 Initial function to use telebot APIs. More...
telebot_error_e telebot_create_forum_topic (telebot_handler_t handle, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id, telebot_forum_topic_t *topic)
 Use this method to create a topic in a forum supergroup chat.
 
telebot_error_e telebot_put_forum_topic (telebot_forum_topic_t *topic)
 Release forum topic obtained with telebot_create_forum_topic.
 
telebot_error_e telebot_edit_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
 Use this method to edit name and icon of a topic in a forum supergroup chat.
 
telebot_error_e telebot_close_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
 Use this method to close an open topic in a forum supergroup chat.
 
telebot_error_e telebot_reopen_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
 Use this method to reopen a closed topic in a forum supergroup chat.
 
telebot_error_e telebot_delete_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
 Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
 
telebot_error_e telebot_unpin_all_forum_topic_messages (telebot_handler_t handle, long long int chat_id, int message_thread_id)
 Use this method to unpin all messages in a forum topic.
 
telebot_error_e telebot_get_forum_topic_icon_stickers (telebot_handler_t handle, telebot_sticker_t **stickers, int *count)
 Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
 
telebot_error_e telebot_edit_general_forum_topic (telebot_handler_t handle, long long int chat_id, const char *name)
 Use this method to edit the name of the 'General' topic in a forum supergroup chat.
 
telebot_error_e telebot_close_general_forum_topic (telebot_handler_t handle, long long int chat_id)
 Use this method to close an open 'General' topic in a forum supergroup chat.
 
telebot_error_e telebot_reopen_general_forum_topic (telebot_handler_t handle, long long int chat_id)
 Use this method to reopen a closed 'General' topic in a forum supergroup chat.
 
telebot_error_e telebot_hide_general_forum_topic (telebot_handler_t handle, long long int chat_id)
 Use this method to hide the 'General' topic in a forum supergroup chat.
 
telebot_error_e telebot_unhide_general_forum_topic (telebot_handler_t handle, long long int chat_id)
 Use this method to unhide the 'General' topic in a forum supergroup chat.
 
telebot_error_e telebot_unpin_all_general_forum_topic_messages (telebot_handler_t handle, long long int chat_id)
 Use this method to unpin all messages in a General forum topic.
 
+telebot_error_e telebot_send_game (telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup, telebot_message_t *message)
 Use this method to send a game.
 
+telebot_error_e telebot_set_game_score (telebot_handler_t handle, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id, telebot_message_t *message)
 Use this method to set the score of the specified user in a game.
 
+telebot_error_e telebot_get_game_high_scores (telebot_handler_t handle, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id, telebot_game_high_score_t **high_scores, int *count)
 Use this method to get data for high score tables.
 
+telebot_error_e telebot_put_game_high_scores (telebot_game_high_score_t *high_scores, int count)
 Release game high scores obtained with telebot_get_game_high_scores.
 
+telebot_error_e telebot_answer_inline_query (telebot_handler_t handle, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
 Use this method to send answers to an inline query.
 
+telebot_error_e telebot_save_prepared_inline_message (telebot_handler_t handle, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats, telebot_prepared_inline_message_t *prepared_message)
 Use this method to save a prepared inline message.
 
+telebot_error_e telebot_put_prepared_inline_message (telebot_prepared_inline_message_t *prepared_message)
 Release prepared inline message.
 
+telebot_error_e telebot_answer_web_app_query (telebot_handler_t handle, const char *web_app_query_id, const char *result, char **inline_message_id)
 Use this method to send answers to an inline query to a user from a Web App.
 
telebot_error_e telebot_create (telebot_handler_t *handle, char *token)
 Initial function to use telebot APIs.
 
telebot_error_e telebot_destroy (telebot_handler_t handle)
 Final function to use telebo APIs. More...
telebot_error_e telebot_destroy (telebot_handler_t handle)
 Final function to use telebo APIs.
 
telebot_error_e telebot_set_proxy (telebot_handler_t handle, char *addr, char *auth)
 Set proxy address to use telebot behind proxy. More...
telebot_error_e telebot_set_proxy (telebot_handler_t handle, char *addr, char *auth)
 Set proxy address to use telebot behind proxy.
 
telebot_error_e telebot_get_proxy (telebot_handler_t handle, char **addr)
 Get proxy address currently used. More...
telebot_error_e telebot_get_proxy (telebot_handler_t handle, char **addr)
 Get proxy address currently used.
 
telebot_error_e telebot_get_updates (telebot_handler_t handle, int offset, int limit, int timeout, telebot_update_type_e allowed_updates[], int allowed_updates_count, telebot_update_t **updates, int *count)
 This function is used to get latest updates. More...
telebot_error_e telebot_get_updates (telebot_handler_t handle, int offset, int limit, int timeout, telebot_update_type_e allowed_updates[], int allowed_updates_count, telebot_update_t **updates, int *count)
 This function is used to get latest updates.
 
telebot_error_e telebot_put_updates (telebot_update_t *updates, int count)
 This function is used to release memory used for obtained updates. More...
telebot_error_e telebot_put_updates (telebot_update_t *updates, int count)
 This function is used to release memory used for obtained updates.
 
telebot_error_e telebot_set_webhook (telebot_handler_t handle, char *url, char *certificate, int max_connections, telebot_update_type_e allowed_updates[], int allowed_updates_count)
 This function is used to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. More...
telebot_error_e telebot_set_webhook (telebot_handler_t handle, char *url, char *certificate, int max_connections, telebot_update_type_e allowed_updates[], int allowed_updates_count)
 This function is used to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
 
telebot_error_e telebot_delete_webhook (telebot_handler_t handle)
 This function is used to remove webhook integration if you decide to switch back to getUpdates. More...
telebot_error_e telebot_delete_webhook (telebot_handler_t handle)
 This function is used to remove webhook integration if you decide to switch back to getUpdates.
 
telebot_error_e telebot_get_webhook_info (telebot_handler_t handle, telebot_webhook_info_t *info)
 This function is used to get information about telegram bot itself. More...
telebot_error_e telebot_get_webhook_info (telebot_handler_t handle, telebot_webhook_info_t *info)
 This function is used to get information about telegram bot itself.
 
telebot_error_e telebot_put_webhook_info (telebot_webhook_info_t *info)
 This function is used to release memory used for obtained information about telegram bot itself. More...
telebot_error_e telebot_put_webhook_info (telebot_webhook_info_t *info)
 This function is used to release memory used for obtained information about telegram bot itself.
 
telebot_error_e telebot_get_me (telebot_handler_t handle, telebot_user_t *me)
 This function is used to get information about telegram bot itself. More...
telebot_error_e telebot_get_me (telebot_handler_t handle, telebot_user_t *me)
 This function is used to get information about telegram bot itself.
 
telebot_error_e telebot_put_me (telebot_user_t *me)
 This function is used to release memory used for obtained information about telegram bot itself. More...
telebot_error_e telebot_put_me (telebot_user_t *me)
 This function is used to release memory used for obtained information about telegram bot itself.
 
telebot_error_e telebot_send_message (telebot_handler_t handle, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send text messages. More...
telebot_error_e telebot_put_user (telebot_user_t *user)
 This function is used to release memory used for user object.
 
telebot_error_e telebot_send_message (telebot_handler_t handle, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send text messages.
 
telebot_error_e telebot_forward_message (telebot_handler_t handle, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
 Forward messages of any kind. More...
telebot_error_e telebot_forward_message (telebot_handler_t handle, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
 Forward messages of any kind.
 
telebot_error_e telebot_send_photo (telebot_handler_t handle, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send photos. More...
telebot_error_e telebot_send_photo (telebot_handler_t handle, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send photos.
 
telebot_error_e telebot_send_audio (telebot_handler_t handle, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_send_voice() function instead. More...
telebot_error_e telebot_send_audio (telebot_handler_t handle, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_send_voice() function instead.
 
telebot_error_e telebot_send_document (telebot_handler_t handle, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send general files. More...
telebot_error_e telebot_send_document (telebot_handler_t handle, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send general files.
 
telebot_error_e telebot_send_video (telebot_handler_t handle, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video files, Telegram clients support mp4 videos (other formats may be sent as Document). More...
telebot_error_e telebot_send_video (telebot_handler_t handle, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
 
telebot_error_e telebot_send_animation (telebot_handler_t handle, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send animation files (GIF or H.264/MPEG-4 AVC without sound). More...
telebot_error_e telebot_send_animation (telebot_handler_t handle, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send animation files (GIF or H.264/MPEG-4 AVC without sound).
 
telebot_error_e telebot_send_voice (telebot_handler_t handle, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). More...
telebot_error_e telebot_send_voice (telebot_handler_t handle, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).
 
telebot_error_e telebot_send_video_note (telebot_handler_t handle, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. More...
telebot_error_e telebot_send_video_note (telebot_handler_t handle, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
 
telebot_error_e telebot_send_location (telebot_handler_t handle, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send point on the map. More...
telebot_error_e telebot_send_media_group (telebot_handler_t handle, long long int chat_id, char *media_paths[], int count, bool disable_notification, int reply_to_message_id)
 Send a group of photos as an album.
 
telebot_error_e telebot_send_location (telebot_handler_t handle, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send point on the map.
 
telebot_error_e telebot_edit_message_live_location (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
 Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_stop_message_live_location(). More...
telebot_error_e telebot_edit_message_live_location (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
 Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_stop_message_live_location().
 
telebot_error_e telebot_stop_message_live_location (telebot_handler_t handle, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
 Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires. More...
telebot_error_e telebot_stop_message_live_location (telebot_handler_t handle, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
 Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
 
telebot_error_e telebot_send_venue (telebot_handler_t handle, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send information about a venue. More...
telebot_error_e telebot_send_venue (telebot_handler_t handle, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send information about a venue.
 
telebot_error_e telebot_send_contact (telebot_handler_t handle, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send phone contacts. More...
telebot_error_e telebot_send_contact (telebot_handler_t handle, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send phone contacts.
 
telebot_error_e telebot_send_poll (telebot_handler_t handle, long long int chat_id, const char *question, const char **options, int count_options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a native poll. More...
telebot_error_e telebot_send_poll (telebot_handler_t handle, long long int chat_id, const char *question, const char **options, int count_options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a native poll.
 
telebot_error_e telebot_send_dice (telebot_handler_t handle, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a dice, which will have a random value from 1 to 6. More...
telebot_error_e telebot_send_dice (telebot_handler_t handle, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a dice, which will have a random value from 1 to 6.
 
telebot_error_e telebot_send_chat_action (telebot_handler_t handle, long long int chat_id, char *action)
 Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive. More...
telebot_error_e telebot_send_chat_action (telebot_handler_t handle, long long int chat_id, char *action)
 Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.
 
telebot_error_e telebot_get_user_profile_photos (telebot_handler_t handle, int user_id, int offset, int limit, telebot_user_profile_photos_t *photos)
 This function is used to get user profile pictures object. More...
telebot_error_e telebot_get_user_profile_photos (telebot_handler_t handle, int user_id, int offset, int limit, telebot_user_profile_photos_t *photos)
 This function is used to get user profile pictures object.
 
telebot_error_e telebot_put_user_profile_photos (telebot_user_profile_photos_t *photos)
 This function is used to free memory allocated for user profile pictures object. More...
telebot_error_e telebot_put_user_profile_photos (telebot_user_profile_photos_t *photos)
 This function is used to free memory allocated for user profile pictures object.
 
telebot_error_e telebot_download_file (telebot_handler_t handle, const char *file_id, const char *path)
 This function is used to download file. More...
+telebot_error_e telebot_get_user_profile_audios (telebot_handler_t handle, long long int user_id, int offset, int limit, telebot_user_profile_audios_t *audios)
 Use this method to get user profile audios.
 
+telebot_error_e telebot_put_user_profile_audios (telebot_user_profile_audios_t *audios)
 Release user profile audios obtained with telebot_get_user_profile_audios.
 
+telebot_error_e telebot_set_my_profile_photo (telebot_handler_t handle, const char *photo)
 Use this method to set the bot's profile photo.
 
+telebot_error_e telebot_remove_my_profile_photo (telebot_handler_t handle, const char *photo_id)
 Use this method to remove the bot's profile photo.
 
+telebot_error_e telebot_get_business_connection (telebot_handler_t handle, const char *business_connection_id, telebot_business_connection_t *connection)
 Use this method to get information about the business connection.
 
+telebot_error_e telebot_put_business_connection (telebot_business_connection_t *connection)
 Release business connection obtained with telebot_get_business_connection.
 
+telebot_error_e telebot_get_user_chat_boosts (telebot_handler_t handle, long long int chat_id, long long int user_id, telebot_user_chat_boosts_t *boosts)
 Use this method to get user chat boosts.
 
+telebot_error_e telebot_put_user_chat_boosts (telebot_user_chat_boosts_t *boosts)
 Release user chat boosts obtained with telebot_get_user_chat_boosts.
 
telebot_error_e telebot_download_file (telebot_handler_t handle, const char *file_id, const char *path)
 This function is used to download file.
 
telebot_error_e telebot_kick_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, long until_date)
 Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
telebot_error_e telebot_kick_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, long until_date)
 Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_error_e telebot_unban_chat_member (telebot_handler_t handle, long long int chat_id, int user_id)
 Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. More...
telebot_error_e telebot_unban_chat_member (telebot_handler_t handle, long long int chat_id, int user_id)
 Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.
 
telebot_error_e telebot_restrict_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user. More...
telebot_error_e telebot_restrict_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user.
 
telebot_error_e telebot_promote_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
 Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. More...
telebot_error_e telebot_promote_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
 Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
 
telebot_error_e telebot_set_chat_admin_custom_title (telebot_handler_t handle, long long int chat_id, int user_id, const char *custom_title)
 Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
telebot_error_e telebot_set_chat_admin_custom_title (telebot_handler_t handle, long long int chat_id, int user_id, const char *custom_title)
 Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_error_e telebot_set_chat_permissions (telebot_handler_t handle, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights. More...
telebot_error_e telebot_set_chat_permissions (telebot_handler_t handle, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.
 
telebot_error_e telebot_export_chat_invite_link (telebot_handler_t handle, long long int chat_id, char **invite_link)
 Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
telebot_error_e telebot_export_chat_invite_link (telebot_handler_t handle, long long int chat_id, char **invite_link)
 Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_error_e telebot_set_chat_photo (telebot_handler_t handle, long long int chat_id, const char *photo)
 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 admin rights. More...
telebot_error_e telebot_set_chat_photo (telebot_handler_t handle, long long int chat_id, const char *photo)
 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 admin rights.
 
telebot_error_e telebot_delete_chat_photo (telebot_handler_t handle, long long int chat_id)
 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 admin rights. More...
telebot_error_e telebot_delete_chat_photo (telebot_handler_t handle, long long int chat_id)
 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 admin rights.
 
telebot_error_e telebot_set_chat_title (telebot_handler_t handle, long long int chat_id, const char *title)
 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 admin rights. More...
telebot_error_e telebot_set_chat_title (telebot_handler_t handle, long long int chat_id, const char *title)
 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 admin rights.
 
telebot_error_e telebot_set_chat_description (telebot_handler_t handle, long long int chat_id, const char *description)
 Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
telebot_error_e telebot_set_chat_description (telebot_handler_t handle, long long int chat_id, const char *description)
 Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_error_e telebot_pin_chat_message (telebot_handler_t handle, long long int chat_id, int message_id, bool disable_notification)
 Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. More...
telebot_error_e telebot_pin_chat_message (telebot_handler_t handle, long long int chat_id, int message_id, bool disable_notification)
 Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
 
telebot_error_e telebot_unpin_chat_message (telebot_handler_t handle, long long int chat_id)
 Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. More...
telebot_error_e telebot_unpin_chat_message (telebot_handler_t handle, long long int chat_id)
 Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
 
telebot_error_e telebot_leave_chat (telebot_handler_t handle, long long int chat_id)
 Leave a group, supergroup or channel. More...
telebot_error_e telebot_leave_chat (telebot_handler_t handle, long long int chat_id)
 Leave a group, supergroup or channel.
 
telebot_error_e telebot_get_chat (telebot_handler_t handle, long long int chat_id, telebot_chat_t *chat)
 Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc). More...
telebot_error_e telebot_get_chat (telebot_handler_t handle, long long int chat_id, telebot_chat_t *chat)
 Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).
 
telebot_error_e telebot_put_chat (telebot_chat_t *chat)
 Release chat obtained with telebot_get_chat(). More...
telebot_error_e telebot_put_chat (telebot_chat_t *chat)
 Release chat obtained with telebot_get_chat().
 
telebot_error_e telebot_get_chat_admins (telebot_handler_t handle, long long int chat_id, telebot_chat_member_t **admin, int *count)
 Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. More...
telebot_error_e telebot_get_chat_admins (telebot_handler_t handle, long long int chat_id, telebot_chat_member_t **admin, int *count)
 Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
 
telebot_error_e telebot_put_chat_admins (telebot_chat_member_t *admins, int count)
 Release chat admins obtained with telebot_get_chat_admins(). More...
telebot_error_e telebot_put_chat_admins (telebot_chat_member_t *admins, int count)
 Release chat admins obtained with telebot_get_chat_admins().
 
telebot_error_e telebot_get_chat_members_count (telebot_handler_t handle, long long int chat_id, int *count)
 Get the number of members in a chat. More...
telebot_error_e telebot_get_chat_members_count (telebot_handler_t handle, long long int chat_id, int *count)
 Get the number of members in a chat.
 
telebot_error_e telebot_get_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, telebot_chat_member_t *member)
 Get information about a member of a chat. More...
telebot_error_e telebot_get_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, telebot_chat_member_t *member)
 Get information about a member of a chat.
 
telebot_error_e telebot_put_chat_member (telebot_chat_member_t *member)
 Release chat member otained with telebot_get_chat_member(). More...
telebot_error_e telebot_put_chat_member (telebot_chat_member_t *member)
 Release chat member otained with telebot_get_chat_member().
 
telebot_error_e telebot_set_chat_sticker_set (telebot_handler_t handle, long long int chat_id, const char *sticker_set_name)
 Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use it. More...
telebot_error_e telebot_set_chat_sticker_set (telebot_handler_t handle, long long int chat_id, const char *sticker_set_name)
 Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use it.
 
telebot_error_e telebot_delete_chat_sticker_set (telebot_handler_t handle, long long int chat_id)
 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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use this method. More...
telebot_error_e telebot_delete_chat_sticker_set (telebot_handler_t handle, long long int chat_id)
 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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use this method.
 
telebot_error_e telebot_answer_callback_query (telebot_handler_t handle, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
 Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. More...
telebot_error_e telebot_answer_callback_query (telebot_handler_t handle, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
 Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
 
telebot_error_e telebot_set_my_commands (telebot_handler_t handle, telebot_bot_command_t commands[], int count)
 Change the list of the bot's commands. More...
telebot_error_e telebot_set_my_commands (telebot_handler_t handle, telebot_bot_command_t commands[], int count)
 Change the list of the bot's commands.
 
telebot_error_e telebot_get_my_commands (telebot_handler_t handle, telebot_bot_command_t **commands, int *count)
 Get the current list of the bot's commands. More...
telebot_error_e telebot_get_my_commands (telebot_handler_t handle, telebot_bot_command_t **commands, int *count)
 Get the current list of the bot's commands.
 
telebot_error_e telebot_put_my_commands (telebot_bot_command_t *commands, int count)
 Release bot commands obtained with telebot_get_my_commands(). More...
telebot_error_e telebot_put_my_commands (telebot_bot_command_t *commands, int count)
 Release bot commands obtained with telebot_get_my_commands().
 
telebot_error_e telebot_edit_message_text (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
 Edit text and game messages sent by the bot or via the bot (for inline bots). More...
telebot_error_e telebot_edit_message_text (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
 Edit text and game messages sent by the bot or via the bot (for inline bots).
 
telebot_error_e telebot_edit_message_caption (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
 Edit captions of messages sent by the bot or via the bot (for inline bots). More...
telebot_error_e telebot_edit_message_caption (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
 Edit captions of messages sent by the bot or via the bot (for inline bots).
 
telebot_error_e telebot_edit_message_reply_markup (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
 Edit only the reply markup of messages sent by the bot or via the bot (for inline bots). More...
telebot_error_e telebot_edit_message_reply_markup (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
 Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
 
telebot_error_e telebot_stop_poll (telebot_handler_t handle, long long int chat_id, int message_id, const char *reply_markup)
 Stop a poll which was sent by the bot. More...
telebot_error_e telebot_stop_poll (telebot_handler_t handle, long long int chat_id, int message_id, const char *reply_markup)
 Stop a poll which was sent by the bot.
 
telebot_error_e telebot_delete_message (telebot_handler_t handle, long long int chat_id, int message_id)
 Delete a message, including service messages, with the following limitations: More...
telebot_error_e telebot_delete_message (telebot_handler_t handle, long long int chat_id, int message_id)
 Delete a message, including service messages, with the following limitations:
 
telebot_error_e telebot_send_sticker (telebot_handler_t handle, long long int chat_id, const char *sticker, bool is_file, bool disable_notification, int reply_to_message_id, char *reply_markup)
 Send static .WEBP or animated .TGS stickers. More...
telebot_error_e telebot_log_out (telebot_handler_t handle)
 Use this method to log out from the cloud Bot API server before launching the bot locally.
 
telebot_error_e telebot_close (telebot_handler_t handle)
 Use this method to close the bot instance before moving it from one local server to another.
 
telebot_error_e telebot_set_my_name (telebot_handler_t handle, const char *name, const char *language_code)
 Use this method to change the bot's name.
 
telebot_error_e telebot_get_my_name (telebot_handler_t handle, const char *language_code, char **name)
 Use this method to get the current bot name for the given user language.
 
telebot_error_e telebot_set_my_description (telebot_handler_t handle, const char *description, const char *language_code)
 Use this method to change the bot's description.
 
telebot_error_e telebot_get_my_description (telebot_handler_t handle, const char *language_code, char **description)
 Use this method to get the current bot description for the given user language.
 
telebot_error_e telebot_set_my_short_description (telebot_handler_t handle, const char *short_description, const char *language_code)
 Use this method to change the bot's short description.
 
telebot_error_e telebot_get_my_short_description (telebot_handler_t handle, const char *language_code, char **short_description)
 Use this method to get the current bot short description for the given user language.
 
telebot_error_e telebot_set_chat_menu_button (telebot_handler_t handle, long long int chat_id, const char *menu_button)
 Use this method to change the bot's menu button in a private chat, or the default menu button.
 
telebot_error_e telebot_get_chat_menu_button (telebot_handler_t handle, long long int chat_id, char **menu_button)
 Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
 
telebot_error_e telebot_set_my_default_administrator_rights (telebot_handler_t handle, const char *rights, bool for_channels)
 Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
 
telebot_error_e telebot_get_my_default_administrator_rights (telebot_handler_t handle, bool for_channels, char **rights)
 Use this method to get the current default administrator rights of the bot.
 
telebot_error_e telebot_delete_my_commands (telebot_handler_t handle, const char *scope, const char *language_code)
 Use this method to delete the list of the bot's commands for the given scope and user language.
 
telebot_error_e telebot_copy_message (telebot_handler_t handle, long long int chat_id, long long int from_chat_id, int message_id, const char *caption, const char *parse_mode, const char *caption_entities, bool disable_notification, bool protect_content, int reply_to_message_id, bool allow_sending_without_reply, const char *reply_markup, int *message_id_out)
 Use this method to copy messages of any kind.
 
telebot_error_e telebot_copy_messages (telebot_handler_t handle, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, bool remove_caption, int **message_ids_out, int *count)
 Use this method to copy multiple messages of any kind.
 
telebot_error_e telebot_forward_messages (telebot_handler_t handle, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, int **message_ids_out, int *count)
 Use this method to forward multiple messages of any kind.
 
telebot_error_e telebot_delete_messages (telebot_handler_t handle, long long int chat_id, const char *message_ids)
 Use this method to delete multiple messages in a chat.
 
telebot_error_e telebot_ban_chat_member (telebot_handler_t handle, long long int chat_id, int user_id, long until_date, bool revoke_messages)
 Use this method to ban a user in a group, a supergroup or a channel.
 
telebot_error_e telebot_ban_chat_sender_chat (telebot_handler_t handle, long long int chat_id, long long int sender_chat_id)
 Use this method to ban a channel chat in a supergroup or a channel.
 
telebot_error_e telebot_unban_chat_sender_chat (telebot_handler_t handle, long long int chat_id, long long int sender_chat_id)
 Use this method to unban a previously banned channel chat in a supergroup or a channel.
 
telebot_error_e telebot_create_chat_invite_link (telebot_handler_t handle, long long int chat_id, const char *name, long expire_date, int member_limit, bool creates_join_request, telebot_chat_invite_link_t *invite_link)
 Use this method to create an additional invite link for a chat.
 
telebot_error_e telebot_edit_chat_invite_link (telebot_handler_t handle, long long int chat_id, const char *invite_link_str, const char *name, long expire_date, int member_limit, bool creates_join_request, telebot_chat_invite_link_t *invite_link)
 Use this method to edit a non-primary invite link created by the bot.
 
telebot_error_e telebot_revoke_chat_invite_link (telebot_handler_t handle, long long int chat_id, const char *invite_link_str, telebot_chat_invite_link_t *invite_link)
 Use this method to revoke an invite link created by the bot.
 
telebot_error_e telebot_put_chat_invite_link (telebot_chat_invite_link_t *invite_link)
 Release chat invite link obtained with telebot_create_chat_invite_link etc.
 
telebot_error_e telebot_approve_chat_join_request (telebot_handler_t handle, long long int chat_id, int user_id)
 Use this method to approve a chat join request.
 
telebot_error_e telebot_decline_chat_join_request (telebot_handler_t handle, long long int chat_id, int user_id)
 Use this method to decline a chat join request.
 
telebot_error_e telebot_set_message_reaction (telebot_handler_t handle, long long int chat_id, int message_id, const char *reaction, bool is_big)
 Use this method to set a new message reaction.
 
telebot_error_e telebot_edit_message_media (telebot_handler_t handle, long long int chat_id, int message_id, const char *inline_message_id, const char *media, const char *reply_markup)
 Use this method to edit animation, audio, document, photo, or video messages.
 
+telebot_error_e telebot_set_passport_data_errors (telebot_handler_t handle, long long int user_id, const char *errors)
 Use this method to set passport data errors.
 
+telebot_error_e telebot_send_invoice (telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup, telebot_message_t *message)
 Use this method to send an invoice.
 
+telebot_error_e telebot_create_invoice_link (telebot_handler_t handle, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, char **invoice_link)
 Use this method to create a link for an invoice.
 
+telebot_error_e telebot_answer_shipping_query (telebot_handler_t handle, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
 Use this method to reply to shipping queries.
 
+telebot_error_e telebot_answer_pre_checkout_query (telebot_handler_t handle, const char *pre_checkout_query_id, bool ok, const char *error_message)
 Use this method to respond to pre-checkout queries.
 
+telebot_error_e telebot_get_my_star_balance (telebot_handler_t handle, long long int *balance)
 Use this method to get the current Telegram Stars balance of the bot.
 
+telebot_error_e telebot_get_star_transactions (telebot_handler_t handle, int offset, int limit, telebot_star_transactions_t *transactions)
 Use this method to get the bot's Telegram Star transactions.
 
+telebot_error_e telebot_put_star_transactions (telebot_star_transactions_t *transactions)
 Release star transactions obtained with telebot_get_star_transactions.
 
+telebot_error_e telebot_refund_star_payment (telebot_handler_t handle, long long int user_id, const char *telegram_payment_charge_id)
 Use this method to refund a successful payment in Telegram Stars.
 
+telebot_error_e telebot_get_available_gifts (telebot_handler_t handle, telebot_gifts_t *gifts)
 Use this method to get a list of gifts that can be sent by the bot to users.
 
+telebot_error_e telebot_put_available_gifts (telebot_gifts_t *gifts)
 Release available gifts obtained with telebot_get_available_gifts.
 
+telebot_error_e telebot_put_gift (telebot_gift_t *gift)
 Release a gift object.
 
+telebot_error_e telebot_get_user_gifts (telebot_handler_t handle, long long int user_id, int offset, int limit, telebot_user_gifts_t *gifts)
 Use this method to get a list of gifts received by a user.
 
+telebot_error_e telebot_put_user_gifts (telebot_user_gifts_t *gifts)
 Release user gifts obtained with telebot_get_user_gifts.
 
+telebot_error_e telebot_put_user_gift (telebot_user_gift_t *gift)
 Release a user gift object.
 
+telebot_error_e telebot_get_chat_gifts (telebot_handler_t handle, long long int chat_id, int offset, int limit, telebot_user_gifts_t *gifts)
 Use this method to get a list of gifts received by a chat.
 
+telebot_error_e telebot_put_chat_gifts (telebot_user_gifts_t *gifts)
 Release chat gifts obtained with telebot_get_chat_gifts.
 
+telebot_error_e telebot_upgrade_gift (telebot_handler_t handle, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to upgrade a gift.
 
+telebot_error_e telebot_transfer_gift (telebot_handler_t handle, long long int user_id, long long int chat_id, const char *gift_id)
 Use this method to transfer a gift.
 
+telebot_error_e telebot_convert_gift_to_stars (telebot_handler_t handle, const char *gift_id)
 Use this method to convert a gift to Telegram Stars.
 
+telebot_error_e telebot_send_gift (telebot_handler_t handle, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to send a gift.
 
+telebot_error_e telebot_gift_premium_subscription (telebot_handler_t handle, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to gift a Telegram Premium subscription to a user.
 
telebot_error_e telebot_send_sticker (telebot_handler_t handle, long long int chat_id, const char *sticker, bool is_file, bool disable_notification, int reply_to_message_id, char *reply_markup)
 Send static .WEBP or animated .TGS stickers.
 
telebot_error_e telebot_get_sticker_set (telebot_handler_t handle, const char *name, telebot_sticker_set_t *stickers)
 Get a sticker set. More...
telebot_error_e telebot_get_sticker_set (telebot_handler_t handle, const char *name, telebot_sticker_set_t *stickers)
 Get a sticker set.
 
telebot_error_e telebot_put_sticker_set (telebot_sticker_set_t *stickers)
 Release sticker set obtained with telebot_get_sticker_set() More...
telebot_error_e telebot_put_sticker_set (telebot_sticker_set_t *stickers)
 Release sticker set obtained with telebot_get_sticker_set()
 
telebot_error_e telebot_put_sticker (telebot_sticker_t *sticker)
 Release a sticker object.
 

Detailed Description

Simplified APIs to create telegram bot.

Typedef Documentation

- -

◆ telebot_file_t

+ +

◆ telebot_file_t

- +
typedef struct telebot_file telebot_file_ttypedef struct telebot_file telebot_file_t
@@ -613,8 +1607,8 @@

Enumeration Type Documentation

- -

◆ telebot_error_e

+ +

◆ telebot_error_e

@@ -627,24 +1621,24 @@

-EnumeratorTELEBOT_ERROR_NONE 

Successful

+EnumeratorTELEBOT_ERROR_NONE 

Successful

-TELEBOT_ERROR_OPERATION_FAILED 

Operation failed

+TELEBOT_ERROR_OPERATION_FAILED 

Operation failed

-TELEBOT_ERROR_NOT_SUPPORTED 

Not supported

+TELEBOT_ERROR_NOT_SUPPORTED 

Not supported

-TELEBOT_ERROR_OUT_OF_MEMORY 

Out of memory

+TELEBOT_ERROR_OUT_OF_MEMORY 

Out of memory

-TELEBOT_ERROR_NO_CONNECTION 

No Internet connection

+TELEBOT_ERROR_NO_CONNECTION 

No Internet connection

-TELEBOT_ERROR_INVALID_PARAMETER 

Invalid parameter

+TELEBOT_ERROR_INVALID_PARAMETER 

Invalid parameter

- -

◆ telebot_update_type

+ +

◆ telebot_update_type

@@ -657,37 +1651,61 @@

-EnumeratorTELEBOT_UPDATE_TYPE_MESSAGE 

Message

+EnumeratorTELEBOT_UPDATE_TYPE_MESSAGE 

Message

+ +TELEBOT_UPDATE_TYPE_EDITED_MESSAGE 

Edited message

+ +TELEBOT_UPDATE_TYPE_CHANNEL_POST 

Channel post

+ +TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST 

Edited channel post

+ +TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION 

Business connection

+ +TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE 

Business message

+ +TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE 

Edited business message

+ +TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES 

Deleted business messages

-TELEBOT_UPDATE_TYPE_EDITED_MESSAGE 

Edited message

+TELEBOT_UPDATE_TYPE_MESSAGE_REACTION 

Message reaction updated

-TELEBOT_UPDATE_TYPE_CHANNEL_POST 

Channel post

+TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT 

Message reaction count updated

-TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST 

Edited channel post

+TELEBOT_UPDATE_TYPE_INLINE_QUERY 

Inline query

-TELEBOT_UPDATE_TYPE_INLINE_QUERY 

Inline query

+TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT 

Chosen inline result

-TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT 

Chosen inline result

+TELEBOT_UPDATE_TYPE_CALLBACK_QUERY 

Callback query

-TELEBOT_UPDATE_TYPE_CALLBACK_QUERY 

Callback query

+TELEBOT_UPDATE_TYPE_SHIPPING_QUERY 

Shipping query

-TELEBOT_UPDATE_TYPE_SHIPPING_QUERY 

Shipping query

+TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY 

Pre-checkout query

-TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY 

Pre-checkout query

+TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA 

User purchased paid media

-TELEBOT_UPDATE_TYPE_POLL 

Poll

+TELEBOT_UPDATE_TYPE_POLL 

Poll

-TELEBOT_UPDATE_TYPE_POLL_ANSWER 

Poll answer

+TELEBOT_UPDATE_TYPE_POLL_ANSWER 

Poll answer

-TELEBOT_UPDATE_TYPE_MAX 

Number of update types

+TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER 

My chat member updated

+ +TELEBOT_UPDATE_TYPE_CHAT_MEMBER 

Chat member updated

+ +TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST 

Chat join request

+ +TELEBOT_UPDATE_TYPE_CHAT_BOOST 

Chat boost updated

+ +TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST 

Chat boost removed

+ +TELEBOT_UPDATE_TYPE_MAX 

Number of update types

Function Documentation

- -

◆ telebot_answer_callback_query()

+ +

◆ telebot_answer_callback_query()

@@ -695,7 +1713,7 @@

telebot_error_e telebot_answer_callback_query ( - telebot_handler_t  + telebot_handler_t  handle, @@ -739,11 +1757,11 @@

Parameters
- + - +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]callback_query_idUnique identifier for the query to be answered.
[in]textText of the notification. If not specified, nothing will be shown to the user, 0-200 characters
[in]show_alertIf true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
[in]urlURL that will be opened by the user's client. If you have created a Game and accepted the conditions via , specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.
[in]urlURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.
[in]cache_timeThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14.
@@ -752,23 +1770,29 @@

-

◆ telebot_create()

+ +

◆ telebot_approve_chat_join_request()

- + - + - - + + + + + + + + @@ -778,12 +1802,12 @@

-

Initial function to use telebot APIs.

-

This function must be used first to call, and it creates handler. This call MUST have corresponding call to telebot_destroy() when operation is complete.

+

Use this method to approve a chat join request.

Parameters

telebot_error_e telebot_create telebot_error_e telebot_approve_chat_join_request (telebot_handler_ttelebot_handler_t  handle,
char * token long long int chat_id,
int user_id 
- - + + +
[out]handlePointer to create telebot handler to use APIs, it must be destroyed with telebot_destroy().
[in]tokenTelegram Bot token to use.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
@@ -791,61 +1815,41 @@

-

◆ telebot_delete_chat_photo()

+ +

◆ telebot_ban_chat_member()

- + - + - + + - - + + -
telebot_error_e telebot_delete_chat_photo telebot_error_e telebot_ban_chat_member (telebot_handler_t telebot_handler_t  handle,
long long int chat_id chat_id,
)int user_id,
-
- -

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 admin rights.

-
Parameters
- - - -
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
-
-
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -
-
- -

◆ telebot_delete_chat_sticker_set()

- -
-
- - - - - + + + + - - + + @@ -855,11 +1859,14 @@

-

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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use this method.

+

Use this method to ban a user in a group, a supergroup or a channel.

Parameters

telebot_error_e telebot_delete_chat_sticker_set (telebot_handler_t handle, long until_date,
long long int chat_id bool revoke_messages 
- - + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
[in]until_dateDate when the user will be unbanned, unix time.
[in]revoke_messagesPass True to delete all messages from the chat for the user that is being banned.
@@ -867,16 +1874,16 @@

-

◆ telebot_delete_message()

+ +

◆ telebot_ban_chat_sender_chat()

- -

◆ telebot_delete_webhook()

+ +

◆ telebot_close()

- + - +
telebot_error_e telebot_delete_webhook telebot_error_e telebot_close (telebot_handler_t telebot_handler_t  handle)
-

This function is used to remove webhook integration if you decide to switch back to getUpdates.

+

Use this method to close the bot instance before moving it from one local server to another.

Parameters
- +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler.
@@ -945,27 +1946,44 @@

-

◆ telebot_destroy()

+ +

◆ telebot_close_forum_topic()

- + - - + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_destroy telebot_error_e telebot_close_forum_topic (telebot_handler_t handle)telebot_handler_t handle,
long long int chat_id,
int message_thread_id 
)
-

Final function to use telebo APIs.

-

This function must be the last function to call for a telebot use. It is the opposite of the telebot_create() function.

+

Use this method to close an open topic in a forum supergroup chat.

Parameters
- + + +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
@@ -973,29 +1991,23 @@

-

◆ telebot_download_file()

+ +

◆ telebot_close_general_forum_topic()

- + - + - - - - - - - - + + @@ -1005,11 +2017,11 @@

-

This function is used to download file.

+

Use this method to close an open 'General' topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_download_file telebot_error_e telebot_close_general_forum_topic (telebot_handler_t telebot_handler_t  handle,
const char * file_id,
const char * path long long int chat_id 
- - + +
[in]file_idFile identifier to get info about.
[in]pathA path where the file is downloaded
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
@@ -1017,16 +2029,16 @@

-

◆ telebot_edit_message_caption()

+ +

◆ telebot_copy_message()

- + - + @@ -1038,14 +2050,14 @@

- - + + - - + + @@ -1063,25 +2075,68 @@

- + + - - + + -
telebot_error_e telebot_edit_message_caption telebot_error_e telebot_copy_message (telebot_handler_t telebot_handler_t  handle,
int message_id, long long int from_chat_id,
const char * inline_message_id, int message_id,
const char * reply_markup caption_entities,
)bool disable_notification,
-
+ +

Use this method to copy messages of any kind.

+
Parameters
+ + + + + + + + + + + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original message was sent.
[in]message_idMessage identifier in the chat specified by from_chat_id.
[in]captionNew caption for media, 0-1024 characters after entities parsing.
[in]parse_modeMode for parsing entities in the new caption.
[in]caption_entitiesA JSON-serialized list of special entities that appear in the new caption.
[in]disable_notificationSends the message silently.
[in]protect_contentProtects the contents of the sent message from forwarding and saving.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]allow_sending_without_replyPass True if the message should be sent even if the specified replied-to message is not found.
[in]reply_markupAdditional interface options.
[out]message_id_outPointer to get the message identifier of the sent message.
@@ -1089,16 +2144,16 @@

-

◆ telebot_edit_message_live_location()

+ +

◆ telebot_copy_messages()

- + - + @@ -1110,32 +2165,44 @@

- - + + - + - - + + - - + + - - + + + + + + + + + + + + + + @@ -1145,16 +2212,18 @@

-

Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_stop_message_live_location().

+

Use this method to copy multiple messages of any kind.

Parameters

telebot_error_e telebot_edit_message_live_location telebot_error_e telebot_copy_messages (telebot_handler_t telebot_handler_t  handle,
int message_id, long long int from_chat_id,
const char * inline_message_id, message_ids,
float latitude, bool disable_notification,
float longitude, bool protect_content,
const char * reply_markup bool remove_caption,
int ** message_ids_out,
int * count 
- - - - - - - + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original messages were sent.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy.
[in]disable_notificationSends the messages silently.
[in]protect_contentProtects the contents of the sent messages from forwarding and saving.
[in]remove_captionPass True to copy the messages without their captions.
[out]message_ids_outPointer to get the message identifiers of the sent messages, MUST be freed after use.
[out]countPointer to get the number of messages sent.
@@ -1162,41 +2231,23 @@

-

◆ telebot_edit_message_reply_markup()

+ +

◆ telebot_create()

- + - + - - - - - - - - - - - - - - - - - - - - + + @@ -1206,14 +2257,12 @@

-

Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

+

Initial function to use telebot APIs.

+

This function must be used first to call, and it creates handler. This call MUST have corresponding call to telebot_destroy() when operation is complete.

Parameters

telebot_error_e telebot_edit_message_reply_markup telebot_error_e telebot_create (telebot_handler_t telebot_handler_t handle,
long long int chat_id,
int message_id,
const char * inline_message_id,
const char * reply_markup char * token 
- - - - - + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[out]handlePointer to create telebot handler to use APIs, it must be destroyed with telebot_destroy().
[in]tokenTelegram Bot token to use.
@@ -1221,16 +2270,16 @@

-

◆ telebot_edit_message_text()

+ +

◆ telebot_create_chat_invite_link()

- + - + @@ -1239,41 +2288,35 @@

long long int 

- - - - - - - + - - + + - - + + - + - - + + @@ -1283,17 +2326,16 @@

-

Edit text and game messages sent by the bot or via the bot (for inline bots).

+

Use this method to create an additional invite link for a chat.

Parameters

telebot_error_e telebot_edit_message_text telebot_error_e telebot_create_chat_invite_link (telebot_handler_t telebot_handler_t  handle,
chat_id,
int message_id,
const char * inline_message_id, name,
const char * text, long expire_date,
const char * parse_mode, int member_limit,
bool disable_web_page_preview, creates_join_request,
const char * reply_markup telebot_chat_invite_link_tinvite_link 
- - - - - - - - + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]textNew text of the message.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
[in]disable_web_page_priviewDisables link previews for links in this message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]nameInvite link name; 0-32 characters.
[in]expire_datePoint in time (Unix timestamp) when the link will expire.
[in]member_limitThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
[in]creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators.
[out]invite_linkPointer to get ChatInviteLink, MUST be released with telebot_put_chat_invite_link.
@@ -1301,16 +2343,16 @@

-

◆ telebot_export_chat_invite_link()

+ +

◆ telebot_create_forum_topic()

- + - + @@ -1322,8 +2364,26 @@

- - + + + + + + + + + + + + + + + + + + + + @@ -1333,12 +2393,15 @@

-

Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

Use this method to create a topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_export_chat_invite_link telebot_error_e telebot_create_forum_topic (telebot_handler_t telebot_handler_t  handle,
char ** invite_link const char * name,
int icon_color,
const char * icon_custom_emoji_id,
telebot_forum_topic_ttopic 
- - - + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]invite_linkExported invite link, must be freed after use.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]nameTopic name, 1-128 characters.
[in]icon_colorColor of the topic icon in RGB format.
[in]icon_custom_emoji_idUnique identifier of the custom emoji used as the topic icon.
[out]topicPointer to get ForumTopic, MUST be released with telebot_put_forum_topic.
@@ -1346,16 +2409,16 @@

-

◆ telebot_forward_message()

+ +

◆ telebot_decline_chat_join_request()

- + - + @@ -1364,23 +2427,11 @@

long long int 

- - - - - - - - - - - - - + @@ -1390,14 +2441,12 @@

-

Forward messages of any kind.

+

Use this method to decline a chat join request.

Parameters

telebot_error_e telebot_forward_message telebot_error_e telebot_decline_chat_join_request (telebot_handler_t telebot_handler_t  handle,
chat_id,
long long int from_chat_id,
bool disable_notification,
int message_id user_id 
- - - - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]from_chat_idUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername).
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]message_idUnique message identifier.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
@@ -1405,29 +2454,23 @@

-

◆ telebot_get_chat()

+ +

◆ telebot_delete_chat_photo()

- + - + - - - - - - - + @@ -1437,12 +2480,11 @@

-

Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).

+

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 admin rights.

Parameters

telebot_error_e telebot_get_chat telebot_error_e telebot_delete_chat_photo (telebot_handler_t telebot_handler_t  handle,
long long int chat_id,
telebot_chat_tchat chat_id 
- + -
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]chatPointer to chat, must be released with telebot_put_chat().
@@ -1450,35 +2492,23 @@

-

◆ telebot_get_chat_admins()

+ +

◆ telebot_delete_chat_sticker_set()

- + - + - - - - - - - - - - - - - + @@ -1488,13 +2518,11 @@

-

Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

+

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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use this method.

Parameters

telebot_error_e telebot_get_chat_admins telebot_error_e telebot_delete_chat_sticker_set (telebot_handler_t telebot_handler_t  handle,
long long int chat_id,
telebot_chat_member_t ** admin,
int * count chat_id 
- + - -
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]adminPointer to chat administrators, must be released with telebot_put_chat_admins().
[out]countPointer to get a number of administrators.
@@ -1502,16 +2530,16 @@

-

◆ telebot_get_chat_member()

+ +

◆ telebot_delete_forum_topic()

- + - + @@ -1524,13 +2552,7 @@

- - - - - - - + @@ -1540,13 +2562,12 @@

-

Get information about a member of a chat.

+

Use this method to delete a forum topic along with all its messages in a forum supergroup chat.

Parameters

telebot_error_e telebot_get_chat_member telebot_error_e telebot_delete_forum_topic (telebot_handler_t telebot_handler_t  handle,
int user_id,
telebot_chat_member_tmember message_thread_id 
- - - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[out]memberPointer to chat member to obtain, must be released with telebot_put_chat_member().
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
@@ -1554,16 +2575,16 @@

-

◆ telebot_get_chat_members_count()

+ +

◆ telebot_delete_message()

- + - + @@ -1575,8 +2596,8 @@

- - + + @@ -1586,36 +2607,48 @@

-

Get the number of members in a chat.

-
Parameters
+

Delete a message, including service messages, with the following limitations:

+
    +
  • A message can only be deleted if it was sent less than 48 hours ago.
  • +
  • Bots can delete outgoing messages in groups and supergroups.
  • +
  • Bots granted can_post_messages permissions can delete outgoing messages in channels.
  • +
  • If the bot is an administrator of a group, it can delete any message there.
  • +
  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
    Parameters

telebot_error_e telebot_get_chat_members_count telebot_error_e telebot_delete_message (telebot_handler_t telebot_handler_t  handle,
int * count int message_id 
- - - + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]countNumber of chat members.
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target message_id Message identifier to be deleted.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
- -

◆ telebot_get_me()

+ +

◆ telebot_delete_messages()

- + - + - - + + + + + + + + @@ -1625,41 +2658,42 @@

-

This function is used to get information about telegram bot itself.

+

Use this method to delete multiple messages in a chat.

Parameters

telebot_error_e telebot_get_me telebot_error_e telebot_delete_messages (telebot_handler_t telebot_handler_t  handle,
telebot_user_tme long long int chat_id,
const char * message_ids 
- - + + +
[in]handleThe telebot handler created with telebot_create().
[out]meTelegram user object, it needs to be released with telebot_put_me after use.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages to delete.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, and user object is stored in input parameter.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -

◆ telebot_get_my_commands()

+ +

◆ telebot_delete_my_commands()

- + - + - - + + - - + + @@ -1669,12 +2703,12 @@

-

Get the current list of the bot's commands.

+

Use this method to delete the list of the bot's commands for the given scope and user language.

Parameters

telebot_error_e telebot_get_my_commands telebot_error_e telebot_delete_my_commands (telebot_handler_t telebot_handler_t  handle,
telebot_bot_command_t ** commands, const char * scope,
int * count const char * language_code 
- - - + + +
[in]handleThe telebot handler created with telebot_create().
[out]commandsPointer to commands to be obtained, which must be released with telebot_put_my_commands().
[out]countPointer to place the number of commands.
[in]handleThe telebot handler.
[in]scopeA JSON-serialized object, describing scope of users for which the commands are relevant.
[in]language_codeA two-letter ISO 639-1 language code.
@@ -1682,37 +2716,54 @@

-

◆ telebot_get_proxy()

+ +

◆ telebot_delete_webhook()

- + - - - - - + + - - +
telebot_error_e telebot_get_proxy telebot_error_e telebot_delete_webhook (telebot_handler_t handle,
telebot_handler_t handle) char ** addr 
+
+ +

This function is used to remove webhook integration if you decide to switch back to getUpdates.

+
Parameters
+ + +
[in]handleThe telebot handler created with telebot_create().
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_destroy()

+ +
+
+ + + + + - -
telebot_error_e telebot_destroy (telebot_handler_t handle) )
-

Get proxy address currently used.

+

Final function to use telebo APIs.

+

This function must be the last function to call for a telebot use. It is the opposite of the telebot_create() function.

Parameters
- - +
[in]handleThe telebot handler created with telebot_create().
[out]addrCurrent proxy address or NULL, MUST be freed after use.
[in]handleThe telebot handler created with telebot_create().
@@ -1720,29 +2771,29 @@

-

◆ telebot_get_sticker_set()

+ +

◆ telebot_download_file()

- + - + - + - - + + @@ -1752,12 +2803,11 @@

-

Get a sticker set.

+

This function is used to download file.

Parameters

telebot_error_e telebot_get_sticker_set telebot_error_e telebot_download_file (telebot_handler_t telebot_handler_t  handle,
const char * name, file_id,
telebot_sticker_set_tstickers const char * path 
- - - + +
[in]handleThe telebot handler created with telebot_create().
[in]nameName of the sticker set.
[out]stickersPointer to sticker set, must be released with telebot_put_sticker_set.
[in]file_idFile identifier to get info about.
[in]pathA path where the file is downloaded
@@ -1765,59 +2815,59 @@

-

◆ telebot_get_updates()

+ +

◆ telebot_edit_chat_invite_link()

- + - + - - + + - - + + - - + + - - + + - + - - + + - - + + @@ -1827,56 +2877,59 @@

-

This function is used to get latest updates.

+

Use this method to edit a non-primary invite link created by the bot.

Parameters

telebot_error_e telebot_get_updates telebot_error_e telebot_edit_chat_invite_link (telebot_handler_t telebot_handler_t  handle,
int offset, long long int chat_id,
int limit, const char * invite_link_str,
int timeout, const char * name,
telebot_update_type_e allowed_updates[], long expire_date,
int allowed_updates_count, member_limit,
telebot_update_t ** updates, bool creates_join_request,
int * count telebot_chat_invite_link_tinvite_link 
- - - - - + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]allowed_updatesTypes of updates you want your bot to receive. Referes telebot_update_type_e.
[in]allowed_updates_countNumber of update types.
[out]updatesAn array of update objects, it needs to be released with telebot_put_updates after use.
[out]countNumber of updates received.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]invite_link_strThe invite link to edit.
[in]nameInvite link name; 0-32 characters.
[in]expire_datePoint in time (Unix timestamp) when the link will expire.
[in]member_limitThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
[in]creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators.
[out]invite_linkPointer to get ChatInviteLink, MUST be released with telebot_put_chat_invite_link.
-
Returns
On success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -

◆ telebot_get_user_profile_photos()

+ +

◆ telebot_edit_forum_topic()

- + - + - - + + - + - - + + - - + + @@ -1886,14 +2939,14 @@

-

This function is used to get user profile pictures object.

+

Use this method to edit name and icon of a topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_get_user_profile_photos telebot_error_e telebot_edit_forum_topic (telebot_handler_t telebot_handler_t  handle,
int user_id, long long int chat_id,
int offset, message_thread_id,
int limit, const char * name,
telebot_user_profile_photos_tphotos const char * icon_custom_emoji_id 
- - - - - + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]user_idUnique identifier of the target user.
[in]offsetSequential number of the first photo to be returned. By default, up to 10 photos are returned.
[in]limitLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
[out]photosA pointer to user profile photo object. It MUST be released with telebot_put_user_profile_photos after use.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
[in]nameNew topic name, 0-128 characters.
[in]icon_custom_emoji_idNew unique identifier of the custom emoji used as the topic icon.
@@ -1901,23 +2954,29 @@

-

◆ telebot_get_webhook_info()

+ +

◆ telebot_edit_general_forum_topic()

- + - + - - + + + + + + + + @@ -1927,28 +2986,29 @@

-

This function is used to get information about telegram bot itself.

+

Use this method to edit the name of the 'General' topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_get_webhook_info telebot_error_e telebot_edit_general_forum_topic (telebot_handler_t telebot_handler_t  handle,
telebot_webhook_info_tinfo long long int chat_id,
const char * name 
- - + + +
[in]handleThe telebot handler created with telebot_create().
[out]infoTelegram webhoook information, it needs to be released with telebot_put_webhook_info after use.
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]nameNew topic name, 1-128 characters.
-
Returns
On success, TELEBOT_ERROR_NONE is returned, and webhook information is stored in input parameter.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -

◆ telebot_kick_chat_member()

+ +

◆ telebot_edit_message_caption()

- -

◆ telebot_leave_chat()

- -
-
- - - - - + + + + - - + + @@ -2017,11 +3055,15 @@

-

Leave a group, supergroup or channel.

+

Edit captions of messages sent by the bot or via the bot (for inline bots).

Parameters

telebot_error_e telebot_leave_chat (telebot_handler_t handle, const char * parse_mode,
long long int chat_id const char * reply_markup 
- - + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]captionNew caption of the message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
@@ -2029,16 +3071,16 @@

-

◆ telebot_pin_chat_message()

+ +

◆ telebot_edit_message_live_location()

- + - + @@ -2056,8 +3098,26 @@

- - + + + + + + + + + + + + + + + + + + + + @@ -2067,13 +3127,16 @@

-

Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

+

Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_stop_message_live_location().

Parameters

telebot_error_e telebot_pin_chat_message telebot_error_e telebot_edit_message_live_location (telebot_handler_t telebot_handler_t  handle,
bool disable_notification const char * inline_message_id,
float latitude,
float longitude,
const char * reply_markup 
- + - - + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idIdentifier of a message to pin.
[in]disable_notificationPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
@@ -2081,16 +3144,16 @@

-

◆ telebot_promote_chat_member()

+ +

◆ telebot_edit_message_media()

+ +

◆ telebot_edit_message_reply_markup()

+ +
+
+ + + + + + - - + + - - + + - - + + - - + + @@ -2161,20 +3254,14 @@

-

Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

+

Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

Parameters

telebot_error_e telebot_edit_message_reply_markup (telebot_handler_t handle,
bool can_invite_users, long long int chat_id,
bool can_restrict_members, int message_id,
bool can_pin_messages, const char * inline_message_id,
bool can_promote_members const char * reply_markup 
- - - - - - - - - - - + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]can_change_infoPass true, if the administrator can change chat title, photo and other settings.
[in]can_post_messagesPass true, if the administrator can create channel posts, channels only.
[in]can_edit_messagesPass true, if the administrator can edit messages of other users and can pin messages, channels only.
[in]can_delete_messagesPass true, if the administrator can delete messages of other users.
[in]can_invite_usersPass true, if the administrator can invite new users to the chat.
[in]can_restrict_membersPass true, if the administrator can restrict, ban or unban chat members.
[in]can_pin_messagesPass true, if the administrator can pin messages, supergroups only.
[in]can_promote_membersPass true, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
@@ -2182,64 +3269,1497 @@

-

◆ telebot_put_chat()

+ +

◆ telebot_edit_message_text()

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_put_chat telebot_error_e telebot_edit_message_text (telebot_handler_t handle,
long long int chat_id,
int message_id,
const char * inline_message_id,
const char * text,
const char * parse_mode,
bool disable_web_page_preview,
const char * reply_markup 
)
+
+ +

Edit text and game messages sent by the bot or via the bot (for inline bots).

+
Parameters
+ + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]textNew text of the message.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
[in]disable_web_page_priviewDisables link previews for links in this message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_export_chat_invite_link()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_export_chat_invite_link (telebot_handler_t handle,
long long int chat_id,
char ** invite_link 
)
+
+ +

Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]invite_linkExported invite link, must be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_forward_message()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_forward_message (telebot_handler_t handle,
long long int chat_id,
long long int from_chat_id,
bool disable_notification,
int message_id 
)
+
+ +

Forward messages of any kind.

+
Parameters
+ + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]from_chat_idUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername).
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]message_idUnique message identifier.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_forward_messages()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_forward_messages (telebot_handler_t handle,
long long int chat_id,
long long int from_chat_id,
const char * message_ids,
bool disable_notification,
bool protect_content,
int ** message_ids_out,
int * count 
)
+
+ +

Use this method to forward multiple messages of any kind.

+
Parameters
+ + + + + + + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original messages were sent.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward.
[in]disable_notificationSends the messages silently.
[in]protect_contentProtects the contents of the sent messages from forwarding and saving.
[out]message_ids_outPointer to get the message identifiers of the sent messages, MUST be freed after use.
[out]countPointer to get the number of messages sent.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_chat()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_chat (telebot_handler_t handle,
long long int chat_id,
telebot_chat_tchat 
)
+
+ +

Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]chatPointer to chat, must be released with telebot_put_chat().
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_chat_admins()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_chat_admins (telebot_handler_t handle,
long long int chat_id,
telebot_chat_member_t ** admin,
int * count 
)
+
+ +

Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

+
Parameters
+ + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]adminPointer to chat administrators, must be released with telebot_put_chat_admins().
[out]countPointer to get a number of administrators.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_chat_member (telebot_handler_t handle,
long long int chat_id,
int user_id,
telebot_chat_member_tmember 
)
+
+ +

Get information about a member of a chat.

+
Parameters
+ + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[out]memberPointer to chat member to obtain, must be released with telebot_put_chat_member().
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_chat_members_count()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_chat_members_count (telebot_handler_t handle,
long long int chat_id,
int * count 
)
+
+ +

Get the number of members in a chat.

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]countNumber of chat members.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_chat_menu_button()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_chat_menu_button (telebot_handler_t handle,
long long int chat_id,
char ** menu_button 
)
+
+ +

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target private chat.
[out]menu_buttonPointer to get menu button, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_forum_topic_icon_stickers()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_forum_topic_icon_stickers (telebot_handler_t handle,
telebot_sticker_t ** stickers,
int * count 
)
+
+ +

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[out]stickersPointer to stickers to be obtained, MUST be released with #telebot_put_stickers.
[out]countPointer to get the number of stickers.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_me()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_me (telebot_handler_t handle,
telebot_user_tme 
)
+
+ +

This function is used to get information about telegram bot itself.

+
Parameters
+ + + +
[in]handleThe telebot handler created with telebot_create().
[out]meTelegram user object, it needs to be released with telebot_put_me after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, and user object is stored in input parameter.
+ +
+
+ +

◆ telebot_get_my_commands()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_my_commands (telebot_handler_t handle,
telebot_bot_command_t ** commands,
int * count 
)
+
+ +

Get the current list of the bot's commands.

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[out]commandsPointer to commands to be obtained, which must be released with telebot_put_my_commands().
[out]countPointer to place the number of commands.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_my_default_administrator_rights()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_my_default_administrator_rights (telebot_handler_t handle,
bool for_channels,
char ** rights 
)
+
+ +

Use this method to get the current default administrator rights of the bot.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]for_channelsPass True to get default administrator rights of the bot in channels.
[out]rightsPointer to get admin rights, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_my_description()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_my_description (telebot_handler_t handle,
const char * language_code,
char ** description 
)
+
+ +

Use this method to get the current bot description for the given user language.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]language_codeA two-letter ISO 639-1 language code.
[out]descriptionPointer to get bot description, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_my_name()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_my_name (telebot_handler_t handle,
const char * language_code,
char ** name 
)
+
+ +

Use this method to get the current bot name for the given user language.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]language_codeA two-letter ISO 639-1 language code.
[out]namePointer to get bot name, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_my_short_description()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_my_short_description (telebot_handler_t handle,
const char * language_code,
char ** short_description 
)
+
+ +

Use this method to get the current bot short description for the given user language.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]language_codeA two-letter ISO 639-1 language code.
[out]short_descriptionPointer to get bot short description, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_proxy()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_proxy (telebot_handler_t handle,
char ** addr 
)
+
+ +

Get proxy address currently used.

+
Parameters
+ + + +
[in]handleThe telebot handler created with telebot_create().
[out]addrCurrent proxy address or NULL, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_sticker_set()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_sticker_set (telebot_handler_t handle,
const char * name,
telebot_sticker_set_tstickers 
)
+
+ +

Get a sticker set.

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[in]nameName of the sticker set.
[out]stickersPointer to sticker set, must be released with telebot_put_sticker_set.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_updates()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_updates (telebot_handler_t handle,
int offset,
int limit,
int timeout,
telebot_update_type_e allowed_updates[],
int allowed_updates_count,
telebot_update_t ** updates,
int * count 
)
+
+ +

This function is used to get latest updates.

+
Parameters
+ + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]offsetIdentifier of the first update to be returned. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue.
[in]limitNumber of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
[in]timeoutTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
[in]allowed_updatesAn array of types of updates you want your bot to receive. Refers to telebot_update_type_e.
[in]allowed_updates_countNumber of update types.
[out]updatesAn array of update objects, it needs to be released with telebot_put_updates after use.
[out]countNumber of updates received.
+
+
+
Returns
On success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_user_profile_photos()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_user_profile_photos (telebot_handler_t handle,
int user_id,
int offset,
int limit,
telebot_user_profile_photos_tphotos 
)
+
+ +

This function is used to get user profile pictures object.

+
Parameters
+ + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]user_idUnique identifier of the target user.
[in]offsetSequential number of the first photo to be returned. By default, up to 10 photos are returned.
[in]limitLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
[out]photosA pointer to user profile photo object. It MUST be released with telebot_put_user_profile_photos after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_get_webhook_info()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_get_webhook_info (telebot_handler_t handle,
telebot_webhook_info_tinfo 
)
+
+ +

This function is used to get information about telegram bot itself.

+
Parameters
+ + + +
[in]handleThe telebot handler created with telebot_create().
[out]infoTelegram webhoook information, it needs to be released with telebot_put_webhook_info after use.
+
+
+
Returns
On success, TELEBOT_ERROR_NONE is returned, and webhook information is stored in input parameter.
+ +
+
+ +

◆ telebot_hide_general_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_hide_general_forum_topic (telebot_handler_t handle,
long long int chat_id 
)
+
+ +

Use this method to hide the 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_kick_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_kick_chat_member (telebot_handler_t handle,
long long int chat_id,
int user_id,
long until_date 
)
+
+ +

Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+
Parameters
+ + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
[in]until_dateDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_leave_chat()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_leave_chat (telebot_handler_t handle,
long long int chat_id 
)
+
+ +

Leave a group, supergroup or channel.

+
Parameters
+ + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_log_out()

+ +
+
+ + + + + + + + +
telebot_error_e telebot_log_out (telebot_handler_t handle)
+
+ +

Use this method to log out from the cloud Bot API server before launching the bot locally.

+
Parameters
+ + +
[in]handleThe telebot handler.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_pin_chat_message()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_pin_chat_message (telebot_handler_t handle,
long long int chat_id,
int message_id,
bool disable_notification 
)
+
+ +

Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

+
Parameters
+ + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idIdentifier of a message to pin.
[in]disable_notificationPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_promote_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_promote_chat_member (telebot_handler_t handle,
long long int chat_id,
int user_id,
bool can_change_info,
bool can_post_messages,
bool can_edit_messages,
bool can_delete_messages,
bool can_invite_users,
bool can_restrict_members,
bool can_pin_messages,
bool can_promote_members 
)
+
+ +

Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

+
Parameters
+ + + + + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]can_change_infoPass true, if the administrator can change chat title, photo and other settings.
[in]can_post_messagesPass true, if the administrator can create channel posts, channels only.
[in]can_edit_messagesPass true, if the administrator can edit messages of other users and can pin messages, channels only.
[in]can_delete_messagesPass true, if the administrator can delete messages of other users.
[in]can_invite_usersPass true, if the administrator can invite new users to the chat.
[in]can_restrict_membersPass true, if the administrator can restrict, ban or unban chat members.
[in]can_pin_messagesPass true, if the administrator can pin messages, supergroups only.
[in]can_promote_membersPass true, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_put_chat()

+ +
+
+ + + + + + + + +
telebot_error_e telebot_put_chat (telebot_chat_tchat)
+
+ +

Release chat obtained with telebot_get_chat().

+
Parameters
+ + +
[in]chatPointer to chat
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_put_chat_admins()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_put_chat_admins (telebot_chat_member_tadmins,
int count 
)
+
+ +

Release chat admins obtained with telebot_get_chat_admins().

+
Parameters
+ + + +
[in]chatPointer to chat administrators to be released.
[in]countNumber of chat administrators.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_put_chat_invite_link()

+ +
+
+ + + - - + +
telebot_error_e telebot_put_chat_invite_link (telebot_chat_tchat)telebot_chat_invite_link_tinvite_link)
-

Release chat obtained with telebot_get_chat().

+

Release chat invite link obtained with telebot_create_chat_invite_link etc.

Parameters
- +
[in]chatPointer to chat
[in]invite_linkPointer to chat invite link to be released.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned.
- -

◆ telebot_put_chat_admins()

+ +

◆ telebot_put_chat_member()

- + - - - - - - - - - - + + - -
telebot_error_e telebot_put_chat_admins telebot_error_e telebot_put_chat_member (telebot_chat_member_tadmins,
int count 
telebot_chat_member_tmember) )
-

Release chat admins obtained with telebot_get_chat_admins().

+

Release chat member otained with telebot_get_chat_member().

Parameters
- - +
[in]chatPointer to chat administrators to be released.
[in]countNumber of chat administrators.
[in]memberPointer to chat member to be released.
@@ -2247,35 +4767,35 @@

-

◆ telebot_put_chat_member()

+ +

◆ telebot_put_forum_topic()

- + - - + +
telebot_error_e telebot_put_chat_member telebot_error_e telebot_put_forum_topic (telebot_chat_member_tmember)telebot_forum_topic_ttopic)
-

Release chat member otained with telebot_get_chat_member().

+

Release forum topic obtained with telebot_create_forum_topic.

Parameters
- +
[in]memberPointer to chat member to be released.
[in]topicPointer to forum topic to be released.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned.
- -

◆ telebot_put_me()

+ +

◆ telebot_put_me()

@@ -2283,7 +4803,7 @@

telebot_error_e telebot_put_me ( - telebot_user_t *  + telebot_user_tme) @@ -2293,7 +4813,7 @@

Parameters
- +
[in]mePointer to telegram user object obtained with telebot_get_me.
[in]mePointer to telegram user object obtained with telebot_get_me.
@@ -2301,8 +4821,8 @@

-

◆ telebot_put_my_commands()

+ +

◆ telebot_put_my_commands()

@@ -2310,7 +4830,7 @@

telebot_error_e telebot_put_my_commands ( - telebot_bot_command_t *  + telebot_bot_command_tcommands, @@ -2327,7 +4847,7 @@

-

Release bot commands obtained with telebot_get_my_commands().

+

Release bot commands obtained with telebot_get_my_commands().

Parameters
@@ -2339,8 +4859,35 @@

-

◆ telebot_put_sticker_set()

+ +

◆ telebot_put_sticker()

+ +
+
+

[in]commandsPointer to commands to be released.
+ + + + + + + +
telebot_error_e telebot_put_sticker (telebot_sticker_tsticker)
+

+ +

Release a sticker object.

+
Parameters
+ + +
[in]stickerPointer to sticker to be released.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_put_sticker_set()

@@ -2348,17 +4895,16 @@

telebot_error_e telebot_put_sticker_set ( - telebot_sticker_set_t *  + telebot_sticker_set_tstickers)

-

Release sticker set obtained with telebot_get_sticker_set()

+

Release sticker set obtained with telebot_get_sticker_set()

Parameters
-
[in]handleThe telebot handler created with telebot_create().
[in]stickersPointer to sticker set to be released.
@@ -2367,8 +4913,8 @@

-

◆ telebot_put_updates()

+ +

◆ telebot_put_updates()

+
Returns
On success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_put_user()

+ +
+
+ + + + + + + + +
telebot_error_e telebot_put_user (telebot_user_tuser)
+
+ +

This function is used to release memory used for user object.

+
Parameters
+ +
[in]userPointer to telegram user object.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative
- -

◆ telebot_put_user_profile_photos()

+ +

◆ telebot_put_user_profile_photos()

@@ -2412,7 +4987,7 @@

telebot_error_e telebot_put_user_profile_photos ( - telebot_user_profile_photos_t *  + telebot_user_profile_photos_tphotos) @@ -2422,7 +4997,7 @@

Parameters
- +
[in]photosA pointer to user profile photo object, obtained with telebot_get_user_profile_photos.
[in]photosA pointer to user profile photo object, obtained with telebot_get_user_profile_photos.
@@ -2430,8 +5005,8 @@

-

◆ telebot_put_webhook_info()

+ +

◆ telebot_put_webhook_info()

@@ -2439,7 +5014,7 @@

telebot_error_e telebot_put_webhook_info ( - telebot_webhook_info_t *  + telebot_webhook_info_tinfo) @@ -2449,7 +5024,7 @@

Parameters
- +
[in]infoTelegram webhook information object obtained with telebot_get_webhook_info.
[in]infoTelegram webhook information object obtained with telebot_get_webhook_info.
@@ -2457,8 +5032,91 @@

-

◆ telebot_restrict_chat_member()

+ +

◆ telebot_reopen_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_reopen_forum_topic (telebot_handler_t handle,
long long int chat_id,
int message_thread_id 
)
+
+ +

Use this method to reopen a closed topic in a forum supergroup chat.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_reopen_general_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_reopen_general_forum_topic (telebot_handler_t handle,
long long int chat_id 
)
+
+ +

Use this method to reopen a closed 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_restrict_chat_member()

@@ -2466,7 +5124,7 @@

telebot_error_e telebot_restrict_chat_member ( - telebot_handler_t  + telebot_handler_t  handle, @@ -2546,21 +5204,79 @@

Parameters
- + - + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user.
[in]until_dateDate when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[incan_send_polls Pass true, if the user is allowed to send polls, implies can_send_messages
[in]can_send_other_messagesPass true, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
[in]can_add_web_page_previewsPass true, if the user may add web page previews to their messages, implies can_send_media_messages.
[in]can_change_infoPass true, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
[in]can_invite_usersPass true, if the user is allowed to invite new users to the chat.
[in]can_pin_messagesPass true, if the user is allowed to pin messages. Ignored in public supergroups
+
+ +
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +

+
+ +

◆ telebot_revoke_chat_invite_link()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_revoke_chat_invite_link (telebot_handler_t handle,
long long int chat_id,
const char * invite_link_str,
telebot_chat_invite_link_tinvite_link 
)
+
+ +

Use this method to revoke an invite link created by the bot.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]invite_link_strThe invite link to revoke.
[out]invite_linkPointer to get ChatInviteLink, MUST be released with telebot_put_chat_invite_link.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -

◆ telebot_send_animation()

+ +

◆ telebot_send_animation()

@@ -2568,7 +5284,7 @@

telebot_error_e telebot_send_animation ( - telebot_handler_t  + telebot_handler_t  handle, @@ -2654,7 +5370,7 @@

Parameters
- + @@ -2674,8 +5390,8 @@

-

◆ telebot_send_audio()

+ +

◆ telebot_send_audio()

@@ -2683,7 +5399,7 @@

telebot_error_e telebot_send_audio

- + @@ -2769,7 +5485,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]animationAnimation file to send. It is either a file_id to resend an animation that exists on the Telegram servers, or a path to animation file.
[in]is_fileFalse if animation is file_id, true, if animation is a file path.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -2789,8 +5505,8 @@

-

◆ telebot_send_chat_action()

+ +

◆ telebot_send_chat_action()

@@ -2798,7 +5514,7 @@

telebot_error_e telebot_send_chat_action

- + @@ -2824,7 +5540,7 @@

telebot_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]audioAudio file to send. It is either a file_id as String to resend an audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if audio is file_id, true, if audio is a file path.
(telebot_handler_t telebot_handler_t  handle,
- +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]actionType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data.
@@ -2834,8 +5550,8 @@

-

◆ telebot_send_contact()

+ +

◆ telebot_send_contact()

@@ -2843,7 +5559,7 @@

telebot_error_e telebot_send_contact ( - telebot_handler_t  + telebot_handler_t  handle, @@ -2905,7 +5621,7 @@

Parameters
- + @@ -2921,8 +5637,8 @@

-

◆ telebot_send_dice()

+ +

◆ telebot_send_dice()

@@ -2930,7 +5646,7 @@

telebot_error_e telebot_send_dice

- + @@ -2968,7 +5684,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]phone_numberContact's phone numbers.
[in]first_nameContact's first name.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -2980,8 +5696,8 @@

-

◆ telebot_send_document()

+ +

◆ telebot_send_document()

@@ -2989,7 +5705,7 @@

telebot_error_e telebot_send_document

- + @@ -3019,14 +5735,96 @@

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
(telebot_handler_t telebot_handler_t  handle,
const char * caption, const char * caption,
const char * parse_mode,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+

+
+ +

◆ telebot_send_location()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -3054,16 +5852,14 @@

-

Send general files.

+

Send point on the map.

Parameters

telebot_error_e telebot_send_location (telebot_handler_t handle,
long long int chat_id,
float latitude,
float longitude,
const char * parse_mode, int live_period,
- + - - - - - + + + @@ -3074,16 +5870,16 @@

-

◆ telebot_send_location()

+ +

◆ telebot_send_media_group()

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]documentDocument file to send. It is either a file_id as String to resend a file that is already on the Telegram servers, or a path to file.
[in]is_fileFalse if document is file_id, true, if document is a file path.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionDocument caption. (may also be used when resending documents).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]live_periodPeriod in secnods for which the location will be updated. Should be between 60 and 86400.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- + - + @@ -3095,20 +5891,14 @@

- - - - - - - - + + - + @@ -3120,13 +5910,7 @@

- - - - - - - + @@ -3136,26 +5920,24 @@

-

Send point on the map.

+

Send a group of photos as an album.

Parameters

telebot_error_e telebot_send_location telebot_error_e telebot_send_media_group (telebot_handler_t telebot_handler_t  handle,
float latitude,
float longitude, char * media_paths[],
int live_period, count,
int reply_to_message_id,
const char * reply_markup reply_to_message_id 
- - - - - - + + + + + -
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]live_periodPeriod in secnods for which the location will be updated. Should be between 60 and 86400.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel.
[in]media_pathsArray of file paths to photos to send.
[in]countNumber of photos in the array (2–10).
[in]disable_notificationSends the message silently.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.

-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

- -

◆ telebot_send_message()

+ +

◆ telebot_send_message()

@@ -3163,7 +5945,7 @@

telebot_error_e telebot_send_message ( - telebot_handler_t  + telebot_handler_t  handle, @@ -3219,7 +6001,7 @@

Parameters
- + @@ -3234,8 +6016,8 @@

-

◆ telebot_send_photo()

+ +

◆ telebot_send_photo()

@@ -3243,7 +6025,7 @@

telebot_error_e telebot_send_photo

- + @@ -3305,7 +6087,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]textText of the message to be sent, 1-4096 characters after entities parsing.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -3321,8 +6103,8 @@

-

◆ telebot_send_poll()

+ +

◆ telebot_send_poll()

@@ -3330,7 +6112,7 @@

telebot_error_e telebot_send_poll

- + @@ -3416,7 +6198,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoPhoto to send. It is either file_id as String to resend a photo that is already on the Telegram servers, or a path to photo file.
[in]is_fileFalse if photo is file_id, true, if photo is a file path.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -3436,8 +6218,8 @@

-

◆ telebot_send_sticker()

+ +

◆ telebot_send_sticker()

@@ -3445,7 +6227,7 @@

telebot_error_e telebot_send_sticker

- + @@ -3495,7 +6277,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]questionPoll question, 1-255 characters.
[in]optionsA aray of answer options, 2-10 strings 1-100 characters each.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -3508,16 +6290,239 @@

-

◆ telebot_send_venue()

+ +

◆ telebot_send_venue()

+ +
+
+
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]stickerSticker file to send. It is either a file_id to resend a sticker that is already on the Telegram servers, or a path to file.
[in]is_fileFalse if sticker is file_id, true, if sticker is a file path.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_send_venue (telebot_handler_t handle,
long long int chat_id,
float latitude,
float longitude,
const char * title,
const char * address,
const char * foursquare_id,
const char * foursquare_type,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+

+ +

Send information about a venue.

+
Parameters
+ + + + + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of venue.
[in]longitudeLongitude of venue.
[in]titleName of the venue
[in]addressAddress of the venue.
[in]foursquare_idFoursquare identifier of the venue.
[in]foursquare_typeFoursquare type of the venue, if known.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_send_video()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_send_video (telebot_handler_t handle,
long long int chat_id,
const char * video,
bool is_file,
int duration,
int width,
int height,
const char * thumb,
const char * caption,
const char * parse_mode,
bool supports_streaming,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).

+
Parameters
+ + + + + + + + + + + + + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]videoVideo file to send. It is either a file_id as String to resend a video that is already on the Telegram servers, or a path to video file.
[in]is_fileFalse if video is file_id, true, if video is a file path.
[in]durationDuration of sent video in seconds. Optional, set 0 for ignoring.
[in]widthVideo width. Optional, set 0 for ignoring.
[in]heightVideo heigh. Optional, set 0 for ignoring.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionVideo caption. (may also be used when resending videos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]supports_streamingPass True, if the uploaded video is suitable for streaming.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_send_video_note()

- + - + @@ -3529,38 +6534,32 @@

- - - - - - - - + + - - + + - - + + - - + + - + @@ -3588,20 +6587,20 @@

-

Send information about a venue.

+

Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.

Parameters

telebot_error_e telebot_send_venue telebot_error_e telebot_send_video_note (telebot_handler_t telebot_handler_t  handle,
float latitude,
float longitude, char * video_note,
const char * title, bool is_file,
const char * address, int duration,
const char * foursquare_id, int length,
const char * foursquare_type, thumb,
- + - - - - - - + + + + + - + +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of venue.
[in]longitudeLongitude of venue.
[in]titleName of the venue
[in]addressAddress of the venue.
[in]foursquare_idFoursquare identifier of the venue.
[in]foursquare_typeFoursquare type of the venue, if known.
[in]video_notVideo note to send. It is either a file_id to resend a video note that exists on the Telegram servers, or a path to video note file.
[in]is_fileFalse if video note is file_id, true, if video note is a file path.
[in]durationDuration of sent video in seconds.
[in]lengthVideo width and height, i.e. diameter of the video message.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with #telebot_put_response().
@@ -3609,16 +6608,16 @@

-

◆ telebot_send_video()

+ +

◆ telebot_send_voice()

- + - + @@ -3631,7 +6630,7 @@

- + @@ -3639,30 +6638,6 @@

bool 

- - - - - - - - - - - - - - - - - - - - - - - - @@ -3678,8 +6653,8 @@

- - + + @@ -3707,20 +6682,16 @@

-

Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).

+

Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).

Parameters

telebot_error_e telebot_send_video telebot_error_e telebot_send_voice (telebot_handler_t telebot_handler_t  handle,
const char * video, voice,
is_file,
int duration,
int width,
int height,
const char * thumb,
bool supports_streaming, int duration,
- + - - - - - - - - - + + + + + @@ -3731,16 +6702,16 @@

-

◆ telebot_send_video_note()

+ +

◆ telebot_set_chat_admin_custom_title()

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]videoVideo file to send. It is either a file_id as String to resend a video that is already on the Telegram servers, or a path to video file.
[in]is_fileFalse if video is file_id, true, if video is a file path.
[in]durationDuration of sent video in seconds. Optional, set 0 for ignoring.
[in]widthVideo width. Optional, set 0 for ignoring.
[in]heightVideo heigh. Optional, set 0 for ignoring.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionVideo caption. (may also be used when resending videos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]supports_streamingPass True, if the uploaded video is suitable for streaming.
[in]voiceAudio file to send. It is either a file_id as String to resend a audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if voice is file_id, true, if voice is a file path.
[in]captionVoice message caption. (may also be used when resending).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]durationDuration of sent voice/audio in seconds.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- + - + @@ -3752,50 +6723,105 @@

- - + + - - + + - - - + + + +
telebot_error_e telebot_send_video_note telebot_error_e telebot_set_chat_admin_custom_title (telebot_handler_t telebot_handler_t  handle,
char * video_note, int user_id,
bool is_file, const char * custom_title 
int duration, )
+
+
+ +

◆ telebot_set_chat_description()

+ +
+
+ + + + + + - - + + - + - - - + + + +
telebot_error_e telebot_set_chat_description (telebot_handler_t handle,
int length, long long int chat_id,
const char * thumb, description 
bool disable_notification, )
+
+ +

Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+
Parameters
+ + + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]descriptionNew chat description, 0-255 characters.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_set_chat_menu_button()

+ +
+
+ + + + + + - - + + - + @@ -3805,20 +6831,12 @@

-

Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.

+

Use this method to change the bot's menu button in a private chat, or the default menu button.

Parameters

telebot_error_e telebot_set_chat_menu_button (telebot_handler_t handle,
int reply_to_message_id, long long int chat_id,
const char * reply_markup menu_button 
- - - - - - - - - - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]video_notVideo note to send. It is either a file_id to resend a video note that exists on the Telegram servers, or a path to video note file.
[in]is_fileFalse if video note is file_id, true, if video note is a file path.
[in]durationDuration of sent video in seconds.
[in]lengthVideo width and height, i.e. diameter of the video message.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with #telebot_put_response().
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target private chat.
[in]menu_buttonA JSON-serialized object for the bot's new menu button.
@@ -3826,16 +6844,16 @@

-

◆ telebot_send_voice()

+ +

◆ telebot_set_chat_permissions()

- + - + @@ -3847,50 +6865,102 @@

- - + + - + - - + + - - + + - - + + - + - - + + + + + + + + + + + + + + +
telebot_error_e telebot_send_voice telebot_error_e telebot_set_chat_permissions (telebot_handler_t telebot_handler_t  handle,
const char * voice, bool can_send_messages,
bool is_file, can_send_media_messages,
const char * caption, bool can_send_polls,
const char * parse_mode, bool can_send_other_messages,
int duration, bool can_add_web_page_previews,
bool disable_notification, can_change_info,
int reply_to_message_id, bool can_invite_users,
bool can_pin_messages 
)
+
+
+ +

◆ telebot_set_chat_photo()

+ +
+
+ + + + + + + + + + + + - + @@ -3900,19 +6970,12 @@

-

Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).

+

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 admin rights.

Parameters

telebot_error_e telebot_set_chat_photo (telebot_handler_t handle,
long long int chat_id,
const char * reply_markup photo 
- + - - - - - - - - +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]voiceAudio file to send. It is either a file_id as String to resend a audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if voice is file_id, true, if voice is a file path.
[in]captionVoice message caption. (may also be used when resending).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]durationDuration of sent voice/audio in seconds.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[in]photoNew chat photo file path.
@@ -3920,16 +6983,16 @@

-

◆ telebot_set_chat_admin_custom_title()

+ +

◆ telebot_set_chat_sticker_set()

- + - + @@ -3938,17 +7001,11 @@

long long int 

- - - - - - - + @@ -3958,13 +7015,12 @@

-

Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use it.

Parameters

telebot_error_e telebot_set_chat_admin_custom_title telebot_error_e telebot_set_chat_sticker_set (telebot_handler_t telebot_handler_t  handle,
chat_id,
int user_id,
const char * custom_title sticker_set_name 
- + - - +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]custom_titleNew custom title for the administrator; 0-16 characters, emoji are not allowed.
[in]sticker_set_nameName of the sticker set to be set as the group sticker set.
@@ -3972,16 +7028,16 @@

-

◆ telebot_set_chat_description()

+ +

◆ telebot_set_chat_title()

- + - + @@ -3994,7 +7050,7 @@

- + @@ -4004,12 +7060,12 @@

-

Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

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 admin rights.

Parameters

telebot_error_e telebot_set_chat_description telebot_error_e telebot_set_chat_title (telebot_handler_t telebot_handler_t  handle,
const char * description title 
- + - +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]descriptionNew chat description, 0-255 characters.
[in]titleNew chat title, 1-255 characters.
@@ -4017,16 +7073,16 @@

-

◆ telebot_set_chat_permissions()

+ +

◆ telebot_set_message_reaction()

+ +

◆ telebot_set_my_commands()

+ +
+
+ - - - - + + + + - - + + - - + + @@ -4091,43 +7164,42 @@

-

Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.

+

Change the list of the bot's commands.

Parameters

bool can_change_info, telebot_error_e telebot_set_my_commands (telebot_handler_t handle,
bool can_invite_users, telebot_bot_command_t commands[],
bool can_pin_messages int count 
- - - - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[in]handleThe telebot handler created with telebot_create().
[in]commandsArray of telegram bot commands.
[in]countThe number of commands in array.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- -

◆ telebot_set_chat_photo()

+ +

◆ telebot_set_my_default_administrator_rights()

- + - + - - + + - - + + @@ -4137,12 +7209,12 @@

-

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 admin rights.

+

Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.

Parameters

telebot_error_e telebot_set_chat_photo telebot_error_e telebot_set_my_default_administrator_rights (telebot_handler_t telebot_handler_t  handle,
long long int chat_id, const char * rights,
const char * photo bool for_channels 
- - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoNew chat photo file path.
[in]handleThe telebot handler.
[in]rightsA JSON-serialized object describing new default administrator rights.
[in]for_channelsPass True to change the default administrator rights of the bot in channels.
@@ -4150,29 +7222,29 @@

-

◆ telebot_set_chat_sticker_set()

+ +

◆ telebot_set_my_description()

- + - + - - + + - + @@ -4182,12 +7254,12 @@

-

Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_get_chat requests to check if the bot can use it.

+

Use this method to change the bot's description.

Parameters

telebot_error_e telebot_set_chat_sticker_set telebot_error_e telebot_set_my_description (telebot_handler_t telebot_handler_t  handle,
long long int chat_id, const char * description,
const char * sticker_set_name language_code 
- - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]sticker_set_nameName of the sticker set to be set as the group sticker set.
[in]handleThe telebot handler.
[in]descriptionNew bot description; 0-512 characters.
[in]language_codeA two-letter ISO 639-1 language code.
@@ -4195,29 +7267,29 @@

-

◆ telebot_set_chat_title()

+ +

◆ telebot_set_my_name()

- + - + - - + + - + @@ -4227,12 +7299,12 @@

-

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 admin rights.

+

Use this method to change the bot's name.

Parameters

telebot_error_e telebot_set_chat_title telebot_error_e telebot_set_my_name (telebot_handler_t telebot_handler_t  handle,
long long int chat_id, const char * name,
const char * title language_code 
- - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]titleNew chat title, 1-255 characters.
[in]handleThe telebot handler.
[in]nameNew bot name; 0-64 characters.
[in]language_codeA two-letter ISO 639-1 language code.
@@ -4240,29 +7312,29 @@

-

◆ telebot_set_my_commands()

+ +

◆ telebot_set_my_short_description()

- + - + - - + + - - + + @@ -4272,12 +7344,12 @@

-

Change the list of the bot's commands.

+

Use this method to change the bot's short description.

Parameters

telebot_error_e telebot_set_my_commands telebot_error_e telebot_set_my_short_description (telebot_handler_t telebot_handler_t  handle,
telebot_bot_command_t commands[], const char * short_description,
int count const char * language_code 
- - - + + +
[in]handleThe telebot handler created with telebot_create().
[in]commandsArray of telegram bot commands.
[in]commandsThe number of commands in array.
[in]handleThe telebot handler.
[in]short_descriptionNew short description; 0-120 characters.
[in]language_codeA two-letter ISO 639-1 language code.
@@ -4285,8 +7357,8 @@

-

◆ telebot_set_proxy()

+ +

◆ telebot_set_proxy()

@@ -4294,7 +7366,7 @@

telebot_error_e telebot_set_proxy ( - telebot_handler_t  + telebot_handler_t  handle, @@ -4320,7 +7392,7 @@

Parameters
- +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]addrProxy address to use.
[in]authProxy authorization information.
@@ -4330,8 +7402,8 @@

-

◆ telebot_set_webhook()

+ +

◆ telebot_set_webhook()

@@ -4339,7 +7411,7 @@

telebot_error_e telebot_set_webhook ( - telebot_handler_t  + telebot_handler_t  handle, @@ -4363,7 +7435,7 @@

- telebot_update_type_e  + telebot_update_type_e  allowed_updates[], @@ -4383,7 +7455,7 @@

Parameters
- + @@ -4396,8 +7468,8 @@

-

◆ telebot_stop_message_live_location()

+ +

◆ telebot_stop_message_live_location()

@@ -4405,7 +7477,7 @@

telebot_error_e telebot_stop_message_live_location

- + @@ -4443,7 +7515,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]urlHTTPS url to send updates to. Use an empty string to remove webhook integration
[in]certificateA path to to a public key certificate to upload server.
[in]max_connectionsOptional Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -4455,8 +7527,8 @@

-

◆ telebot_stop_poll()

+ +

◆ telebot_stop_poll()

@@ -4464,7 +7536,7 @@

telebot_error_e telebot_stop_poll

- + @@ -4496,7 +7568,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
(telebot_handler_t telebot_handler_t  handle,
- + @@ -4508,8 +7580,8 @@

-

◆ telebot_unban_chat_member()

+ +

◆ telebot_unban_chat_member()

@@ -4517,7 +7589,7 @@

telebot_error_e telebot_unban_chat_member

- + @@ -4543,7 +7615,7 @@

Parameters

[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
(telebot_handler_t telebot_handler_t  handle,
- +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
@@ -4553,8 +7625,174 @@

-

◆ telebot_unpin_chat_message()

+ +

◆ telebot_unban_chat_sender_chat()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_unban_chat_sender_chat (telebot_handler_t handle,
long long int chat_id,
long long int sender_chat_id 
)
+
+ +

Use this method to unban a previously banned channel chat in a supergroup or a channel.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]sender_chat_idUnique identifier of the target sender chat.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_unhide_general_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_unhide_general_forum_topic (telebot_handler_t handle,
long long int chat_id 
)
+
+ +

Use this method to unhide the 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_unpin_all_forum_topic_messages()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_unpin_all_forum_topic_messages (telebot_handler_t handle,
long long int chat_id,
int message_thread_id 
)
+
+ +

Use this method to unpin all messages in a forum topic.

+
Parameters
+ + + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_unpin_all_general_forum_topic_messages()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_unpin_all_general_forum_topic_messages (telebot_handler_t handle,
long long int chat_id 
)
+
+ +

Use this method to unpin all messages in a General forum topic.

+
Parameters
+ + + +
[in]handleThe telebot handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_unpin_chat_message()

@@ -4562,7 +7800,7 @@

telebot_error_e telebot_unpin_chat_message ( - telebot_handler_t  + telebot_handler_t  handle, @@ -4582,7 +7820,7 @@

Parameters
- +
[in]handleThe telebot handler created with telebot_create().
[in]handleThe telebot handler created with telebot_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
@@ -4594,9 +7832,7 @@

diff --git a/docs/group__TELEBOT__CORE__API.html b/docs/group__TELEBOT__CORE__API.html index 415fa5f..487c7a2 100644 --- a/docs/group__TELEBOT__CORE__API.html +++ b/docs/group__TELEBOT__CORE__API.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Core Telegram Bot API @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- +

@@ -54,234 +57,461 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
Core Telegram Bot API
+
Core Telegram Bot API

The APIs for the telegram bot interface, response is unparsed json sting. More...

- - - - - - + + +

-Classes

struct  telebot_core_handler
 This object represents a core telebot handler. More...
 
struct  telebot_core_response
 This object represents a telegram bot response. More...

+Files

file  telebot-core.h
 This file contains core API for the telegram bot interface.
 
- - - - - - - + + + + + +

+

Typedefs

-typedef struct telebot_core_handler telebot_core_handler_t
 This object represents a core telebot handler.
 
-typedef struct telebot_core_response telebot_core_response_t
 This object represents a telegram bot response.
 
+typedef struct telebot_core_handler * telebot_core_handler_t
 Telebot core handler opaque type.
 
+typedef struct telebot_core_response * telebot_core_response_t
 Telebot core response opaque type.
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+

Functions

telebot_error_e telebot_core_create (telebot_core_handler_t **core_h, const char *token)
 Start function to use telebot core APIs. More...
 
telebot_error_e telebot_core_destroy (telebot_core_handler_t **core_h)
 Final function to use telebot core APIs. More...
 
telebot_error_e telebot_core_set_proxy (telebot_core_handler_t *core_h, const char *addr, const char *auth)
 Set proxy address to use telebot behind proxy. More...
 
telebot_error_e telebot_core_get_proxy (telebot_core_handler_t *core_h, char **addr)
 Get currently used proxy address. More...
 
telebot_error_e telebot_core_get_updates (telebot_core_handler_t *core_h, int offset, int limit, int timeout, const char *allowed_updates, telebot_core_response_t *response)
 Receive incoming updates (long polling). It will not work if an outgoing webhook is set up. In order to avoid getting duplicate updates, recalculate offset after each server response. More...
 
telebot_error_e telebot_core_set_webhook (telebot_core_handler_t *core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates, telebot_core_response_t *response)
 Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. More...
 
telebot_error_e telebot_core_delete_webhook (telebot_core_handler_t *core_h, telebot_core_response_t *response)
 Remove webhook integration if you decide to switch back to getUpdates. More...
 
telebot_error_e telebot_core_get_webhook_info (telebot_core_handler_t *core_h, telebot_core_response_t *response)
 Get current webhook status. More...
 
telebot_error_e telebot_core_get_me (telebot_core_handler_t *core_h, telebot_core_response_t *response)
 Get basic information about the bot. More...
 
telebot_error_e telebot_core_send_message (telebot_core_handler_t *core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send text messages. More...
 
telebot_error_e telebot_core_forward_message (telebot_core_handler_t *core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id, telebot_core_response_t *response)
 Forward messages of any kind. More...
 
telebot_error_e telebot_core_send_photo (telebot_core_handler_t *core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send photos. More...
 
telebot_error_e telebot_core_send_audio (telebot_core_handler_t *core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead. More...
 
telebot_error_e telebot_core_send_document (telebot_core_handler_t *core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send general files. More...
 
telebot_error_e telebot_core_send_video (telebot_core_handler_t *core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send video files, Telegram clients support mp4 videos (other formats may be sent as Document). More...
 
telebot_error_e telebot_core_send_animation (telebot_core_handler_t *core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send animation files (GIF or H.264/MPEG-4 AVC without sound). More...
 
telebot_error_e telebot_core_send_voice (telebot_core_handler_t *core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). More...
 
telebot_error_e telebot_core_send_video_note (telebot_core_handler_t *core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. More...
 
telebot_error_e telebot_core_send_location (telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send point on the map. More...
 
telebot_error_e telebot_core_edit_message_live_location (telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup, telebot_core_response_t *response)
 Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_core_stop_message_live_location(). More...
 
telebot_error_e telebot_core_stop_message_live_location (telebot_core_handler_t *core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
 Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires. More...
 
telebot_error_e telebot_core_send_venue (telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send information about a venue. More...
 
telebot_error_e telebot_core_send_contact (telebot_core_handler_t *core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send phone contacts. More...
 
telebot_error_e telebot_core_send_poll (telebot_core_handler_t *core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send a native poll. More...
 
telebot_error_e telebot_core_send_dice (telebot_core_handler_t *core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
 Send a dice, which will have a random value from 1 to 6. More...
 
telebot_error_e telebot_core_send_chat_action (telebot_core_handler_t *core_h, long long int chat_id, const char *action, telebot_core_response_t *response)
 Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_core_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive. More...
 
telebot_error_e telebot_core_get_user_profile_photos (telebot_core_handler_t *core_h, int user_id, int offset, int limit, telebot_core_response_t *response)
 Get user profile pictures object. More...
 
telebot_error_e telebot_core_get_file (telebot_core_handler_t *core_h, const char *file_id, telebot_core_response_t *response)
 Get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. More...
 
telebot_error_e telebot_core_download_file (telebot_core_handler_t *core_h, const char *file_path, const char *out_file)
 Download file using file_path obtained with telebot_core_get_file(). 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 telebot_core_get_file() again. More...
 
telebot_error_e telebot_core_kick_chat_member (telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, telebot_core_response_t *response)
 Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
 
telebot_error_e telebot_core_unban_chat_member (telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
 Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. More...
 
telebot_error_e telebot_core_restrict_chat_member (telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
 Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user. More...
 
telebot_error_e telebot_core_promote_chat_member (telebot_core_handler_t *core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members, telebot_core_response_t *response)
 Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. More...
 
telebot_error_e telebot_core_set_chat_admin_custom_title (telebot_core_handler_t *core_h, long long int chat_id, int user_id, const char *custom_title, telebot_core_response_t *response)
 Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
 
telebot_error_e telebot_core_set_chat_permissions (telebot_core_handler_t *core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
 Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights. More...
 
telebot_error_e telebot_core_export_chat_invite_link (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
 
telebot_error_e telebot_core_set_chat_photo (telebot_core_handler_t *core_h, long long int chat_id, const char *photo, telebot_core_response_t *response)
 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 admin rights. More...
 
telebot_error_e telebot_core_delete_chat_photo (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 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 admin rights. More...
 
telebot_error_e telebot_core_set_chat_title (telebot_core_handler_t *core_h, long long int chat_id, const char *title, telebot_core_response_t *response)
 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 admin rights. More...
 
telebot_error_e telebot_core_set_chat_description (telebot_core_handler_t *core_h, long long int chat_id, const char *description, telebot_core_response_t *response)
 Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. More...
 
telebot_error_e telebot_core_pin_chat_message (telebot_core_handler_t *core_h, long long int chat_id, int message_id, bool disable_notification, telebot_core_response_t *response)
 Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. More...
 
telebot_error_e telebot_core_unpin_chat_message (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. More...
 
telebot_error_e telebot_core_leave_chat (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Leave a group, supergroup or channel. More...
 
telebot_error_e telebot_core_get_chat (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc). More...
 
telebot_error_e telebot_core_get_chat_admins (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. More...
 
telebot_error_e telebot_core_get_chat_members_count (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 Get the number of members in a chat. More...
 
telebot_error_e telebot_core_get_chat_member (telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
 Get information about a member of a chat. More...
 
telebot_error_e telebot_core_set_chat_sticker_set (telebot_core_handler_t *core_h, long long int chat_id, const char *sticker_set_name, telebot_core_response_t *response)
 Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use it. More...
 
telebot_error_e telebot_core_delete_chat_sticker_set (telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
 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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use this method. More...
 
telebot_error_e telebot_core_answer_callback_query (telebot_core_handler_t *core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time, telebot_core_response_t *response)
 Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. More...
 
telebot_error_e telebot_core_set_my_commands (telebot_core_handler_t *core_h, const char *commands, telebot_core_response_t *response)
 Change the list of the bot's commands. More...
 
telebot_error_e telebot_core_get_my_commands (telebot_core_handler_t *core_h, telebot_core_response_t *response)
 Get the current list of the bot's commands.. More...
 
telebot_error_e telebot_core_edit_message_text (telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup, telebot_core_response_t *response)
 Edit text and game messages sent by the bot or via the bot (for inline bots). More...
 
telebot_error_e telebot_core_edit_message_caption (telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup, telebot_core_response_t *response)
 Edit captions of messages sent by the bot or via the bot (for inline bots). More...
 
telebot_error_e telebot_core_edit_message_reply_markup (telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
 Edit only the reply markup of messages sent by the bot or via the bot (for inline bots). More...
 
telebot_error_e telebot_core_stop_poll (telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *reply_markup, telebot_core_response_t *response)
 Stop a poll which was sent by the bot. More...
 
telebot_error_e telebot_core_delete_message (telebot_core_handler_t *core_h, long long int chat_id, int message_id, telebot_core_response_t *response)
 Delete a message, including service messages, with the following limitations: More...
 
void telebot_core_put_response (telebot_core_response_t *response)
 Release response data obtained with telebot core methods. More...
 
telebot_error_e telebot_core_get_response_code (telebot_core_response_t response)
 Get response error code.
 
const char * telebot_core_get_response_data (telebot_core_response_t response)
 Get response data.
 
void telebot_core_put_response (telebot_core_response_t response)
 Release response data obtained with telebot core methods.
 
telebot_error_e telebot_core_create (telebot_core_handler_t *core_h, const char *token)
 Start function to use telebot core APIs.
 
telebot_error_e telebot_core_destroy (telebot_core_handler_t *core_h)
 Final function to use telebot core APIs.
 
telebot_error_e telebot_core_set_proxy (telebot_core_handler_t core_h, const char *addr, const char *auth)
 Set proxy address to use telebot behind proxy.
 
telebot_error_e telebot_core_get_proxy (telebot_core_handler_t core_h, char **addr)
 Get currently used proxy address.
 
telebot_core_response_t telebot_core_get_updates (telebot_core_handler_t core_h, int offset, int limit, int timeout, const char *allowed_updates)
 Receive incoming updates (long polling). It will not work if an outgoing webhook is set up. In order to avoid getting duplicate updates, recalculate offset after each server response.
 
telebot_core_response_t telebot_core_set_webhook (telebot_core_handler_t core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates)
 Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
 
telebot_core_response_t telebot_core_delete_webhook (telebot_core_handler_t core_h)
 Remove webhook integration if you decide to switch back to getUpdates.
 
telebot_core_response_t telebot_core_get_webhook_info (telebot_core_handler_t core_h)
 Get current webhook status.
 
telebot_core_response_t telebot_core_get_me (telebot_core_handler_t core_h)
 Get basic information about the bot.
 
telebot_core_response_t telebot_core_send_message (telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send text messages.
 
telebot_core_response_t telebot_core_forward_message (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
 Forward messages of any kind.
 
telebot_core_response_t telebot_core_send_photo (telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send photos.
 
telebot_core_response_t telebot_core_send_audio (telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.
 
telebot_core_response_t telebot_core_send_document (telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send general files.
 
telebot_core_response_t telebot_core_send_video (telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
 
telebot_core_response_t telebot_core_send_animation (telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send animation files (GIF or H.264/MPEG-4 AVC without sound).
 
telebot_core_response_t telebot_core_send_voice (telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).
 
telebot_core_response_t telebot_core_send_video_note (telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
 
telebot_core_response_t telebot_core_send_media_group (telebot_core_handler_t core_h, long long int chat_id, char *media_paths[], int count, bool disable_notification, int reply_to_message_id)
 Send a group of photos as an album.
 
telebot_core_response_t telebot_core_send_location (telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send point on the map.
 
telebot_core_response_t telebot_core_edit_message_live_location (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
 Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_core_stop_message_live_location().
 
telebot_core_response_t telebot_core_stop_message_live_location (telebot_core_handler_t core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
 Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
 
telebot_core_response_t telebot_core_send_venue (telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send information about a venue.
 
telebot_core_response_t telebot_core_send_contact (telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send phone contacts.
 
telebot_core_response_t telebot_core_send_poll (telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a native poll.
 
telebot_core_response_t telebot_core_send_dice (telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
 Send a dice, which will have a random value from 1 to 6.
 
telebot_core_response_t telebot_core_send_chat_action (telebot_core_handler_t core_h, long long int chat_id, const char *action)
 Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_core_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.
 
telebot_core_response_t telebot_core_get_user_profile_photos (telebot_core_handler_t core_h, int user_id, int offset, int limit)
 Get user profile pictures object.
 
telebot_core_response_t telebot_core_get_file (telebot_core_handler_t core_h, const char *file_id)
 Get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.
 
telebot_error_e telebot_core_download_file (telebot_core_handler_t core_h, const char *file_path, const char *out_file)
 Download file using file_path obtained with telebot_core_get_file(). 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 telebot_core_get_file() again.
 
telebot_core_response_t telebot_core_kick_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date)
 Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_core_response_t telebot_core_unban_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id)
 Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.
 
telebot_core_response_t telebot_core_restrict_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user.
 
telebot_core_response_t telebot_core_promote_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
 Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
 
telebot_core_response_t telebot_core_set_chat_admin_custom_title (telebot_core_handler_t core_h, long long int chat_id, int user_id, const char *custom_title)
 Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_core_response_t telebot_core_set_chat_permissions (telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
 Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.
 
telebot_core_response_t telebot_core_export_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id)
 Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_core_response_t telebot_core_set_chat_photo (telebot_core_handler_t core_h, long long int chat_id, const char *photo)
 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 admin rights.
 
telebot_core_response_t telebot_core_delete_chat_photo (telebot_core_handler_t core_h, long long int chat_id)
 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 admin rights.
 
telebot_core_response_t telebot_core_set_chat_title (telebot_core_handler_t core_h, long long int chat_id, const char *title)
 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 admin rights.
 
telebot_core_response_t telebot_core_set_chat_description (telebot_core_handler_t core_h, long long int chat_id, const char *description)
 Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
 
telebot_core_response_t telebot_core_pin_chat_message (telebot_core_handler_t core_h, long long int chat_id, int message_id, bool disable_notification)
 Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
 
telebot_core_response_t telebot_core_unpin_chat_message (telebot_core_handler_t core_h, long long int chat_id)
 Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
 
telebot_core_response_t telebot_core_leave_chat (telebot_core_handler_t core_h, long long int chat_id)
 Leave a group, supergroup or channel.
 
telebot_core_response_t telebot_core_get_chat (telebot_core_handler_t core_h, long long int chat_id)
 Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).
 
telebot_core_response_t telebot_core_get_chat_admins (telebot_core_handler_t core_h, long long int chat_id)
 Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
 
telebot_core_response_t telebot_core_get_chat_members_count (telebot_core_handler_t core_h, long long int chat_id)
 Get the number of members in a chat.
 
telebot_core_response_t telebot_core_get_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id)
 Get information about a member of a chat.
 
telebot_core_response_t telebot_core_set_chat_sticker_set (telebot_core_handler_t core_h, long long int chat_id, const char *sticker_set_name)
 Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use it.
 
telebot_core_response_t telebot_core_delete_chat_sticker_set (telebot_core_handler_t core_h, long long int chat_id)
 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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use this method.
 
telebot_core_response_t telebot_core_answer_callback_query (telebot_core_handler_t core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
 Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
 
telebot_core_response_t telebot_core_set_my_commands (telebot_core_handler_t core_h, const char *commands)
 Change the list of the bot's commands.
 
telebot_core_response_t telebot_core_get_my_commands (telebot_core_handler_t core_h)
 Get the current list of the bot's commands..
 
telebot_core_response_t telebot_core_edit_message_text (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
 Edit text and game messages sent by the bot or via the bot (for inline bots).
 
telebot_core_response_t telebot_core_edit_message_caption (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
 Edit captions of messages sent by the bot or via the bot (for inline bots).
 
telebot_core_response_t telebot_core_edit_message_reply_markup (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
 Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
 
telebot_core_response_t telebot_core_edit_message_media (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *media, const char *reply_markup)
 Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio of the same type and with the same caption.
 
telebot_core_response_t telebot_core_stop_poll (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reply_markup)
 Stop a poll which was sent by the bot.
 
telebot_core_response_t telebot_core_delete_message (telebot_core_handler_t core_h, long long int chat_id, int message_id)
 Delete a message, including service messages, with the following limitations:
 
telebot_core_response_t telebot_core_log_out (telebot_core_handler_t core_h)
 Use this method to log out from the cloud Bot API server before launching the bot locally.
 
telebot_core_response_t telebot_core_close (telebot_core_handler_t core_h)
 Use this method to close the bot instance before moving it from one local server to another.
 
telebot_core_response_t telebot_core_set_my_name (telebot_core_handler_t core_h, const char *name, const char *language_code)
 Use this method to change the bot's name.
 
telebot_core_response_t telebot_core_get_my_name (telebot_core_handler_t core_h, const char *language_code)
 Use this method to get the current bot name for the given user language.
 
telebot_core_response_t telebot_core_set_my_description (telebot_core_handler_t core_h, const char *description, const char *language_code)
 Use this method to change the bot's description.
 
telebot_core_response_t telebot_core_get_my_description (telebot_core_handler_t core_h, const char *language_code)
 Use this method to get the current bot description for the given user language.
 
telebot_core_response_t telebot_core_set_my_short_description (telebot_core_handler_t core_h, const char *short_description, const char *language_code)
 Use this method to change the bot's short description.
 
telebot_core_response_t telebot_core_get_my_short_description (telebot_core_handler_t core_h, const char *language_code)
 Use this method to get the current bot short description for the given user language.
 
telebot_core_response_t telebot_core_set_chat_menu_button (telebot_core_handler_t core_h, long long int chat_id, const char *menu_button)
 Use this method to change the bot's menu button in a private chat, or the default menu button.
 
telebot_core_response_t telebot_core_get_chat_menu_button (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
 
telebot_core_response_t telebot_core_set_my_default_administrator_rights (telebot_core_handler_t core_h, const char *rights, bool for_channels)
 Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
 
telebot_core_response_t telebot_core_get_my_default_administrator_rights (telebot_core_handler_t core_h, bool for_channels)
 Use this method to get the current default administrator rights of the bot.
 
telebot_core_response_t telebot_core_delete_my_commands (telebot_core_handler_t core_h, const char *scope, const char *language_code)
 Use this method to delete the list of the bot's commands for the given scope and user language.
 
telebot_core_response_t telebot_core_copy_message (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, int message_id, const char *caption, const char *parse_mode, const char *caption_entities, bool disable_notification, bool protect_content, int reply_to_message_id, bool allow_sending_without_reply, const char *reply_markup)
 Use this method to copy messages of any kind.
 
telebot_core_response_t telebot_core_copy_messages (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, bool remove_caption)
 Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
 
telebot_core_response_t telebot_core_forward_messages (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content)
 Use this method to forward multiple messages of any kind.
 
telebot_core_response_t telebot_core_delete_messages (telebot_core_handler_t core_h, long long int chat_id, const char *message_ids)
 Use this method to delete multiple messages in a chat.
 
telebot_core_response_t telebot_core_ban_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool revoke_messages)
 Use this method to ban a user in a group, a supergroup or a channel.
 
telebot_core_response_t telebot_core_ban_chat_sender_chat (telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
 Use this method to ban a channel chat in a supergroup or a channel.
 
telebot_core_response_t telebot_core_unban_chat_sender_chat (telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
 Use this method to unban a previously banned channel chat in a supergroup or a channel.
 
telebot_core_response_t telebot_core_create_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *name, long expire_date, int member_limit, bool creates_join_request)
 Use this method to create an additional invite link for a chat.
 
telebot_core_response_t telebot_core_edit_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *invite_link, const char *name, long expire_date, int member_limit, bool creates_join_request)
 Use this method to edit a non-primary invite link created by the bot.
 
telebot_core_response_t telebot_core_revoke_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *invite_link)
 Use this method to revoke an invite link created by the bot.
 
telebot_core_response_t telebot_core_approve_chat_join_request (telebot_core_handler_t core_h, long long int chat_id, int user_id)
 Use this method to approve a chat join request.
 
telebot_core_response_t telebot_core_decline_chat_join_request (telebot_core_handler_t core_h, long long int chat_id, int user_id)
 Use this method to decline a chat join request.
 
telebot_core_response_t telebot_core_set_message_reaction (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reaction, bool is_big)
 Use this method to set a new message reaction.
 
telebot_core_response_t telebot_core_create_forum_topic (telebot_core_handler_t core_h, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id)
 Use this method to create a topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_edit_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
 Use this method to edit name and icon of a topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_close_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
 Use this method to close an open topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_reopen_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
 Use this method to reopen a closed topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_delete_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
 Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
 
telebot_core_response_t telebot_core_unpin_all_forum_topic_messages (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
 Use this method to unpin all messages in a forum topic.
 
telebot_core_response_t telebot_core_get_forum_topic_icon_stickers (telebot_core_handler_t core_h)
 Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
 
telebot_core_response_t telebot_core_edit_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id, const char *name)
 Use this method to edit the name of the 'General' topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_close_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to close an open 'General' topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_reopen_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to reopen a closed 'General' topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_hide_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to hide the 'General' topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_unhide_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to unhide the 'General' topic in a forum supergroup chat.
 
telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages (telebot_core_handler_t core_h, long long int chat_id)
 Use this method to unpin all messages in a General forum topic.
 
telebot_core_response_t telebot_core_get_custom_emoji_stickers (telebot_core_handler_t core_h, const char *custom_emoji_ids)
 Use this method to get information about custom emoji stickers by their identifiers.
 
telebot_core_response_t telebot_core_answer_web_app_query (telebot_core_handler_t core_h, const char *web_app_query_id, const char *result)
 Use this method to send answers to an inline query to a user from a Web App.
 
telebot_core_response_t telebot_core_send_paid_media (telebot_core_handler_t core_h, long long int chat_id, int star_count, const char *media, const char *caption, const char *parse_mode, const char *caption_entities, bool show_caption_above_media, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
 Use this method to send paid media to a user.
 
telebot_core_response_t telebot_core_answer_inline_query (telebot_core_handler_t core_h, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
 Use this method to send answers to an inline query.
 
telebot_core_response_t telebot_core_save_prepared_inline_message (telebot_core_handler_t core_h, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats)
 Use this method to save a prepared inline message.
 
telebot_core_response_t telebot_core_send_gift (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to send a gift.
 
telebot_core_response_t telebot_core_gift_premium_subscription (telebot_core_handler_t core_h, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to gift a Telegram Premium subscription to a user.
 
telebot_core_response_t telebot_core_get_my_star_balance (telebot_core_handler_t core_h)
 Use this method to get the current Telegram Stars balance of the bot.
 
telebot_core_response_t telebot_core_get_star_transactions (telebot_core_handler_t core_h, int offset, int limit)
 Use this method to get the bot's Telegram Star transactions.
 
telebot_core_response_t telebot_core_refund_star_payment (telebot_core_handler_t core_h, long long int user_id, const char *telegram_payment_charge_id)
 Use this method to refund a successful payment in Telegram Stars.
 
telebot_core_response_t telebot_core_get_available_gifts (telebot_core_handler_t core_h)
 Use this method to get a list of gifts that can be sent by the bot to users.
 
telebot_core_response_t telebot_core_get_user_gifts (telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
 Use this method to get a list of gifts received by a user.
 
telebot_core_response_t telebot_core_get_chat_gifts (telebot_core_handler_t core_h, long long int chat_id, int offset, int limit)
 Use this method to get a list of gifts received by a chat.
 
telebot_core_response_t telebot_core_upgrade_gift (telebot_core_handler_t core_h, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
 Use this method to upgrade a gift.
 
telebot_core_response_t telebot_core_transfer_gift (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id)
 Use this method to transfer a gift.
 
telebot_core_response_t telebot_core_convert_gift_to_stars (telebot_core_handler_t core_h, const char *gift_id)
 Use this method to convert a gift to Telegram Stars.
 
telebot_core_response_t telebot_core_get_user_profile_audios (telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
 Use this method to get user profile audios.
 
telebot_core_response_t telebot_core_set_my_profile_photo (telebot_core_handler_t core_h, const char *photo)
 Use this method to set the bot's profile photo.
 
telebot_core_response_t telebot_core_remove_my_profile_photo (telebot_core_handler_t core_h, const char *photo_id)
 Use this method to remove the bot's profile photo.
 
telebot_core_response_t telebot_core_get_business_connection (telebot_core_handler_t core_h, const char *business_connection_id)
 Use this method to get information about the business connection.
 
telebot_core_response_t telebot_core_get_user_chat_boosts (telebot_core_handler_t core_h, long long int chat_id, long long int user_id)
 Use this method to get user chat boosts.
 
+telebot_core_response_t telebot_core_set_game_score (telebot_core_handler_t core_h, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id)
 Use this method to set the score of the specified user in a game.
 
+telebot_core_response_t telebot_core_get_game_high_scores (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id)
 Use this method to get data for high score tables.
 
+telebot_core_response_t telebot_core_send_game (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
 Use this method to send a game.
 
+telebot_core_response_t telebot_core_set_passport_data_errors (telebot_core_handler_t core_h, long long int user_id, const char *errors)
 Use this method to set passport data errors.
 
+telebot_core_response_t telebot_core_send_invoice (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
 Use this method to send an invoice.
 
+telebot_core_response_t telebot_core_create_invoice_link (telebot_core_handler_t core_h, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible)
 Use this method to create a link for an invoice.
 
+telebot_core_response_t telebot_core_answer_shipping_query (telebot_core_handler_t core_h, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
 Use this method to reply to shipping queries.
 
+telebot_core_response_t telebot_core_answer_pre_checkout_query (telebot_core_handler_t core_h, const char *pre_checkout_query_id, bool ok, const char *error_message)
 Use this method to respond to pre-checkout queries.
 

Detailed Description

The APIs for the telegram bot interface, response is unparsed json sting.

Function Documentation

- -

◆ telebot_core_answer_callback_query()

+ +

◆ telebot_core_answer_callback_query()

- + - + @@ -312,13 +542,7 @@

- - - - - - - + @@ -331,37 +555,66 @@

Parameters

telebot_error_e telebot_core_answer_callback_query telebot_core_response_t telebot_core_answer_callback_query (telebot_core_handler_ttelebot_core_handler_t  core_h,
int cache_time,
telebot_core_response_tresponse cache_time 
- + - + -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]callback_query_idUnique identifier for the query to be answered.
[in]textText of the notification. If not specified, nothing will be shown to the user, 0-200 characters
[in]show_alertIf true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
[in]urlURL that will be opened by the user's client. If you have created a Game and accepted the conditions via , specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.
[in]urlURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.
[in]cache_timeThe maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().

- -

◆ telebot_core_create()

+ +

◆ telebot_core_answer_inline_query()

- + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -371,41 +624,46 @@

-

Start function to use telebot core APIs.

-

This function must be used first to call, and it creates handler that is used as input to other functions in telebot core interface. This call MUST have corresponding call to telebot_core_destroy when operation is complete.

Parameters
+

Use this method to send answers to an inline query.

+
Parameters

telebot_error_e telebot_core_create telebot_core_response_t telebot_core_answer_inline_query (telebot_core_handler_t ** telebot_core_handler_t  core_h,
const char * token inline_query_id,
const char * results,
int cache_time,
bool is_personal,
const char * next_offset,
const char * button 
- - + + + + + + +
core_h[in,out]A pointer to a handler, which will be allocated and created. Obtained handler MUST be released with telebot_core_destroy()
token[in]Telegram bot token to use.
[in]core_hThe telebot core handler.
[in]inline_query_idUnique identifier for the answered query.
[in]resultsA JSON-serialized array of results for the inline query.
[in]cache_timeThe maximum amount of time in seconds that the result of the inline query may be cached on the server.
[in]is_personalPass True, if results may be cached only for the user that sent the query.
[in]next_offsetPass the offset that a client should send in the next query with the same text to receive more results.
[in]buttonA JSON-serialized object describing a button to be shown above inline query results.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response.

- -

◆ telebot_core_delete_chat_photo()

+ +

◆ telebot_core_answer_web_app_query()

- + - + - - + + - - + + @@ -415,29 +673,29 @@

-

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 admin rights.

+

Use this method to send answers to an inline query to a user from a Web App.

Parameters

telebot_error_e telebot_core_delete_chat_photo telebot_core_response_t telebot_core_answer_web_app_query (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id, const char * web_app_query_id,
telebot_core_response_tresponse const char * result 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]web_app_query_idUnique identifier for the query to be answered.
[in]resultA JSON-serialized object describing the message to be sent.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains SentWebAppMessage.
- -

◆ telebot_core_delete_chat_sticker_set()

+ +

◆ telebot_core_approve_chat_join_request()

- + - + @@ -449,8 +707,8 @@

- - + + @@ -460,29 +718,29 @@

-

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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use this method.

+

Use this method to approve a chat join request.

Parameters

telebot_error_e telebot_core_delete_chat_sticker_set telebot_core_response_t telebot_core_approve_chat_join_request (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse int user_id 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_delete_message()

+ +

◆ telebot_core_ban_chat_member()

- + - + @@ -495,13 +753,19 @@

- + + + + + + + - - + + @@ -511,43 +775,44 @@

-

Delete a message, including service messages, with the following limitations:

-
    -
  • A message can only be deleted if it was sent less than 48 hours ago.
  • -
  • Bots can delete outgoing messages in groups and supergroups.
  • -
  • Bots granted can_post_messages permissions can delete outgoing messages in channels.
  • -
  • If the bot is an administrator of a group, it can delete any message there.
  • -
  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
    Parameters
    +

    Use this method to ban a user in a group, a supergroup or a channel.

    +
    Parameters

telebot_error_e telebot_core_delete_message telebot_core_response_t telebot_core_ban_chat_member (telebot_core_handler_ttelebot_core_handler_t  core_h,
int message_id, user_id,
long until_date,
telebot_core_response_tresponse bool revoke_messages 
- - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target message_id Message identifier to be deleted.
[out]responseResponse data that contains "True" on succes, It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
[in]until_dateDate when the user will be unbanned, unix time.
[in]revoke_messagesPass True to delete all messages from the chat for the user that is being banned.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
- - +
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_delete_webhook()

+ +

◆ telebot_core_ban_chat_sender_chat()

- + - + - - + + + + + + + + @@ -557,68 +822,69 @@

-

Remove webhook integration if you decide to switch back to getUpdates.

+

Use this method to ban a channel chat in a supergroup or a channel.

Parameters

telebot_error_e telebot_core_delete_webhook telebot_core_response_t telebot_core_ban_chat_sender_chat (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse long long int chat_id,
long long int sender_chat_id 
- - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]sender_chat_idUnique identifier of the target sender chat.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_destroy()

+ +

◆ telebot_core_close()

- + - +
telebot_error_e telebot_core_destroy telebot_core_response_t telebot_core_close (telebot_core_handler_t ** telebot_core_handler_t  core_h)
-

Final function to use telebot core APIs.

-

This function must be the last function to call for a telebot core use. It is the opposite of the telebot_core_create function and MUST be called with the same handler as the input that a telebot_core_create call created.

Parameters
+

Use this method to close the bot instance before moving it from one local server to another.

+
Parameters
- +
[in,out]core_hThe A pointer to telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_download_file()

+ +

◆ telebot_core_close_forum_topic()

- + - + - - + + - - + + @@ -628,72 +894,74 @@

-

Download file using file_path obtained with telebot_core_get_file(). 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 telebot_core_get_file() again.

+

Use this method to close an open topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_download_file telebot_core_response_t telebot_core_close_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * file_path, long long int chat_id,
const char * out_file int message_thread_id 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]file_pathA file path take from the response of telebot_core_get_file()
[in]out_fileFull path to download and save file.
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. No response, i.e., core_h->resp_data contains nothing.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_edit_message_caption()

+ +

◆ telebot_core_close_general_forum_topic()

- + - + - - - - - - - - - - - - - + - - - + + +
telebot_error_e telebot_core_edit_message_caption telebot_core_response_t telebot_core_close_general_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
int message_id,
const char * inline_message_id, chat_id 
const char * caption, )
+
+ +

Use this method to close an open 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_convert_gift_to_stars()

+ +
+
+ - - - - + + + + - - - - - - - + @@ -703,33 +971,28 @@

-

Edit captions of messages sent by the bot or via the bot (for inline bots).

+

Use this method to convert a gift to Telegram Stars.

Parameters

const char * parse_mode, telebot_core_response_t telebot_core_convert_gift_to_stars (telebot_core_handler_t core_h,
const char * reply_markup,
telebot_core_response_tresponse gift_id 
- - - - - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]captionNew caption of the message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[out]responseResponse data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]gift_idIdentifier of the gift.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response.
- -

◆ telebot_core_edit_message_live_location()

+ +

◆ telebot_core_copy_message()

- + - + @@ -738,6 +1001,12 @@

long long int 

+ + + + + + @@ -748,31 +1017,49 @@

- + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + - - + + @@ -782,34 +1069,38 @@

-

Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_core_stop_message_live_location().

+

Use this method to copy messages of any kind.

Parameters

telebot_error_e telebot_core_edit_message_live_location telebot_core_response_t telebot_core_copy_message (telebot_core_handler_ttelebot_core_handler_t  core_h,
chat_id,
long long int from_chat_id,
const char * inline_message_id, caption,
float latitude, const char * parse_mode,
float longitude, const char * caption_entities,
const char * reply_markup, bool disable_notification,
bool protect_content,
int reply_to_message_id,
bool allow_sending_without_reply,
telebot_core_response_tresponse const char * reply_markup 
- - - - - - - - + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
[out]responseResponse data that contains the sent message on success. Otherwise, True is returned. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original message was sent.
[in]message_idMessage identifier in the chat specified by from_chat_id.
[in]captionNew caption for media, 0-1024 characters after entities parsing.
[in]parse_modeMode for parsing entities in the new caption.
[in]caption_entitiesA JSON-serialized list of special entities that appear in the new caption.
[in]disable_notificationSends the message silently.
[in]protect_contentProtects the contents of the sent message from forwarding and saving.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]allow_sending_without_replyPass True if the message should be sent even if the specified replied-to message is not found.
[in]reply_markupAdditional interface options.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains MessageId.
- -

◆ telebot_core_edit_message_reply_markup()

+ +

◆ telebot_core_copy_messages()

- + - + @@ -821,26 +1112,32 @@

- - + + - + - - + + - - + + + + + + + + @@ -850,81 +1147,102 @@

-

Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

+

Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.

Parameters

telebot_error_e telebot_core_edit_message_reply_markup telebot_core_response_t telebot_core_copy_messages (telebot_core_handler_ttelebot_core_handler_t  core_h,
int message_id, long long int from_chat_id,
const char * inline_message_id, message_ids,
const char * reply_markup, bool disable_notification,
telebot_core_response_tresponse bool protect_content,
bool remove_caption 
- - - - - - + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[out]responseResponse data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original messages were sent.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy.
[in]disable_notificationSends the messages silently.
[in]protect_contentProtects the contents of the sent messages from forwarding and saving.
[in]remove_captionPass True to copy the messages without their captions.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains an array of MessageId.
- -

◆ telebot_core_edit_message_text()

+ +

◆ telebot_core_create()

- + - + - - + + - - - + + +
telebot_error_e telebot_core_edit_message_text telebot_error_e telebot_core_create (telebot_core_handler_ttelebot_core_handler_t core_h,
long long int chat_id, const char * token 
int message_id, )
+
+ +

Start function to use telebot core APIs.

+

This function must be used first to call, and it creates handler that is used as input to other functions in telebot core interface. This call MUST have corresponding call to telebot_core_destroy when operation is complete.

Parameters
+ + + +
core_h[out]A pointer to a handler, which will be allocated and created. Obtained handler MUST be released with telebot_core_destroy()
token[in]Telegram bot token to use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_core_create_chat_invite_link()

+ +
+
+ - - - - + + + + - - + + - + - - + + - - + + - - + + @@ -934,35 +1252,32 @@

-

Edit text and game messages sent by the bot or via the bot (for inline bots).

+

Use this method to create an additional invite link for a chat.

Parameters

const char * inline_message_id, telebot_core_response_t telebot_core_create_chat_invite_link (telebot_core_handler_t core_h,
const char * text, long long int chat_id,
const char * parse_mode, name,
bool disable_web_page_preview, long expire_date,
const char * reply_markup, int member_limit,
telebot_core_response_tresponse bool creates_join_request 
- - - - - - - - - + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]textNew text of the message.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
[in]disable_web_page_priviewDisables link previews for links in this message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[out]responseResponse data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]nameInvite link name; 0-32 characters.
[in]expire_datePoint in time (Unix timestamp) when the link will expire.
[in]member_limitThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
[in]creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains ChatInviteLink.
- -

◆ telebot_core_export_chat_invite_link()

+ +

◆ telebot_core_create_forum_topic()

- + - + @@ -974,8 +1289,20 @@

- - + + + + + + + + + + + + + + @@ -985,29 +1312,31 @@

-

Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

Use this method to create a topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_export_chat_invite_link telebot_core_response_t telebot_core_create_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse const char * name,
int icon_color,
const char * icon_custom_emoji_id 
- - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains the new invite link on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]nameTopic name, 1-128 characters.
[in]icon_colorColor of the topic icon in RGB format.
[in]icon_custom_emoji_idUnique identifier of the custom emoji used as the topic icon.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains ForumTopic.
- -

◆ telebot_core_forward_message()

+ +

◆ telebot_core_decline_chat_join_request()

+ +

◆ telebot_core_delete_chat_photo()

+ +
+
+ - - - - + + + + - - + + @@ -1048,45 +1398,35 @@

-

Forward messages of any kind.

+

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 admin rights.

Parameters

int message_id, telebot_core_response_t telebot_core_delete_chat_photo (telebot_core_handler_t core_h,
telebot_core_response_tresponse long long int chat_id 
- + - - - -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]from_chat_idUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername).
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]message_idUnique message identifier.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_get_chat()

+ +

◆ telebot_core_delete_chat_sticker_set()

- + - + - - - - - - - + @@ -1096,29 +1436,28 @@

-

Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).

+

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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use this method.

Parameters

telebot_error_e telebot_core_get_chat telebot_core_response_t telebot_core_delete_chat_sticker_set (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
telebot_core_response_tresponse chat_id 
- + -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains a Chat object on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_get_chat_admins()

+ +

◆ telebot_core_delete_forum_topic()

- + - + @@ -1130,8 +1469,8 @@

- - + + @@ -1141,29 +1480,29 @@

-

Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

+

Use this method to delete a forum topic along with all its messages in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_get_chat_admins telebot_core_response_t telebot_core_delete_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse int message_thread_id 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains a array of chat members on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_get_chat_member()

+ +

◆ telebot_core_delete_message()

- + - + @@ -1176,13 +1515,7 @@

- - - - - - - + @@ -1192,30 +1525,35 @@

-

Get information about a member of a chat.

-
Parameters
+

Delete a message, including service messages, with the following limitations:

+
    +
  • A message can only be deleted if it was sent less than 48 hours ago.
  • +
  • Bots can delete outgoing messages in groups and supergroups.
  • +
  • Bots granted can_post_messages permissions can delete outgoing messages in channels.
  • +
  • If the bot is an administrator of a group, it can delete any message there.
  • +
  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
    Parameters

telebot_error_e telebot_core_get_chat_member telebot_core_response_t telebot_core_delete_message (telebot_core_handler_ttelebot_core_handler_t  core_h,
int user_id,
telebot_core_response_tresponse message_id 
- - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[out]responseResponse data that contains a chat member on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target message_id Message identifier to be deleted.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
- -

◆ telebot_core_get_chat_members_count()

+ +

◆ telebot_core_delete_messages()

- + - + @@ -1227,8 +1565,8 @@

- - + + @@ -1238,42 +1576,42 @@

-

Get the number of members in a chat.

+

Use this method to delete multiple messages in a chat.

Parameters

telebot_error_e telebot_core_get_chat_members_count telebot_core_response_t telebot_core_delete_messages (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse const char * message_ids 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains number of chat members on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages to delete.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_get_file()

+ +

◆ telebot_core_delete_my_commands()

- + - + - + - - + + @@ -1283,88 +1621,66 @@

-

Get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.

+

Use this method to delete the list of the bot's commands for the given scope and user language.

Parameters

telebot_error_e telebot_core_get_file telebot_core_response_t telebot_core_delete_my_commands (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * file_id, scope,
telebot_core_response_tresponse const char * language_code 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]file_idFile identifier to get info about.
[out]responseResponse data that contains file object on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]scopeA JSON-serialized object, describing scope of users for which the commands are relevant.
[in]language_codeA two-letter ISO 639-1 language code.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_get_me()

+ +

◆ telebot_core_delete_webhook()

- + - - - - - - - - - - + + - -
telebot_error_e telebot_core_get_me telebot_core_response_t telebot_core_delete_webhook (telebot_core_handler_tcore_h,
telebot_core_response_tresponse 
telebot_core_handler_t core_h) )
-

Get basic information about the bot.

+

Remove webhook integration if you decide to switch back to getUpdates.

Parameters
- - +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_get_my_commands()

+ +

◆ telebot_core_destroy()

- + - - - - - - - - - - + + - -
telebot_error_e telebot_core_get_my_commands telebot_error_e telebot_core_destroy (telebot_core_handler_tcore_h,
telebot_core_response_tresponse 
telebot_core_handler_tcore_h) )
-

Get the current list of the bot's commands..

-
Parameters
+

Final function to use telebot core APIs.

+

This function must be the last function to call for a telebot core use. It is the opposite of the telebot_core_create function and MUST be called with the same handler as the input that a telebot_core_create call created.

Parameters
- - +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in,out]core_hThe A pointer to telebot core handler created with telebot_core_create().
@@ -1372,23 +1688,29 @@

-

◆ telebot_core_get_proxy()

+ +

◆ telebot_core_download_file()

- + - + - - + + + + + + + + @@ -1398,59 +1720,66 @@

-

Get currently used proxy address.

+

Download file using file_path obtained with telebot_core_get_file(). 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 telebot_core_get_file() again.

Parameters

telebot_error_e telebot_core_get_proxy telebot_error_e telebot_core_download_file (telebot_core_handler_ttelebot_core_handler_t  core_h,
char ** addr const char * file_path,
const char * out_file 
- - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]addrCurrent proxy address or NULL, MUST be freed after use.
[in]core_hThe telebot core handler created with telebot_core_create().
[in]file_pathA file path take from the response of telebot_core_get_file()
[in]out_fileFull path to download and save file.

-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. No response, i.e., core_h->resp_data contains nothing.
- -

◆ telebot_core_get_updates()

+ +

◆ telebot_core_edit_chat_invite_link()

- + - + - - + + - - + + - - + + - - + + + + + + + + - - + + @@ -1460,57 +1789,58 @@

-

Receive incoming updates (long polling). It will not work if an outgoing webhook is set up. In order to avoid getting duplicate updates, recalculate offset after each server response.

+

Use this method to edit a non-primary invite link created by the bot.

Parameters

telebot_error_e telebot_core_get_updates telebot_core_response_t telebot_core_edit_chat_invite_link (telebot_core_handler_ttelebot_core_handler_t  core_h,
int offset, long long int chat_id,
int limit, const char * invite_link,
int timeout, const char * name,
const char * allowed_updates, long expire_date,
int member_limit,
telebot_core_response_tresponse bool creates_join_request 
- - - - - - + + + + + + +
[in]core_hTelebot core handler creating using telebot_core_create().
[in]offsetIdentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as the function is called with an offset higher than its update_id.
[in]limitLimits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.
[in]timeoutTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling.
[in]allowed_updatesList the types of update you want your bot to receive. Specify an empty list to receive all updates regardless of type (default).
[out]responseResponse data, MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]invite_linkThe invite link to edit.
[in]nameInvite link name; 0-32 characters.
[in]expire_datePoint in time (Unix timestamp) when the link will expire.
[in]member_limitThe maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
[in]creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains ChatInviteLink.
- -

◆ telebot_core_get_user_profile_photos()

+ +

◆ telebot_core_edit_forum_topic()

- + - + - - + + - + - - + + - - + + @@ -1520,38 +1850,44 @@

-

Get user profile pictures object.

+

Use this method to edit name and icon of a topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_get_user_profile_photos telebot_core_response_t telebot_core_edit_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
int user_id, long long int chat_id,
int offset, message_thread_id,
int limit, const char * name,
telebot_core_response_tresponse const char * icon_custom_emoji_id 
- - - - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]user_idUnique identifier of the target user.
[in]offsetSequential number of the first photo to be returned. By default, all photos are returned.
[in]limitLimits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
[out]responseResponse data that contains user's profile photos on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
[in]nameNew topic name, 0-128 characters.
[in]icon_custom_emoji_idNew unique identifier of the custom emoji used as the topic icon.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_get_webhook_info()

+ +

◆ telebot_core_edit_general_forum_topic()

- + - + - - + + + + + + + + @@ -1561,28 +1897,29 @@

-

Get current webhook status.

+

Use this method to edit the name of the 'General' topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_get_webhook_info telebot_core_response_t telebot_core_edit_general_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse long long int chat_id,
const char * name 
- - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]nameNew topic name, 1-128 characters.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_kick_chat_member()

+ +

◆ telebot_core_edit_message_caption()

- + - + @@ -1595,19 +1932,31 @@

- + - - + + + + + + + + + + + + + + - - + + @@ -1617,31 +1966,32 @@

-

Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

Edit captions of messages sent by the bot or via the bot (for inline bots).

Parameters

telebot_error_e telebot_core_kick_chat_member telebot_core_response_t telebot_core_edit_message_caption (telebot_core_handler_ttelebot_core_handler_t  core_h,
int user_id, message_id,
long until_date, const char * inline_message_id,
const char * caption,
const char * parse_mode,
telebot_core_response_tresponse const char * reply_markup 
- - - - - + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
[in]until_dateDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]captionNew caption of the message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the message edited, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_leave_chat()

+ +

◆ telebot_core_edit_message_live_location()

- + - + @@ -1653,8 +2003,32 @@

- - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1664,29 +2038,33 @@

-

Leave a group, supergroup or channel.

+

Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_core_stop_message_live_location().

Parameters

telebot_error_e telebot_core_leave_chat telebot_core_response_t telebot_core_edit_message_live_location (telebot_core_handler_ttelebot_core_handler_t  core_h,
telebot_core_response_tresponse int message_id,
const char * inline_message_id,
float latitude,
float longitude,
const char * reply_markup 
- + - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_pin_chat_message()

+ +

◆ telebot_core_edit_message_media()

- + - + @@ -1704,14 +2082,20 @@

- - - + + + + + + + + + - - + + @@ -1721,31 +2105,32 @@

-

Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

+

Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio of the same type and with the same caption.

Parameters

telebot_error_e telebot_core_pin_chat_message telebot_core_response_t telebot_core_edit_message_media (telebot_core_handler_ttelebot_core_handler_t  core_h,
bool disable_notification,
const char * inline_message_id,
const char * media,
telebot_core_response_tresponse const char * reply_markup 
- - - - - + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idIdentifier of a message to pin.
[in]disable_notificationPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idRequired if inline_message_id is not specified.
[in]message_idRequired if inline_message_id is not specified.
[in]inline_message_idRequired if chat_id and message_id are not specified.
[in]mediaA JSON-serialized object for a new media content of the message.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the edited message.
- -

◆ telebot_core_promote_chat_member()

+ +

◆ telebot_core_edit_message_reply_markup()

+ +

◆ telebot_core_edit_message_text()

+ +
+
+ + + + + + - - + + - - + + - - + + - - + + - - + + - + - - + + @@ -1822,64 +2242,72 @@

-

Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

+

Edit text and game messages sent by the bot or via the bot (for inline bots).

Parameters

telebot_core_response_t telebot_core_edit_message_text (telebot_core_handler_t core_h,
bool can_edit_messages, long long int chat_id,
bool can_delete_messages, int message_id,
bool can_invite_users, const char * inline_message_id,
bool can_restrict_members, const char * text,
bool can_pin_messages, const char * parse_mode,
bool can_promote_members, disable_web_page_preview,
telebot_core_response_tresponse const char * reply_markup 
- - - - - - - - - - - - + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]can_change_infoPass true, if the administrator can change chat title, photo and other settings.
[in]can_post_messagesPass true, if the administrator can create channel posts, channels only.
[in]can_edit_messagesPass true, if the administrator can edit messages of other users and can pin messages, channels only.
[in]can_delete_messagesPass true, if the administrator can delete messages of other users.
[in]can_invite_usersPass true, if the administrator can invite new users to the chat.
[in]can_restrict_membersPass true, if the administrator can restrict, ban or unban chat members.
[in]can_pin_messagesPass true, if the administrator can pin messages, supergroups only.
[in]can_promote_membersPass true, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]textNew text of the message.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
[in]disable_web_page_priviewDisables link previews for links in this message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the message edited, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_put_response()

+ +

◆ telebot_core_export_chat_invite_link()

- + - - + + + + + + + + + + + +
void telebot_core_put_response telebot_core_response_t telebot_core_export_chat_invite_link (telebot_core_response_tresponse)telebot_core_handler_t core_h,
long long int chat_id 
)
-

Release response data obtained with telebot core methods.

+

Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

Parameters
- + +
[in]responsePointer to response to release.
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
Returns
telebot_core_response_t response that contains new invite link, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_restrict_chat_member()

+ +

◆ telebot_core_forward_message()

- + - + @@ -1891,68 +2319,20 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - + + @@ -1962,32 +2342,31 @@

-

Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user.

+

Forward messages of any kind.

Parameters

telebot_error_e telebot_core_restrict_chat_member telebot_core_response_t telebot_core_forward_message (telebot_core_handler_ttelebot_core_handler_t  core_h,
int user_id,
long until_date,
bool can_send_messages,
bool can_send_media_messages,
bool can_send_polls,
bool can_send_other_messages,
bool can_add_web_page_previews,
bool can_change_info,
bool can_invite_users, long long int from_chat_id,
bool can_pin_messages, disable_notification,
telebot_core_response_tresponse int message_id 
- - - - - - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user.
[in]until_dateDate when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]from_chat_idUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername).
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]message_idUnique message identifier.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_animation()

+ +

◆ telebot_core_forward_messages()

- + - + @@ -1999,50 +2378,14 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + @@ -2053,20 +2396,8 @@

- - - - - - - - - - - - - - + + @@ -2076,53 +2407,2341 @@

-

Send animation files (GIF or H.264/MPEG-4 AVC without sound).

+

Use this method to forward multiple messages of any kind.

Parameters

telebot_error_e telebot_core_send_animation telebot_core_response_t telebot_core_forward_messages (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * animation,
bool is_file,
int duration,
int width,
int height,
const char * thumb,
const char * caption, long long int from_chat_id,
const char * parse_mode, message_ids,
int reply_to_message_id,
const char * reply_markup,
telebot_core_response_tresponse bool protect_content 
- - - - - - - - - - - - - - + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]animationAnimation file to send. It is either a file_id to resend an animation that exists on the Telegram servers, or a path to animation file.
[in]is_fileFalse if animation is file_id, true, if animation is a file path.
[in]durationDuration of sent animation in seconds.
[in]widthAnimation width
[in]heightAnimation height
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionAnimation caption. (may also be used when resending animations).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]from_chat_idUnique identifier for the chat where the original messages were sent.
[in]message_idsA JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward.
[in]disable_notificationSends the messages silently.
[in]protect_contentProtects the contents of the sent messages from forwarding and saving.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains an array of MessageId.
- -

◆ telebot_core_send_audio()

+ +

◆ telebot_core_get_available_gifts()

- + - - - - - - - - - - - + + - - + +
telebot_error_e telebot_core_send_audio telebot_core_response_t telebot_core_get_available_gifts (telebot_core_handler_tcore_h,
long long int chat_id,
telebot_core_handler_t core_h) const char * audio,
+
+ +

Use this method to get a list of gifts that can be sent by the bot to users.

+
Parameters
+ + +
[in]core_hThe telebot core handler.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_business_connection()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_business_connection (telebot_core_handler_t core_h,
const char * business_connection_id 
)
+
+ +

Use this method to get information about the business connection.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]business_connection_idUnique identifier of the business connection.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_chat()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
+
+
Returns
telebot_core_response_t response that contains chat object, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_chat_admins()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat_admins (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
+
+
Returns
telebot_core_response_t response that contains an array of chat members, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_chat_gifts()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat_gifts (telebot_core_handler_t core_h,
long long int chat_id,
int offset,
int limit 
)
+
+ +

Use this method to get a list of gifts received by a chat.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier of the target chat.
[in]offsetNumber of gifts to skip.
[in]limitMaximum number of gifts to be retrieved.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat_member (telebot_core_handler_t core_h,
long long int chat_id,
int user_id 
)
+
+ +

Get information about a member of a chat.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
+
+
+
Returns
telebot_core_response_t response that contains a chat member, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_chat_members_count()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat_members_count (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Get the number of members in a chat.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
+
+
Returns
telebot_core_response_t response that contains the number of chat members, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_chat_menu_button()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_chat_menu_button (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target private chat.
+
+
+
Returns
telebot_core_response_t response that contains MenuButton.
+ +
+
+ +

◆ telebot_core_get_custom_emoji_stickers()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_custom_emoji_stickers (telebot_core_handler_t core_h,
const char * custom_emoji_ids 
)
+
+ +

Use this method to get information about custom emoji stickers by their identifiers.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]custom_emoji_idsList of custom emoji identifiers.
+
+
+
Returns
telebot_core_response_t response that contains an array of Sticker objects.
+ +
+
+ +

◆ telebot_core_get_file()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_file (telebot_core_handler_t core_h,
const char * file_id 
)
+
+ +

Get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]file_idFile identifier to get info about.
+
+
+
Returns
telebot_core_response_t response that contains file object, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_forum_topic_icon_stickers()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_get_forum_topic_icon_stickers (telebot_core_handler_t core_h)
+
+ +

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.

+
Parameters
+ + +
[in]core_hThe telebot core handler.
+
+
+
Returns
telebot_core_response_t response that contains an array of Sticker objects.
+ +
+
+ +

◆ telebot_core_get_me()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_get_me (telebot_core_handler_t core_h)
+
+ +

Get basic information about the bot.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
+
+
+
Returns
telebot_core_response_t response that contains bot information, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_my_commands()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_get_my_commands (telebot_core_handler_t core_h)
+
+ +

Get the current list of the bot's commands..

+
Parameters
+ + +
[in]core_hThe telebot core handler created with telebot_core_create().
+
+
+
Returns
telebot_core_response_t response that contains an array of bot commands, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_my_default_administrator_rights()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_my_default_administrator_rights (telebot_core_handler_t core_h,
bool for_channels 
)
+
+ +

Use this method to get the current default administrator rights of the bot.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]for_channelsPass True to get default administrator rights of the bot in channels.
+
+
+
Returns
telebot_core_response_t response that contains ChatAdministratorRights.
+ +
+
+ +

◆ telebot_core_get_my_description()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_my_description (telebot_core_handler_t core_h,
const char * language_code 
)
+
+ +

Use this method to get the current bot description for the given user language.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]language_codeA two-letter ISO 639-1 language code.
+
+
+
Returns
telebot_core_response_t response that contains BotDescription.
+ +
+
+ +

◆ telebot_core_get_my_name()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_my_name (telebot_core_handler_t core_h,
const char * language_code 
)
+
+ +

Use this method to get the current bot name for the given user language.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]language_codeA two-letter ISO 639-1 language code.
+
+
+
Returns
telebot_core_response_t response that contains BotName.
+ +
+
+ +

◆ telebot_core_get_my_short_description()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_my_short_description (telebot_core_handler_t core_h,
const char * language_code 
)
+
+ +

Use this method to get the current bot short description for the given user language.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]language_codeA two-letter ISO 639-1 language code.
+
+
+
Returns
telebot_core_response_t response that contains BotShortDescription.
+ +
+
+ +

◆ telebot_core_get_my_star_balance()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_get_my_star_balance (telebot_core_handler_t core_h)
+
+ +

Use this method to get the current Telegram Stars balance of the bot.

+
Parameters
+ + +
[in]core_hThe telebot core handler.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_proxy()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_core_get_proxy (telebot_core_handler_t core_h,
char ** addr 
)
+
+ +

Get currently used proxy address.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[out]addrCurrent proxy address or NULL, MUST be freed after use.
+
+
+
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+ +
+
+ +

◆ telebot_core_get_response_code()

+ +
+
+ + + + + + + + +
telebot_error_e telebot_core_get_response_code (telebot_core_response_t response)
+
+ +

Get response error code.

+
Parameters
+ + +
[in]responseResponse to get its error code.
+
+
+
Returns
on For successful responses TELEBOT_ERROR_NONE is returned, otherwise a negative error value
+
See also
telebot_error_e
+ +
+
+ +

◆ telebot_core_get_response_data()

+ +
+
+ + + + + + + + +
const char * telebot_core_get_response_data (telebot_core_response_t response)
+
+ +

Get response data.

+
Parameters
+ + +
[in]responseResponse to get its data.
+
+
+
Returns
on For successful responses null terminated string is returned, otherwise NULL.
+ +
+
+ +

◆ telebot_core_get_star_transactions()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_star_transactions (telebot_core_handler_t core_h,
int offset,
int limit 
)
+
+ +

Use this method to get the bot's Telegram Star transactions.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]offsetNumber of transactions to skip.
[in]limitMaximum number of transactions to be retrieved.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_updates()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_updates (telebot_core_handler_t core_h,
int offset,
int limit,
int timeout,
const char * allowed_updates 
)
+
+ +

Receive incoming updates (long polling). It will not work if an outgoing webhook is set up. In order to avoid getting duplicate updates, recalculate offset after each server response.

+
Parameters
+ + + + + + +
[in]core_hTelebot core handler creating using telebot_core_create().
[in]offsetIdentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as the function is called with an offset higher than its update_id.
[in]limitLimits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.
[in]timeoutTimeout in seconds for long polling. Defaults to 0, i.e. usual short polling.
[in]allowed_updatesList the types of update you want your bot to receive. Specify an empty list to receive all updates regardless of type (default).
+
+
+
Returns
telebot_core_response_t response that contains updates, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_user_chat_boosts()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_user_chat_boosts (telebot_core_handler_t core_h,
long long int chat_id,
long long int user_id 
)
+
+ +

Use this method to get user chat boosts.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]user_idUnique identifier of the target user.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_user_gifts()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_user_gifts (telebot_core_handler_t core_h,
long long int user_id,
int offset,
int limit 
)
+
+ +

Use this method to get a list of gifts received by a user.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]offsetNumber of gifts to skip.
[in]limitMaximum number of gifts to be retrieved.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_user_profile_audios()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_user_profile_audios (telebot_core_handler_t core_h,
long long int user_id,
int offset,
int limit 
)
+
+ +

Use this method to get user profile audios.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]offsetNumber of audios to skip.
[in]limitMaximum number of audios to be retrieved.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_get_user_profile_photos()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_get_user_profile_photos (telebot_core_handler_t core_h,
int user_id,
int offset,
int limit 
)
+
+ +

Get user profile pictures object.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]user_idUnique identifier of the target user.
[in]offsetSequential number of the first photo to be returned. By default, all photos are returned.
[in]limitLimits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
+
+
+
Returns
telebot_core_response_t response that contains user profile photos, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_get_webhook_info()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_get_webhook_info (telebot_core_handler_t core_h)
+
+ +

Get current webhook status.

+
Parameters
+ + +
[in]core_hThe telebot core handler created with telebot_core_create().
+
+
+
Returns
telebot_core_response_t response that contains webhook information, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_gift_premium_subscription()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_gift_premium_subscription (telebot_core_handler_t core_h,
long long int user_id,
int month_count,
int star_count,
const char * text,
const char * text_parse_mode,
const char * text_entities 
)
+
+ +

Use this method to gift a Telegram Premium subscription to a user.

+
Parameters
+ + + + + + + + +
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]month_countNumber of months the Telegram Premium subscription will be active.
[in]star_countNumber of Telegram Stars to pay.
[in]textText that will be shown along with the service message.
[in]text_parse_modeMode for parsing entities in the text.
[in]text_entitiesA JSON-serialized list of special entities.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_hide_general_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_hide_general_forum_topic (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Use this method to hide the 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_kick_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_kick_chat_member (telebot_core_handler_t core_h,
long long int chat_id,
int user_id,
long until_date 
)
+
+ +

Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
[in]until_dateDate when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_leave_chat()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_leave_chat (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Leave a group, supergroup or channel.

+
Parameters
+ + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_log_out()

+ +
+
+ + + + + + + + +
telebot_core_response_t telebot_core_log_out (telebot_core_handler_t core_h)
+
+ +

Use this method to log out from the cloud Bot API server before launching the bot locally.

+
Parameters
+ + +
[in]core_hThe telebot core handler.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_pin_chat_message()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_pin_chat_message (telebot_core_handler_t core_h,
long long int chat_id,
int message_id,
bool disable_notification 
)
+
+ +

Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

+
Parameters
+ + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idIdentifier of a message to pin.
[in]disable_notificationPass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_promote_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_promote_chat_member (telebot_core_handler_t core_h,
long long int chat_id,
int user_id,
bool can_change_info,
bool can_post_messages,
bool can_edit_messages,
bool can_delete_messages,
bool can_invite_users,
bool can_restrict_members,
bool can_pin_messages,
bool can_promote_members 
)
+
+ +

Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

+
Parameters
+ + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]can_change_infoPass true, if the administrator can change chat title, photo and other settings.
[in]can_post_messagesPass true, if the administrator can create channel posts, channels only.
[in]can_edit_messagesPass true, if the administrator can edit messages of other users and can pin messages, channels only.
[in]can_delete_messagesPass true, if the administrator can delete messages of other users.
[in]can_invite_usersPass true, if the administrator can invite new users to the chat.
[in]can_restrict_membersPass true, if the administrator can restrict, ban or unban chat members.
[in]can_pin_messagesPass true, if the administrator can pin messages, supergroups only.
[in]can_promote_membersPass true, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_put_response()

+ +
+
+ + + + + + + + +
void telebot_core_put_response (telebot_core_response_t response)
+
+ +

Release response data obtained with telebot core methods.

+
Parameters
+ + +
[in]responseResponse to release.
+
+
+ +
+
+ +

◆ telebot_core_refund_star_payment()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_refund_star_payment (telebot_core_handler_t core_h,
long long int user_id,
const char * telegram_payment_charge_id 
)
+
+ +

Use this method to refund a successful payment in Telegram Stars.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]user_idIdentifier of the user whose payment will be refunded.
[in]telegram_payment_charge_idTelegram payment identifier.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_remove_my_profile_photo()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_remove_my_profile_photo (telebot_core_handler_t core_h,
const char * photo_id 
)
+
+ +

Use this method to remove the bot's profile photo.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]photo_idIdentifier of the photo to remove.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_reopen_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_reopen_forum_topic (telebot_core_handler_t core_h,
long long int chat_id,
int message_thread_id 
)
+
+ +

Use this method to reopen a closed topic in a forum supergroup chat.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_reopen_general_forum_topic()

+ +
+
+ + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_reopen_general_forum_topic (telebot_core_handler_t core_h,
long long int chat_id 
)
+
+ +

Use this method to reopen a closed 'General' topic in a forum supergroup chat.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_restrict_chat_member()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_restrict_chat_member (telebot_core_handler_t core_h,
long long int chat_id,
int user_id,
long until_date,
bool can_send_messages,
bool can_send_media_messages,
bool can_send_polls,
bool can_send_other_messages,
bool can_add_web_page_previews,
bool can_change_info,
bool can_invite_users,
bool can_pin_messages 
)
+
+ +

Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user.

+
Parameters
+ + + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user.
[in]until_dateDate when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever.
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[incan_send_polls Pass true, if the user is allowed to send polls, implies can_send_messages
[in]can_send_other_messagesPass true, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
[in]can_add_web_page_previewsPass true, if the user may add web page previews to their messages, implies can_send_media_messages.
[in]can_change_infoPass true, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
[in]can_invite_usersPass true, if the user is allowed to invite new users to the chat.
[in]can_pin_messagesPass true, if the user is allowed to pin messages. Ignored in public supergroups
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_revoke_chat_invite_link()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_revoke_chat_invite_link (telebot_core_handler_t core_h,
long long int chat_id,
const char * invite_link 
)
+
+ +

Use this method to revoke an invite link created by the bot.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]invite_linkThe invite link to revoke.
+
+
+
Returns
telebot_core_response_t response that contains ChatInviteLink.
+ +
+
+ +

◆ telebot_core_save_prepared_inline_message()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_save_prepared_inline_message (telebot_core_handler_t core_h,
long long int user_id,
const char * result,
bool allow_user_chats,
bool allow_bot_chats,
bool allow_group_chats,
bool allow_channel_chats 
)
+
+ +

Use this method to save a prepared inline message.

+
Parameters
+ + + + + + + + +
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]resultA JSON-serialized object describing the message to be sent.
[in]allow_user_chatsPass True, if the message can be sent to user chats.
[in]allow_bot_chatsPass True, if the message can be sent to bot chats.
[in]allow_group_chatsPass True, if the message can be sent to group chats.
[in]allow_channel_chatsPass True, if the message can be sent to channel chats.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_send_animation()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_animation (telebot_core_handler_t core_h,
long long int chat_id,
const char * animation,
bool is_file,
int duration,
int width,
int height,
const char * thumb,
const char * caption,
const char * parse_mode,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send animation files (GIF or H.264/MPEG-4 AVC without sound).

+
Parameters
+ + + + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]animationAnimation file to send. It is either a file_id to resend an animation that exists on the Telegram servers, or a path to animation file.
[in]is_fileFalse if animation is file_id, true, if animation is a file path.
[in]durationDuration of sent animation in seconds.
[in]widthAnimation width
[in]heightAnimation height
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionAnimation caption. (may also be used when resending animations).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_audio()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_audio (telebot_core_handler_t core_h,
long long int chat_id,
const char * audio,
bool is_file,
const char * caption,
const char * parse_mode,
int duration,
const char * performer,
const char * title,
const char * thumb,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.

+
Parameters
+ + + + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]audioAudio file to send. It is either a file_id as String to resend an audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if audio is file_id, true, if audio is a file path.
[in]captionAudio caption. (may also be used when resending audios).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]durationDuration of sent audio in seconds.
[in]performerThe performer of the audio.
[in]titleThe track name of the audio.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_chat_action()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_chat_action (telebot_core_handler_t core_h,
long long int chat_id,
const char * action 
)
+
+ +

Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_core_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]actionType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data.
+
+
+
Returns
telebot_core_response_t response that contains sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_contact()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_contact (telebot_core_handler_t core_h,
long long int chat_id,
const char * phone_number,
const char * first_name,
const char * last_name,
const char * vcard,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send phone contacts.

+
Parameters
+ + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]phone_numberContact's phone numbers.
[in]first_nameContact's first name.
[in]last_nameContact's last name.
[in]vcardAdditional data about the contact in the form of a vCard, 0-2048 bytes.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_dice()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_dice (telebot_core_handler_t core_h,
long long int chat_id,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send a dice, which will have a random value from 1 to 6.

+
Parameters
+ + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_document()

+ +
+
+ + + + + + + + + + + + + + + + + + @@ -2130,6 +4749,12 @@

bool 

+ + + + + + @@ -2143,28 +4768,240 @@

parse_mode,

- - - - + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_document (telebot_core_handler_t core_h,
long long int chat_id,
const char * document,
is_file,
const char * thumb,
int duration, bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send general files.

+
Parameters
+ + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]documentDocument file to send. It is either a file_id as String to resend a file that is already on the Telegram servers, or a path to file.
[in]is_fileFalse if document is file_id, true, if document is a file path.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionDocument caption. (may also be used when resending documents).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_gift()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_gift (telebot_core_handler_t core_h,
long long int user_id,
long long int chat_id,
const char * gift_id,
bool pay_for_upgrade,
const char * text,
const char * text_parse_mode,
const char * text_entities 
)
+
+ +

Use this method to send a gift.

+
Parameters
+ + + + + + + + + +
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]chat_idUnique identifier for the target chat.
[in]gift_idIdentifier of the gift.
[in]pay_for_upgradePass True to pay for the gift upgrade.
[in]textText that will be shown along with the gift.
[in]text_parse_modeMode for parsing entities in the text.
[in]text_entitiesA JSON-serialized list of special entities.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_send_location()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_core_response_t telebot_core_send_location (telebot_core_handler_t core_h,
long long int chat_id,
float latitude,
float longitude,
int live_period,
bool disable_notification,
int reply_to_message_id,
const char * reply_markup 
)
+
+ +

Send point on the map.

+
Parameters
+ + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]live_periodPeriod in secnods for which the location will be updated. Should be between 60 and 86400.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+
+
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_send_media_group()

+ +
+
+ + + + + + - - + + - - + + - - + + @@ -2176,19 +5013,7 @@

- - - - - - - - - - - - - + @@ -2198,40 +5023,32 @@

-

Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.

+

Send a group of photos as an album.

Parameters

telebot_core_response_t telebot_core_send_media_group (telebot_core_handler_t core_h,
const char * performer, long long int chat_id,
const char * title, char * media_paths[],
const char * thumb, int count,
int reply_to_message_id,
const char * reply_markup,
telebot_core_response_tresponse reply_to_message_id 
- - - - - - - - - - + + + + - -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]audioAudio file to send. It is either a file_id as String to resend an audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if audio is file_id, true, if audio is a file path.
[in]captionAudio caption. (may also be used when resending audios).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]durationDuration of sent audio in seconds.
[in]performerThe performer of the audio.
[in]titleThe track name of the audio.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel.
[in]media_pathsArray of file paths to photos to send.
[in]countNumber of photos in the array (2–10).
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_chat_action()

+ +

◆ telebot_core_send_message()

- + - + @@ -2244,13 +5061,37 @@

- + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -2260,30 +5101,34 @@

-

Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_core_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.

+

Send text messages.

Parameters

telebot_error_e telebot_core_send_chat_action telebot_core_response_t telebot_core_send_message (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * action, text,
const char * parse_mode,
bool disable_web_page_preview,
bool disable_notification,
int reply_to_message_id,
telebot_core_response_tresponse const char * reply_markup 
- - - - + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]actionType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]textText of the message to be sent, 1-4096 characters after entities parsing.
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]disable_web_page_previewDisables link previews for links in this message.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_contact()

+ +

◆ telebot_core_send_paid_media()

- + - + @@ -2292,29 +5137,41 @@

long long int 

+ + + + + + - + - + - + - + + + + + + + @@ -2325,20 +5182,20 @@

- - + + - + - - + + @@ -2348,36 +5205,38 @@

-

Send phone contacts.

+

Use this method to send paid media to a user.

Parameters

telebot_error_e telebot_core_send_contact telebot_core_response_t telebot_core_send_paid_media (telebot_core_handler_ttelebot_core_handler_t  core_h,
chat_id,
int star_count,
const char * phone_number, media,
const char * first_name, caption,
const char * last_name, parse_mode,
const char * vcard, caption_entities,
bool show_caption_above_media,
int reply_to_message_id, bool protect_content,
const char * reply_markup, reply_parameters,
telebot_core_response_tresponse const char * reply_markup 
- - - - - - - - - - + + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]phone_numberContact's phone numbers.
[in]first_nameContact's first name.
[in]last_nameContact's last name.
[in]vcardAdditional data about the contact in the form of a vCard, 0-2048 bytes.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]star_countThe number of Telegram Stars that must be paid.
[in]mediaA JSON-serialized array of InputPaidMedia objects.
[in]captionMedia caption.
[in]parse_modeMode for parsing entities in the caption.
[in]caption_entitiesA JSON-serialized list of special entities.
[in]show_caption_above_mediaPass True, if the caption must be shown above the message media.
[in]disable_notificationSends the message silently.
[in]protect_contentProtects the contents of the sent message.
[in]reply_parametersDescription of the message to reply to.
[in]reply_markupAdditional interface options.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response.
- -

◆ telebot_core_send_dice()

+ +

◆ telebot_core_send_photo()

- + - + @@ -2386,29 +5245,47 @@

long long int 

+ + + + + + - + - - + + - + + + + + + + + + + + + + - - + + @@ -2418,32 +5295,35 @@

-

Send a dice, which will have a random value from 1 to 6.

+

Send photos.

Parameters

telebot_error_e telebot_core_send_dice telebot_core_response_t telebot_core_send_photo (telebot_core_handler_ttelebot_core_handler_t  core_h,
chat_id,
const char * photo,
bool disable_notification, is_file,
int reply_to_message_id, const char * caption,
const char * reply_markup, parse_mode,
bool disable_notification,
int reply_to_message_id,
telebot_core_response_tresponse const char * reply_markup 
- - + + + + + + - - +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoPhoto to send. It is either file_id as String to resend a photo that is already on the Telegram servers, or a path to photo file.
[in]is_fileFalse if photo is file_id, true, if photo is a file path.
[in]captionPhoto caption. (may also be used when resending photos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_document()

+ +

◆ telebot_core_send_poll()

- + - + @@ -2456,55 +5336,61 @@

- + + + + + + + - + - + - - + + - - + + - + - - + + - - + + - - + + @@ -2514,37 +5400,38 @@

-

Send general files.

+

Send a native poll.

Parameters

telebot_error_e telebot_core_send_document telebot_core_response_t telebot_core_send_poll (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * document, question,
const char * options,
bool is_file, is_anonymous,
const char * thumb, type,
const char * caption, bool allows_multiple_answers,
const char * parse_mode, int correct_option_id,
bool disable_notification, is_closed,
int reply_to_message_id, bool disable_notification,
const char * reply_markup, int reply_to_message_id,
telebot_core_response_tresponse const char * reply_markup 
- + - - - - - + + + + + + + - - +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]documentDocument file to send. It is either a file_id as String to resend a file that is already on the Telegram servers, or a path to file.
[in]is_fileFalse if document is file_id, true, if document is a file path.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionDocument caption. (may also be used when resending documents).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]questionPoll question, 1-255 characters.
[in]optionsA JSON-serialized list of answer options, 2-10 strings 1-100 characters each.
[in]is_anonymousTrue, if the poll needs to be anonymous, defaults to True.
[in]typePoll type, “quiz” or “regular”, defaults to “regular”.
[in]allows_multiple_answersTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
[in]correct_option_id0-based identifier of the correct answer option, required for polls in quiz mode.
[in]is_closedPass True, if the poll needs to be immediately closed. This can be useful for poll preview.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_location()

+ +

◆ telebot_core_send_venue()

- + - + @@ -2568,32 +5455,44 @@

- - + + - - + + - - + + - + + + + + + + + + + + + + - - + + @@ -2603,48 +5502,86 @@

-

Send point on the map.

+

Send information about a venue.

Parameters

telebot_error_e telebot_core_send_location telebot_core_response_t telebot_core_send_venue (telebot_core_handler_ttelebot_core_handler_t  core_h,
int live_period, const char * title,
bool disable_notification, const char * address,
int reply_to_message_id, const char * foursquare_id,
const char * reply_markup, foursquare_type,
bool disable_notification,
int reply_to_message_id,
telebot_core_response_tresponse const char * reply_markup 
- + - - - + + + + + + - - +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of location.
[in]longitudeLongitude of location.
[in]live_periodPeriod in secnods for which the location will be updated. Should be between 60 and 86400.
[in]latitudeLatitude of venue.
[in]longitudeLongitude of venue.
[in]titleName of the venue
[in]addressAddress of the venue.
[in]foursquare_idFoursquare identifier of the venue.
[in]foursquare_typeFoursquare type of the venue, if known.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains sent messageß, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_message()

+ +

◆ telebot_core_send_video()

- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + + + + + @@ -2656,7 +5593,7 @@

- + @@ -2674,13 +5611,7 @@

- - - - - - - + @@ -2690,35 +5621,40 @@

-

Send text messages.

+

Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).

Parameters

telebot_error_e telebot_core_send_message (telebot_core_handler_tcore_h, telebot_core_response_t telebot_core_send_video (telebot_core_handler_t core_h,
long long int chat_id,
const char * video,
bool is_file,
int duration,
int width,
long long int chat_id, int height,
const char * text, thumb,
const char * caption,
bool disable_web_page_preview, supports_streaming,
const char * reply_markup,
telebot_core_response_tresponse reply_markup 
- + - + + + + + + + - + -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]textText of the message to be sent, 1-4096 characters after entities parsing.
[in]videoVideo file to send. It is either a file_id as String to resend a video that is already on the Telegram servers, or a path to video file.
[in]is_fileFalse if video is file_id, true, if video is a file path.
[in]durationDuration of sent video in seconds. Optional, set 0 for ignoring.
[in]widthVideo width. Optional, set 0 for ignoring.
[in]heightVideo heigh. Optional, set 0 for ignoring.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionVideo caption. (may also be used when resending videos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]disable_web_page_previewDisables link previews for links in this message.
[in]supports_streamingPass True, if the uploaded video is suitable for streaming.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_photo()

+ +

◆ telebot_core_send_video_note()

- + - + @@ -2730,8 +5666,8 @@

- - + + @@ -2742,14 +5678,20 @@

- - + + + + + + + + - + @@ -2767,13 +5709,7 @@

- - - - - - - + @@ -2783,36 +5719,36 @@

-

Send photos.

+

Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.

Parameters

telebot_error_e telebot_core_send_photo telebot_core_response_t telebot_core_send_video_note (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * photo, char * video_note,
const char * caption, int duration,
int length,
const char * parse_mode, thumb,
const char * reply_markup,
telebot_core_response_tresponse reply_markup 
- + - - - - + + + + + -
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoPhoto to send. It is either file_id as String to resend a photo that is already on the Telegram servers, or a path to photo file.
[in]is_fileFalse if photo is file_id, true, if photo is a file path.
[in]captionPhoto caption. (may also be used when resending photos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]video_notVideo note to send. It is either a file_id to resend a video note that exists on the Telegram servers, or a path to video note file.
[in]is_fileFalse if video note is file_id, true, if video note is a file path.
[in]durationDuration of sent video in seconds.
[in]lengthVideo width and height, i.e. diameter of the video message.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_poll()

+ +

◆ telebot_core_send_voice()

- + - + @@ -2825,43 +5761,31 @@

- - - - - - - + - + - + - - + + - - - - - - - + @@ -2879,13 +5803,7 @@

- - - - - - - + @@ -2895,39 +5813,36 @@

-

Send a native poll.

+

Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).

Parameters

telebot_error_e telebot_core_send_poll telebot_core_response_t telebot_core_send_voice (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * question,
const char * options, voice,
bool is_anonymous, is_file,
const char * type, caption,
bool allows_multiple_answers, const char * parse_mode,
int correct_option_id,
bool is_closed, duration,
const char * reply_markup,
telebot_core_response_tresponse reply_markup 
- + - - - - - - - + + + + + - - +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]questionPoll question, 1-255 characters.
[in]optionsA JSON-serialized list of answer options, 2-10 strings 1-100 characters each.
[in]is_anonymousTrue, if the poll needs to be anonymous, defaults to True.
[in]typePoll type, “quiz” or “regular”, defaults to “regular”.
[in]allows_multiple_answersTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
[in]correct_option_id0-based identifier of the correct answer option, required for polls in quiz mode.
[in]is_closedPass True, if the poll needs to be immediately closed. This can be useful for poll preview.
[in]voiceAudio file to send. It is either a file_id as String to resend a audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if voice is file_id, true, if voice is a file path.
[in]captionVoice message caption. (may also be used when resending).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]durationDuration of sent voice/audio in seconds.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the sent message, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_venue()

+ +

◆ telebot_core_set_chat_admin_custom_title()

+ +

◆ telebot_core_set_chat_description()

+ +
+
+ - - - - + + + + - - + + - + - - - + + +
const char * address, telebot_core_response_t telebot_core_set_chat_description (telebot_core_handler_t core_h,
const char * foursquare_id, long long int chat_id,
const char * foursquare_type, description 
bool disable_notification, )
+
+ +

Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]descriptionNew chat description, 0-255 characters.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_set_chat_menu_button()

+ +
+
+ - - - - + + + + - - + + - - + + @@ -3004,38 +5962,29 @@

-

Send information about a venue.

+

Use this method to change the bot's menu button in a private chat, or the default menu button.

Parameters

int reply_to_message_id, telebot_core_response_t telebot_core_set_chat_menu_button (telebot_core_handler_t core_h,
const char * reply_markup, long long int chat_id,
telebot_core_response_tresponse const char * menu_button 
- - - - - - - - - - - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]latitudeLatitude of venue.
[in]longitudeLongitude of venue.
[in]titleName of the venue
[in]addressAddress of the venue.
[in]foursquare_idFoursquare identifier of the venue.
[in]foursquare_typeFoursquare type of the venue, if known.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target private chat.
[in]menu_buttonA JSON-serialized object for the bot's new menu button.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_send_video()

+ +

◆ telebot_core_set_chat_permissions()

- + - + @@ -3047,80 +5996,147 @@

- - + + - + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
telebot_error_e telebot_core_send_video telebot_core_response_t telebot_core_set_chat_permissions (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * video, bool can_send_messages,
bool is_file, can_send_media_messages,
int duration, bool can_send_polls,
int width, bool can_send_other_messages,
int height, bool can_add_web_page_previews,
bool can_change_info,
bool can_invite_users,
bool can_pin_messages 
)
+
+ +

Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.

+
Parameters
+ + + + + + + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[incan_send_polls Pass true, if the user is allowed to send polls, implies can_send_messages
[in]can_send_other_messagesPass true, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages
[in]can_add_web_page_previewsPass true, if the user may add web page previews to their messages, implies can_send_media_messages.
[in]can_change_infoPass true, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.
[in]can_invite_usersPass true, if the user is allowed to invite new users to the chat.
[in]can_pin_messagesPass true, if the user is allowed to pin messages. Ignored in public supergroups
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_set_chat_photo()

+ +
+
+ - - - - + + + + - - + + - + - - - + + +
const char * thumb, telebot_core_response_t telebot_core_set_chat_photo (telebot_core_handler_t core_h,
const char * caption, long long int chat_id,
const char * parse_mode, photo 
bool supports_streaming, )
+
+ +

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 admin rights.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoNew chat photo file path.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
+ +
+
+ +

◆ telebot_core_set_chat_sticker_set()

+ +
+
+ - - - - + + + + - - + + - - - - - - - + @@ -3130,41 +6146,29 @@

-

Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).

+

Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use it.

Parameters

bool disable_notification, telebot_core_response_t telebot_core_set_chat_sticker_set (telebot_core_handler_t core_h,
int reply_to_message_id, long long int chat_id,
const char * reply_markup,
telebot_core_response_tresponse sticker_set_name 
- + - - - - - - - - - - - - - +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]videoVideo file to send. It is either a file_id as String to resend a video that is already on the Telegram servers, or a path to video file.
[in]is_fileFalse if video is file_id, true, if video is a file path.
[in]durationDuration of sent video in seconds. Optional, set 0 for ignoring.
[in]widthVideo width. Optional, set 0 for ignoring.
[in]heightVideo heigh. Optional, set 0 for ignoring.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]captionVideo caption. (may also be used when resending videos).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message.
[in]supports_streamingPass True, if the uploaded video is suitable for streaming.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]sticker_set_nameName of the sticker set to be set as the group sticker set.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_video_note()

+ +

◆ telebot_core_set_chat_title()

+ +

◆ telebot_core_set_message_reaction()

+ +
+
+ + + + + + - - + + - + - + - + - - - + + +
telebot_core_response_t telebot_core_set_message_reaction (telebot_core_handler_t core_h,
int duration, long long int chat_id,
int length, message_id,
const char * thumb, reaction,
bool disable_notification, is_big 
int reply_to_message_id, )
+
+ +

Use this method to set a new message reaction.

+
Parameters
+ + + + + + +
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_idUnique identifier of the target message.
[in]reactionA JSON-serialized list of reaction types to set on the message.
[in]is_bigPass True to set the reaction with a big animation.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_set_my_commands()

+ +
+
+ - - - - + + + + - - + + @@ -3235,98 +6289,131 @@

-

Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.

+

Change the list of the bot's commands.

Parameters

const char * reply_markup, telebot_core_response_t telebot_core_set_my_commands (telebot_core_handler_t core_h,
telebot_core_response_tresponse const char * commands 
- - - - - - - - - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]video_notVideo note to send. It is either a file_id to resend a video note that exists on the Telegram servers, or a path to video note file.
[in]is_fileFalse if video note is file_id, true, if video note is a file path.
[in]durationDuration of sent video in seconds.
[in]lengthVideo width and height, i.e. diameter of the video message.
[in]thumbThumbnail file path of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Optional. Set to NULL to ignore.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]commandsA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_send_voice()

+ +

◆ telebot_core_set_my_default_administrator_rights()

- + - + - - - - - - - + - + - - - + + + +
telebot_error_e telebot_core_send_voice telebot_core_response_t telebot_core_set_my_default_administrator_rights (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
const char * voice, rights,
bool is_file, for_channels 
const char * caption, )
+
+ +

Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]rightsA JSON-serialized object describing new default administrator rights.
[in]for_channelsPass True to change the default administrator rights of the bot in channels.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_set_my_description()

+ +
+
+ + + + + + - + - - + + - - - + + +
telebot_core_response_t telebot_core_set_my_description (telebot_core_handler_t core_h,
const char * parse_mode, description,
int duration, const char * language_code 
bool disable_notification, )
+
+ +

Use this method to change the bot's description.

+
Parameters
+ + + + +
[in]core_hThe telebot core handler.
[in]descriptionNew bot description; 0-512 characters.
[in]language_codeA two-letter ISO 639-1 language code.
+
+
+
Returns
telebot_core_response_t response that contains the result (true/false).
+ +
+
+ +

◆ telebot_core_set_my_name()

+ +
+
+ - - - - + + + + - + - - + + @@ -3336,62 +6423,80 @@

-

Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).

+

Use this method to change the bot's name.

Parameters

int reply_to_message_id, telebot_core_response_t telebot_core_set_my_name (telebot_core_handler_t core_h,
const char * reply_markup, name,
telebot_core_response_tresponse const char * language_code 
- - - - - - - - - - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]voiceAudio file to send. It is either a file_id as String to resend a audio that is already on the Telegram servers, or a path to audio file.
[in]is_fileFalse if voice is file_id, true, if voice is a file path.
[in]captionVoice message caption. (may also be used when resending).
[in]parse_modeSend Markdown or HTML, if you want Telegram apps to show bold,
[in]durationDuration of sent voice/audio in seconds.
[in]disable_notificationSends the message silently. Users will receive a notification with no sound.
[in]reply_to_message_idIf the message is a reply, ID of the original message.
[in]reply_markupAdditional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
[out]responseResponse data that contains the sent message on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]nameNew bot name; 0-64 characters.
[in]language_codeA two-letter ISO 639-1 language code.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_set_chat_admin_custom_title()

+ +

◆ telebot_core_set_my_profile_photo()

- + - + - - + + - - - + + + +
telebot_error_e telebot_core_set_chat_admin_custom_title telebot_core_response_t telebot_core_set_my_profile_photo (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id, const char * photo 
int user_id, )
+
+ +

Use this method to set the bot's profile photo.

+
Parameters
+ + + +
[in]core_hThe telebot core handler.
[in]photoPath to the new profile photo.
+
+
+
Returns
telebot_core_response_t response.
+ +
+
+ +

◆ telebot_core_set_my_short_description()

+ +
+
+ + + + + + - + - - + + @@ -3401,50 +6506,42 @@

-

Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

-
Parameters
-

telebot_core_response_t telebot_core_set_my_short_description (telebot_core_handler_t core_h,
const char * custom_title, short_description,
telebot_core_response_tresponse const char * language_code 
- - - - - +

Use this method to change the bot's short description.

+
Parameters
+
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]user_idUnique identifier of the target user.
[in]custom_titleNew custom title for the administrator; 0-16 characters, emoji are not allowed.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
+ + +
[in]core_hThe telebot core handler.
[in]short_descriptionNew short description; 0-120 characters.
[in]language_codeA two-letter ISO 639-1 language code.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_set_chat_description()

+ +

◆ telebot_core_set_proxy()

- + - + - - - - - - - + - - + + @@ -3454,13 +6551,12 @@

-

Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

+

Set proxy address to use telebot behind proxy.

Parameters

telebot_error_e telebot_core_set_chat_description telebot_error_e telebot_core_set_proxy (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
const char * description, addr,
telebot_core_response_tresponse const char * auth 
- - - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]descriptionNew chat description, 0-255 characters.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]addrProxy address in full.
[in]authProxy authorization informatio.
@@ -3468,77 +6564,41 @@

-

◆ telebot_core_set_chat_permissions()

+ +

◆ telebot_core_set_webhook()

- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + @@ -3548,30 +6608,31 @@

-

Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.

+

Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.

Parameters

telebot_error_e telebot_core_set_chat_permissions telebot_core_response_t telebot_core_set_webhook (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
bool can_send_messages,
bool can_send_media_messages,
bool can_send_polls,
bool can_send_other_messages,
bool can_add_web_page_previews,
bool can_change_info, const char * url,
bool can_invite_users, const char * certificate,
bool can_pin_messages, int max_connections,
telebot_core_response_tresponse const char * allowed_updates 
- - - - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]can_send_messagesPass true, if the user is allowed to send text messages, contacts, locations and venues
[in]can_send_media_messagesPass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
[in]core_hThe telebot core handler created with telebot_core_create().
[in]urlHTTPS url to send updates to. Use an empty string to remove webhook integration
[in]certificateA path to to a public key certificate to upload server.
[in]max_connectionsOptional Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
[in]allowed_updatesList the types of updates you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_set_chat_photo()

+ +

◆ telebot_core_stop_message_live_location()

- + - + @@ -3583,14 +6644,20 @@

- - + + + + + + + + - - + + @@ -3600,30 +6667,31 @@

-

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 admin rights.

+

Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.

Parameters

telebot_error_e telebot_core_set_chat_photo telebot_core_response_t telebot_core_stop_message_live_location (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * photo, int message_id,
char * inline_message_id,
telebot_core_response_tresponse const char * reply_markup 
- + - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]photoNew chat photo file path.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_set_chat_sticker_set()

+ +

◆ telebot_core_stop_poll()

- + - + @@ -3635,14 +6703,14 @@

- - + + - - + + @@ -3652,49 +6720,50 @@

-

Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use it.

+

Stop a poll which was sent by the bot.

Parameters

telebot_error_e telebot_core_set_chat_sticker_set telebot_core_response_t telebot_core_stop_poll (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * sticker_set_name, int message_id,
telebot_core_response_tresponse const char * reply_markup 
- - - - + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]sticker_set_nameName of the sticker set to be set as the group sticker set.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the stopped poll, which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_set_chat_title()

+ +

◆ telebot_core_transfer_gift()

- + - + - + - - + + - - + + @@ -3704,43 +6773,43 @@

-

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 admin rights.

+

Use this method to transfer a gift.

Parameters

telebot_error_e telebot_core_set_chat_title telebot_core_response_t telebot_core_transfer_gift (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id, user_id,
const char * title, long long int chat_id,
telebot_core_response_tresponse const char * gift_id 
- - - - + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]titleNew chat title, 1-255 characters.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]user_idUnique identifier of the target user.
[in]chat_idUnique identifier for the target chat.
[in]gift_idIdentifier of the gift.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response.
- -

◆ telebot_core_set_my_commands()

+ +

◆ telebot_core_unban_chat_member()

- + - + - - + + - - + + @@ -3750,42 +6819,42 @@

-

Change the list of the bot's commands.

+

Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.

Parameters

telebot_error_e telebot_core_set_my_commands telebot_core_response_t telebot_core_unban_chat_member (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * commands, long long int chat_id,
telebot_core_response_tresponse int user_id 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]commandsA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_set_proxy()

+ +

◆ telebot_core_unban_chat_sender_chat()

- + - + - - + + - - + + @@ -3795,60 +6864,36 @@

-

Set proxy address to use telebot behind proxy.

+

Use this method to unban a previously banned channel chat in a supergroup or a channel.

Parameters

telebot_error_e telebot_core_set_proxy telebot_core_response_t telebot_core_unban_chat_sender_chat (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * addr, long long int chat_id,
const char * auth long long int sender_chat_id 
- - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]addrProxy address in full.
[in]authProxy authorization informatio.
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]sender_chat_idUnique identifier of the target sender chat.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_set_webhook()

+ +

◆ telebot_core_unhide_general_forum_topic()

- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -3858,32 +6903,28 @@

-

Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.

+

Use this method to unhide the 'General' topic in a forum supergroup chat.

Parameters

telebot_error_e telebot_core_set_webhook telebot_core_response_t telebot_core_unhide_general_forum_topic (telebot_core_handler_ttelebot_core_handler_t  core_h,
const char * url,
const char * certificate,
int max_connections,
const char * allowed_updates,
telebot_core_response_tresponse long long int chat_id 
- - - - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]urlHTTPS url to send updates to. Use an empty string to remove webhook integration
[in]certificateA path to to a public key certificate to upload server.
[in]max_connectionsOptional Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
[in]allowed_updatesList the types of updates you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types.
[out]responseResponse data, MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_stop_message_live_location()

+ +

◆ telebot_core_unpin_all_forum_topic_messages()

- + - + @@ -3896,25 +6937,7 @@

- - - - - - - - - - - - - - - - - - - + @@ -3924,57 +6947,36 @@

-

Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.

+

Use this method to unpin all messages in a forum topic.

Parameters

telebot_error_e telebot_core_stop_message_live_location telebot_core_response_t telebot_core_unpin_all_forum_topic_messages (telebot_core_handler_ttelebot_core_handler_t  core_h,
int message_id,
char * inline_message_id,
const char * reply_markup,
telebot_core_response_tresponse message_thread_id 
- - - - - - + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for a new inline keyboard.
[out]responseResponse data that contains the sent message on success. Otherwise, True is returned. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
[in]message_thread_idUnique identifier for the target message thread of the forum topic.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_stop_poll()

+ +

◆ telebot_core_unpin_all_general_forum_topic_messages()

- + - + - - - - - - - - - - - - - - - - - - - + @@ -3984,51 +6986,35 @@

-

Stop a poll which was sent by the bot.

+

Use this method to unpin all messages in a General forum topic.

Parameters

telebot_error_e telebot_core_stop_poll telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
int message_id,
const char * reply_markup,
telebot_core_response_tresponse chat_id 
- - - - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idRequired if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername).
[in]message_idRequired if inline_message_id is not specified. Identifier of the sent message.
[in]inline_message_idRequired if chat_id and message_id are not specified. Identifier of the inline message.
[in]reply_markupA JSON-serialized object for an inline keyboard.
[out]responseResponse data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]chat_idUnique identifier for the target chat.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false).
- -

◆ telebot_core_unban_chat_member()

+ +

◆ telebot_core_unpin_chat_message()

- + - + - - - - - - - - - - - - - + @@ -4038,43 +7024,59 @@

-

Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.

+

Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

Parameters

telebot_error_e telebot_core_unban_chat_member telebot_core_response_t telebot_core_unpin_chat_message (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id,
int user_id,
telebot_core_response_tresponse chat_id 
- - - - + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername)
[in]user_idUnique identifier of the target user
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response that contains the result (true/false), which MUST be released with telebot_core_put_response(), or null if allocation fails. Response code should be checked with #teleobot_core_get_response_code(), before getting data with telebot_core_get_response_data().
- -

◆ telebot_core_unpin_chat_message()

+ +

◆ telebot_core_upgrade_gift()

- + - + - - + + + + + + + + + + + + + + + + + + + + - - + + @@ -4084,25 +7086,26 @@

-

Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

+

Use this method to upgrade a gift.

Parameters

telebot_error_e telebot_core_unpin_chat_message telebot_core_response_t telebot_core_upgrade_gift (telebot_core_handler_ttelebot_core_handler_t  core_h,
long long int chat_id, const char * gift_id,
bool pay_for_upgrade,
const char * text,
const char * text_parse_mode,
telebot_core_response_tresponse const char * text_entities 
- - - + + + + + +
[in]core_hThe telebot core handler created with telebot_core_create().
[in]chat_idUnique identifier for the target chat or username of the target channel (in the format @channelusername).
[out]responseResponse data that contains "True" on success. It MUST be freed with telebot_core_put_response().
[in]core_hThe telebot core handler.
[in]gift_idIdentifier of the gift.
[in]pay_for_upgradePass True to pay for the gift upgrade.
[in]textText that will be shown along with the gift.
[in]text_parse_modeMode for parsing entities in the text.
[in]text_entitiesA JSON-serialized list of special entities.
-
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.
+
Returns
telebot_core_response_t response.
diff --git a/docs/index.html b/docs/index.html index 2d95332..99c94dd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Telebot @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- +
@@ -54,25 +57,181 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
-
Telebot
+
+
Telebot
-

C Library for Telegram bot API that uses json-c and libcurl. Head over to Telegram Bots page to read about how to register your brand new bot with Telegram platform and see it in action using telebot.

-

Building

-

You need to install libraries and build tools such as CMake. On Debian-based Linux distributions you can do it as follows:

sudo apt-get install libcurl4-openssl-dev libjson-c-dev cmake binutils make

On Mac OSX, first install macports from MacPorts and in Terminal

sudo port install cmake json-c curl

To build the library run following commands:

cd [your repository]
mkdir -p Build && cd Build
cmake ../
make

Sample

-

Following sample creates a simple dummy bot which echoes back the messages sent to it. The same example is built as echobot executable under Build/test folder.

if (telebot_create(&handle, token) != TELEBOT_ERROR_NONE) {
printf("Telebot create failed\n");
return -1;
}
if (telebot_get_me(handle, &me) != TELEBOT_ERROR_NONE) {
printf("Failed to get bot information\n");
telebot_destroy(handle);
return -1;
}
printf("ID: %d\n", me.id);
printf("First Name: %s\n", me.first_name);
printf("User Name: %s\n", me.username);
int index, count, offset = 1;
char str[4096];
while (1) {
telebot_update_t *updates;
ret = telebot_get_updates(handle, offset, 20, 0, NULL, 0, &updates, &count);
if (ret != TELEBOT_ERROR_NONE)
continue;
printf("Number of updates: %d\n", count);
for (index = 0; index < count; index++) {
if (updates[index].update_type == TELEBOT_UPDATE_TYPE_MESSAGE) {
message = updates[index].message;
printf("%s: %s \n", message.from->first_name, message.text);
if (strstr(message.text, "/start")) {
snprintf(str, SIZE_OF_ARRAY(str), "Hello %s", message.from->first_name);
} else {
snprintf(str, SIZE_OF_ARRAY(str), "RE:%s", message.text);
}
ret = telebot_send_message(handle, message.chat->id, str, "", false, false, 0, "");
if (ret != TELEBOT_ERROR_NONE) {
printf("Failed to send message: %d \n", ret);
}
}
offset = updates[index].update_id + 1;
}
telebot_put_updates(updates, count);
sleep(1);
}
+

Build GitHub repo size GitHub issues GitHub pull requests License

+

C Library for Telegram bot API that uses json-c and libcurl. Head over to Telegram Bots page to read about how to register your brand new bot with Telegram platform and see it in action using telebot.

+

+Building

+

You need to install libraries and build tools such as CMake. On Debian-based Linux distributions you can do it as follows:

+
sudo apt-get install libcurl4-openssl-dev libjson-c-dev cmake binutils make
+

On Mac OSX, first install macports from MacPorts and in Terminal

+
sudo port install cmake json-c curl
+

To build the library run following commands:

+
cd [your repository]
+
mkdir -p build && cd build
+
cmake ..
+
make
+

For debug build

mkdir -p build && cd build
+
cmake .. -DDEBUG=1
+
make
+

+Testing

+

Place Telegam Bot API Token in .token file in the root folder of the repository, and run as below

./build/test/testbot
+
+ +Sample +

+

Following sample creates a simple dummy bot which echoes back the messages sent to it. A more comprehensive test bot is built as testbot executable under Build/test folder. It supports various commands to test APIs, polls, custom keyboards, and multimedia sending. The executable expects and reads bot token from .token file on the same location.

+
#include <stdio.h>
+
#include <stdlib.h>
+
#include <pthread.h>
+
#include <string.h>
+
#include <unistd.h>
+
#include <telebot.h>
+
+
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
+
+
int main(int argc, char *argv[])
+
{
+
printf("Welcome to Echobot\n");
+
+
FILE *fp = fopen(".token", "r");
+
if (fp == NULL)
+
{
+
printf("Failed to open .token file\n");
+
return -1;
+
}
+
+
char token[1024];
+
if (fscanf(fp, "%s", token) == 0)
+
{
+
printf("Failed to read token\n");
+
fclose(fp);
+
return -1;
+
}
+
printf("Token: %s\n", token);
+
fclose(fp);
+
+ +
if (telebot_create(&handle, token) != TELEBOT_ERROR_NONE)
+
{
+
printf("Telebot create failed\n");
+
return -1;
+
}
+
+ +
if (telebot_get_me(handle, &me) != TELEBOT_ERROR_NONE)
+
{
+
printf("Failed to get bot information\n");
+
telebot_destroy(handle);
+
return -1;
+
}
+
+
printf("ID: %d\n", me.id);
+
printf("First Name: %s\n", me.first_name);
+
printf("User Name: %s\n", me.username);
+
+ +
+
int index, count, offset = -1;
+ + + +
+
while (1)
+
{
+
telebot_update_t *updates;
+
ret = telebot_get_updates(handle, offset, 20, 0, update_types, 0, &updates, &count);
+
if (ret != TELEBOT_ERROR_NONE)
+
continue;
+
printf("Number of updates: %d\n", count);
+
for (index = 0; index < count; index++)
+
{
+
message = updates[index].message;
+
if (message.text)
+
{
+
printf("%s: %s \n", message.from->first_name, message.text);
+
if (strstr(message.text, "/dice"))
+
{
+
telebot_send_dice(handle, message.chat->id, false, 0, "");
+
}
+
else
+
{
+
char str[4096];
+
if (strstr(message.text, "/start"))
+
{
+
snprintf(str, SIZE_OF_ARRAY(str), "Hello %s", message.from->first_name);
+
}
+
else
+
{
+
snprintf(str, SIZE_OF_ARRAY(str), "<i>%s</i>", message.text);
+
}
+
ret = telebot_send_message(handle, message.chat->id, str, "HTML", false, false, updates[index].message.message_id, "");
+
}
+
if (ret != TELEBOT_ERROR_NONE)
+
{
+
printf("Failed to send message: %d \n", ret);
+
}
+
}
+
offset = updates[index].update_id + 1;
+
}
+
telebot_put_updates(updates, count);
+
+
sleep(1);
+
}
+
+
telebot_destroy(handle);
+
+
return 0;
+
}
+
telebot_error_e telebot_send_dice(telebot_handler_t handle, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send a dice, which will have a random value from 1 to 6.
+
telebot_error_e telebot_destroy(telebot_handler_t handle)
Final function to use telebo APIs.
+
enum telebot_update_type telebot_update_type_e
Enumerations of telegram update types.
+
telebot_error_e telebot_get_updates(telebot_handler_t handle, int offset, int limit, int timeout, telebot_update_type_e allowed_updates[], int allowed_updates_count, telebot_update_t **updates, int *count)
This function is used to get latest updates.
+
telebot_error_e telebot_get_me(telebot_handler_t handle, telebot_user_t *me)
This function is used to get information about telegram bot itself.
+
telebot_error_e telebot_put_me(telebot_user_t *me)
This function is used to release memory used for obtained information about telegram bot itself.
+
telebot_error_e telebot_put_updates(telebot_update_t *updates, int count)
This function is used to release memory used for obtained updates.
+
struct telebot_handler * telebot_handler_t
This is opaque object to represent a telebot handler.
Definition telebot-types.h:3489
+
telebot_error_e telebot_send_message(telebot_handler_t handle, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send text messages.
+
telebot_error_e
Enumerations of error code for telebot programming interface.
Definition telebot-common.h:45
+
telebot_error_e telebot_create(telebot_handler_t *handle, char *token)
Initial function to use telebot APIs.
+
@ TELEBOT_UPDATE_TYPE_MESSAGE
Definition telebot-types.h:45
+
@ TELEBOT_ERROR_NONE
Definition telebot-common.h:46
+
long long int id
Definition telebot-types.h:231
+
This object represents a message.
Definition telebot-types.h:1777
+
struct telebot_user * from
Definition telebot-types.h:1788
+
struct telebot_chat * chat
Definition telebot-types.h:1813
+
char * text
Definition telebot-types.h:1898
+
This object represents an incoming update.
Definition telebot-types.h:3328
+
int update_id
Definition telebot-types.h:3333
+
telebot_message_t message
Definition telebot-types.h:3342
+
This object represents a Telegram user or bot.
Definition telebot-types.h:178
+
long long int id
Definition telebot-types.h:180
+
char * username
Definition telebot-types.h:192
+
char * first_name
Definition telebot-types.h:186
+
This file includes all the header files of the telegram bot library.
+

+
+
+
diff --git a/docs/jquery.js b/docs/jquery.js index f5343ed..1dffb65 100644 --- a/docs/jquery.js +++ b/docs/jquery.js @@ -1,71 +1,25 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n
").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bE=/\s+$/,bA=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,by=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bB=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bu.userAgent,bV,bC,e,bL=Object.prototype.toString,bG=Object.prototype.hasOwnProperty,bz=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bv=Array.prototype.indexOf,bx={};bF.fn=bF.prototype={constructor:bF,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&av.body){this.context=av;this[0]=av.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bF?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:av);b1=bA.exec(b0);if(b1){if(bF.isPlainObject(b4)){b0=[av.createElement(b1[1])];bF.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bF.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bF.clone(b1.fragment):b1.fragment).childNodes}return bF.merge(this,b0)}else{b5=av.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=av;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bF.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==L){this.selector=b0.selector;this.context=b0.context}return bF.makeArray(b0,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bF.isArray(b1)){bz.apply(b2,b1)}else{bF.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bF.each(this,b1,b0)},ready:function(b0){bF.bindReady();bC.add(b0);return this},eq:function(b0){b0=+b0;return b0===-1?this.slice(b0):this.slice(b0,b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bF.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:bz,sort:[].sort,splice:[].splice};bF.fn.init.prototype=bF.fn;bF.extend=bF.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bF.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b40){return}bC.fireWith(av,[bF]);if(bF.fn.trigger){bF(av).trigger("ready").off("ready")}}},bindReady:function(){if(bC){return}bC=bF.Callbacks("once memory");if(av.readyState==="complete"){return setTimeout(bF.ready,1)}if(av.addEventListener){av.addEventListener("DOMContentLoaded",e,false);bb.addEventListener("load",bF.ready,false)}else{if(av.attachEvent){av.attachEvent("onreadystatechange",e);bb.attachEvent("onload",bF.ready);var b0=false;try{b0=bb.frameElement==null}catch(b1){}if(av.documentElement.doScroll&&b0){bw()}}}},isFunction:function(b0){return bF.type(b0)==="function"},isArray:Array.isArray||function(b0){return bF.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNumeric:function(b0){return !isNaN(parseFloat(b0))&&isFinite(b0)},type:function(b0){return b0==null?String(b0):bx[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bF.type(b2)!=="object"||b2.nodeType||bF.isWindow(b2)){return false}try{if(b2.constructor&&!bG.call(b2,"constructor")&&!bG.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===L||bG.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw new Error(b0)},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bF.trim(b0);if(bb.JSON&&bb.JSON.parse){return bb.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bF.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(bb.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=L}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bF.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(bb.execScript||function(b1){bb["eval"].call(bb,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bB,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===L||bF.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b40&&b0[0]&&b0[b1-1])||b1===0||bF.isArray(b0));if(b3){for(;b21?aJ.call(arguments,0):bG;if(!(--bw)){bC.resolveWith(bC,bx)}}}function bz(bF){return function(bG){bB[bF]=arguments.length>1?aJ.call(arguments,0):bG;bC.notifyWith(bE,bB)}}if(e>1){for(;bv
a";bI=bv.getElementsByTagName("*");bF=bv.getElementsByTagName("a")[0];if(!bI||!bI.length||!bF){return{}}bG=av.createElement("select");bx=bG.appendChild(av.createElement("option"));bE=bv.getElementsByTagName("input")[0];bJ={leadingWhitespace:(bv.firstChild.nodeType===3),tbody:!bv.getElementsByTagName("tbody").length,htmlSerialize:!!bv.getElementsByTagName("link").length,style:/top/.test(bF.getAttribute("style")),hrefNormalized:(bF.getAttribute("href")==="/a"),opacity:/^0.55/.test(bF.style.opacity),cssFloat:!!bF.style.cssFloat,checkOn:(bE.value==="on"),optSelected:bx.selected,getSetAttribute:bv.className!=="t",enctype:!!av.createElement("form").enctype,html5Clone:av.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bE.checked=true;bJ.noCloneChecked=bE.cloneNode(true).checked;bG.disabled=true;bJ.optDisabled=!bx.disabled;try{delete bv.test}catch(bC){bJ.deleteExpando=false}if(!bv.addEventListener&&bv.attachEvent&&bv.fireEvent){bv.attachEvent("onclick",function(){bJ.noCloneEvent=false});bv.cloneNode(true).fireEvent("onclick")}bE=av.createElement("input");bE.value="t";bE.setAttribute("type","radio");bJ.radioValue=bE.value==="t";bE.setAttribute("checked","checked");bv.appendChild(bE);bD=av.createDocumentFragment();bD.appendChild(bv.lastChild);bJ.checkClone=bD.cloneNode(true).cloneNode(true).lastChild.checked;bJ.appendChecked=bE.checked;bD.removeChild(bE);bD.appendChild(bv);bv.innerHTML="";if(bb.getComputedStyle){bA=av.createElement("div");bA.style.width="0";bA.style.marginRight="0";bv.style.width="2px";bv.appendChild(bA);bJ.reliableMarginRight=(parseInt((bb.getComputedStyle(bA,null)||{marginRight:0}).marginRight,10)||0)===0}if(bv.attachEvent){for(by in {submit:1,change:1,focusin:1}){bB="on"+by;bw=(bB in bv);if(!bw){bv.setAttribute(bB,"return;");bw=(typeof bv[bB]==="function")}bJ[by+"Bubbles"]=bw}}bD.removeChild(bv);bD=bG=bx=bA=bv=bE=null;b(function(){var bM,bU,bV,bT,bN,bO,bL,bS,bR,e,bP,bQ=av.getElementsByTagName("body")[0];if(!bQ){return}bL=1;bS="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";bR="visibility:hidden;border:0;";e="style='"+bS+"border:5px solid #000;padding:0;'";bP="
";bM=av.createElement("div");bM.style.cssText=bR+"width:0;height:0;position:static;top:0;margin-top:"+bL+"px";bQ.insertBefore(bM,bQ.firstChild);bv=av.createElement("div");bM.appendChild(bv);bv.innerHTML="
t
";bz=bv.getElementsByTagName("td");bw=(bz[0].offsetHeight===0);bz[0].style.display="";bz[1].style.display="none";bJ.reliableHiddenOffsets=bw&&(bz[0].offsetHeight===0);bv.innerHTML="";bv.style.width=bv.style.paddingLeft="1px";b.boxModel=bJ.boxModel=bv.offsetWidth===2;if(typeof bv.style.zoom!=="undefined"){bv.style.display="inline";bv.style.zoom=1;bJ.inlineBlockNeedsLayout=(bv.offsetWidth===2);bv.style.display="";bv.innerHTML="
";bJ.shrinkWrapBlocks=(bv.offsetWidth!==2)}bv.style.cssText=bS+bR;bv.innerHTML=bP;bU=bv.firstChild;bV=bU.firstChild;bN=bU.nextSibling.firstChild.firstChild;bO={doesNotAddBorder:(bV.offsetTop!==5),doesAddBorderForTableAndCells:(bN.offsetTop===5)};bV.style.position="fixed";bV.style.top="20px";bO.fixedPosition=(bV.offsetTop===20||bV.offsetTop===15);bV.style.position=bV.style.top="";bU.style.overflow="hidden";bU.style.position="relative";bO.subtractsBorderForOverflowNotVisible=(bV.offsetTop===-5);bO.doesNotIncludeMarginInBodyOffset=(bQ.offsetTop!==bL);bQ.removeChild(bM);bv=bM=null;b.extend(bJ,bO)});return bJ})();var aS=/^(?:\{.*\}|\[.*\])$/,aA=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!S(e)},data:function(bx,bv,bz,by){if(!b.acceptData(bx)){return}var bG,bA,bD,bE=b.expando,bC=typeof bv==="string",bF=bx.nodeType,e=bF?b.cache:bx,bw=bF?bx[bE]:bx[bE]&&bE,bB=bv==="events";if((!bw||!e[bw]||(!bB&&!by&&!e[bw].data))&&bC&&bz===L){return}if(!bw){if(bF){bx[bE]=bw=++b.uuid}else{bw=bE}}if(!e[bw]){e[bw]={};if(!bF){e[bw].toJSON=b.noop}}if(typeof bv==="object"||typeof bv==="function"){if(by){e[bw]=b.extend(e[bw],bv)}else{e[bw].data=b.extend(e[bw].data,bv)}}bG=bA=e[bw];if(!by){if(!bA.data){bA.data={}}bA=bA.data}if(bz!==L){bA[b.camelCase(bv)]=bz}if(bB&&!bA[bv]){return bG.events}if(bC){bD=bA[bv];if(bD==null){bD=bA[b.camelCase(bv)]}}else{bD=bA}return bD},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bB,bA,bz,bC=b.expando,bD=bx.nodeType,e=bD?b.cache:bx,bw=bD?bx[bC]:bC;if(!e[bw]){return}if(bv){bB=by?e[bw]:e[bw].data;if(bB){if(!b.isArray(bv)){if(bv in bB){bv=[bv]}else{bv=b.camelCase(bv);if(bv in bB){bv=[bv]}else{bv=bv.split(" ")}}}for(bA=0,bz=bv.length;bA-1){return true}}return false},val:function(bx){var e,bv,by,bw=this[0];if(!arguments.length){if(bw){e=b.valHooks[bw.nodeName.toLowerCase()]||b.valHooks[bw.type];if(e&&"get" in e&&(bv=e.get(bw,"value"))!==L){return bv}bv=bw.value;return typeof bv==="string"?bv.replace(aU,""):bv==null?"":bv}return}by=b.isFunction(bx);return this.each(function(bA){var bz=b(this),bB;if(this.nodeType!==1){return}if(by){bB=bx.call(this,bA,bz.val())}else{bB=bx}if(bB==null){bB=""}else{if(typeof bB==="number"){bB+=""}else{if(b.isArray(bB)){bB=b.map(bB,function(bC){return bC==null?"":bC+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bB,"value")===L){this.value=bB}})}});b.extend({valHooks:{option:{get:function(e){var bv=e.attributes.value;return !bv||bv.specified?e.value:e.text}},select:{get:function(e){var bA,bv,bz,bx,by=e.selectedIndex,bB=[],bC=e.options,bw=e.type==="select-one";if(by<0){return null}bv=bw?by:0;bz=bw?by+1:bC.length;for(;bv=0});if(!e.length){bv.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(bA,bx,bB,bz){var bw,e,by,bv=bA.nodeType;if(!bA||bv===3||bv===8||bv===2){return}if(bz&&bx in b.attrFn){return b(bA)[bx](bB)}if(typeof bA.getAttribute==="undefined"){return b.prop(bA,bx,bB)}by=bv!==1||!b.isXMLDoc(bA);if(by){bx=bx.toLowerCase();e=b.attrHooks[bx]||(ao.test(bx)?aY:be)}if(bB!==L){if(bB===null){b.removeAttr(bA,bx);return}else{if(e&&"set" in e&&by&&(bw=e.set(bA,bB,bx))!==L){return bw}else{bA.setAttribute(bx,""+bB);return bB}}}else{if(e&&"get" in e&&by&&(bw=e.get(bA,bx))!==null){return bw}else{bw=bA.getAttribute(bx);return bw===null?L:bw}}},removeAttr:function(bx,bz){var by,bA,bv,e,bw=0;if(bz&&bx.nodeType===1){bA=bz.toLowerCase().split(af);e=bA.length;for(;bw=0)}}})});var bd=/^(?:textarea|input|select)$/i,n=/^([^\.]*)?(?:\.(.+))?$/,J=/\bhover(\.\S+)?\b/,aO=/^key/,bf=/^(?:mouse|contextmenu)|click/,T=/^(?:focusinfocus|focusoutblur)$/,U=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,Y=function(e){var bv=U.exec(e);if(bv){bv[1]=(bv[1]||"").toLowerCase();bv[3]=bv[3]&&new RegExp("(?:^|\\s)"+bv[3]+"(?:\\s|$)")}return bv},j=function(bw,e){var bv=bw.attributes||{};return((!e[1]||bw.nodeName.toLowerCase()===e[1])&&(!e[2]||(bv.id||{}).value===e[2])&&(!e[3]||e[3].test((bv["class"]||{}).value)))},bt=function(e){return b.event.special.hover?e:e.replace(J,"mouseenter$1 mouseleave$1")};b.event={add:function(bx,bC,bJ,bA,by){var bD,bB,bK,bI,bH,bF,e,bG,bv,bz,bw,bE;if(bx.nodeType===3||bx.nodeType===8||!bC||!bJ||!(bD=b._data(bx))){return}if(bJ.handler){bv=bJ;bJ=bv.handler}if(!bJ.guid){bJ.guid=b.guid++}bK=bD.events;if(!bK){bD.events=bK={}}bB=bD.handle;if(!bB){bD.handle=bB=function(bL){return typeof b!=="undefined"&&(!bL||b.event.triggered!==bL.type)?b.event.dispatch.apply(bB.elem,arguments):L};bB.elem=bx}bC=b.trim(bt(bC)).split(" ");for(bI=0;bI=0){bG=bG.slice(0,-1);bw=true}if(bG.indexOf(".")>=0){bx=bG.split(".");bG=bx.shift();bx.sort()}if((!bA||b.event.customEvent[bG])&&!b.event.global[bG]){return}bv=typeof bv==="object"?bv[b.expando]?bv:new b.Event(bG,bv):new b.Event(bG);bv.type=bG;bv.isTrigger=true;bv.exclusive=bw;bv.namespace=bx.join(".");bv.namespace_re=bv.namespace?new RegExp("(^|\\.)"+bx.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;by=bG.indexOf(":")<0?"on"+bG:"";if(!bA){e=b.cache;for(bC in e){if(e[bC].events&&e[bC].events[bG]){b.event.trigger(bv,bD,e[bC].handle.elem,true)}}return}bv.result=L;if(!bv.target){bv.target=bA}bD=bD!=null?b.makeArray(bD):[];bD.unshift(bv);bF=b.event.special[bG]||{};if(bF.trigger&&bF.trigger.apply(bA,bD)===false){return}bB=[[bA,bF.bindType||bG]];if(!bJ&&!bF.noBubble&&!b.isWindow(bA)){bI=bF.delegateType||bG;bH=T.test(bI+bG)?bA:bA.parentNode;bz=null;for(;bH;bH=bH.parentNode){bB.push([bH,bI]);bz=bH}if(bz&&bz===bA.ownerDocument){bB.push([bz.defaultView||bz.parentWindow||bb,bI])}}for(bC=0;bCbA){bH.push({elem:this,matches:bz.slice(bA)})}for(bC=0;bC0?this.on(e,null,bx,bw):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}if(aO.test(e)){b.event.fixHooks[e]=b.event.keyHooks}if(bf.test(e)){b.event.fixHooks[e]=b.event.mouseHooks}}); -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var bH=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bC="sizcache"+(Math.random()+"").replace(".",""),bI=0,bL=Object.prototype.toString,bB=false,bA=true,bK=/\\/g,bO=/\r\n/g,bQ=/\W/;[0,0].sort(function(){bA=false;return 0});var by=function(bV,e,bY,bZ){bY=bY||[];e=e||av;var b1=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bV||typeof bV!=="string"){return bY}var bS,b3,b6,bR,b2,b5,b4,bX,bU=true,bT=by.isXML(e),bW=[],b0=bV;do{bH.exec("");bS=bH.exec(b0);if(bS){b0=bS[3];bW.push(bS[1]);if(bS[2]){bR=bS[3];break}}}while(bS);if(bW.length>1&&bD.exec(bV)){if(bW.length===2&&bE.relative[bW[0]]){b3=bM(bW[0]+bW[1],e,bZ)}else{b3=bE.relative[bW[0]]?[e]:by(bW.shift(),e);while(bW.length){bV=bW.shift();if(bE.relative[bV]){bV+=bW.shift()}b3=bM(bV,b3,bZ)}}}else{if(!bZ&&bW.length>1&&e.nodeType===9&&!bT&&bE.match.ID.test(bW[0])&&!bE.match.ID.test(bW[bW.length-1])){b2=by.find(bW.shift(),e,bT);e=b2.expr?by.filter(b2.expr,b2.set)[0]:b2.set[0]}if(e){b2=bZ?{expr:bW.pop(),set:bF(bZ)}:by.find(bW.pop(),bW.length===1&&(bW[0]==="~"||bW[0]==="+")&&e.parentNode?e.parentNode:e,bT);b3=b2.expr?by.filter(b2.expr,b2.set):b2.set;if(bW.length>0){b6=bF(b3)}else{bU=false}while(bW.length){b5=bW.pop();b4=b5;if(!bE.relative[b5]){b5=""}else{b4=bW.pop()}if(b4==null){b4=e}bE.relative[b5](b6,b4,bT)}}else{b6=bW=[]}}if(!b6){b6=b3}if(!b6){by.error(b5||bV)}if(bL.call(b6)==="[object Array]"){if(!bU){bY.push.apply(bY,b6)}else{if(e&&e.nodeType===1){for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&(b6[bX]===true||b6[bX].nodeType===1&&by.contains(e,b6[bX]))){bY.push(b3[bX])}}}else{for(bX=0;b6[bX]!=null;bX++){if(b6[bX]&&b6[bX].nodeType===1){bY.push(b3[bX])}}}}}else{bF(b6,bY)}if(bR){by(bR,b1,bY,bZ);by.uniqueSort(bY)}return bY};by.uniqueSort=function(bR){if(bJ){bB=bA;bR.sort(bJ);if(bB){for(var e=1;e0};by.find=function(bX,e,bY){var bW,bS,bU,bT,bV,bR;if(!bX){return[]}for(bS=0,bU=bE.order.length;bS":function(bW,bR){var bV,bU=typeof bR==="string",bS=0,e=bW.length;if(bU&&!bQ.test(bR)){bR=bR.toLowerCase();for(;bS=0)){if(!bS){e.push(bV)}}else{if(bS){bR[bU]=false}}}}return false},ID:function(e){return e[1].replace(bK,"")},TAG:function(bR,e){return bR[1].replace(bK,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){by.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bR=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bR[1]+(bR[2]||1))-0;e[3]=bR[3]-0}else{if(e[2]){by.error(e[0])}}e[0]=bI++;return e},ATTR:function(bU,bR,bS,e,bV,bW){var bT=bU[1]=bU[1].replace(bK,"");if(!bW&&bE.attrMap[bT]){bU[1]=bE.attrMap[bT]}bU[4]=(bU[4]||bU[5]||"").replace(bK,"");if(bU[2]==="~="){bU[4]=" "+bU[4]+" "}return bU},PSEUDO:function(bU,bR,bS,e,bV){if(bU[1]==="not"){if((bH.exec(bU[3])||"").length>1||/^\w/.test(bU[3])){bU[3]=by(bU[3],null,null,bR)}else{var bT=by.filter(bU[3],bR,bS,true^bV);if(!bS){e.push.apply(e,bT)}return false}}else{if(bE.match.POS.test(bU[0])||bE.match.CHILD.test(bU[0])){return true}}return bU},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bS,bR,e){return !!by(e[3],bS).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bS){var e=bS.getAttribute("type"),bR=bS.type;return bS.nodeName.toLowerCase()==="input"&&"text"===bR&&(e===bR||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bR.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bR){var e=bR.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bR.type},button:function(bR){var e=bR.nodeName.toLowerCase();return e==="input"&&"button"===bR.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bR,e){return e===0},last:function(bS,bR,e,bT){return bR===bT.length-1},even:function(bR,e){return e%2===0},odd:function(bR,e){return e%2===1},lt:function(bS,bR,e){return bRe[3]-0},nth:function(bS,bR,e){return e[3]-0===bR},eq:function(bS,bR,e){return e[3]-0===bR}},filter:{PSEUDO:function(bS,bX,bW,bY){var e=bX[1],bR=bE.filters[e];if(bR){return bR(bS,bW,bX,bY)}else{if(e==="contains"){return(bS.textContent||bS.innerText||bw([bS])||"").indexOf(bX[3])>=0}else{if(e==="not"){var bT=bX[3];for(var bV=0,bU=bT.length;bV=0)}}},ID:function(bR,e){return bR.nodeType===1&&bR.getAttribute("id")===e},TAG:function(bR,e){return(e==="*"&&bR.nodeType===1)||!!bR.nodeName&&bR.nodeName.toLowerCase()===e},CLASS:function(bR,e){return(" "+(bR.className||bR.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bV,bT){var bS=bT[1],e=by.attr?by.attr(bV,bS):bE.attrHandle[bS]?bE.attrHandle[bS](bV):bV[bS]!=null?bV[bS]:bV.getAttribute(bS),bW=e+"",bU=bT[2],bR=bT[4];return e==null?bU==="!=":!bU&&by.attr?e!=null:bU==="="?bW===bR:bU==="*="?bW.indexOf(bR)>=0:bU==="~="?(" "+bW+" ").indexOf(bR)>=0:!bR?bW&&e!==false:bU==="!="?bW!==bR:bU==="^="?bW.indexOf(bR)===0:bU==="$="?bW.substr(bW.length-bR.length)===bR:bU==="|="?bW===bR||bW.substr(0,bR.length+1)===bR+"-":false},POS:function(bU,bR,bS,bV){var e=bR[2],bT=bE.setFilters[e];if(bT){return bT(bU,bS,bR,bV)}}}};var bD=bE.match.POS,bx=function(bR,e){return"\\"+(e-0+1)};for(var bz in bE.match){bE.match[bz]=new RegExp(bE.match[bz].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bE.leftMatch[bz]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bE.match[bz].source.replace(/\\(\d+)/g,bx))}var bF=function(bR,e){bR=Array.prototype.slice.call(bR,0);if(e){e.push.apply(e,bR);return e}return bR};try{Array.prototype.slice.call(av.documentElement.childNodes,0)[0].nodeType}catch(bP){bF=function(bU,bT){var bS=0,bR=bT||[];if(bL.call(bU)==="[object Array]"){Array.prototype.push.apply(bR,bU)}else{if(typeof bU.length==="number"){for(var e=bU.length;bS";e.insertBefore(bR,e.firstChild);if(av.getElementById(bS)){bE.find.ID=function(bU,bV,bW){if(typeof bV.getElementById!=="undefined"&&!bW){var bT=bV.getElementById(bU[1]);return bT?bT.id===bU[1]||typeof bT.getAttributeNode!=="undefined"&&bT.getAttributeNode("id").nodeValue===bU[1]?[bT]:L:[]}};bE.filter.ID=function(bV,bT){var bU=typeof bV.getAttributeNode!=="undefined"&&bV.getAttributeNode("id");return bV.nodeType===1&&bU&&bU.nodeValue===bT}}e.removeChild(bR);e=bR=null})();(function(){var e=av.createElement("div");e.appendChild(av.createComment(""));if(e.getElementsByTagName("*").length>0){bE.find.TAG=function(bR,bV){var bU=bV.getElementsByTagName(bR[1]);if(bR[1]==="*"){var bT=[];for(var bS=0;bU[bS];bS++){if(bU[bS].nodeType===1){bT.push(bU[bS])}}bU=bT}return bU}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bE.attrHandle.href=function(bR){return bR.getAttribute("href",2)}}e=null})();if(av.querySelectorAll){(function(){var e=by,bT=av.createElement("div"),bS="__sizzle__";bT.innerHTML="

";if(bT.querySelectorAll&&bT.querySelectorAll(".TEST").length===0){return}by=function(b4,bV,bZ,b3){bV=bV||av;if(!b3&&!by.isXML(bV)){var b2=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b4);if(b2&&(bV.nodeType===1||bV.nodeType===9)){if(b2[1]){return bF(bV.getElementsByTagName(b4),bZ)}else{if(b2[2]&&bE.find.CLASS&&bV.getElementsByClassName){return bF(bV.getElementsByClassName(b2[2]),bZ)}}}if(bV.nodeType===9){if(b4==="body"&&bV.body){return bF([bV.body],bZ)}else{if(b2&&b2[3]){var bY=bV.getElementById(b2[3]);if(bY&&bY.parentNode){if(bY.id===b2[3]){return bF([bY],bZ)}}else{return bF([],bZ)}}}try{return bF(bV.querySelectorAll(b4),bZ)}catch(b0){}}else{if(bV.nodeType===1&&bV.nodeName.toLowerCase()!=="object"){var bW=bV,bX=bV.getAttribute("id"),bU=bX||bS,b6=bV.parentNode,b5=/^\s*[+~]/.test(b4);if(!bX){bV.setAttribute("id",bU)}else{bU=bU.replace(/'/g,"\\$&")}if(b5&&b6){bV=bV.parentNode}try{if(!b5||b6){return bF(bV.querySelectorAll("[id='"+bU+"'] "+b4),bZ)}}catch(b1){}finally{if(!bX){bW.removeAttribute("id")}}}}}return e(b4,bV,bZ,b3)};for(var bR in e){by[bR]=e[bR]}bT=null})()}(function(){var e=av.documentElement,bS=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bS){var bU=!bS.call(av.createElement("div"),"div"),bR=false;try{bS.call(av.documentElement,"[test!='']:sizzle")}catch(bT){bR=true}by.matchesSelector=function(bW,bY){bY=bY.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!by.isXML(bW)){try{if(bR||!bE.match.PSEUDO.test(bY)&&!/!=/.test(bY)){var bV=bS.call(bW,bY);if(bV||!bU||bW.document&&bW.document.nodeType!==11){return bV}}}catch(bX){}}return by(bY,null,null,[bW]).length>0}}})();(function(){var e=av.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bE.order.splice(1,0,"CLASS");bE.find.CLASS=function(bR,bS,bT){if(typeof bS.getElementsByClassName!=="undefined"&&!bT){return bS.getElementsByClassName(bR[1])}};e=null})();function bv(bR,bW,bV,bZ,bX,bY){for(var bT=0,bS=bZ.length;bT0){bU=e;break}}}e=e[bR]}bZ[bT]=bU}}}if(av.documentElement.contains){by.contains=function(bR,e){return bR!==e&&(bR.contains?bR.contains(e):true)}}else{if(av.documentElement.compareDocumentPosition){by.contains=function(bR,e){return !!(bR.compareDocumentPosition(e)&16)}}else{by.contains=function(){return false}}}by.isXML=function(e){var bR=(e?e.ownerDocument||e:0).documentElement;return bR?bR.nodeName!=="HTML":false};var bM=function(bS,e,bW){var bV,bX=[],bU="",bY=e.nodeType?[e]:e;while((bV=bE.match.PSEUDO.exec(bS))){bU+=bV[0];bS=bS.replace(bE.match.PSEUDO,"")}bS=bE.relative[bS]?bS+"*":bS;for(var bT=0,bR=bY.length;bT0){for(bB=bA;bB=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(by,bx){var bv=[],bw,e,bz=this[0];if(b.isArray(by)){var bB=1;while(bz&&bz.ownerDocument&&bz!==bx){for(bw=0;bw-1:b.find.matchesSelector(bz,by)){bv.push(bz);break}else{bz=bz.parentNode;if(!bz||!bz.ownerDocument||bz===bx||bz.nodeType===11){break}}}}bv=bv.length>1?b.unique(bv):bv;return this.pushStack(bv,"closest",by)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bv){var bx=typeof e==="string"?b(e,bv):b.makeArray(e&&e.nodeType?[e]:e),bw=b.merge(this.get(),bx);return this.pushStack(C(bx[0])||C(bw[0])?bw:b.unique(bw))},andSelf:function(){return this.add(this.prevObject)}});function C(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bv){var e=bv.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bv,e,bw){return b.dir(bv,"parentNode",bw)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bv,e,bw){return b.dir(bv,"nextSibling",bw)},prevUntil:function(bv,e,bw){return b.dir(bv,"previousSibling",bw)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bv){b.fn[e]=function(by,bw){var bx=b.map(this,bv,by);if(!ab.test(e)){bw=by}if(bw&&typeof bw==="string"){bx=b.filter(bw,bx)}bx=this.length>1&&!ay[e]?b.unique(bx):bx;if((this.length>1||a9.test(bw))&&aq.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,P.call(arguments).join(","))}});b.extend({filter:function(bw,e,bv){if(bv){bw=":not("+bw+")"}return e.length===1?b.find.matchesSelector(e[0],bw)?[e[0]]:[]:b.find.matches(bw,e)},dir:function(bw,bv,by){var e=[],bx=bw[bv];while(bx&&bx.nodeType!==9&&(by===L||bx.nodeType!==1||!b(bx).is(by))){if(bx.nodeType===1){e.push(bx)}bx=bx[bv]}return e},nth:function(by,e,bw,bx){e=e||1;var bv=0;for(;by;by=by[bw]){if(by.nodeType===1&&++bv===e){break}}return by},sibling:function(bw,bv){var e=[];for(;bw;bw=bw.nextSibling){if(bw.nodeType===1&&bw!==bv){e.push(bw)}}return e}});function aG(bx,bw,e){bw=bw||0;if(b.isFunction(bw)){return b.grep(bx,function(bz,by){var bA=!!bw.call(bz,by,bz);return bA===e})}else{if(bw.nodeType){return b.grep(bx,function(bz,by){return(bz===bw)===e})}else{if(typeof bw==="string"){var bv=b.grep(bx,function(by){return by.nodeType===1});if(bp.test(bw)){return b.filter(bw,bv,!e)}else{bw=b.filter(bw,bv)}}}}return b.grep(bx,function(bz,by){return(b.inArray(bz,bw)>=0)===e})}function a(e){var bw=aR.split("|"),bv=e.createDocumentFragment();if(bv.createElement){while(bw.length){bv.createElement(bw.pop())}}return bv}var aR="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ag=/ jQuery\d+="(?:\d+|null)"/g,ar=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,w=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ac=a(av);ax.optgroup=ax.option;ax.tbody=ax.tfoot=ax.colgroup=ax.caption=ax.thead;ax.th=ax.td;if(!b.support.htmlSerialize){ax._default=[1,"div
","
"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this);bv.text(e.call(this,bw,bv.text()))})}if(typeof e!=="object"&&e!==L){return this.empty().append((this[0]&&this[0].ownerDocument||av).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bw){b(this).wrapAll(e.call(this,bw))})}if(this[0]){var bv=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bv.insertBefore(this[0])}bv.map(function(){var bw=this;while(bw.firstChild&&bw.firstChild.nodeType===1){bw=bw.firstChild}return bw}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapInner(e.call(this,bv))})}return this.each(function(){var bv=b(this),bw=bv.contents();if(bw.length){bw.wrapAll(e)}else{bv.append(e)}})},wrap:function(e){var bv=b.isFunction(e);return this.each(function(bw){b(this).wrapAll(bv?e.call(this,bw):e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this)})}else{if(arguments.length){var e=b.clean(arguments);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bv){this.parentNode.insertBefore(bv,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b.clean(arguments));return e}}},remove:function(e,bx){for(var bv=0,bw;(bw=this[bv])!=null;bv++){if(!e||b.filter(e,[bw]).length){if(!bx&&bw.nodeType===1){b.cleanData(bw.getElementsByTagName("*"));b.cleanData([bw])}if(bw.parentNode){bw.parentNode.removeChild(bw)}}}return this},empty:function(){for(var e=0,bv;(bv=this[e])!=null;e++){if(bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"))}while(bv.firstChild){bv.removeChild(bv.firstChild)}}return this},clone:function(bv,e){bv=bv==null?false:bv;e=e==null?bv:e;return this.map(function(){return b.clone(this,bv,e)})},html:function(bx){if(bx===L){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ag,""):null}else{if(typeof bx==="string"&&!ae.test(bx)&&(b.support.leadingWhitespace||!ar.test(bx))&&!ax[(d.exec(bx)||["",""])[1].toLowerCase()]){bx=bx.replace(R,"<$1>");try{for(var bw=0,bv=this.length;bw1&&bw0?this.clone(true):this).get();b(bC[bA])[bv](by);bz=bz.concat(by)}return this.pushStack(bz,e,bC.selector)}}});function bg(e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName("*")}else{if(typeof e.querySelectorAll!=="undefined"){return e.querySelectorAll("*")}else{return[]}}}function az(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function E(e){var bv=(e.nodeName||"").toLowerCase();if(bv==="input"){az(e)}else{if(bv!=="script"&&typeof e.getElementsByTagName!=="undefined"){b.grep(e.getElementsByTagName("input"),az)}}}function al(e){var bv=av.createElement("div");ac.appendChild(bv);bv.innerHTML=e.outerHTML;return bv.firstChild}b.extend({clone:function(by,bA,bw){var e,bv,bx,bz=b.support.html5Clone||!ah.test("<"+by.nodeName)?by.cloneNode(true):al(by);if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(by.nodeType===1||by.nodeType===11)&&!b.isXMLDoc(by)){ai(by,bz);e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){if(bv[bx]){ai(e[bx],bv[bx])}}}if(bA){t(by,bz);if(bw){e=bg(by);bv=bg(bz);for(bx=0;e[bx];++bx){t(e[bx],bv[bx])}}}e=bv=null;return bz},clean:function(bw,by,bH,bA){var bF;by=by||av;if(typeof by.createElement==="undefined"){by=by.ownerDocument||by[0]&&by[0].ownerDocument||av}var bI=[],bB;for(var bE=0,bz;(bz=bw[bE])!=null;bE++){if(typeof bz==="number"){bz+=""}if(!bz){continue}if(typeof bz==="string"){if(!W.test(bz)){bz=by.createTextNode(bz)}else{bz=bz.replace(R,"<$1>");var bK=(d.exec(bz)||["",""])[1].toLowerCase(),bx=ax[bK]||ax._default,bD=bx[0],bv=by.createElement("div");if(by===av){ac.appendChild(bv)}else{a(by).appendChild(bv)}bv.innerHTML=bx[1]+bz+bx[2];while(bD--){bv=bv.lastChild}if(!b.support.tbody){var e=w.test(bz),bC=bK==="table"&&!e?bv.firstChild&&bv.firstChild.childNodes:bx[1]===""&&!e?bv.childNodes:[];for(bB=bC.length-1;bB>=0;--bB){if(b.nodeName(bC[bB],"tbody")&&!bC[bB].childNodes.length){bC[bB].parentNode.removeChild(bC[bB])}}}if(!b.support.leadingWhitespace&&ar.test(bz)){bv.insertBefore(by.createTextNode(ar.exec(bz)[0]),bv.firstChild)}bz=bv.childNodes}}var bG;if(!b.support.appendChecked){if(bz[0]&&typeof(bG=bz.length)==="number"){for(bB=0;bB=0){return bx+"px"}}else{return bx}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bv,e){return au.test((e&&bv.currentStyle?bv.currentStyle.filter:bv.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(by,bz){var bx=by.style,bv=by.currentStyle,e=b.isNumeric(bz)?"alpha(opacity="+bz*100+")":"",bw=bv&&bv.filter||bx.filter||"";bx.zoom=1;if(bz>=1&&b.trim(bw.replace(ak,""))===""){bx.removeAttribute("filter");if(bv&&!bv.filter){return}}bx.filter=ak.test(bw)?bw.replace(ak,e):bw+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bw,bv){var e;b.swap(bw,{display:"inline-block"},function(){if(bv){e=Z(bw,"margin-right","marginRight")}else{e=bw.style.marginRight}});return e}}}});if(av.defaultView&&av.defaultView.getComputedStyle){aI=function(by,bw){var bv,bx,e;bw=bw.replace(z,"-$1").toLowerCase();if((bx=by.ownerDocument.defaultView)&&(e=bx.getComputedStyle(by,null))){bv=e.getPropertyValue(bw);if(bv===""&&!b.contains(by.ownerDocument.documentElement,by)){bv=b.style(by,bw)}}return bv}}if(av.documentElement.currentStyle){aX=function(bz,bw){var bA,e,by,bv=bz.currentStyle&&bz.currentStyle[bw],bx=bz.style;if(bv===null&&bx&&(by=bx[bw])){bv=by}if(!bc.test(bv)&&bn.test(bv)){bA=bx.left;e=bz.runtimeStyle&&bz.runtimeStyle.left;if(e){bz.runtimeStyle.left=bz.currentStyle.left}bx.left=bw==="fontSize"?"1em":(bv||0);bv=bx.pixelLeft+"px";bx.left=bA;if(e){bz.runtimeStyle.left=e}}return bv===""?"auto":bv}}Z=aI||aX;function p(by,bw,bv){var bA=bw==="width"?by.offsetWidth:by.offsetHeight,bz=bw==="width"?an:a1,bx=0,e=bz.length;if(bA>0){if(bv!=="border"){for(;bx)<[^<]*)*<\/script>/gi,q=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,K=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,A=b.fn.load,aa={},r={},aE,s,aV=["*/"]+["*"];try{aE=bl.href}catch(aw){aE=av.createElement("a");aE.href="";aE=aE.href}s=K.exec(aE.toLowerCase())||[];function f(e){return function(by,bA){if(typeof by!=="string"){bA=by;by="*"}if(b.isFunction(bA)){var bx=by.toLowerCase().split(h),bw=0,bz=bx.length,bv,bB,bC;for(;bw=0){var e=bw.slice(by,bw.length);bw=bw.slice(0,by)}var bx="GET";if(bz){if(b.isFunction(bz)){bA=bz;bz=L}else{if(typeof bz==="object"){bz=b.param(bz,b.ajaxSettings.traditional);bx="POST"}}}var bv=this;b.ajax({url:bw,type:bx,dataType:"html",data:bz,complete:function(bC,bB,bD){bD=bC.responseText;if(bC.isResolved()){bC.done(function(bE){bD=bE});bv.html(e?b("
").append(bD.replace(a6,"")).find(e):bD)}if(bA){bv.each(bA,[bD,bB,bC])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||q.test(this.nodeName)||aZ.test(this.type))}).map(function(e,bv){var bw=b(this).val();return bw==null?null:b.isArray(bw)?b.map(bw,function(by,bx){return{name:bv.name,value:by.replace(bs,"\r\n")}}):{name:bv.name,value:bw.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bv){b.fn[bv]=function(bw){return this.on(bv,bw)}});b.each(["get","post"],function(e,bv){b[bv]=function(bw,by,bz,bx){if(b.isFunction(by)){bx=bx||bz;bz=by;by=L}return b.ajax({type:bv,url:bw,data:by,success:bz,dataType:bx})}});b.extend({getScript:function(e,bv){return b.get(e,L,bv,"script")},getJSON:function(e,bv,bw){return b.get(e,bv,bw,"json")},ajaxSetup:function(bv,e){if(e){am(bv,b.ajaxSettings)}else{e=bv;bv=b.ajaxSettings}am(bv,e);return bv},ajaxSettings:{url:aE,isLocal:aM.test(s[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aV},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":bb.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(aa),ajaxTransport:f(r),ajax:function(bz,bx){if(typeof bz==="object"){bx=bz;bz=L}bx=bx||{};var bD=b.ajaxSetup({},bx),bS=bD.context||bD,bG=bS!==bD&&(bS.nodeType||bS instanceof b)?b(bS):b.event,bR=b.Deferred(),bN=b.Callbacks("once memory"),bB=bD.statusCode||{},bC,bH={},bO={},bQ,by,bL,bE,bI,bA=0,bw,bK,bJ={readyState:0,setRequestHeader:function(bT,bU){if(!bA){var e=bT.toLowerCase();bT=bO[e]=bO[e]||bT;bH[bT]=bU}return this},getAllResponseHeaders:function(){return bA===2?bQ:null},getResponseHeader:function(bT){var e;if(bA===2){if(!by){by={};while((e=aD.exec(bQ))){by[e[1].toLowerCase()]=e[2]}}e=by[bT.toLowerCase()]}return e===L?null:e},overrideMimeType:function(e){if(!bA){bD.mimeType=e}return this},abort:function(e){e=e||"abort";if(bL){bL.abort(e)}bF(0,e);return this}};function bF(bZ,bU,b0,bW){if(bA===2){return}bA=2;if(bE){clearTimeout(bE)}bL=L;bQ=bW||"";bJ.readyState=bZ>0?4:0;var bT,b4,b3,bX=bU,bY=b0?bj(bD,bJ,b0):L,bV,b2;if(bZ>=200&&bZ<300||bZ===304){if(bD.ifModified){if((bV=bJ.getResponseHeader("Last-Modified"))){b.lastModified[bC]=bV}if((b2=bJ.getResponseHeader("Etag"))){b.etag[bC]=b2}}if(bZ===304){bX="notmodified";bT=true}else{try{b4=G(bD,bY);bX="success";bT=true}catch(b1){bX="parsererror";b3=b1}}}else{b3=bX;if(!bX||bZ){bX="error";if(bZ<0){bZ=0}}}bJ.status=bZ;bJ.statusText=""+(bU||bX);if(bT){bR.resolveWith(bS,[b4,bX,bJ])}else{bR.rejectWith(bS,[bJ,bX,b3])}bJ.statusCode(bB);bB=L;if(bw){bG.trigger("ajax"+(bT?"Success":"Error"),[bJ,bD,bT?b4:b3])}bN.fireWith(bS,[bJ,bX]);if(bw){bG.trigger("ajaxComplete",[bJ,bD]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bR.promise(bJ);bJ.success=bJ.done;bJ.error=bJ.fail;bJ.complete=bN.add;bJ.statusCode=function(bT){if(bT){var e;if(bA<2){for(e in bT){bB[e]=[bB[e],bT[e]]}}else{e=bT[bJ.status];bJ.then(e,e)}}return this};bD.url=((bz||bD.url)+"").replace(bq,"").replace(c,s[1]+"//");bD.dataTypes=b.trim(bD.dataType||"*").toLowerCase().split(h);if(bD.crossDomain==null){bI=K.exec(bD.url.toLowerCase());bD.crossDomain=!!(bI&&(bI[1]!=s[1]||bI[2]!=s[2]||(bI[3]||(bI[1]==="http:"?80:443))!=(s[3]||(s[1]==="http:"?80:443))))}if(bD.data&&bD.processData&&typeof bD.data!=="string"){bD.data=b.param(bD.data,bD.traditional)}aW(aa,bD,bx,bJ);if(bA===2){return false}bw=bD.global;bD.type=bD.type.toUpperCase();bD.hasContent=!aQ.test(bD.type);if(bw&&b.active++===0){b.event.trigger("ajaxStart")}if(!bD.hasContent){if(bD.data){bD.url+=(M.test(bD.url)?"&":"?")+bD.data;delete bD.data}bC=bD.url;if(bD.cache===false){var bv=b.now(),bP=bD.url.replace(br,"$1_="+bv);bD.url=bP+((bP===bD.url)?(M.test(bD.url)?"&":"?")+"_="+bv:"")}}if(bD.data&&bD.hasContent&&bD.contentType!==false||bx.contentType){bJ.setRequestHeader("Content-Type",bD.contentType)}if(bD.ifModified){bC=bC||bD.url;if(b.lastModified[bC]){bJ.setRequestHeader("If-Modified-Since",b.lastModified[bC])}if(b.etag[bC]){bJ.setRequestHeader("If-None-Match",b.etag[bC])}}bJ.setRequestHeader("Accept",bD.dataTypes[0]&&bD.accepts[bD.dataTypes[0]]?bD.accepts[bD.dataTypes[0]]+(bD.dataTypes[0]!=="*"?", "+aV+"; q=0.01":""):bD.accepts["*"]);for(bK in bD.headers){bJ.setRequestHeader(bK,bD.headers[bK])}if(bD.beforeSend&&(bD.beforeSend.call(bS,bJ,bD)===false||bA===2)){bJ.abort();return false}for(bK in {success:1,error:1,complete:1}){bJ[bK](bD[bK])}bL=aW(r,bD,bx,bJ);if(!bL){bF(-1,"No Transport")}else{bJ.readyState=1;if(bw){bG.trigger("ajaxSend",[bJ,bD])}if(bD.async&&bD.timeout>0){bE=setTimeout(function(){bJ.abort("timeout")},bD.timeout)}try{bA=1;bL.send(bH,bF)}catch(bM){if(bA<2){bF(-1,bM)}else{throw bM}}}return bJ},param:function(e,bw){var bv=[],by=function(bz,bA){bA=b.isFunction(bA)?bA():bA;bv[bv.length]=encodeURIComponent(bz)+"="+encodeURIComponent(bA)};if(bw===L){bw=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){by(this.name,this.value)})}else{for(var bx in e){v(bx,e[bx],bw,by)}}return bv.join("&").replace(k,"+")}});function v(bw,by,bv,bx){if(b.isArray(by)){b.each(by,function(bA,bz){if(bv||ap.test(bw)){bx(bw,bz)}else{v(bw+"["+(typeof bz==="object"||b.isArray(bz)?bA:"")+"]",bz,bv,bx)}})}else{if(!bv&&by!=null&&typeof by==="object"){for(var e in by){v(bw+"["+e+"]",by[e],bv,bx)}}else{bx(bw,by)}}}b.extend({active:0,lastModified:{},etag:{}});function bj(bD,bC,bz){var bv=bD.contents,bB=bD.dataTypes,bw=bD.responseFields,by,bA,bx,e;for(bA in bw){if(bA in bz){bC[bw[bA]]=bz[bA]}}while(bB[0]==="*"){bB.shift();if(by===L){by=bD.mimeType||bC.getResponseHeader("content-type")}}if(by){for(bA in bv){if(bv[bA]&&bv[bA].test(by)){bB.unshift(bA);break}}}if(bB[0] in bz){bx=bB[0]}else{for(bA in bz){if(!bB[0]||bD.converters[bA+" "+bB[0]]){bx=bA;break}if(!e){e=bA}}bx=bx||e}if(bx){if(bx!==bB[0]){bB.unshift(bx)}return bz[bx]}}function G(bH,bz){if(bH.dataFilter){bz=bH.dataFilter(bz,bH.dataType)}var bD=bH.dataTypes,bG={},bA,bE,bw=bD.length,bB,bC=bD[0],bx,by,bF,bv,e;for(bA=1;bA=bw.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bw.animatedProperties[this.prop]=true;for(bA in bw.animatedProperties){if(bw.animatedProperties[bA]!==true){e=false}}if(e){if(bw.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bC,bD){bz.style["overflow"+bD]=bw.overflow[bC]})}if(bw.hide){b(bz).hide()}if(bw.hide||bw.show){for(bA in bw.animatedProperties){b.style(bz,bA,bw.orig[bA]);b.removeData(bz,"fxshow"+bA,true);b.removeData(bz,"toggle"+bA,true)}}bv=bw.complete;if(bv){bw.complete=false;bv.call(bz)}}return false}else{if(bw.duration==Infinity){this.now=bx}else{bB=bx-this.startTime;this.state=bB/bw.duration;this.pos=b.easing[bw.animatedProperties[this.prop]](this.state,bB,0,1,bw.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){var bw,bv=b.timers,e=0;for(;e").appendTo(e),bw=bv.css("display");bv.remove();if(bw==="none"||bw===""){if(!a8){a8=av.createElement("iframe");a8.frameBorder=a8.width=a8.height=0}e.appendChild(a8);if(!m||!a8.createElement){m=(a8.contentWindow||a8.contentDocument).document;m.write((av.compatMode==="CSS1Compat"?"":"")+"");m.close()}bv=m.createElement(bx);m.body.appendChild(bv);bw=b.css(bv,"display");e.removeChild(a8)}Q[bx]=bw}return Q[bx]}var V=/^t(?:able|d|h)$/i,ad=/^(?:body|html)$/i;if("getBoundingClientRect" in av.documentElement){b.fn.offset=function(bI){var by=this[0],bB;if(bI){return this.each(function(e){b.offset.setOffset(this,bI,e)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}try{bB=by.getBoundingClientRect()}catch(bF){}var bH=by.ownerDocument,bw=bH.documentElement;if(!bB||!b.contains(bw,by)){return bB?{top:bB.top,left:bB.left}:{top:0,left:0}}var bC=bH.body,bD=aK(bH),bA=bw.clientTop||bC.clientTop||0,bE=bw.clientLeft||bC.clientLeft||0,bv=bD.pageYOffset||b.support.boxModel&&bw.scrollTop||bC.scrollTop,bz=bD.pageXOffset||b.support.boxModel&&bw.scrollLeft||bC.scrollLeft,bG=bB.top+bv-bA,bx=bB.left+bz-bE;return{top:bG,left:bx}}}else{b.fn.offset=function(bF){var bz=this[0];if(bF){return this.each(function(bG){b.offset.setOffset(this,bF,bG)})}if(!bz||!bz.ownerDocument){return null}if(bz===bz.ownerDocument.body){return b.offset.bodyOffset(bz)}var bC,bw=bz.offsetParent,bv=bz,bE=bz.ownerDocument,bx=bE.documentElement,bA=bE.body,bB=bE.defaultView,e=bB?bB.getComputedStyle(bz,null):bz.currentStyle,bD=bz.offsetTop,by=bz.offsetLeft;while((bz=bz.parentNode)&&bz!==bA&&bz!==bx){if(b.support.fixedPosition&&e.position==="fixed"){break}bC=bB?bB.getComputedStyle(bz,null):bz.currentStyle;bD-=bz.scrollTop;by-=bz.scrollLeft;if(bz===bw){bD+=bz.offsetTop;by+=bz.offsetLeft;if(b.support.doesNotAddBorder&&!(b.support.doesAddBorderForTableAndCells&&V.test(bz.nodeName))){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}bv=bw;bw=bz.offsetParent}if(b.support.subtractsBorderForOverflowNotVisible&&bC.overflow!=="visible"){bD+=parseFloat(bC.borderTopWidth)||0;by+=parseFloat(bC.borderLeftWidth)||0}e=bC}if(e.position==="relative"||e.position==="static"){bD+=bA.offsetTop;by+=bA.offsetLeft}if(b.support.fixedPosition&&e.position==="fixed"){bD+=Math.max(bx.scrollTop,bA.scrollTop);by+=Math.max(bx.scrollLeft,bA.scrollLeft)}return{top:bD,left:by}}}b.offset={bodyOffset:function(e){var bw=e.offsetTop,bv=e.offsetLeft;if(b.support.doesNotIncludeMarginInBodyOffset){bw+=parseFloat(b.css(e,"marginTop"))||0;bv+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bw,left:bv}},setOffset:function(bx,bG,bA){var bB=b.css(bx,"position");if(bB==="static"){bx.style.position="relative"}var bz=b(bx),bv=bz.offset(),e=b.css(bx,"top"),bE=b.css(bx,"left"),bF=(bB==="absolute"||bB==="fixed")&&b.inArray("auto",[e,bE])>-1,bD={},bC={},bw,by;if(bF){bC=bz.position();bw=bC.top;by=bC.left}else{bw=parseFloat(e)||0;by=parseFloat(bE)||0}if(b.isFunction(bG)){bG=bG.call(bx,bA,bv)}if(bG.top!=null){bD.top=(bG.top-bv.top)+bw}if(bG.left!=null){bD.left=(bG.left-bv.left)+by}if("using" in bG){bG.using.call(bx,bD)}else{bz.css(bD)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bw=this[0],bv=this.offsetParent(),bx=this.offset(),e=ad.test(bv[0].nodeName)?{top:0,left:0}:bv.offset();bx.top-=parseFloat(b.css(bw,"marginTop"))||0;bx.left-=parseFloat(b.css(bw,"marginLeft"))||0;e.top+=parseFloat(b.css(bv[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bv[0],"borderLeftWidth"))||0;return{top:bx.top-e.top,left:bx.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||av.body;while(e&&(!ad.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bv,e){var bw="scroll"+e;b.fn[bw]=function(bz){var bx,by;if(bz===L){bx=this[0];if(!bx){return null}by=aK(bx);return by?("pageXOffset" in by)?by[bv?"pageYOffset":"pageXOffset"]:b.support.boxModel&&by.document.documentElement[bw]||by.document.body[bw]:bx[bw]}return this.each(function(){by=aK(this);if(by){by.scrollTo(!bv?bz:b(by).scrollLeft(),bv?bz:b(by).scrollTop())}else{this[bw]=bz}})}});function aK(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bv,e){var bw=e.toLowerCase();b.fn["inner"+e]=function(){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,"padding")):this[bw]():null};b.fn["outer"+e]=function(by){var bx=this[0];return bx?bx.style?parseFloat(b.css(bx,bw,by?"margin":"border")):this[bw]():null};b.fn[bw]=function(bz){var bA=this[0];if(!bA){return bz==null?null:this}if(b.isFunction(bz)){return this.each(function(bE){var bD=b(this);bD[bw](bz.call(this,bE,bD[bw]()))})}if(b.isWindow(bA)){var bB=bA.document.documentElement["client"+e],bx=bA.document.body;return bA.document.compatMode==="CSS1Compat"&&bB||bx&&bx["client"+e]||bB}else{if(bA.nodeType===9){return Math.max(bA.documentElement["client"+e],bA.body["scroll"+e],bA.documentElement["scroll"+e],bA.body["offset"+e],bA.documentElement["offset"+e])}else{if(bz===L){var bC=b.css(bA,bw),by=parseFloat(bC);return b.isNumeric(by)?by:bC}else{return this.css(bw,typeof bz==="string"?bz:bz+"px")}}}}});bb.jQuery=bb.$=b;if(typeof define==="function"&&define.amd&&define.amd.jQuery){define("jquery",[],function(){return b})}})(window);/*! - * jQuery UI 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(m,l,i,n){a.each(f,function(){l-=parseFloat(a.curCSS(m,"padding"+this,true))||0;if(i){l-=parseFloat(a.curCSS(m,"border"+this+"Width",true))||0}if(n){l-=parseFloat(a.curCSS(m,"margin"+this,true))||0}});return l}a.fn["inner"+e]=function(i){if(i===d){return k["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,i)+"px")})};a.fn["outer"+e]=function(i,l){if(typeof i!=="number"){return k["outer"+e].call(this,i)}return this.each(function(){a(this).css(h,j(this,i,true,l)+"px")})}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));f.offsetHeight;a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(j,f,i,h,e,g){return a.ui.isOverAxis(j,i,e)&&a.ui.isOverAxis(f,h,g)}})})(jQuery);/*! - * jQuery UI Widget 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],j;f=f.split(".")[1];j=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][j]=function(k){return !!b.data(k,f)};b[g]=b[g]||{};b[g][f]=function(k,l){if(arguments.length){this._createWidget(k,l)}};var i=new h();i.options=b.extend(true,{},i.options);b[g][f].prototype=b.extend(true,i,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:j},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(i){var g=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!g&&h.length?b.extend.apply(null,[true,i].concat(h)):i;if(g&&i.charAt(0)==="_"){return j}if(g){this.each(function(){var k=b.data(this,f),l=k&&b.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==d){j=l;return false}})}else{this.each(function(){var k=b.data(this,f);if(k){k.option(i||{})._init()}else{b.data(this,f,new e(i,this))}})}return j}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(e,f,g){var j,i,h=this.options[e];g=g||{};f=b.Event(f);f.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();f.target=this.element[0];i=f.originalEvent;if(i){for(j in i){if(!(j in f)){f[j]=i[j]}}}this.element.trigger(f,g);return !(b.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);/*! - * jQuery UI Mouse 1.8.18 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Mouse - * - * Depends: - * jquery.ui.widget.js - */ -(function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g
');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! - * jQuery hashchange event - v1.3 - 7/21/2010 - * http://benalman.com/projects/jquery-hashchange-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$(' +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
-
-
telebot_animation Member List
+
telebot_animation Member List

This is the complete list of members for telebot_animation, including all inherited members.

- + - + - + - +
durationtelebot_animation
file_idtelebot_animation
file_idtelebot_animation
file_nametelebot_animation
file_sizetelebot_animation
file_sizetelebot_animation
file_unique_idtelebot_animation
heighttelebot_animation
heighttelebot_animation
mime_typetelebot_animation
thumbtelebot_animation
thumbtelebot_animation
widthtelebot_animation
diff --git a/docs/structtelebot__animation.html b/docs/structtelebot__animation.html index cfba3d5..739f39a 100644 --- a/docs/structtelebot__animation.html +++ b/docs/structtelebot__animation.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_animation Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

@@ -63,8 +73,7 @@ -
-
telebot_animation Struct Reference
+
telebot_animation Struct Reference
@@ -73,32 +82,32 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - + - + - +

+

Public Attributes

char * file_id
char * file_id
 
char * file_unique_id
char * file_unique_id
 
int width
int width
 
int height
int height
 
int duration
int duration
 
struct telebot_photothumb
struct telebot_photothumb
 
char * file_name
char * file_name
 
char * mime_type
char * mime_type
 
int file_size
int file_size
 

Detailed Description

This object represents a video file.

Member Data Documentation

- -

◆ duration

+ +

◆ duration

@@ -112,8 +121,8 @@

-

◆ file_id

+ +

◆ file_id

@@ -127,8 +136,8 @@

-

◆ file_name

+ +

◆ file_name

@@ -142,8 +151,8 @@

-

◆ file_size

+ +

◆ file_size

@@ -157,8 +166,8 @@

-

◆ file_unique_id

+ +

◆ file_unique_id

@@ -172,8 +181,8 @@

-

◆ height

+ +

◆ height

@@ -187,8 +196,8 @@

-

◆ mime_type

+ +

◆ mime_type

@@ -202,8 +211,8 @@

-

◆ thumb

+ +

◆ thumb

@@ -217,8 +226,8 @@

-

◆ width

+ +

◆ width

@@ -238,9 +247,7 @@

diff --git a/docs/structtelebot__audio-members.html b/docs/structtelebot__audio-members.html index 26db9e2..ffee4b7 100644 --- a/docs/structtelebot__audio-members.html +++ b/docs/structtelebot__audio-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,34 +56,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_audio Member List
+
telebot_audio Member List
diff --git a/docs/structtelebot__audio.html b/docs/structtelebot__audio.html index 483c581..0c3640d 100644 --- a/docs/structtelebot__audio.html +++ b/docs/structtelebot__audio.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_audio Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_audio Struct Reference
+
telebot_audio Struct Reference

@@ -73,30 +82,30 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - + - +

+

Public Attributes

char * file_id
char * file_id
 
char * file_unique_id
char * file_unique_id
 
int duration
int duration
 
char * performer
char * performer
 
char * title
char * title
 
char * mime_type
char * mime_type
 
int file_size
int file_size
 
struct telebot_photothumb
struct telebot_photothumb
 

Detailed Description

This object represents an audio file to be treated as music by the Telegram clients.

Member Data Documentation

- -

◆ duration

+ +

◆ duration

@@ -110,8 +119,8 @@

-

◆ file_id

+ +

◆ file_id

@@ -125,8 +134,8 @@

-

◆ file_size

+ +

◆ file_size

@@ -140,8 +149,8 @@

-

◆ file_unique_id

+ +

◆ file_unique_id

@@ -155,8 +164,8 @@

-

◆ mime_type

+ +

◆ mime_type

@@ -170,8 +179,8 @@

-

◆ performer

+ +

◆ performer

@@ -185,8 +194,8 @@

-

◆ thumb

+ +

◆ thumb

@@ -200,8 +209,8 @@

-

◆ title

+ +

◆ title

@@ -221,9 +230,7 @@

diff --git a/docs/structtelebot__birthdate-members.html b/docs/structtelebot__birthdate-members.html new file mode 100644 index 0000000..ddf8946 --- /dev/null +++ b/docs/structtelebot__birthdate-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_birthdate Member List
+
+
+ +

This is the complete list of members for telebot_birthdate, including all inherited members.

+ + + + +
daytelebot_birthdate
monthtelebot_birthdate
yeartelebot_birthdate
+ + + + diff --git a/docs/structtelebot__birthdate.html b/docs/structtelebot__birthdate.html new file mode 100644 index 0000000..4d9156b --- /dev/null +++ b/docs/structtelebot__birthdate.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_birthdate Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_birthdate Struct Reference
+
+
+ +

Describes the birthdate of a user. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

int day
 
int month
 
int year
 
+

Detailed Description

+

Describes the birthdate of a user.

+

Member Data Documentation

+ +

◆ day

+ +
+
+ + + + +
int telebot_birthdate::day
+
+

Day of the user's birth; 1-31

+ +
+
+ +

◆ month

+ +
+
+ + + + +
int telebot_birthdate::month
+
+

Month of the user's birth; 1-12

+ +
+
+ +

◆ year

+ +
+
+ + + + +
int telebot_birthdate::year
+
+

Optional. Year of the user's birth

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__bot__command-members.html b/docs/structtelebot__bot__command-members.html index 09383a9..66f4b20 100644 --- a/docs/structtelebot__bot__command-members.html +++ b/docs/structtelebot__bot__command-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,28 +56,32 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_bot_command Member List
+
telebot_bot_command Member List

This is the complete list of members for telebot_bot_command, including all inherited members.

- +
commandtelebot_bot_command
descriptiontelebot_bot_command
descriptiontelebot_bot_command
diff --git a/docs/structtelebot__bot__command.html b/docs/structtelebot__bot__command.html index f2ed1fb..130b51e 100644 --- a/docs/structtelebot__bot__command.html +++ b/docs/structtelebot__bot__command.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_bot_command Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_bot_command Struct Reference
+
telebot_bot_command Struct Reference

@@ -73,18 +82,18 @@

#include <telebot-types.h>

- - + - +

+

Public Attributes

char * command
char * command
 
char * description
char * description
 

Detailed Description

This object represents a bot command.

Member Data Documentation

- -

◆ command

+ +

◆ command

@@ -98,8 +107,8 @@

-

◆ description

+ +

◆ description

@@ -119,9 +128,7 @@

diff --git a/docs/structtelebot__business__bot__rights-members.html b/docs/structtelebot__business__bot__rights-members.html new file mode 100644 index 0000000..650c587 --- /dev/null +++ b/docs/structtelebot__business__bot__rights-members.html @@ -0,0 +1,99 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_bot_rights Member List
+
+
+ +

This is the complete list of members for telebot_business_bot_rights, including all inherited members.

+ + + + + + + + + + + + + + + +
can_change_gift_settings (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_convert_gifts_to_stars (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_delete_all_messages (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_delete_sent_messages (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_edit_bio (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_edit_name (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_edit_profile_photo (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_edit_username (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_manage_stories (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_read_messages (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_reply (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_transfer_and_upgrade_gifts (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_transfer_stars (defined in telebot_business_bot_rights)telebot_business_bot_rights
can_view_gifts_and_stars (defined in telebot_business_bot_rights)telebot_business_bot_rights
+ + + + diff --git a/docs/structtelebot__business__bot__rights.html b/docs/structtelebot__business__bot__rights.html new file mode 100644 index 0000000..75b3df6 --- /dev/null +++ b/docs/structtelebot__business__bot__rights.html @@ -0,0 +1,141 @@ + + + + + + + +Telebot: telebot_business_bot_rights Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_bot_rights Struct Reference
+
+
+ +

Represents the rights of a business bot. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

+bool can_reply
 
+bool can_read_messages
 
+bool can_delete_sent_messages
 
+bool can_delete_all_messages
 
+bool can_edit_name
 
+bool can_edit_bio
 
+bool can_edit_profile_photo
 
+bool can_edit_username
 
+bool can_change_gift_settings
 
+bool can_view_gifts_and_stars
 
+bool can_convert_gifts_to_stars
 
+bool can_transfer_and_upgrade_gifts
 
+bool can_transfer_stars
 
+bool can_manage_stories
 
+

Detailed Description

+

Represents the rights of a business bot.

+

The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__connection-members.html b/docs/structtelebot__business__connection-members.html new file mode 100644 index 0000000..c8da7c5 --- /dev/null +++ b/docs/structtelebot__business__connection-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_connection Member List
+
+ + + + + diff --git a/docs/structtelebot__business__connection.html b/docs/structtelebot__business__connection.html new file mode 100644 index 0000000..11b1672 --- /dev/null +++ b/docs/structtelebot__business__connection.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_business_connection Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_connection Struct Reference
+
+
+ +

Describes the connection of the bot with a business account. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + +

+Public Attributes

+char * id
 
+struct telebot_useruser
 
+long long int user_chat_id
 
+long date
 
+bool can_reply
 
+bool is_enabled
 
+

Detailed Description

+

Describes the connection of the bot with a business account.

+

The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__intro-members.html b/docs/structtelebot__business__intro-members.html new file mode 100644 index 0000000..5bfecba --- /dev/null +++ b/docs/structtelebot__business__intro-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_intro Member List
+
+
+ +

This is the complete list of members for telebot_business_intro, including all inherited members.

+ + + + +
messagetelebot_business_intro
stickertelebot_business_intro
titletelebot_business_intro
+ + + + diff --git a/docs/structtelebot__business__intro.html b/docs/structtelebot__business__intro.html new file mode 100644 index 0000000..b3b7cb3 --- /dev/null +++ b/docs/structtelebot__business__intro.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_business_intro Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_intro Struct Reference
+
+
+ +

Contains information about the start page settings of a Telegram Business account. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

char * title
 
char * message
 
struct telebot_stickersticker
 
+

Detailed Description

+

Contains information about the start page settings of a Telegram Business account.

+

Member Data Documentation

+ +

◆ message

+ +
+
+ + + + +
char* telebot_business_intro::message
+
+

Optional. Message text of the business intro

+ +
+
+ +

◆ sticker

+ +
+
+ + + + +
struct telebot_sticker* telebot_business_intro::sticker
+
+

Optional. Sticker of the business intro

+ +
+
+ +

◆ title

+ +
+
+ + + + +
char* telebot_business_intro::title
+
+

Optional. Title text of the business intro

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__location-members.html b/docs/structtelebot__business__location-members.html new file mode 100644 index 0000000..553b1d4 --- /dev/null +++ b/docs/structtelebot__business__location-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_location Member List
+
+
+ +

This is the complete list of members for telebot_business_location, including all inherited members.

+ + + +
addresstelebot_business_location
locationtelebot_business_location
+ + + + diff --git a/docs/structtelebot__business__location.html b/docs/structtelebot__business__location.html new file mode 100644 index 0000000..e674315 --- /dev/null +++ b/docs/structtelebot__business__location.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_business_location Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_location Struct Reference
+
+
+ +

Contains information about the location of a Telegram Business account. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

char * address
 
struct telebot_locationlocation
 
+

Detailed Description

+

Contains information about the location of a Telegram Business account.

+

Member Data Documentation

+ +

◆ address

+ +
+
+ + + + +
char* telebot_business_location::address
+
+

Address of the business

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_location* telebot_business_location::location
+
+

Optional. Location of the business

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__messages__deleted-members.html b/docs/structtelebot__business__messages__deleted-members.html new file mode 100644 index 0000000..e3e6857 --- /dev/null +++ b/docs/structtelebot__business__messages__deleted-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_messages_deleted Member List
+
+
+ +

This is the complete list of members for telebot_business_messages_deleted, including all inherited members.

+ + + + + +
business_connection_id (defined in telebot_business_messages_deleted)telebot_business_messages_deleted
chat (defined in telebot_business_messages_deleted)telebot_business_messages_deleted
count_message_ids (defined in telebot_business_messages_deleted)telebot_business_messages_deleted
message_ids (defined in telebot_business_messages_deleted)telebot_business_messages_deleted
+ + + + diff --git a/docs/structtelebot__business__messages__deleted.html b/docs/structtelebot__business__messages__deleted.html new file mode 100644 index 0000000..7888159 --- /dev/null +++ b/docs/structtelebot__business__messages__deleted.html @@ -0,0 +1,111 @@ + + + + + + + +Telebot: telebot_business_messages_deleted Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_messages_deleted Struct Reference
+
+
+ +

This object is received when messages are deleted from a connected business account. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

+char * business_connection_id
 
+struct telebot_chatchat
 
+int * message_ids
 
+int count_message_ids
 
+

Detailed Description

+

This object is received when messages are deleted from a connected business account.

+

The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__opening__hours-members.html b/docs/structtelebot__business__opening__hours-members.html new file mode 100644 index 0000000..b33a90c --- /dev/null +++ b/docs/structtelebot__business__opening__hours-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_opening_hours Member List
+
+
+ +

This is the complete list of members for telebot_business_opening_hours, including all inherited members.

+ + + + +
count_opening_hours (defined in telebot_business_opening_hours)telebot_business_opening_hours
opening_hourstelebot_business_opening_hours
time_zone_nametelebot_business_opening_hours
+ + + + diff --git a/docs/structtelebot__business__opening__hours.html b/docs/structtelebot__business__opening__hours.html new file mode 100644 index 0000000..1ea7476 --- /dev/null +++ b/docs/structtelebot__business__opening__hours.html @@ -0,0 +1,137 @@ + + + + + + + +Telebot: telebot_business_opening_hours Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_opening_hours Struct Reference
+
+
+ +

Describes the opening hours of a business. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

char * time_zone_name
 
struct telebot_business_opening_hours_intervalopening_hours
 
+int count_opening_hours
 
+

Detailed Description

+

Describes the opening hours of a business.

+

Member Data Documentation

+ +

◆ opening_hours

+ +
+
+ + + + +
struct telebot_business_opening_hours_interval* telebot_business_opening_hours::opening_hours
+
+

List of time intervals describing business opening hours

+ +
+
+ +

◆ time_zone_name

+ +
+
+ + + + +
char* telebot_business_opening_hours::time_zone_name
+
+

Unique name of the time zone for which the opening hours are defined

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__business__opening__hours__interval-members.html b/docs/structtelebot__business__opening__hours__interval-members.html new file mode 100644 index 0000000..861f47e --- /dev/null +++ b/docs/structtelebot__business__opening__hours__interval-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_business_opening_hours_interval Member List
+
+ + + + + diff --git a/docs/structtelebot__business__opening__hours__interval.html b/docs/structtelebot__business__opening__hours__interval.html new file mode 100644 index 0000000..afe27b2 --- /dev/null +++ b/docs/structtelebot__business__opening__hours__interval.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_business_opening_hours_interval Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_business_opening_hours_interval Struct Reference
+
+
+ +

Describes an interval of time during which a business is open. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

int opening_minute
 
int closing_minute
 
+

Detailed Description

+

Describes an interval of time during which a business is open.

+

Member Data Documentation

+ +

◆ closing_minute

+ +
+
+ + + + +
int telebot_business_opening_hours_interval::closing_minute
+
+

The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60

+ +
+
+ +

◆ opening_minute

+ +
+
+ + + + +
int telebot_business_opening_hours_interval::opening_minute
+
+

The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__callback__game-members.html b/docs/structtelebot__callback__game-members.html new file mode 100644 index 0000000..3db6625 --- /dev/null +++ b/docs/structtelebot__callback__game-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_callback_game Member List
+
+
+ +

This is the complete list of members for telebot_callback_game, including all inherited members.

+ + +
dummy (defined in telebot_callback_game)telebot_callback_game
+ + + + diff --git a/docs/structtelebot__callback__game.html b/docs/structtelebot__callback__game.html new file mode 100644 index 0000000..75a6e65 --- /dev/null +++ b/docs/structtelebot__callback__game.html @@ -0,0 +1,102 @@ + + + + + + + +Telebot: telebot_callback_game Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_callback_game Struct Reference
+
+
+ +

A placeholder, currently holds no information. Use BotFather to set up your game. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

+bool dummy
 
+

Detailed Description

+

A placeholder, currently holds no information. Use BotFather to set up your game.

+

The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__callback__query-members.html b/docs/structtelebot__callback__query-members.html index e95b6f4..6bd49e9 100644 --- a/docs/structtelebot__callback__query-members.html +++ b/docs/structtelebot__callback__query-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,33 +56,37 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_callback_query Member List
+
telebot_callback_query Member List
diff --git a/docs/structtelebot__callback__query.html b/docs/structtelebot__callback__query.html index d705207..32d5a57 100644 --- a/docs/structtelebot__callback__query.html +++ b/docs/structtelebot__callback__query.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_callback_query Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_callback_query Struct Reference
+
telebot_callback_query Struct Reference

@@ -73,28 +82,28 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - +

+

Public Attributes

char * id
char * id
 
struct telebot_userfrom
struct telebot_userfrom
 
struct telebot_messagemessage
struct telebot_messagemessage
 
char * inline_message_id
char * inline_message_id
 
char * chat_instance
char * chat_instance
 
char * data
char * data
 
char * game_short_name
char * game_short_name
 

Detailed Description

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

Member Data Documentation

- -

◆ chat_instance

+ +

◆ chat_instance

@@ -108,8 +117,8 @@

-

◆ data

+ +

◆ data

@@ -123,8 +132,8 @@

-

◆ from

+ +

◆ from

@@ -138,8 +147,8 @@

-

◆ game_short_name

+ +

◆ game_short_name

@@ -153,8 +162,8 @@

-

◆ id

+ +

◆ id

@@ -168,8 +177,8 @@

-

◆ inline_message_id

+ +

◆ inline_message_id

@@ -183,8 +192,8 @@

-

◆ message

+ +

◆ message

@@ -204,9 +213,7 @@

diff --git a/docs/structtelebot__chat-members.html b/docs/structtelebot__chat-members.html index 20d9d04..5236b9c 100644 --- a/docs/structtelebot__chat-members.html +++ b/docs/structtelebot__chat-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,40 +56,72 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_chat Member List
+
telebot_chat Member List

This is the complete list of members for telebot_chat, including all inherited members.

- - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + +
can_set_sticker_settelebot_chat
descriptiontelebot_chat
first_nametelebot_chat
idtelebot_chat
invite_linktelebot_chat
last_nametelebot_chat
accent_color_idtelebot_chat
active_usernamestelebot_chat
biotelebot_chat
birthdatetelebot_chat
business_introtelebot_chat
business_locationtelebot_chat
business_opening_hourstelebot_chat
can_set_sticker_settelebot_chat
count_active_usernames (defined in telebot_chat)telebot_chat
custom_emoji_sticker_set_nametelebot_chat
descriptiontelebot_chat
emoji_status_custom_emoji_idtelebot_chat
emoji_status_expiration_datetelebot_chat
first_nametelebot_chat
has_aggressive_anti_spam_enabledtelebot_chat
has_hidden_memberstelebot_chat
has_private_forwardstelebot_chat
has_protected_contenttelebot_chat
has_restricted_voice_and_video_messagestelebot_chat
has_visible_historytelebot_chat
idtelebot_chat
invite_linktelebot_chat
is_direct_messagestelebot_chat
is_forumtelebot_chat
join_by_requesttelebot_chat
join_to_send_messagestelebot_chat
last_nametelebot_chat
linked_chat_idtelebot_chat
locationtelebot_chat
max_reaction_counttelebot_chat
message_auto_delete_timetelebot_chat
parent_chattelebot_chat
permissionstelebot_chat
phototelebot_chat
pinned_messagetelebot_chat
slow_mode_delaytelebot_chat
sticker_set_nametelebot_chat
titletelebot_chat
typetelebot_chat
usernametelebot_chat
personal_chattelebot_chat
phototelebot_chat
pinned_messagetelebot_chat
slow_mode_delaytelebot_chat
sticker_set_nametelebot_chat
titletelebot_chat
typetelebot_chat
unrestrict_boost_counttelebot_chat
usernametelebot_chat
diff --git a/docs/structtelebot__chat.html b/docs/structtelebot__chat.html index 101d93c..2137c44 100644 --- a/docs/structtelebot__chat.html +++ b/docs/structtelebot__chat.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_chat Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_chat Struct Reference
+
telebot_chat Struct Reference

@@ -73,42 +82,204 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + - + + + + + + +

+

Public Attributes

long long int id
long long int id
 
char * type
char * type
 
char * title
char * title
 
char * username
char * username
 
char * first_name
char * first_name
 
char * last_name
char * last_name
 
struct telebot_chat_photophoto
bool is_forum
 
bool is_direct_messages
 
int accent_color_id
 
int max_reaction_count
 
struct telebot_chat_photophoto
 
char * description
char ** active_usernames
 
+int count_active_usernames
 
struct telebot_birthdatebirthdate
 
struct telebot_business_introbusiness_intro
 
struct telebot_business_locationbusiness_location
 
struct telebot_business_opening_hoursbusiness_opening_hours
 
struct telebot_chatpersonal_chat
 
struct telebot_chatparent_chat
 
char * emoji_status_custom_emoji_id
 
long emoji_status_expiration_date
 
char * bio
 
bool has_private_forwards
 
bool has_restricted_voice_and_video_messages
 
bool join_to_send_messages
 
bool join_by_request
 
char * description
 
char * invite_link
char * invite_link
 
struct telebot_messagepinned_message
struct telebot_messagepinned_message
 
struct telebot_chat_permissionspermissions
struct telebot_chat_permissionspermissions
 
int slow_mode_delay
int slow_mode_delay
 
char * sticker_set_name
int unrestrict_boost_count
 
int message_auto_delete_time
 
bool has_aggressive_anti_spam_enabled
 
bool has_hidden_members
 
bool has_protected_content
 
bool has_visible_history
 
char * sticker_set_name
 
bool can_set_sticker_set
bool can_set_sticker_set
 
char * custom_emoji_sticker_set_name
 
long long int linked_chat_id
 
struct telebot_chat_locationlocation
 

Detailed Description

This object represents a chat.

Member Data Documentation

- -

◆ can_set_sticker_set

+ +

◆ accent_color_id

+ +
+
+ + + + +
int telebot_chat::accent_color_id
+
+

Optional. Identifier of the accent color for the chat name and backgrounds.

+ +
+
+ +

◆ active_usernames

+ +
+
+ + + + +
char** telebot_chat::active_usernames
+
+

Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.

+ +
+
+ +

◆ bio

+ +
+
+ + + + +
char* telebot_chat::bio
+
+

Optional. Bio of the other party in a private chat. Returned only in getChat.

+ +
+
+ +

◆ birthdate

+ +
+
+ + + + +
struct telebot_birthdate* telebot_chat::birthdate
+
+

Optional. For private chats, the date of birth of the user.

+ +
+
+ +

◆ business_intro

+ +
+
+ + + + +
struct telebot_business_intro* telebot_chat::business_intro
+
+

Optional. For private chats with business accounts, the intro of the business.

+ +
+
+ +

◆ business_location

+ +
+
+ + + + +
struct telebot_business_location* telebot_chat::business_location
+
+

Optional. For private chats with business accounts, the location of the business.

+ +
+
+ +

◆ business_opening_hours

+ +
+
+ + + + +
struct telebot_business_opening_hours* telebot_chat::business_opening_hours
+
+

Optional. For private chats with business accounts, the opening hours of the business.

+ +
+
+ +

◆ can_set_sticker_set

@@ -122,8 +293,23 @@

-

◆ description

+ +

◆ custom_emoji_sticker_set_name

+ +
+
+ + + + +
char* telebot_chat::custom_emoji_sticker_set_name
+
+

Optional. For supergroups, the name of the group's custom emoji sticker set.

+ +
+
+ +

◆ description

+ +

◆ emoji_status_custom_emoji_id

+ +
+
+ + + + +
char* telebot_chat::emoji_status_custom_emoji_id
+
+

Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat.

+ +
+
+ +

◆ emoji_status_expiration_date

+ +
+
+ + + + +
long telebot_chat::emoji_status_expiration_date
+
+

Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any.

- -

◆ first_name

+ +

◆ first_name

@@ -152,8 +368,98 @@

-

◆ id

+ +

◆ has_aggressive_anti_spam_enabled

+ +
+
+ + + + +
bool telebot_chat::has_aggressive_anti_spam_enabled
+
+

Optional. True, if aggressive anti-spam checks are enabled in the supergroup.

+ +
+
+ +

◆ has_hidden_members

+ +
+
+ + + + +
bool telebot_chat::has_hidden_members
+
+

Optional. True, if non-administrators can only get the list of bots and administrators in the chat.

+ +
+
+ +

◆ has_private_forwards

+ +
+
+ + + + +
bool telebot_chat::has_private_forwards
+
+

Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.

+ +
+
+ +

◆ has_protected_content

+ +
+
+ + + + +
bool telebot_chat::has_protected_content
+
+

Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.

+ +
+
+ +

◆ has_restricted_voice_and_video_messages

+ +
+
+ + + + +
bool telebot_chat::has_restricted_voice_and_video_messages
+
+

Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

+ +
+
+ +

◆ has_visible_history

+ +
+
+ + + + +
bool telebot_chat::has_visible_history
+
+

Optional. True, if new chat members will have access to old messages.

+ +
+
+ +

◆ id

@@ -167,8 +473,8 @@

-

◆ invite_link

+ +

◆ invite_link

- -

◆ last_name

+ +

◆ is_direct_messages

+ +
+
+ + + + +
bool telebot_chat::is_direct_messages
+
+

Optional. True, if the chat is the direct messages chat of a channel.

+ +
+
+ +

◆ is_forum

+ +
+
+ + + + +
bool telebot_chat::is_forum
+
+

Optional. True, if the supergroup chat is a forum (has topics enabled).

+ +
+
+ +

◆ join_by_request

+ +
+
+ + + + +
bool telebot_chat::join_by_request
+
+

Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.

+ +
+
+ +

◆ join_to_send_messages

+ +
+
+ + + + +
bool telebot_chat::join_to_send_messages
+
+

Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.

+ +
+
+ +

◆ last_name

@@ -197,8 +563,83 @@

-

◆ permissions

+ +

◆ linked_chat_id

+ +
+
+ + + + +
long long int telebot_chat::linked_chat_id
+
+

Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in getChat.

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_chat_location* telebot_chat::location
+
+

Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.

+ +
+
+ +

◆ max_reaction_count

+ +
+
+ + + + +
int telebot_chat::max_reaction_count
+
+

Optional. The maximum number of reactions that can be set on a message in the chat.

+ +
+
+ +

◆ message_auto_delete_time

+ +
+
+ + + + +
int telebot_chat::message_auto_delete_time
+
+

Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.

+ +
+
+ +

◆ parent_chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat::parent_chat
+
+

Optional. Information about the corresponding channel chat; for direct messages chats only.

+ +
+
+ +

◆ permissions

@@ -212,8 +653,23 @@

-

◆ photo

+ +

◆ personal_chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat::personal_chat
+
+

Optional. For private chats, the personal channel of the user.

+ +
+
+ +

◆ photo

@@ -227,8 +683,8 @@

-

◆ pinned_message

+ +

◆ pinned_message

- -

◆ slow_mode_delay

+ +

◆ slow_mode_delay

@@ -257,8 +713,8 @@

-

◆ sticker_set_name

+ +

◆ sticker_set_name

@@ -272,8 +728,8 @@

-

◆ title

+ +

◆ title

@@ -287,8 +743,8 @@

-

◆ type

+ +

◆ type

@@ -302,8 +758,23 @@

-

◆ username

+ +

◆ unrestrict_boost_count

+ +
+
+ + + + +
int telebot_chat::unrestrict_boost_count
+
+

Optional. For supergroups, the minimum number of boosts that a non-administrator user needs.

+ +
+
+ +

◆ username

@@ -323,9 +794,7 @@

diff --git a/docs/structtelebot__chat__background-members.html b/docs/structtelebot__chat__background-members.html new file mode 100644 index 0000000..086e3a5 --- /dev/null +++ b/docs/structtelebot__chat__background-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_background Member List
+
+
+ +

This is the complete list of members for telebot_chat_background, including all inherited members.

+ + +
typetelebot_chat_background
+ + + + diff --git a/docs/structtelebot__chat__background.html b/docs/structtelebot__chat__background.html new file mode 100644 index 0000000..0084a1a --- /dev/null +++ b/docs/structtelebot__chat__background.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_chat_background Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_background Struct Reference
+
+
+ +

This object represents a chat background. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

char * type
 
+

Detailed Description

+

This object represents a chat background.

+

Member Data Documentation

+ +

◆ type

+ +
+
+ + + + +
char* telebot_chat_background::type
+
+

Type of the background

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__boost-members.html b/docs/structtelebot__chat__boost-members.html new file mode 100644 index 0000000..ba54e0d --- /dev/null +++ b/docs/structtelebot__chat__boost-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_boost Member List
+
+
+ +

This is the complete list of members for telebot_chat_boost, including all inherited members.

+ + + + + +
add_datetelebot_chat_boost
boost_idtelebot_chat_boost
expiration_datetelebot_chat_boost
sourcetelebot_chat_boost
+ + + + diff --git a/docs/structtelebot__chat__boost.html b/docs/structtelebot__chat__boost.html new file mode 100644 index 0000000..adcd6d0 --- /dev/null +++ b/docs/structtelebot__chat__boost.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_chat_boost Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_boost Struct Reference
+
+
+ +

This object contains information about a chat boost. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

char * boost_id
 
long add_date
 
long expiration_date
 
struct telebot_chat_boost_sourcesource
 
+

Detailed Description

+

This object contains information about a chat boost.

+

Member Data Documentation

+ +

◆ add_date

+ +
+
+ + + + +
long telebot_chat_boost::add_date
+
+

Point in time (Unix timestamp) when the chat was boosted

+ +
+
+ +

◆ boost_id

+ +
+
+ + + + +
char* telebot_chat_boost::boost_id
+
+

Unique identifier of the boost

+ +
+
+ +

◆ expiration_date

+ +
+
+ + + + +
long telebot_chat_boost::expiration_date
+
+

Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged

+ +
+
+ +

◆ source

+ +
+
+ + + + +
struct telebot_chat_boost_source* telebot_chat_boost::source
+
+

Source of the added boost

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__boost__added-members.html b/docs/structtelebot__chat__boost__added-members.html new file mode 100644 index 0000000..98f17ae --- /dev/null +++ b/docs/structtelebot__chat__boost__added-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_boost_added Member List
+
+
+ +

This is the complete list of members for telebot_chat_boost_added, including all inherited members.

+ + +
boost_counttelebot_chat_boost_added
+ + + + diff --git a/docs/structtelebot__chat__boost__added.html b/docs/structtelebot__chat__boost__added.html new file mode 100644 index 0000000..406d48b --- /dev/null +++ b/docs/structtelebot__chat__boost__added.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_chat_boost_added Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_boost_added Struct Reference
+
+
+ +

This object represents a service message about a user boosting a chat. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

int boost_count
 
+

Detailed Description

+

This object represents a service message about a user boosting a chat.

+

Member Data Documentation

+ +

◆ boost_count

+ +
+
+ + + + +
int telebot_chat_boost_added::boost_count
+
+

Number of boosts added by the user

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__boost__removed-members.html b/docs/structtelebot__chat__boost__removed-members.html new file mode 100644 index 0000000..e420cd6 --- /dev/null +++ b/docs/structtelebot__chat__boost__removed-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_boost_removed Member List
+
+ + + + + diff --git a/docs/structtelebot__chat__boost__removed.html b/docs/structtelebot__chat__boost__removed.html new file mode 100644 index 0000000..a6b057b --- /dev/null +++ b/docs/structtelebot__chat__boost__removed.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_chat_boost_removed Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_boost_removed Struct Reference
+
+
+ +

This object represents a boost removed from a chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

struct telebot_chatchat
 
char * boost_id
 
long remove_date
 
struct telebot_chat_boost_sourcesource
 
+

Detailed Description

+

This object represents a boost removed from a chat.

+

Member Data Documentation

+ +

◆ boost_id

+ +
+
+ + + + +
char* telebot_chat_boost_removed::boost_id
+
+

Unique identifier of the boost

+ +
+
+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat_boost_removed::chat
+
+

Chat from which the boost was removed

+ +
+
+ +

◆ remove_date

+ +
+
+ + + + +
long telebot_chat_boost_removed::remove_date
+
+

Point in time (Unix timestamp) when the boost was removed

+ +
+
+ +

◆ source

+ +
+
+ + + + +
struct telebot_chat_boost_source* telebot_chat_boost_removed::source
+
+

Source of the removed boost

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__boost__source-members.html b/docs/structtelebot__chat__boost__source-members.html new file mode 100644 index 0000000..7ea03a9 --- /dev/null +++ b/docs/structtelebot__chat__boost__source-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_boost_source Member List
+
+
+ +

This is the complete list of members for telebot_chat_boost_source, including all inherited members.

+ + + +
sourcetelebot_chat_boost_source
usertelebot_chat_boost_source
+ + + + diff --git a/docs/structtelebot__chat__boost__source.html b/docs/structtelebot__chat__boost__source.html new file mode 100644 index 0000000..db4f539 --- /dev/null +++ b/docs/structtelebot__chat__boost__source.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_chat_boost_source Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_boost_source Struct Reference
+
+
+ +

This object represents the source of a chat boost. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

char * source
 
struct telebot_useruser
 
+

Detailed Description

+

This object represents the source of a chat boost.

+

Member Data Documentation

+ +

◆ source

+ +
+
+ + + + +
char* telebot_chat_boost_source::source
+
+

Source of the boost, one of "premium", "gift_code", "giveaway"

+ +
+
+ +

◆ user

+ +
+
+ + + + +
struct telebot_user* telebot_chat_boost_source::user
+
+

Optional. User that boosted the chat

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__boost__updated-members.html b/docs/structtelebot__chat__boost__updated-members.html new file mode 100644 index 0000000..97f4a01 --- /dev/null +++ b/docs/structtelebot__chat__boost__updated-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_boost_updated Member List
+
+
+ +

This is the complete list of members for telebot_chat_boost_updated, including all inherited members.

+ + + +
boosttelebot_chat_boost_updated
chattelebot_chat_boost_updated
+ + + + diff --git a/docs/structtelebot__chat__boost__updated.html b/docs/structtelebot__chat__boost__updated.html new file mode 100644 index 0000000..90a944a --- /dev/null +++ b/docs/structtelebot__chat__boost__updated.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_chat_boost_updated Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_boost_updated Struct Reference
+
+
+ +

This object represents a boost added to a chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

struct telebot_chatchat
 
struct telebot_chat_boostboost
 
+

Detailed Description

+

This object represents a boost added to a chat.

+

Member Data Documentation

+ +

◆ boost

+ +
+
+ + + + +
struct telebot_chat_boost* telebot_chat_boost_updated::boost
+
+

Information about the boost

+ +
+
+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat_boost_updated::chat
+
+

Chat which was boosted

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__invite__link-members.html b/docs/structtelebot__chat__invite__link-members.html new file mode 100644 index 0000000..8b82fd1 --- /dev/null +++ b/docs/structtelebot__chat__invite__link-members.html @@ -0,0 +1,94 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_invite_link Member List
+
+ + + + + diff --git a/docs/structtelebot__chat__invite__link.html b/docs/structtelebot__chat__invite__link.html new file mode 100644 index 0000000..ca88e66 --- /dev/null +++ b/docs/structtelebot__chat__invite__link.html @@ -0,0 +1,253 @@ + + + + + + + +Telebot: telebot_chat_invite_link Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_invite_link Struct Reference
+
+
+ +

This object represents a chat invite link. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + +

+Public Attributes

char * invite_link
 
struct telebot_usercreator
 
bool creates_join_request
 
bool is_primary
 
bool is_revoked
 
char * name
 
long expire_date
 
int member_limit
 
int pending_join_request_count
 
+

Detailed Description

+

This object represents a chat invite link.

+

Member Data Documentation

+ +

◆ creates_join_request

+ +
+
+ + + + +
bool telebot_chat_invite_link::creates_join_request
+
+

True, if users joining the chat via the link need to be approved by chat administrators

+ +
+
+ +

◆ creator

+ +
+
+ + + + +
struct telebot_user* telebot_chat_invite_link::creator
+
+

Creator of the link

+ +
+
+ +

◆ expire_date

+ +
+
+ + + + +
long telebot_chat_invite_link::expire_date
+
+

Optional. Point in time (Unix timestamp) when the link will expire or has expired

+ +
+
+ +

◆ invite_link

+ +
+
+ + + + +
char* telebot_chat_invite_link::invite_link
+
+

The invite link.

+ +
+
+ +

◆ is_primary

+ +
+
+ + + + +
bool telebot_chat_invite_link::is_primary
+
+

True, if the link is primary

+ +
+
+ +

◆ is_revoked

+ +
+
+ + + + +
bool telebot_chat_invite_link::is_revoked
+
+

True, if the link is revoked

+ +
+
+ +

◆ member_limit

+ +
+
+ + + + +
int telebot_chat_invite_link::member_limit
+
+

Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char* telebot_chat_invite_link::name
+
+

Optional. Invite link name

+ +
+
+ +

◆ pending_join_request_count

+ +
+
+ + + + +
int telebot_chat_invite_link::pending_join_request_count
+
+

Optional. Number of pending join requests created using this link

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__join__request-members.html b/docs/structtelebot__chat__join__request-members.html new file mode 100644 index 0000000..45c5584 --- /dev/null +++ b/docs/structtelebot__chat__join__request-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_join_request Member List
+
+ + + + + diff --git a/docs/structtelebot__chat__join__request.html b/docs/structtelebot__chat__join__request.html new file mode 100644 index 0000000..3421e0e --- /dev/null +++ b/docs/structtelebot__chat__join__request.html @@ -0,0 +1,202 @@ + + + + + + + +Telebot: telebot_chat_join_request Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_join_request Struct Reference
+
+
+ +

This object represents a join request sent to a chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + +

+Public Attributes

struct telebot_chatchat
 
struct telebot_userfrom
 
long long int user_chat_id
 
long date
 
char * bio
 
struct telebot_chat_invite_linkinvite_link
 
+

Detailed Description

+

This object represents a join request sent to a chat.

+

Member Data Documentation

+ +

◆ bio

+ +
+
+ + + + +
char* telebot_chat_join_request::bio
+
+

Optional. Bio of the user.

+ +
+
+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat_join_request::chat
+
+

Chat to which the request was sent

+ +
+
+ +

◆ date

+ +
+
+ + + + +
long telebot_chat_join_request::date
+
+

Date the request was sent in Unix time

+ +
+
+ +

◆ from

+ +
+
+ + + + +
struct telebot_user* telebot_chat_join_request::from
+
+

User that sent the join request

+ +
+
+ +

◆ invite_link

+ +
+
+ + + + +
struct telebot_chat_invite_link* telebot_chat_join_request::invite_link
+
+

Optional. Chat invite link that was used by the user to send the join request

+ +
+
+ +

◆ user_chat_id

+ +
+
+ + + + +
long long int telebot_chat_join_request::user_chat_id
+
+

Identifier of a private chat with the user who sent the join request.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__location-members.html b/docs/structtelebot__chat__location-members.html new file mode 100644 index 0000000..aba6f2d --- /dev/null +++ b/docs/structtelebot__chat__location-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_location Member List
+
+
+ +

This is the complete list of members for telebot_chat_location, including all inherited members.

+ + + +
addresstelebot_chat_location
locationtelebot_chat_location
+ + + + diff --git a/docs/structtelebot__chat__location.html b/docs/structtelebot__chat__location.html new file mode 100644 index 0000000..232b964 --- /dev/null +++ b/docs/structtelebot__chat__location.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_chat_location Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_location Struct Reference
+
+
+ +

Thi object represetns information about the current status of a webhook. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

struct telebot_locationlocation
 
char * address
 
+

Detailed Description

+

Thi object represetns information about the current status of a webhook.

+

Member Data Documentation

+ +

◆ address

+ +
+
+ + + + +
char* telebot_chat_location::address
+
+

Location address; 1-64 characters, as defined by the chat owner

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_location* telebot_chat_location::location
+
+

The location to which the supergroup is connected. Can't be a live location.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__member-members.html b/docs/structtelebot__chat__member-members.html index e90f4da..8222944 100644 --- a/docs/structtelebot__chat__member-members.html +++ b/docs/structtelebot__chat__member-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,45 +56,49 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_chat_member Member List
+
telebot_chat_member Member List
diff --git a/docs/structtelebot__chat__member.html b/docs/structtelebot__chat__member.html index 08cc0c8..ca9e17c 100644 --- a/docs/structtelebot__chat__member.html +++ b/docs/structtelebot__chat__member.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_chat_member Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_chat_member Struct Reference
+
telebot_chat_member Struct Reference

@@ -73,52 +82,52 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +

+

Public Attributes

struct telebot_useruser
struct telebot_useruser
 
char * status
char * status
 
char * custom_title
char * custom_title
 
long until_date
long until_date
 
bool can_be_edited
bool can_be_edited
 
bool can_post_messages
bool can_post_messages
 
bool can_edit_messages
bool can_edit_messages
 
bool can_delete_messages
bool can_delete_messages
 
bool can_restrict_members
bool can_restrict_members
 
bool can_promote_members
bool can_promote_members
 
bool can_change_info
bool can_change_info
 
bool can_invite_users
bool can_invite_users
 
bool can_pin_messages
bool can_pin_messages
 
bool is_member
bool is_member
 
bool can_send_messages
bool can_send_messages
 
bool can_send_media_messages
bool can_send_media_messages
 
bool can_send_polls
bool can_send_polls
 
bool can_send_other_messages
bool can_send_other_messages
 
bool can_add_web_page_previews
bool can_add_web_page_previews
 

Detailed Description

This object contains information about one member of a chat.

Member Data Documentation

- -

◆ can_add_web_page_previews

+ +

◆ can_add_web_page_previews

@@ -132,8 +141,8 @@

-

◆ can_be_edited

+ +

◆ can_be_edited

@@ -147,8 +156,8 @@

-

◆ can_change_info

+ +

◆ can_change_info

@@ -162,8 +171,8 @@

-

◆ can_delete_messages

+ +

◆ can_delete_messages

@@ -177,8 +186,8 @@

-

◆ can_edit_messages

+ +

◆ can_edit_messages

@@ -192,8 +201,8 @@

-

◆ can_invite_users

+ +

◆ can_invite_users

@@ -207,8 +216,8 @@

-

◆ can_pin_messages

+ +

◆ can_pin_messages

@@ -222,8 +231,8 @@

-

◆ can_post_messages

+ +

◆ can_post_messages

@@ -237,8 +246,8 @@

-

◆ can_promote_members

+ +

◆ can_promote_members

@@ -252,8 +261,8 @@

-

◆ can_restrict_members

+ +

◆ can_restrict_members

@@ -267,8 +276,8 @@

-

◆ can_send_media_messages

+ +

◆ can_send_media_messages

@@ -282,8 +291,8 @@

-

◆ can_send_messages

+ +

◆ can_send_messages

@@ -297,8 +306,8 @@

-

◆ can_send_other_messages

+ +

◆ can_send_other_messages

@@ -312,8 +321,8 @@

-

◆ can_send_polls

+ +

◆ can_send_polls

@@ -327,8 +336,8 @@

-

◆ custom_title

+ +

◆ custom_title

@@ -342,8 +351,8 @@

-

◆ is_member

+ +

◆ is_member

@@ -357,8 +366,8 @@

-

◆ status

+ +

◆ status

@@ -372,8 +381,8 @@

-

◆ until_date

+ +

◆ until_date

@@ -387,8 +396,8 @@

-

◆ user

+ +

◆ user

@@ -408,9 +417,7 @@

diff --git a/docs/structtelebot__chat__member__updated-members.html b/docs/structtelebot__chat__member__updated-members.html new file mode 100644 index 0000000..53d8f4e --- /dev/null +++ b/docs/structtelebot__chat__member__updated-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_member_updated Member List
+
+ + + + + diff --git a/docs/structtelebot__chat__member__updated.html b/docs/structtelebot__chat__member__updated.html new file mode 100644 index 0000000..3b5f35b --- /dev/null +++ b/docs/structtelebot__chat__member__updated.html @@ -0,0 +1,219 @@ + + + + + + + +Telebot: telebot_chat_member_updated Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_member_updated Struct Reference
+
+
+ +

This object represents changes in the status of a chat member. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + +

+Public Attributes

struct telebot_chatchat
 
struct telebot_userfrom
 
long date
 
struct telebot_chat_memberold_chat_member
 
struct telebot_chat_membernew_chat_member
 
struct telebot_chat_invite_linkinvite_link
 
bool via_chat_folder_invite_link
 
+

Detailed Description

+

This object represents changes in the status of a chat member.

+

Member Data Documentation

+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_chat_member_updated::chat
+
+

Chat the user belongs to

+ +
+
+ +

◆ date

+ +
+
+ + + + +
long telebot_chat_member_updated::date
+
+

Date the change was effected in Unix time

+ +
+
+ +

◆ from

+ +
+
+ + + + +
struct telebot_user* telebot_chat_member_updated::from
+
+

Performer of the action, which resulted in the change

+ +
+
+ +

◆ invite_link

+ +
+
+ + + + +
struct telebot_chat_invite_link* telebot_chat_member_updated::invite_link
+
+

Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.

+ +
+
+ +

◆ new_chat_member

+ +
+
+ + + + +
struct telebot_chat_member* telebot_chat_member_updated::new_chat_member
+
+

New information about the chat member

+ +
+
+ +

◆ old_chat_member

+ +
+
+ + + + +
struct telebot_chat_member* telebot_chat_member_updated::old_chat_member
+
+

Previous information about the chat member

+ +
+
+ +

◆ via_chat_folder_invite_link

+ +
+
+ + + + +
bool telebot_chat_member_updated::via_chat_folder_invite_link
+
+

Optional. True, if the user joined the chat via a chat folder invite link

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chat__permissions-members.html b/docs/structtelebot__chat__permissions-members.html index ae4d798..6f725f6 100644 --- a/docs/structtelebot__chat__permissions-members.html +++ b/docs/structtelebot__chat__permissions-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,34 +56,38 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_chat_permissions Member List
+
telebot_chat_permissions Member List
diff --git a/docs/structtelebot__chat__permissions.html b/docs/structtelebot__chat__permissions.html index 8375ace..9b5111e 100644 --- a/docs/structtelebot__chat__permissions.html +++ b/docs/structtelebot__chat__permissions.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_chat_permissions Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_chat_permissions Struct Reference
+
telebot_chat_permissions Struct Reference

@@ -73,30 +82,30 @@

#include <telebot-types.h>

- - + - + - + - + - + - + - + - +

+

Public Attributes

bool can_send_messages
bool can_send_messages
 
bool can_send_media_messages
bool can_send_media_messages
 
bool can_send_polls
bool can_send_polls
 
bool can_send_other_messages
bool can_send_other_messages
 
bool can_add_web_page_previews
bool can_add_web_page_previews
 
bool can_change_info
bool can_change_info
 
bool can_invite_users
bool can_invite_users
 
bool can_pin_messages
bool can_pin_messages
 

Detailed Description

Describes actions that a non-administrator user is allowed to take in a chat.

Member Data Documentation

- -

◆ can_add_web_page_previews

+ +

◆ can_add_web_page_previews

@@ -110,8 +119,8 @@

-

◆ can_change_info

+ +

◆ can_change_info

@@ -125,8 +134,8 @@

-

◆ can_invite_users

+ +

◆ can_invite_users

@@ -140,8 +149,8 @@

-

◆ can_pin_messages

+ +

◆ can_pin_messages

@@ -155,8 +164,8 @@

-

◆ can_send_media_messages

+ +

◆ can_send_media_messages

@@ -170,8 +179,8 @@

-

◆ can_send_messages

+ +

◆ can_send_messages

@@ -185,8 +194,8 @@

-

◆ can_send_other_messages

+ +

◆ can_send_other_messages

@@ -200,8 +209,8 @@

-

◆ can_send_polls

+ +

◆ can_send_polls

@@ -221,9 +230,7 @@

diff --git a/docs/structtelebot__chat__photo-members.html b/docs/structtelebot__chat__photo-members.html index c85c0d4..f87275b 100644 --- a/docs/structtelebot__chat__photo-members.html +++ b/docs/structtelebot__chat__photo-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,30 +56,34 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_chat_photo Member List
+
telebot_chat_photo Member List
diff --git a/docs/structtelebot__chat__photo.html b/docs/structtelebot__chat__photo.html index d0bdb44..4a5f874 100644 --- a/docs/structtelebot__chat__photo.html +++ b/docs/structtelebot__chat__photo.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_chat_photo Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_chat_photo Struct Reference
+
telebot_chat_photo Struct Reference

@@ -73,22 +82,22 @@

#include <telebot-types.h>

- - + - + - + - +

+

Public Attributes

char * small_file_id
char * small_file_id
 
char * small_file_unique_id
char * small_file_unique_id
 
char * big_file_id
char * big_file_id
 
char * big_file_unique_id
char * big_file_unique_id
 

Detailed Description

This object represents a chat photo.

Member Data Documentation

- -

◆ big_file_id

+ +

◆ big_file_id

@@ -102,8 +111,8 @@

-

◆ big_file_unique_id

+ +

◆ big_file_unique_id

@@ -117,8 +126,8 @@

-

◆ small_file_id

+ +

◆ small_file_id

@@ -132,8 +141,8 @@

-

◆ small_file_unique_id

+ +

◆ small_file_unique_id

@@ -153,9 +162,7 @@

diff --git a/docs/structtelebot__chat__shared-members.html b/docs/structtelebot__chat__shared-members.html new file mode 100644 index 0000000..7cdebd0 --- /dev/null +++ b/docs/structtelebot__chat__shared-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chat_shared Member List
+
+
+ +

This is the complete list of members for telebot_chat_shared, including all inherited members.

+ + + +
chat_idtelebot_chat_shared
request_idtelebot_chat_shared
+ + + + diff --git a/docs/structtelebot__chat__shared.html b/docs/structtelebot__chat__shared.html new file mode 100644 index 0000000..8dfd985 --- /dev/null +++ b/docs/structtelebot__chat__shared.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_chat_shared Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chat_shared Struct Reference
+
+
+ +

This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

int request_id
 
long long int chat_id
 
+

Detailed Description

+

This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.

+

Member Data Documentation

+ +

◆ chat_id

+ +
+
+ + + + +
long long int telebot_chat_shared::chat_id
+
+

Identifier of the shared chat.

+ +
+
+ +

◆ request_id

+ +
+
+ + + + +
int telebot_chat_shared::request_id
+
+

Identifier of the request

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__chosen__inline__result-members.html b/docs/structtelebot__chosen__inline__result-members.html new file mode 100644 index 0000000..411774c --- /dev/null +++ b/docs/structtelebot__chosen__inline__result-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_chosen_inline_result Member List
+
+ + + + + diff --git a/docs/structtelebot__chosen__inline__result.html b/docs/structtelebot__chosen__inline__result.html new file mode 100644 index 0000000..21a1951 --- /dev/null +++ b/docs/structtelebot__chosen__inline__result.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: telebot_chosen_inline_result Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_chosen_inline_result Struct Reference
+
+
+ +

Represents a result of an inline query that was chosen by the user and sent to their chat partner. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + +

+Public Attributes

char * result_id
 
struct telebot_userfrom
 
struct telebot_locationlocation
 
char * inline_message_id
 
char * query
 
+

Detailed Description

+

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

+

Member Data Documentation

+ +

◆ from

+ +
+
+ + + + +
struct telebot_user* telebot_chosen_inline_result::from
+
+

The user who chose the result

+ +
+
+ +

◆ inline_message_id

+ +
+
+ + + + +
char* telebot_chosen_inline_result::inline_message_id
+
+

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.

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_location* telebot_chosen_inline_result::location
+
+

Optional. Sender location, only for bots that request user location

+ +
+
+ +

◆ query

+ +
+
+ + + + +
char* telebot_chosen_inline_result::query
+
+

The query that was used to obtain the result

+ +
+
+ +

◆ result_id

+ +
+
+ + + + +
char* telebot_chosen_inline_result::result_id
+
+

The unique identifier for the result that was chosen

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__contact-members.html b/docs/structtelebot__contact-members.html index 630055f..101cbe3 100644 --- a/docs/structtelebot__contact-members.html +++ b/docs/structtelebot__contact-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,31 +56,35 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_contact Member List
+
telebot_contact Member List
diff --git a/docs/structtelebot__contact.html b/docs/structtelebot__contact.html index 6abc7db..b6e21ab 100644 --- a/docs/structtelebot__contact.html +++ b/docs/structtelebot__contact.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_contact Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_contact Struct Reference
+
telebot_contact Struct Reference

@@ -73,24 +82,24 @@

#include <telebot-types.h>

- - + - + - + - + - +

+

Public Attributes

char * phone_number
char * phone_number
 
char * first_name
char * first_name
 
char * last_name
char * last_name
 
int user_id
int user_id
 
char * vcard
char * vcard
 

Detailed Description

This object represents a phone contact.

Member Data Documentation

- -

◆ first_name

+ +

◆ first_name

@@ -104,8 +113,8 @@

-

◆ last_name

+ +

◆ last_name

@@ -119,8 +128,8 @@

-

◆ phone_number

+ +

◆ phone_number

@@ -134,8 +143,8 @@

-

◆ user_id

+ +

◆ user_id

@@ -149,8 +158,8 @@

-

◆ vcard

+ +

◆ vcard

@@ -170,9 +179,7 @@

diff --git a/docs/structtelebot__copy__text__button-members.html b/docs/structtelebot__copy__text__button-members.html new file mode 100644 index 0000000..d9c1690 --- /dev/null +++ b/docs/structtelebot__copy__text__button-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_copy_text_button Member List
+
+
+ +

This is the complete list of members for telebot_copy_text_button, including all inherited members.

+ + +
texttelebot_copy_text_button
+ + + + diff --git a/docs/structtelebot__copy__text__button.html b/docs/structtelebot__copy__text__button.html new file mode 100644 index 0000000..b58d713 --- /dev/null +++ b/docs/structtelebot__copy__text__button.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_copy_text_button Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_copy_text_button Struct Reference
+
+
+ +

This object represents an inline keyboard button that copies specified text to the clipboard. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

char * text
 
+

Detailed Description

+

This object represents an inline keyboard button that copies specified text to the clipboard.

+

Member Data Documentation

+ +

◆ text

+ +
+
+ + + + +
char* telebot_copy_text_button::text
+
+

The text to be copied to the clipboard; 1-256 characters

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__core__handler.html b/docs/structtelebot__core__handler.html deleted file mode 100644 index a5d9ada..0000000 --- a/docs/structtelebot__core__handler.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -Telebot: telebot_core_handler Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Telebot -  4.7.0 -
-
Library for Telegram bot API
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
-
telebot_core_handler Struct Reference
-
-
- -

This object represents a core telebot handler. - More...

- -

#include <telebot-core.h>

- - - - - - - - -

-Public Attributes

char * token
 
-char * proxy_addr
 
-char * proxy_auth
 
-

Detailed Description

-

This object represents a core telebot handler.

-

Member Data Documentation

- -

◆ token

- -
-
- - - - -
char* telebot_core_handler::token
-
-

Telegam bot token

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/structtelebot__core__response.html b/docs/structtelebot__core__response.html deleted file mode 100644 index ba5fe0a..0000000 --- a/docs/structtelebot__core__response.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - -Telebot: telebot_core_response Struct Reference - - - - - - - - - -
-
- - - - - - -
-
Telebot -  4.7.0 -
-
Library for Telegram bot API
-
-
- - - - - - - - -
-
- - -
- -
- -
-
- -
-
telebot_core_response Struct Reference
-
-
- -

This object represents a telegram bot response. - More...

- -

#include <telebot-core.h>

- - - - - - -

-Public Attributes

size_t size
 
char * data
 
-

Detailed Description

-

This object represents a telegram bot response.

-

Member Data Documentation

- -

◆ data

- -
-
- - - - -
char* telebot_core_response::data
-
-

Telegam bot response object

- -
-
- -

◆ size

- -
-
- - - - -
size_t telebot_core_response::size
-
-

Telegam bot response size

- -
-
-
The documentation for this struct was generated from the following file: -
- - - - diff --git a/docs/structtelebot__dice-members.html b/docs/structtelebot__dice-members.html index b925d61..ea6aab9 100644 --- a/docs/structtelebot__dice-members.html +++ b/docs/structtelebot__dice-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,15 +56,21 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_dice Member List
+
telebot_dice Member List
@@ -71,9 +80,7 @@
diff --git a/docs/structtelebot__dice.html b/docs/structtelebot__dice.html index a5fccf0..c014784 100644 --- a/docs/structtelebot__dice.html +++ b/docs/structtelebot__dice.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_dice Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_dice Struct Reference
+
telebot_dice Struct Reference

@@ -73,16 +82,16 @@

#include <telebot-types.h>

- - +

+

Public Attributes

int value
int value
 

Detailed Description

This object represents a dice with random value from 1 to 6.

Member Data Documentation

- -

◆ value

+ +

◆ value

@@ -102,9 +111,7 @@

diff --git a/docs/structtelebot__document-members.html b/docs/structtelebot__document-members.html index 8392510..e9a0814 100644 --- a/docs/structtelebot__document-members.html +++ b/docs/structtelebot__document-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,32 +56,36 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_document Member List
+
telebot_document Member List
diff --git a/docs/structtelebot__document.html b/docs/structtelebot__document.html index dbe9eb7..ab4e2c0 100644 --- a/docs/structtelebot__document.html +++ b/docs/structtelebot__document.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_document Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_document Struct Reference
+
telebot_document Struct Reference
@@ -73,26 +82,26 @@

#include <telebot-types.h>

- - + - + - + - + - + - +

+

Public Attributes

char * file_id
char * file_id
 
char * file_unique_id
char * file_unique_id
 
struct telebot_photothumb
struct telebot_photothumb
 
char * file_name
char * file_name
 
char * mime_type
char * mime_type
 
int file_size
int file_size
 

Detailed Description

This object represents a general file (as opposed to photos, voice messages and audio files).

Member Data Documentation

- -

◆ file_id

+ +

◆ file_id

@@ -106,8 +115,8 @@

-

◆ file_name

+ +

◆ file_name

@@ -121,8 +130,8 @@

-

◆ file_size

+ +

◆ file_size

@@ -136,8 +145,8 @@

-

◆ file_unique_id

+ +

◆ file_unique_id

@@ -151,8 +160,8 @@

-

◆ mime_type

+ +

◆ mime_type

@@ -166,8 +175,8 @@

-

◆ thumb

+ +

◆ thumb

@@ -187,9 +196,7 @@

diff --git a/docs/structtelebot__encrypted__credentials-members.html b/docs/structtelebot__encrypted__credentials-members.html new file mode 100644 index 0000000..6dc84e3 --- /dev/null +++ b/docs/structtelebot__encrypted__credentials-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_encrypted_credentials Member List
+
+
+ +

This is the complete list of members for telebot_encrypted_credentials, including all inherited members.

+ + + + +
datatelebot_encrypted_credentials
hashtelebot_encrypted_credentials
secrettelebot_encrypted_credentials
+ + + + diff --git a/docs/structtelebot__encrypted__credentials.html b/docs/structtelebot__encrypted__credentials.html new file mode 100644 index 0000000..13fc94e --- /dev/null +++ b/docs/structtelebot__encrypted__credentials.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_encrypted_credentials Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_encrypted_credentials Struct Reference
+
+
+ +

This object represents credentials required to decrypt the data. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

char * data
 
char * hash
 
char * secret
 
+

Detailed Description

+

This object represents credentials required to decrypt the data.

+

Member Data Documentation

+ +

◆ data

+ +
+
+ + + + +
char* telebot_encrypted_credentials::data
+
+

Base64-encoded encrypted JSON-serialized data with unique user's payload

+ +
+
+ +

◆ hash

+ +
+
+ + + + +
char* telebot_encrypted_credentials::hash
+
+

Base64-encoded data hash

+ +
+
+ +

◆ secret

+ +
+
+ + + + +
char* telebot_encrypted_credentials::secret
+
+

Base64-encoded secret used for data decryption

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__encrypted__passport__element-members.html b/docs/structtelebot__encrypted__passport__element-members.html new file mode 100644 index 0000000..c98dcb5 --- /dev/null +++ b/docs/structtelebot__encrypted__passport__element-members.html @@ -0,0 +1,97 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_encrypted_passport_element Member List
+
+ + + + + diff --git a/docs/structtelebot__encrypted__passport__element.html b/docs/structtelebot__encrypted__passport__element.html new file mode 100644 index 0000000..5566d99 --- /dev/null +++ b/docs/structtelebot__encrypted__passport__element.html @@ -0,0 +1,276 @@ + + + + + + + +Telebot: telebot_encrypted_passport_element Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_encrypted_passport_element Struct Reference
+
+
+ +

This object represents one element of the Telegram Passport data. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

char * type
 
char * data
 
char * phone_number
 
char * email
 
struct telebot_passport_filefiles
 
+int count_files
 
struct telebot_passport_filefront_side
 
struct telebot_passport_filereverse_side
 
struct telebot_passport_fileselfie
 
struct telebot_passport_filetranslation
 
+int count_translation
 
char * hash
 
+

Detailed Description

+

This object represents one element of the Telegram Passport data.

+

Member Data Documentation

+ +

◆ data

+ +
+
+ + + + +
char* telebot_encrypted_passport_element::data
+
+

Optional. Base64-encoded encrypted Telegram Passport element data provided by the user.

+ +
+
+ +

◆ email

+ +
+
+ + + + +
char* telebot_encrypted_passport_element::email
+
+

Optional. User's verified email address.

+ +
+
+ +

◆ files

+ +
+
+ + + + +
struct telebot_passport_file* telebot_encrypted_passport_element::files
+
+

Optional. Array of encrypted files with documents provided by the user.

+ +
+
+ +

◆ front_side

+ +
+
+ + + + +
struct telebot_passport_file* telebot_encrypted_passport_element::front_side
+
+

Optional. Encrypted file with the front side of the document.

+ +
+
+ +

◆ hash

+ +
+
+ + + + +
char* telebot_encrypted_passport_element::hash
+
+

Base64-encoded element hash for using in PassportElementErrorUnspecified

+ +
+
+ +

◆ phone_number

+ +
+
+ + + + +
char* telebot_encrypted_passport_element::phone_number
+
+

Optional. User's verified phone number.

+ +
+
+ +

◆ reverse_side

+ +
+
+ + + + +
struct telebot_passport_file* telebot_encrypted_passport_element::reverse_side
+
+

Optional. Encrypted file with the reverse side of the document.

+ +
+
+ +

◆ selfie

+ +
+
+ + + + +
struct telebot_passport_file* telebot_encrypted_passport_element::selfie
+
+

Optional. Encrypted file with the selfie of the user holding a document.

+ +
+
+ +

◆ translation

+ +
+
+ + + + +
struct telebot_passport_file* telebot_encrypted_passport_element::translation
+
+

Optional. Array of encrypted files with translated versions of documents.

+ +
+
+ +

◆ type

+ +
+
+ + + + +
char* telebot_encrypted_passport_element::type
+
+

Element type. One of "personal_details", "passport", "internal_passport", "driver_license", "id_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email".

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__external__reply__info-members.html b/docs/structtelebot__external__reply__info-members.html new file mode 100644 index 0000000..735db33 --- /dev/null +++ b/docs/structtelebot__external__reply__info-members.html @@ -0,0 +1,110 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_external_reply_info Member List
+
+ + + + + diff --git a/docs/structtelebot__external__reply__info.html b/docs/structtelebot__external__reply__info.html new file mode 100644 index 0000000..88d2224 --- /dev/null +++ b/docs/structtelebot__external__reply__info.html @@ -0,0 +1,511 @@ + + + + + + + +Telebot: telebot_external_reply_info Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_external_reply_info Struct Reference
+
+
+ +

This object contains information about the message that is being replied to, which may come from another chat or forum topic. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

struct telebot_message_origin origin
 
struct telebot_chatchat
 
int message_id
 
struct telebot_link_preview_optionslink_preview_options
 
struct telebot_animationanimation
 
struct telebot_audioaudio
 
struct telebot_documentdocument
 
struct telebot_paid_media_infopaid_media
 
struct telebot_photophotos
 
+int count_photos
 
struct telebot_stickersticker
 
struct telebot_storystory
 
struct telebot_videovideo
 
struct telebot_video_notevideo_note
 
struct telebot_voicevoice
 
bool has_media_spoiler
 
struct telebot_contactcontact
 
struct telebot_dicedice
 
struct telebot_gamegame
 
struct telebot_giveawaygiveaway
 
struct telebot_giveaway_winnersgiveaway_winners
 
struct telebot_invoiceinvoice
 
struct telebot_locationlocation
 
struct telebot_pollpoll
 
struct telebot_venuevenue
 
+

Detailed Description

+

This object contains information about the message that is being replied to, which may come from another chat or forum topic.

+

Member Data Documentation

+ +

◆ animation

+ +
+
+ + + + +
struct telebot_animation* telebot_external_reply_info::animation
+
+

Optional. Message is an animation, information about the animation

+ +
+
+ +

◆ audio

+ +
+
+ + + + +
struct telebot_audio* telebot_external_reply_info::audio
+
+

Optional. Message is an audio file, information about the file

+ +
+
+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_external_reply_info::chat
+
+

Optional. Chat the original message belongs to.

+ +
+
+ +

◆ contact

+ +
+
+ + + + +
struct telebot_contact* telebot_external_reply_info::contact
+
+

Optional. Message is a shared contact, information about the contact

+ +
+
+ +

◆ dice

+ +
+
+ + + + +
struct telebot_dice* telebot_external_reply_info::dice
+
+

Optional. Message is a dice with random value

+ +
+
+ +

◆ document

+ +
+
+ + + + +
struct telebot_document* telebot_external_reply_info::document
+
+

Optional. Message is a general file, information about the file

+ +
+
+ +

◆ game

+ +
+
+ + + + +
struct telebot_game* telebot_external_reply_info::game
+
+

Optional. Message is a game, information about the game.

+ +
+
+ +

◆ giveaway

+ +
+
+ + + + +
struct telebot_giveaway* telebot_external_reply_info::giveaway
+
+

Optional. Message is a giveaway, information about the giveaway

+ +
+
+ +

◆ giveaway_winners

+ +
+
+ + + + +
struct telebot_giveaway_winners* telebot_external_reply_info::giveaway_winners
+
+

Optional. A giveaway with public winners was completed

+ +
+
+ +

◆ has_media_spoiler

+ +
+
+ + + + +
bool telebot_external_reply_info::has_media_spoiler
+
+

Optional. True, if the message media is covered by a spoiler animation

+ +
+
+ +

◆ invoice

+ +
+
+ + + + +
struct telebot_invoice* telebot_external_reply_info::invoice
+
+

Optional. Message is an invoice for a payment, information about the invoice.

+ +
+
+ +

◆ link_preview_options

+ +
+
+ + + + +
struct telebot_link_preview_options* telebot_external_reply_info::link_preview_options
+
+

Optional. Options used for link preview generation for the original message

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_location* telebot_external_reply_info::location
+
+

Optional. Message is a shared location, information about the location

+ +
+
+ +

◆ message_id

+ +
+
+ + + + +
int telebot_external_reply_info::message_id
+
+

Optional. Unique message identifier inside the original chat.

+ +
+
+ +

◆ origin

+ +
+
+ + + + +
struct telebot_message_origin telebot_external_reply_info::origin
+
+

Origin of the message replied to by the given message

+ +
+
+ +

◆ paid_media

+ +
+
+ + + + +
struct telebot_paid_media_info* telebot_external_reply_info::paid_media
+
+

Optional. Message contains paid media; information about the paid media

+ +
+
+ +

◆ photos

+ +
+
+ + + + +
struct telebot_photo* telebot_external_reply_info::photos
+
+

Optional. Message is a photo, available sizes of the photo

+ +
+
+ +

◆ poll

+ +
+
+ + + + +
struct telebot_poll* telebot_external_reply_info::poll
+
+

Optional. Message is a native poll, information about the poll

+ +
+
+ +

◆ sticker

+ +
+
+ + + + +
struct telebot_sticker* telebot_external_reply_info::sticker
+
+

Optional. Message is a sticker, information about the sticker

+ +
+
+ +

◆ story

+ +
+
+ + + + +
struct telebot_story* telebot_external_reply_info::story
+
+

Optional. Message is a forwarded story

+ +
+
+ +

◆ venue

+ +
+
+ + + + +
struct telebot_venue* telebot_external_reply_info::venue
+
+

Optional. Message is a venue, information about the venue

+ +
+
+ +

◆ video

+ +
+
+ + + + +
struct telebot_video* telebot_external_reply_info::video
+
+

Optional. Message is a video, information about the video

+ +
+
+ +

◆ video_note

+ +
+
+ + + + +
struct telebot_video_note* telebot_external_reply_info::video_note
+
+

Optional. Message is a video note, information about the video message

+ +
+
+ +

◆ voice

+ +
+
+ + + + +
struct telebot_voice* telebot_external_reply_info::voice
+
+

Optional. Message is a voice message, information about the file

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__file-members.html b/docs/structtelebot__file-members.html index d0f33da..09a4751 100644 --- a/docs/structtelebot__file-members.html +++ b/docs/structtelebot__file-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,30 +56,34 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_file Member List
+
telebot_file Member List
diff --git a/docs/structtelebot__file.html b/docs/structtelebot__file.html index 41e86aa..6eba66b 100644 --- a/docs/structtelebot__file.html +++ b/docs/structtelebot__file.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_file Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_file Struct Reference
+
telebot_file Struct Reference

@@ -73,23 +82,23 @@

#include <telebot-types.h>

- - + - + - + - +

+

Public Attributes

char * file_id
char * file_id
 
char * file_unique_id
char * file_unique_id
 
int file_size
int file_size
 
char * file_path
char * file_path
 

Detailed Description

This object represents a file ready to be downloaded.

The file can be downloaded via the link https://api.telegram.org/file/bot[token]/[file_path]. 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. Maximum file size to download is 20 MB.

Member Data Documentation

- -

◆ file_id

+ +

◆ file_id

@@ -103,8 +112,8 @@

-

◆ file_path

+ +

◆ file_path

@@ -118,8 +127,8 @@

-

◆ file_size

+ +

◆ file_size

@@ -133,8 +142,8 @@

-

◆ file_unique_id

+ +

◆ file_unique_id

@@ -154,9 +163,7 @@

diff --git a/docs/structtelebot__force__reply-members.html b/docs/structtelebot__force__reply-members.html index 974df2f..1871d9d 100644 --- a/docs/structtelebot__force__reply-members.html +++ b/docs/structtelebot__force__reply-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,28 +56,32 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_force_reply Member List
+
telebot_force_reply Member List

This is the complete list of members for telebot_force_reply, including all inherited members.

- +
force_replytelebot_force_reply
selectivetelebot_force_reply
selectivetelebot_force_reply
diff --git a/docs/structtelebot__force__reply.html b/docs/structtelebot__force__reply.html index 2d9bb77..52535a3 100644 --- a/docs/structtelebot__force__reply.html +++ b/docs/structtelebot__force__reply.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_force_reply Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_force_reply Struct Reference
+
telebot_force_reply Struct Reference

@@ -73,18 +82,18 @@

#include <telebot-types.h>

- - + - +

+

Public Attributes

bool force_reply
bool force_reply
 
bool selective
bool selective
 

Detailed Description

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.

Member Data Documentation

- -

◆ force_reply

+ +

◆ force_reply

@@ -98,8 +107,8 @@

-

◆ selective

+ +

◆ selective

@@ -119,9 +128,7 @@

diff --git a/docs/structtelebot__forum__topic-members.html b/docs/structtelebot__forum__topic-members.html new file mode 100644 index 0000000..5615f67 --- /dev/null +++ b/docs/structtelebot__forum__topic-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_forum_topic Member List
+
+ + + + + diff --git a/docs/structtelebot__forum__topic.html b/docs/structtelebot__forum__topic.html new file mode 100644 index 0000000..788703f --- /dev/null +++ b/docs/structtelebot__forum__topic.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_forum_topic Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_forum_topic Struct Reference
+
+
+ +

This object represents a forum topic. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

int message_thread_id
 
char * name
 
int icon_color
 
char * icon_custom_emoji_id
 
+

Detailed Description

+

This object represents a forum topic.

+

Member Data Documentation

+ +

◆ icon_color

+ +
+
+ + + + +
int telebot_forum_topic::icon_color
+
+

Color of the topic icon in RGB format

+ +
+
+ +

◆ icon_custom_emoji_id

+ +
+
+ + + + +
char* telebot_forum_topic::icon_custom_emoji_id
+
+

Optional. Unique identifier of the custom emoji used as the topic icon

+ +
+
+ +

◆ message_thread_id

+ +
+
+ + + + +
int telebot_forum_topic::message_thread_id
+
+

Unique identifier of the forum topic

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char* telebot_forum_topic::name
+
+

Name of the topic

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__forum__topic__closed-members.html b/docs/structtelebot__forum__topic__closed-members.html new file mode 100644 index 0000000..67da548 --- /dev/null +++ b/docs/structtelebot__forum__topic__closed-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_forum_topic_closed Member List
+
+
+ +

This is the complete list of members for telebot_forum_topic_closed, including all inherited members.

+ + +
dummytelebot_forum_topic_closed
+ + + + diff --git a/docs/structtelebot__forum__topic__closed.html b/docs/structtelebot__forum__topic__closed.html new file mode 100644 index 0000000..a38ae4e --- /dev/null +++ b/docs/structtelebot__forum__topic__closed.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_forum_topic_closed Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_forum_topic_closed Struct Reference
+
+
+ +

This object represents a service message about a forum topic closed in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

bool dummy
 
+

Detailed Description

+

This object represents a service message about a forum topic closed in the chat.

+

Member Data Documentation

+ +

◆ dummy

+ +
+
+ + + + +
bool telebot_forum_topic_closed::dummy
+
+

Empty struct as per Telegram API

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__forum__topic__created-members.html b/docs/structtelebot__forum__topic__created-members.html new file mode 100644 index 0000000..4e37457 --- /dev/null +++ b/docs/structtelebot__forum__topic__created-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_forum_topic_created Member List
+
+ + + + + diff --git a/docs/structtelebot__forum__topic__created.html b/docs/structtelebot__forum__topic__created.html new file mode 100644 index 0000000..66879a6 --- /dev/null +++ b/docs/structtelebot__forum__topic__created.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_forum_topic_created Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_forum_topic_created Struct Reference
+
+
+ +

This object represents a service message about a new forum topic created in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

char * name
 
int icon_color
 
char * icon_custom_emoji_id
 
+

Detailed Description

+

This object represents a service message about a new forum topic created in the chat.

+

Member Data Documentation

+ +

◆ icon_color

+ +
+
+ + + + +
int telebot_forum_topic_created::icon_color
+
+

Color of the topic icon in RGB format

+ +
+
+ +

◆ icon_custom_emoji_id

+ +
+
+ + + + +
char* telebot_forum_topic_created::icon_custom_emoji_id
+
+

Optional. Unique identifier of the custom emoji used as the topic icon

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char* telebot_forum_topic_created::name
+
+

Name of the topic

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__forum__topic__edited-members.html b/docs/structtelebot__forum__topic__edited-members.html new file mode 100644 index 0000000..61b74d6 --- /dev/null +++ b/docs/structtelebot__forum__topic__edited-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_forum_topic_edited Member List
+
+
+ +

This is the complete list of members for telebot_forum_topic_edited, including all inherited members.

+ + + +
icon_custom_emoji_idtelebot_forum_topic_edited
nametelebot_forum_topic_edited
+ + + + diff --git a/docs/structtelebot__forum__topic__edited.html b/docs/structtelebot__forum__topic__edited.html new file mode 100644 index 0000000..4456b9d --- /dev/null +++ b/docs/structtelebot__forum__topic__edited.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_forum_topic_edited Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_forum_topic_edited Struct Reference
+
+
+ +

This object represents a service message about a forum topic edited in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

char * name
 
char * icon_custom_emoji_id
 
+

Detailed Description

+

This object represents a service message about a forum topic edited in the chat.

+

Member Data Documentation

+ +

◆ icon_custom_emoji_id

+ +
+
+ + + + +
char* telebot_forum_topic_edited::icon_custom_emoji_id
+
+

Optional. New identifier of the custom emoji used as the topic icon, if it was edited

+ +
+
+ +

◆ name

+ +
+
+ + + + +
char* telebot_forum_topic_edited::name
+
+

Optional. New name of the topic, if it was edited

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__forum__topic__reopened-members.html b/docs/structtelebot__forum__topic__reopened-members.html new file mode 100644 index 0000000..bc2d0f8 --- /dev/null +++ b/docs/structtelebot__forum__topic__reopened-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_forum_topic_reopened Member List
+
+
+ +

This is the complete list of members for telebot_forum_topic_reopened, including all inherited members.

+ + +
dummytelebot_forum_topic_reopened
+ + + + diff --git a/docs/structtelebot__forum__topic__reopened.html b/docs/structtelebot__forum__topic__reopened.html new file mode 100644 index 0000000..9081f67 --- /dev/null +++ b/docs/structtelebot__forum__topic__reopened.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_forum_topic_reopened Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_forum_topic_reopened Struct Reference
+
+
+ +

This object represents a service message about a forum topic reopened in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

bool dummy
 
+

Detailed Description

+

This object represents a service message about a forum topic reopened in the chat.

+

Member Data Documentation

+ +

◆ dummy

+ +
+
+ + + + +
bool telebot_forum_topic_reopened::dummy
+
+

Empty struct as per Telegram API

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__game-members.html b/docs/structtelebot__game-members.html new file mode 100644 index 0000000..7384771 --- /dev/null +++ b/docs/structtelebot__game-members.html @@ -0,0 +1,93 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_game Member List
+
+
+ +

This is the complete list of members for telebot_game, including all inherited members.

+ + + + + + + + + +
animationtelebot_game
count_phototelebot_game
count_text_entities (defined in telebot_game)telebot_game
descriptiontelebot_game
phototelebot_game
texttelebot_game
text_entitiestelebot_game
titletelebot_game
+ + + + diff --git a/docs/structtelebot__game.html b/docs/structtelebot__game.html new file mode 100644 index 0000000..ac55ada --- /dev/null +++ b/docs/structtelebot__game.html @@ -0,0 +1,222 @@ + + + + + + + +Telebot: telebot_game Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_game Struct Reference
+
+
+ +

This object represents a game. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + +

+Public Attributes

char * title
 
char * description
 
struct telebot_photophoto
 
int count_photo
 
char * text
 
struct telebot_message_entitytext_entities
 
+int count_text_entities
 
struct telebot_animationanimation
 
+

Detailed Description

+

This object represents a game.

+

Member Data Documentation

+ +

◆ animation

+ +
+
+ + + + +
struct telebot_animation* telebot_game::animation
+
+

Optional. Animation that will be displayed in the game message in chats.

+ +
+
+ +

◆ count_photo

+ +
+
+ + + + +
int telebot_game::count_photo
+
+

Number of photos

+ +
+
+ +

◆ description

+ +
+
+ + + + +
char* telebot_game::description
+
+

Description of the game

+ +
+
+ +

◆ photo

+ +
+
+ + + + +
struct telebot_photo* telebot_game::photo
+
+

Photo that will be displayed in the game message in chats.

+ +
+
+ +

◆ text

+ +
+
+ + + + +
char* telebot_game::text
+
+

Optional. Brief description of the game or high scores included in the game message.

+ +
+
+ +

◆ text_entities

+ +
+
+ + + + +
struct telebot_message_entity* telebot_game::text_entities
+
+

Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.

+ +
+
+ +

◆ title

+ +
+
+ + + + +
char* telebot_game::title
+
+

Title of the game

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__game__high__score-members.html b/docs/structtelebot__game__high__score-members.html new file mode 100644 index 0000000..ad96423 --- /dev/null +++ b/docs/structtelebot__game__high__score-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_game_high_score Member List
+
+
+ +

This is the complete list of members for telebot_game_high_score, including all inherited members.

+ + + + +
positiontelebot_game_high_score
scoretelebot_game_high_score
usertelebot_game_high_score
+ + + + diff --git a/docs/structtelebot__game__high__score.html b/docs/structtelebot__game__high__score.html new file mode 100644 index 0000000..7943189 --- /dev/null +++ b/docs/structtelebot__game__high__score.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_game_high_score Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_game_high_score Struct Reference
+
+
+ +

This object represents a game high score row. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

int position
 
struct telebot_useruser
 
int score
 
+

Detailed Description

+

This object represents a game high score row.

+

Member Data Documentation

+ +

◆ position

+ +
+
+ + + + +
int telebot_game_high_score::position
+
+

Position in high score table for the game

+ +
+
+ +

◆ score

+ +
+
+ + + + +
int telebot_game_high_score::score
+
+

Score

+ +
+
+ +

◆ user

+ +
+
+ + + + +
struct telebot_user* telebot_game_high_score::user
+
+

User

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__general__forum__topic__hidden-members.html b/docs/structtelebot__general__forum__topic__hidden-members.html new file mode 100644 index 0000000..7436165 --- /dev/null +++ b/docs/structtelebot__general__forum__topic__hidden-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_general_forum_topic_hidden Member List
+
+
+ +

This is the complete list of members for telebot_general_forum_topic_hidden, including all inherited members.

+ + +
dummytelebot_general_forum_topic_hidden
+ + + + diff --git a/docs/structtelebot__general__forum__topic__hidden.html b/docs/structtelebot__general__forum__topic__hidden.html new file mode 100644 index 0000000..b6ff8bb --- /dev/null +++ b/docs/structtelebot__general__forum__topic__hidden.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_general_forum_topic_hidden Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_general_forum_topic_hidden Struct Reference
+
+
+ +

This object represents a service message about a general forum topic hidden in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

bool dummy
 
+

Detailed Description

+

This object represents a service message about a general forum topic hidden in the chat.

+

Member Data Documentation

+ +

◆ dummy

+ +
+
+ + + + +
bool telebot_general_forum_topic_hidden::dummy
+
+

Empty struct as per Telegram API

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__general__forum__topic__unhidden-members.html b/docs/structtelebot__general__forum__topic__unhidden-members.html new file mode 100644 index 0000000..d94ba0e --- /dev/null +++ b/docs/structtelebot__general__forum__topic__unhidden-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_general_forum_topic_unhidden Member List
+
+
+ +

This is the complete list of members for telebot_general_forum_topic_unhidden, including all inherited members.

+ + +
dummytelebot_general_forum_topic_unhidden
+ + + + diff --git a/docs/structtelebot__general__forum__topic__unhidden.html b/docs/structtelebot__general__forum__topic__unhidden.html new file mode 100644 index 0000000..2b98e26 --- /dev/null +++ b/docs/structtelebot__general__forum__topic__unhidden.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_general_forum_topic_unhidden Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_general_forum_topic_unhidden Struct Reference
+
+
+ +

This object represents a service message about a general forum topic unhidden in the chat. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

bool dummy
 
+

Detailed Description

+

This object represents a service message about a general forum topic unhidden in the chat.

+

Member Data Documentation

+ +

◆ dummy

+ +
+
+ + + + +
bool telebot_general_forum_topic_unhidden::dummy
+
+

Empty struct as per Telegram API

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__gift-members.html b/docs/structtelebot__gift-members.html new file mode 100644 index 0000000..73cffce --- /dev/null +++ b/docs/structtelebot__gift-members.html @@ -0,0 +1,93 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_gift Member List
+
+ + + + + diff --git a/docs/structtelebot__gift.html b/docs/structtelebot__gift.html new file mode 100644 index 0000000..1f6a6e0 --- /dev/null +++ b/docs/structtelebot__gift.html @@ -0,0 +1,236 @@ + + + + + + + +Telebot: telebot_gift Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_gift Struct Reference
+
+
+ +

This object represents a gift that can be sent by the bot. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + +

+Public Attributes

char * id
 
struct telebot_stickersticker
 
int star_count
 
int upgrade_star_count
 
bool is_premium
 
bool has_colors
 
int total_count
 
int remaining_count
 
+

Detailed Description

+

This object represents a gift that can be sent by the bot.

+

Member Data Documentation

+ +

◆ has_colors

+ +
+
+ + + + +
bool telebot_gift::has_colors
+
+

Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance

+ +
+
+ +

◆ id

+ +
+
+ + + + +
char* telebot_gift::id
+
+

Unique identifier of the gift

+ +
+
+ +

◆ is_premium

+ +
+
+ + + + +
bool telebot_gift::is_premium
+
+

Optional. True, if the gift can only be purchased by Telegram Premium subscribers

+ +
+
+ +

◆ remaining_count

+ +
+
+ + + + +
int telebot_gift::remaining_count
+
+

Optional. The number of remaining gifts

+ +
+
+ +

◆ star_count

+ +
+
+ + + + +
int telebot_gift::star_count
+
+

The number of Telegram Stars that must be paid to send the sticker

+ +
+
+ +

◆ sticker

+ +
+
+ + + + +
struct telebot_sticker* telebot_gift::sticker
+
+

The sticker that represents the gift

+ +
+
+ +

◆ total_count

+ +
+
+ + + + +
int telebot_gift::total_count
+
+

Optional. The total number of gifts of this type that can be sent

+ +
+
+ +

◆ upgrade_star_count

+ +
+
+ + + + +
int telebot_gift::upgrade_star_count
+
+

Optional. The number of Telegram Stars that must be paid to upgrade the gift

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__gift__info-members.html b/docs/structtelebot__gift__info-members.html new file mode 100644 index 0000000..17caaf6 --- /dev/null +++ b/docs/structtelebot__gift__info-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_gift_info Member List
+
+
+ +

This is the complete list of members for telebot_gift_info, including all inherited members.

+ + + + + + +
count_entities (defined in telebot_gift_info)telebot_gift_info
entitiestelebot_gift_info
gifttelebot_gift_info
is_privatetelebot_gift_info
texttelebot_gift_info
+ + + + diff --git a/docs/structtelebot__gift__info.html b/docs/structtelebot__gift__info.html new file mode 100644 index 0000000..2a7f099 --- /dev/null +++ b/docs/structtelebot__gift__info.html @@ -0,0 +1,171 @@ + + + + + + + +Telebot: telebot_gift_info Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_gift_info Struct Reference
+
+
+ +

Describes a regular gift that was sent or received. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + +

+Public Attributes

struct telebot_gift gift
 
char * text
 
struct telebot_message_entityentities
 
+int count_entities
 
bool is_private
 
+

Detailed Description

+

Describes a regular gift that was sent or received.

+

Member Data Documentation

+ +

◆ entities

+ +
+
+ + + + +
struct telebot_message_entity* telebot_gift_info::entities
+
+

Optional. Special entities that appear in the text

+ +
+
+ +

◆ gift

+ +
+
+ + + + +
struct telebot_gift telebot_gift_info::gift
+
+

Information about the gift

+ +
+
+ +

◆ is_private

+ +
+
+ + + + +
bool telebot_gift_info::is_private
+
+

Optional. True, if the sender and gift text are shown only to the receiver

+ +
+
+ +

◆ text

+ +
+
+ + + + +
char* telebot_gift_info::text
+
+

Optional. Message text added to the gift

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__gifts-members.html b/docs/structtelebot__gifts-members.html new file mode 100644 index 0000000..507531d --- /dev/null +++ b/docs/structtelebot__gifts-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_gifts Member List
+
+
+ +

This is the complete list of members for telebot_gifts, including all inherited members.

+ + + +
counttelebot_gifts
giftstelebot_gifts
+ + + + diff --git a/docs/structtelebot__gifts.html b/docs/structtelebot__gifts.html new file mode 100644 index 0000000..0993b24 --- /dev/null +++ b/docs/structtelebot__gifts.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_gifts Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_gifts Struct Reference
+
+
+ +

This object represent a list of gifts. + More...

+ +

#include <telebot-types.h>

+ + + + + + +

+Public Attributes

telebot_gift_tgifts
 
int count
 
+

Detailed Description

+

This object represent a list of gifts.

+

Member Data Documentation

+ +

◆ count

+ +
+
+ + + + +
int telebot_gifts::count
+
+

Number of gifts

+ +
+
+ +

◆ gifts

+ +
+
+ + + + +
telebot_gift_t* telebot_gifts::gifts
+
+

The list of gifts

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__giveaway-members.html b/docs/structtelebot__giveaway-members.html new file mode 100644 index 0000000..825cf80 --- /dev/null +++ b/docs/structtelebot__giveaway-members.html @@ -0,0 +1,96 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_giveaway Member List
+
+ + + + + diff --git a/docs/structtelebot__giveaway.html b/docs/structtelebot__giveaway.html new file mode 100644 index 0000000..965b096 --- /dev/null +++ b/docs/structtelebot__giveaway.html @@ -0,0 +1,259 @@ + + + + + + + +Telebot: telebot_giveaway Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_giveaway Struct Reference
+
+
+ +

This object represents a message about a scheduled giveaway. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

struct telebot_chatchats
 
+int count_chats
 
long winners_selection_date
 
int winner_count
 
bool only_new_members
 
bool has_public_winners
 
char * prize_description
 
char ** country_codes
 
+int count_country_codes
 
int prize_star_count
 
int premium_subscription_month_count
 
+

Detailed Description

+

This object represents a message about a scheduled giveaway.

+

Member Data Documentation

+ +

◆ chats

+ +
+
+ + + + +
struct telebot_chat* telebot_giveaway::chats
+
+

The list of chats which the user must join to participate in the giveaway

+ +
+
+ +

◆ country_codes

+ +
+
+ + + + +
char** telebot_giveaway::country_codes
+
+

Optional. A list of two-letter ISO 3166-1 alpha-2 country codes

+ +
+
+ +

◆ has_public_winners

+ +
+
+ + + + +
bool telebot_giveaway::has_public_winners
+
+

Optional. True, if the list of giveaway winners will be visible to everyone

+ +
+
+ +

◆ only_new_members

+ +
+
+ + + + +
bool telebot_giveaway::only_new_members
+
+

Optional. True, if only users who join the chats after the giveaway started should be eligible to win

+ +
+
+ +

◆ premium_subscription_month_count

+ +
+
+ + + + +
int telebot_giveaway::premium_subscription_month_count
+
+

Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for

+ +
+
+ +

◆ prize_description

+ +
+
+ + + + +
char* telebot_giveaway::prize_description
+
+

Optional. Description of additional giveaway prize

+ +
+
+ +

◆ prize_star_count

+ +
+
+ + + + +
int telebot_giveaway::prize_star_count
+
+

Optional. The number of Telegram Stars to be split between giveaway winners

+ +
+
+ +

◆ winner_count

+ +
+
+ + + + +
int telebot_giveaway::winner_count
+
+

The number of users which are supposed to be selected as winners of the giveaway

+ +
+
+ +

◆ winners_selection_date

+ +
+
+ + + + +
long telebot_giveaway::winners_selection_date
+
+

Point in time (Unix timestamp) when winners of the giveaway will be selected

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__giveaway__completed-members.html b/docs/structtelebot__giveaway__completed-members.html new file mode 100644 index 0000000..319a7b6 --- /dev/null +++ b/docs/structtelebot__giveaway__completed-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_giveaway_completed Member List
+
+ + + + + diff --git a/docs/structtelebot__giveaway__completed.html b/docs/structtelebot__giveaway__completed.html new file mode 100644 index 0000000..10a8c18 --- /dev/null +++ b/docs/structtelebot__giveaway__completed.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_giveaway_completed Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_giveaway_completed Struct Reference
+
+
+ +

This object represents a service message about the completion of a giveaway without public winners. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

int winner_count
 
int unclaimed_prize_count
 
struct telebot_messagegiveaway_message
 
bool is_star_giveaway
 
+

Detailed Description

+

This object represents a service message about the completion of a giveaway without public winners.

+

Member Data Documentation

+ +

◆ giveaway_message

+ +
+
+ + + + +
struct telebot_message* telebot_giveaway_completed::giveaway_message
+
+

Optional. Message with the giveaway that was completed

+ +
+
+ +

◆ is_star_giveaway

+ +
+
+ + + + +
bool telebot_giveaway_completed::is_star_giveaway
+
+

Optional. True, if the giveaway is a Telegram Star giveaway

+ +
+
+ +

◆ unclaimed_prize_count

+ +
+
+ + + + +
int telebot_giveaway_completed::unclaimed_prize_count
+
+

Optional. Number of undistributed prizes

+ +
+
+ +

◆ winner_count

+ +
+
+ + + + +
int telebot_giveaway_completed::winner_count
+
+

Number of winners in the giveaway

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__giveaway__created-members.html b/docs/structtelebot__giveaway__created-members.html new file mode 100644 index 0000000..378482e --- /dev/null +++ b/docs/structtelebot__giveaway__created-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_giveaway_created Member List
+
+
+ +

This is the complete list of members for telebot_giveaway_created, including all inherited members.

+ + +
prize_star_counttelebot_giveaway_created
+ + + + diff --git a/docs/structtelebot__giveaway__created.html b/docs/structtelebot__giveaway__created.html new file mode 100644 index 0000000..3f11678 --- /dev/null +++ b/docs/structtelebot__giveaway__created.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_giveaway_created Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_giveaway_created Struct Reference
+
+
+ +

This object represents a service message about the creation of a scheduled giveaway. + More...

+ +

#include <telebot-types.h>

+ + + + +

+Public Attributes

int prize_star_count
 
+

Detailed Description

+

This object represents a service message about the creation of a scheduled giveaway.

+

Member Data Documentation

+ +

◆ prize_star_count

+ +
+
+ + + + +
int telebot_giveaway_created::prize_star_count
+
+

Optional. The number of Telegram Stars to be split between giveaway winners

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__giveaway__winners-members.html b/docs/structtelebot__giveaway__winners-members.html new file mode 100644 index 0000000..240ac52 --- /dev/null +++ b/docs/structtelebot__giveaway__winners-members.html @@ -0,0 +1,98 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_giveaway_winners Member List
+
+ + + + + diff --git a/docs/structtelebot__giveaway__winners.html b/docs/structtelebot__giveaway__winners.html new file mode 100644 index 0000000..2319ca1 --- /dev/null +++ b/docs/structtelebot__giveaway__winners.html @@ -0,0 +1,307 @@ + + + + + + + +Telebot: telebot_giveaway_winners Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_giveaway_winners Struct Reference
+
+
+ +

This object represents a message about the completion of a giveaway with public winners. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

struct telebot_chatchat
 
int giveaway_message_id
 
long winners_selection_date
 
int winner_count
 
struct telebot_userwinners
 
+int count_winners
 
int additional_chat_count
 
int prize_star_count
 
int premium_subscription_month_count
 
int unclaimed_prize_count
 
bool only_new_members
 
bool was_refunded
 
char * prize_description
 
+

Detailed Description

+

This object represents a message about the completion of a giveaway with public winners.

+

Member Data Documentation

+ +

◆ additional_chat_count

+ +
+
+ + + + +
int telebot_giveaway_winners::additional_chat_count
+
+

Optional. The number of other chats the user had to join in order to be eligible for the giveaway

+ +
+
+ +

◆ chat

+ +
+
+ + + + +
struct telebot_chat* telebot_giveaway_winners::chat
+
+

The chat that created the giveaway

+ +
+
+ +

◆ giveaway_message_id

+ +
+
+ + + + +
int telebot_giveaway_winners::giveaway_message_id
+
+

Identifier of the message with the giveaway in the chat

+ +
+
+ +

◆ only_new_members

+ +
+
+ + + + +
bool telebot_giveaway_winners::only_new_members
+
+

Optional. True, if only users who had joined the chats after the giveaway started were eligible to win

+ +
+
+ +

◆ premium_subscription_month_count

+ +
+
+ + + + +
int telebot_giveaway_winners::premium_subscription_month_count
+
+

Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for

+ +
+
+ +

◆ prize_description

+ +
+
+ + + + +
char* telebot_giveaway_winners::prize_description
+
+

Optional. Description of additional giveaway prize

+ +
+
+ +

◆ prize_star_count

+ +
+
+ + + + +
int telebot_giveaway_winners::prize_star_count
+
+

Optional. The number of Telegram Stars that were split between giveaway winners

+ +
+
+ +

◆ unclaimed_prize_count

+ +
+
+ + + + +
int telebot_giveaway_winners::unclaimed_prize_count
+
+

Optional. Number of undistributed prizes

+ +
+
+ +

◆ was_refunded

+ +
+
+ + + + +
bool telebot_giveaway_winners::was_refunded
+
+

Optional. True, if the giveaway was canceled because the payment for it was refunded

+ +
+
+ +

◆ winner_count

+ +
+
+ + + + +
int telebot_giveaway_winners::winner_count
+
+

Total number of winners in the giveaway

+ +
+
+ +

◆ winners

+ +
+
+ + + + +
struct telebot_user* telebot_giveaway_winners::winners
+
+

List of winners of the giveaway

+ +
+
+ +

◆ winners_selection_date

+ +
+
+ + + + +
long telebot_giveaway_winners::winners_selection_date
+
+

Point in time (Unix timestamp) when winners of the giveaway were selected

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__inline__keyboard__button-members.html b/docs/structtelebot__inline__keyboard__button-members.html new file mode 100644 index 0000000..1bc5608 --- /dev/null +++ b/docs/structtelebot__inline__keyboard__button-members.html @@ -0,0 +1,96 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_inline_keyboard_button Member List
+
+ + + + + diff --git a/docs/structtelebot__inline__keyboard__button.html b/docs/structtelebot__inline__keyboard__button.html new file mode 100644 index 0000000..78a9dbe --- /dev/null +++ b/docs/structtelebot__inline__keyboard__button.html @@ -0,0 +1,287 @@ + + + + + + + +Telebot: telebot_inline_keyboard_button Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_inline_keyboard_button Struct Reference
+
+
+ +

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

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

char * text
 
char * url
 
char * callback_data
 
struct telebot_web_app_infoweb_app
 
struct telebot_login_urllogin_url
 
char * switch_inline_query
 
char * switch_inline_query_current_chat
 
struct telebot_switch_inline_query_chosen_chatswitch_inline_query_chosen_chat
 
struct telebot_copy_text_buttoncopy_text
 
struct telebot_callback_gamecallback_game
 
bool pay
 
+

Detailed Description

+

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

+

Member Data Documentation

+ +

◆ callback_data

+ +
+
+ + + + +
char* telebot_inline_keyboard_button::callback_data
+
+

Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes

+ +
+
+ +

◆ callback_game

+ +
+
+ + + + +
struct telebot_callback_game* telebot_inline_keyboard_button::callback_game
+
+

Optional. Description of the game that will be launched when the user presses the button.

+ +
+
+ +

◆ copy_text

+ +
+
+ + + + +
struct telebot_copy_text_button* telebot_inline_keyboard_button::copy_text
+
+

Optional. Description of the button that copies the specified text to the clipboard.

+ +
+
+ +

◆ login_url

+ +
+
+ + + + +
struct telebot_login_url* telebot_inline_keyboard_button::login_url
+
+

Optional. An HTTPS URL used to automatically authorize the user.

+ +
+
+ +

◆ pay

+ +
+
+ + + + +
bool telebot_inline_keyboard_button::pay
+
+

Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row.

+ +
+
+ +

◆ switch_inline_query

+ +
+
+ + + + +
char* telebot_inline_keyboard_button::switch_inline_query
+
+

Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.

+ +
+
+ +

◆ switch_inline_query_chosen_chat

+ +
+
+ + + + +
struct telebot_switch_inline_query_chosen_chat* telebot_inline_keyboard_button::switch_inline_query_chosen_chat
+
+

Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type.

+ +
+
+ +

◆ switch_inline_query_current_chat

+ +
+
+ + + + +
char* telebot_inline_keyboard_button::switch_inline_query_current_chat
+
+

Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case just the bot's username will be inserted.

+ +
+
+ +

◆ text

+ +
+
+ + + + +
char* telebot_inline_keyboard_button::text
+
+

Label text on the button

+ +
+
+ +

◆ url

+ +
+
+ + + + +
char* telebot_inline_keyboard_button::url
+
+

Optional. HTTP or tg:// url to be opened when button is pressed

+ +
+
+ +

◆ web_app

+ +
+
+ + + + +
struct telebot_web_app_info* telebot_inline_keyboard_button::web_app
+
+

Optional. Description of the Web App that will be launched when the user presses the button.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__inline__keyboard__markup-members.html b/docs/structtelebot__inline__keyboard__markup-members.html new file mode 100644 index 0000000..977ef3a --- /dev/null +++ b/docs/structtelebot__inline__keyboard__markup-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_inline_keyboard_markup Member List
+
+ + + + + diff --git a/docs/structtelebot__inline__keyboard__markup.html b/docs/structtelebot__inline__keyboard__markup.html new file mode 100644 index 0000000..13c6133 --- /dev/null +++ b/docs/structtelebot__inline__keyboard__markup.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_inline_keyboard_markup Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_inline_keyboard_markup Struct Reference
+
+
+ +

This object represents an inline keyboard that appears right next to the message it belongs to. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + +

+Public Attributes

telebot_inline_keyboard_button_tinline_keyboard
 
int rows
 
int cols
 
+

Detailed Description

+

This object represents an inline keyboard that appears right next to the message it belongs to.

+

Member Data Documentation

+ +

◆ cols

+ +
+
+ + + + +
int telebot_inline_keyboard_markup::cols
+
+

Number of columns

+ +
+
+ +

◆ inline_keyboard

+ +
+
+ + + + +
telebot_inline_keyboard_button_t* telebot_inline_keyboard_markup::inline_keyboard
+
+

Array of button rows, each represented by an Array of InlineKeyboardButton objects

+ +
+
+ +

◆ rows

+ +
+
+ + + + +
int telebot_inline_keyboard_markup::rows
+
+

Number of rows

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__inline__query-members.html b/docs/structtelebot__inline__query-members.html new file mode 100644 index 0000000..60b73a6 --- /dev/null +++ b/docs/structtelebot__inline__query-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_inline_query Member List
+
+ + + + + diff --git a/docs/structtelebot__inline__query.html b/docs/structtelebot__inline__query.html new file mode 100644 index 0000000..1530b08 --- /dev/null +++ b/docs/structtelebot__inline__query.html @@ -0,0 +1,202 @@ + + + + + + + +Telebot: telebot_inline_query Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_inline_query Struct Reference
+
+
+ +

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + +

+Public Attributes

char * id
 
struct telebot_userfrom
 
char * query
 
char * offset
 
char * chat_type
 
struct telebot_locationlocation
 
+

Detailed Description

+

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

+

Member Data Documentation

+ +

◆ chat_type

+ +
+
+ + + + +
char* telebot_inline_query::chat_type
+
+

Optional. Type of the chat from which the inline query was sent

+ +
+
+ +

◆ from

+ +
+
+ + + + +
struct telebot_user* telebot_inline_query::from
+
+

Sender

+ +
+
+ +

◆ id

+ +
+
+ + + + +
char* telebot_inline_query::id
+
+

Unique identifier for this query

+ +
+
+ +

◆ location

+ +
+
+ + + + +
struct telebot_location* telebot_inline_query::location
+
+

Optional. Sender location, only for bots that request user location

+ +
+
+ +

◆ offset

+ +
+
+ + + + +
char* telebot_inline_query::offset
+
+

Offset of the results to be returned, can be controlled by the bot

+ +
+
+ +

◆ query

+ +
+
+ + + + +
char* telebot_inline_query::query
+
+

Text of the query (up to 256 characters)

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__invoice-members.html b/docs/structtelebot__invoice-members.html new file mode 100644 index 0000000..1024015 --- /dev/null +++ b/docs/structtelebot__invoice-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_invoice Member List
+
+ + + + + diff --git a/docs/structtelebot__invoice.html b/docs/structtelebot__invoice.html new file mode 100644 index 0000000..7f6b3ec --- /dev/null +++ b/docs/structtelebot__invoice.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: telebot_invoice Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_invoice Struct Reference
+
+
+ +

This object contains basic information about an invoice. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + +

+Public Attributes

char * title
 
char * description
 
char * start_parameter
 
char * currency
 
int total_amount
 
+

Detailed Description

+

This object contains basic information about an invoice.

+

Member Data Documentation

+ +

◆ currency

+ +
+
+ + + + +
char* telebot_invoice::currency
+
+

Three-letter ISO 4217 currency code

+ +
+
+ +

◆ description

+ +
+
+ + + + +
char* telebot_invoice::description
+
+

Product description

+ +
+
+ +

◆ start_parameter

+ +
+
+ + + + +
char* telebot_invoice::start_parameter
+
+

Unique bot deep-linking parameter that can be used to generate this invoice

+ +
+
+ +

◆ title

+ +
+
+ + + + +
char* telebot_invoice::title
+
+

Product name

+ +
+
+ +

◆ total_amount

+ +
+
+ + + + +
int telebot_invoice::total_amount
+
+

Total amount in the smallest units of the currency (integer, not float/double).

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__keyboard__button-members.html b/docs/structtelebot__keyboard__button-members.html index 341a128..f552d15 100644 --- a/docs/structtelebot__keyboard__button-members.html +++ b/docs/structtelebot__keyboard__button-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,30 +56,37 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_keyboard_button Member List
+
telebot_keyboard_button Member List
diff --git a/docs/structtelebot__keyboard__button.html b/docs/structtelebot__keyboard__button.html index 69e3ec4..43f61c8 100644 --- a/docs/structtelebot__keyboard__button.html +++ b/docs/structtelebot__keyboard__button.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_keyboard_button Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_keyboard_button Struct Reference
+
telebot_keyboard_button Struct Reference
@@ -73,22 +82,43 @@

#include <telebot-types.h>

- - + - + + + + + - + - + + +

+

Public Attributes

char * text
char * text
 
bool request_contact
struct telebot_keyboard_button_request_usersrequest_users
 
struct telebot_keyboard_button_request_chatrequest_chat
 
bool request_contact
 
bool request_location
bool request_location
 
telebot_keyboard_button_poll_type_trequest_poll
telebot_keyboard_button_poll_type_trequest_poll
 
struct telebot_web_app_infoweb_app
 

Detailed Description

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

Member Data Documentation

- -

◆ request_contact

+ +

◆ request_chat

+ +
+
+ + + + +
struct telebot_keyboard_button_request_chat* telebot_keyboard_button::request_chat
+
+

Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a "chat_shared" service message. Available in private chats only.

+ +
+
+ +

◆ request_contact

@@ -102,8 +132,8 @@

-

◆ request_location

+ +

◆ request_location

@@ -117,14 +147,14 @@

-

◆ request_poll

+ +

◆ request_poll

- +
telebot_keyboard_button_poll_type_t* telebot_keyboard_button::request_polltelebot_keyboard_button_poll_type_t* telebot_keyboard_button::request_poll
@@ -132,8 +162,23 @@

-

◆ text

+ +

◆ request_users

+ +
+
+ + + + +
struct telebot_keyboard_button_request_users* telebot_keyboard_button::request_users
+
+

Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a "users_shared" service message. Available in private chats only.

+ +
+
+ +

◆ text

+ +

◆ web_app

+ +
+
+ + + + +
struct telebot_web_app_info* telebot_keyboard_button::web_app
+
+

Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a "web_app_data" service message. Available in private chats only.

+

The documentation for this struct was generated from the following file:
    @@ -153,9 +213,7 @@

    diff --git a/docs/structtelebot__keyboard__button__poll__type-members.html b/docs/structtelebot__keyboard__button__poll__type-members.html index 49d1679..2dba2a1 100644 --- a/docs/structtelebot__keyboard__button__poll__type-members.html +++ b/docs/structtelebot__keyboard__button__poll__type-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,15 +56,21 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

-
-
telebot_keyboard_button_poll_type Member List
+
telebot_keyboard_button_poll_type Member List
@@ -71,9 +80,7 @@
diff --git a/docs/structtelebot__keyboard__button__poll__type.html b/docs/structtelebot__keyboard__button__poll__type.html index 3f9adc1..5aa4d9e 100644 --- a/docs/structtelebot__keyboard__button__poll__type.html +++ b/docs/structtelebot__keyboard__button__poll__type.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_keyboard_button_poll_type Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_keyboard_button_poll_type Struct Reference
+
telebot_keyboard_button_poll_type Struct Reference

@@ -73,16 +82,16 @@

#include <telebot-types.h>

- - +

+

Public Attributes

char * type
char * type
 

Detailed Description

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

Member Data Documentation

- -

◆ type

+ +

◆ type

@@ -102,9 +111,7 @@

diff --git a/docs/structtelebot__keyboard__button__request__chat-members.html b/docs/structtelebot__keyboard__button__request__chat-members.html new file mode 100644 index 0000000..d5a722b --- /dev/null +++ b/docs/structtelebot__keyboard__button__request__chat-members.html @@ -0,0 +1,96 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_keyboard_button_request_chat Member List
+
+ + + + + diff --git a/docs/structtelebot__keyboard__button__request__chat.html b/docs/structtelebot__keyboard__button__request__chat.html new file mode 100644 index 0000000..c7cf3f5 --- /dev/null +++ b/docs/structtelebot__keyboard__button__request__chat.html @@ -0,0 +1,287 @@ + + + + + + + +Telebot: telebot_keyboard_button_request_chat Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_keyboard_button_request_chat Struct Reference
+
+
+ +

This object defines the criteria used to request a suitable chat. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Attributes

int request_id
 
bool chat_is_channel
 
bool chat_is_forum
 
bool chat_has_username
 
bool chat_is_created
 
struct telebot_chat_administrator_rights * user_administrator_rights
 
struct telebot_chat_administrator_rights * bot_administrator_rights
 
bool bot_is_member
 
bool request_title
 
bool request_username
 
bool request_photo
 
+

Detailed Description

+

This object defines the criteria used to request a suitable chat.

+

Member Data Documentation

+ +

◆ bot_administrator_rights

+ +
+
+ + + + +
struct telebot_chat_administrator_rights* telebot_keyboard_button_request_chat::bot_administrator_rights
+
+

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat.

+ +
+
+ +

◆ bot_is_member

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::bot_is_member
+
+

Optional. Pass True to request a chat with the bot as a member.

+ +
+
+ +

◆ chat_has_username

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::chat_has_username
+
+

Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username.

+ +
+
+ +

◆ chat_is_channel

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::chat_is_channel
+
+

Pass True to request a channel chat, pass False to request a group or a supergroup chat.

+ +
+
+ +

◆ chat_is_created

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::chat_is_created
+
+

Optional. Pass True to request a chat owned by the user.

+ +
+
+ +

◆ chat_is_forum

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::chat_is_forum
+
+

Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat.

+ +
+
+ +

◆ request_id

+ +
+
+ + + + +
int telebot_keyboard_button_request_chat::request_id
+
+

Identifier of the request

+ +
+
+ +

◆ request_photo

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::request_photo
+
+

Optional. Pass True to request the chat's photo

+ +
+
+ +

◆ request_title

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::request_title
+
+

Optional. Pass True to request the chat's title

+ +
+
+ +

◆ request_username

+ +
+
+ + + + +
bool telebot_keyboard_button_request_chat::request_username
+
+

Optional. Pass True to request the chat's username

+ +
+
+ +

◆ user_administrator_rights

+ +
+
+ + + + +
struct telebot_chat_administrator_rights* telebot_keyboard_button_request_chat::user_administrator_rights
+
+

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__keyboard__button__request__users-members.html b/docs/structtelebot__keyboard__button__request__users-members.html new file mode 100644 index 0000000..e89cb5f --- /dev/null +++ b/docs/structtelebot__keyboard__button__request__users-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_keyboard_button_request_users Member List
+
+ + + + + diff --git a/docs/structtelebot__keyboard__button__request__users.html b/docs/structtelebot__keyboard__button__request__users.html new file mode 100644 index 0000000..99c13f8 --- /dev/null +++ b/docs/structtelebot__keyboard__button__request__users.html @@ -0,0 +1,219 @@ + + + + + + + +Telebot: telebot_keyboard_button_request_users Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_keyboard_button_request_users Struct Reference
+
+
+ +

This object defines the criteria used to request suitable users. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + + + + + +

+Public Attributes

int request_id
 
bool user_is_bot
 
bool user_is_premium
 
int max_quantity
 
bool request_name
 
bool request_username
 
bool request_photo
 
+

Detailed Description

+

This object defines the criteria used to request suitable users.

+

Member Data Documentation

+ +

◆ max_quantity

+ +
+
+ + + + +
int telebot_keyboard_button_request_users::max_quantity
+
+

Optional. The maximum number of users to be selected; 1-10.

+ +
+
+ +

◆ request_id

+ +
+
+ + + + +
int telebot_keyboard_button_request_users::request_id
+
+

Identifier of the request

+ +
+
+ +

◆ request_name

+ +
+
+ + + + +
bool telebot_keyboard_button_request_users::request_name
+
+

Optional. Pass True to request the users' first and last names

+ +
+
+ +

◆ request_photo

+ +
+
+ + + + +
bool telebot_keyboard_button_request_users::request_photo
+
+

Optional. Pass True to request the users' photos

+ +
+
+ +

◆ request_username

+ +
+
+ + + + +
bool telebot_keyboard_button_request_users::request_username
+
+

Optional. Pass True to request the users' usernames

+ +
+
+ +

◆ user_is_bot

+ +
+
+ + + + +
bool telebot_keyboard_button_request_users::user_is_bot
+
+

Optional. Pass True to request bots, pass False to request regular users.

+ +
+
+ +

◆ user_is_premium

+ +
+
+ + + + +
bool telebot_keyboard_button_request_users::user_is_premium
+
+

Optional. Pass True to request premium users, pass False to request non-premium users.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__link__preview__options-members.html b/docs/structtelebot__link__preview__options-members.html new file mode 100644 index 0000000..b3c9f9f --- /dev/null +++ b/docs/structtelebot__link__preview__options-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_link_preview_options Member List
+
+ + + + + diff --git a/docs/structtelebot__link__preview__options.html b/docs/structtelebot__link__preview__options.html new file mode 100644 index 0000000..e882c7f --- /dev/null +++ b/docs/structtelebot__link__preview__options.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: telebot_link_preview_options Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_link_preview_options Struct Reference
+
+
+ +

Describes the options used for link preview generation. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + + + +

+Public Attributes

bool is_disabled
 
char * url
 
bool prefer_small_media
 
bool prefer_large_media
 
bool show_above_text
 
+

Detailed Description

+

Describes the options used for link preview generation.

+

Member Data Documentation

+ +

◆ is_disabled

+ +
+
+ + + + +
bool telebot_link_preview_options::is_disabled
+
+

Optional. True, if the link preview is disabled

+ +
+
+ +

◆ prefer_large_media

+ +
+
+ + + + +
bool telebot_link_preview_options::prefer_large_media
+
+

Optional. True, if the media in the link preview is supposed to be enlarged

+ +
+
+ +

◆ prefer_small_media

+ +
+
+ + + + +
bool telebot_link_preview_options::prefer_small_media
+
+

Optional. True, if the media in the link preview is supposed to be shrunk

+ +
+
+ +

◆ show_above_text

+ +
+
+ + + + +
bool telebot_link_preview_options::show_above_text
+
+

Optional. True, if the link preview must be shown above the message text

+ +
+
+ +

◆ url

+ +
+
+ + + + +
char* telebot_link_preview_options::url
+
+

Optional. URL to use for the link preview.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__location-members.html b/docs/structtelebot__location-members.html index 5c8e923..65b9b63 100644 --- a/docs/structtelebot__location-members.html +++ b/docs/structtelebot__location-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,28 +56,32 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_location Member List
+
telebot_location Member List

This is the complete list of members for telebot_location, including all inherited members.

- +
latitudetelebot_location
longitudetelebot_location
longitudetelebot_location
diff --git a/docs/structtelebot__location.html b/docs/structtelebot__location.html index bcd0fbb..c9d1956 100644 --- a/docs/structtelebot__location.html +++ b/docs/structtelebot__location.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_location Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,8 +73,7 @@ -
-
telebot_location Struct Reference
+
telebot_location Struct Reference
@@ -73,18 +82,18 @@

#include <telebot-types.h>

- - + - +

+

Public Attributes

float longitude
float longitude
 
float latitude
float latitude
 

Detailed Description

This object represents a point on the map.

Member Data Documentation

- -

◆ latitude

+ +

◆ latitude

@@ -98,8 +107,8 @@

-

◆ longitude

+ +

◆ longitude

@@ -119,9 +128,7 @@

diff --git a/docs/structtelebot__login__url-members.html b/docs/structtelebot__login__url-members.html new file mode 100644 index 0000000..d181592 --- /dev/null +++ b/docs/structtelebot__login__url-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
telebot_login_url Member List
+
+
+ +

This is the complete list of members for telebot_login_url, including all inherited members.

+ + + + + +
bot_usernametelebot_login_url
forward_texttelebot_login_url
request_write_accesstelebot_login_url
urltelebot_login_url
+ + + + diff --git a/docs/structtelebot__login__url.html b/docs/structtelebot__login__url.html new file mode 100644 index 0000000..3add301 --- /dev/null +++ b/docs/structtelebot__login__url.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_login_url Struct Reference + + + + + + + + + +
+
+ + + + + + +
+
Telebot 9.4 +
+
Library for Telegram bot API
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
telebot_login_url Struct Reference
+
+
+ +

This object represents a parameter of the inline keyboard button used to automatically authorize a user. + More...

+ +

#include <telebot-types.h>

+ + + + + + + + + + +

+Public Attributes

char * url
 
char * forward_text
 
char * bot_username
 
bool request_write_access
 
+

Detailed Description

+

This object represents a parameter of the inline keyboard button used to automatically authorize a user.

+

Member Data Documentation

+ +

◆ bot_username

+ +
+
+ + + + +
char* telebot_login_url::bot_username
+
+

Optional. Username of a bot, which will be used for user authorization.

+ +
+
+ +

◆ forward_text

+ +
+
+ + + + +
char* telebot_login_url::forward_text
+
+

Optional. New text of the button in forwarded messages.

+ +
+
+ +

◆ request_write_access

+ +
+
+ + + + +
bool telebot_login_url::request_write_access
+
+

Optional. Pass True to request the permission for your bot to send messages to the user.

+ +
+
+ +

◆ url

+ +
+
+ + + + +
char* telebot_login_url::url
+
+

An HTTPS URL used to automatically authorize the user.

+ +
+
+
The documentation for this struct was generated from the following file: +
+ + + + diff --git a/docs/structtelebot__mask__position-members.html b/docs/structtelebot__mask__position-members.html index 43beef8..98d1d99 100644 --- a/docs/structtelebot__mask__position-members.html +++ b/docs/structtelebot__mask__position-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,30 +56,34 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+

-
-
telebot_mask_position Member List
+
telebot_mask_position Member List
diff --git a/docs/structtelebot__mask__position.html b/docs/structtelebot__mask__position.html index 25d8c6b..271f774 100644 --- a/docs/structtelebot__mask__position.html +++ b/docs/structtelebot__mask__position.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_mask_position Struct Reference @@ -19,10 +19,9 @@
- - + @@ -31,17 +30,21 @@
-
Telebot -  4.7.0 +
+
Telebot 9.4
Library for Telegram bot API
- + @@ -53,9 +56,16 @@
- +
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
@@ -63,32 +73,31 @@ -
-
telebot_mask_position Struct Reference
+
telebot_mask_position Struct Reference

This object describes the position on faces where a mask should be placed by default. More...

-

#include <telebot-stickers.h>

+

#include <telebot-types.h>

- - + - + - + - +

+

Public Attributes

char * point
char * point
 
float x_shift
float x_shift
 
float y_shift
float y_shift
 
float scale
float scale
 

Detailed Description

This object describes the position on faces where a mask should be placed by default.

Member Data Documentation

- -

◆ point

+ +

◆ point

@@ -102,8 +111,8 @@

-

◆ scale

+ +

◆ scale

@@ -117,8 +126,8 @@

-

◆ x_shift

+ +

◆ x_shift

@@ -132,8 +141,8 @@

-

◆ y_shift

+ +

◆ y_shift

@@ -148,14 +157,12 @@

telebot-stickers.h +
  • include/telebot-types.h
  • diff --git a/docs/structtelebot__message-members.html b/docs/structtelebot__message-members.html index 6d41ca4..6c75128 100644 --- a/docs/structtelebot__message-members.html +++ b/docs/structtelebot__message-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,80 +56,126 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot_message Member List
    +
    telebot_message Member List

    This is the complete list of members for telebot_message, including all inherited members.

    - + - + + + - + - + + + - + - + - + - + - + - - - + + + + + + + + + - + - - - - - + + + + + + + + + + + + + - + + + + + - - - + + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + +
    animationtelebot_message
    audiotelebot_message
    audiotelebot_message
    author_signaturetelebot_message
    captiontelebot_message
    boost_addedtelebot_message
    business_connection_idtelebot_message
    captiontelebot_message
    caption_entitiestelebot_message
    channel_chat_createdtelebot_message
    channel_chat_createdtelebot_message
    chattelebot_message
    connected_websitetelebot_message
    chat_background_settelebot_message
    chat_sharedtelebot_message
    connected_websitetelebot_message
    contacttelebot_message
    count_caption_entities (defined in telebot_message)telebot_message
    count_caption_entities (defined in telebot_message)telebot_message
    count_entities (defined in telebot_message)telebot_message
    count_left_chat_members (defined in telebot_message)telebot_message
    count_left_chat_members (defined in telebot_message)telebot_message
    count_new_chat_members (defined in telebot_message)telebot_message
    count_new_chat_photos (defined in telebot_message)telebot_message
    count_new_chat_photos (defined in telebot_message)telebot_message
    count_photos (defined in telebot_message)telebot_message
    datetelebot_message
    datetelebot_message
    delete_chat_phototelebot_message
    dicetelebot_message
    dicetelebot_message
    documenttelebot_message
    edit_datetelebot_message
    entitiestelebot_message
    forward_datetelebot_message
    edit_datetelebot_message
    effect_idtelebot_message
    entitiestelebot_message
    external_replytelebot_message
    forum_topic_closedtelebot_message
    forum_topic_createdtelebot_message
    forum_topic_editedtelebot_message
    forum_topic_reopenedtelebot_message
    forward_datetelebot_message
    forward_fromtelebot_message
    forward_from_chattelebot_message
    forward_from_chattelebot_message
    forward_from_message_idtelebot_message
    forward_sender_nametelebot_message
    forward_signaturetelebot_message
    fromtelebot_message
    gametelebot_message
    group_chat_createdtelebot_message
    forward_origintelebot_message
    forward_sender_nametelebot_message
    forward_signaturetelebot_message
    fromtelebot_message
    gametelebot_message
    general_forum_topic_hiddentelebot_message
    general_forum_topic_unhiddentelebot_message
    gifttelebot_message
    giveaway_completedtelebot_message
    giveaway_createdtelebot_message
    group_chat_createdtelebot_message
    has_media_spoilertelebot_message
    has_protected_contenttelebot_message
    invoicetelebot_message
    left_chat_memberstelebot_message
    is_automatic_forwardtelebot_message
    is_paid_posttelebot_message
    is_topic_messagetelebot_message
    left_chat_memberstelebot_message
    link_preview_optionstelebot_message
    locationtelebot_message
    media_group_idtelebot_message
    message_idtelebot_message
    migrate_from_chat_idtelebot_message
    media_group_idtelebot_message
    message_auto_delete_timer_changedtelebot_message
    message_idtelebot_message
    message_thread_idtelebot_message
    migrate_from_chat_idtelebot_message
    migrate_to_chat_idtelebot_message
    new_chat_memberstelebot_message
    new_chat_memberstelebot_message
    new_chat_photostelebot_message
    new_chat_titletelebot_message
    passport_datatelebot_message
    photostelebot_message
    pinned_messagetelebot_message
    polltelebot_message
    reply_markuptelebot_message
    reply_to_messagetelebot_message
    stickertelebot_message
    successful_paymenttelebot_message
    supergroup_chat_createdtelebot_message
    texttelebot_message
    venuetelebot_message
    videotelebot_message
    new_chat_titletelebot_message
    paid_mediatelebot_message
    passport_datatelebot_message
    photostelebot_message
    pinned_messagetelebot_message
    polltelebot_message
    proximity_alert_triggeredtelebot_message
    quotetelebot_message
    refunded_paymenttelebot_message
    reply_markuptelebot_message
    reply_to_messagetelebot_message
    reply_to_storytelebot_message
    sender_boost_counttelebot_message
    sender_business_bottelebot_message
    sender_chattelebot_message
    show_caption_above_mediatelebot_message
    stickertelebot_message
    successful_paymenttelebot_message
    supergroup_chat_createdtelebot_message
    texttelebot_message
    unique_gifttelebot_message
    users_sharedtelebot_message
    venuetelebot_message
    via_bottelebot_message
    videotelebot_message
    video_chat_endedtelebot_message
    video_chat_participants_invitedtelebot_message
    video_chat_scheduledtelebot_message
    video_chat_startedtelebot_message
    video_notetelebot_message
    voicetelebot_message
    voicetelebot_message
    web_app_datatelebot_message
    write_access_allowedtelebot_message
    diff --git a/docs/structtelebot__message.html b/docs/structtelebot__message.html index cece780..0ce65fa 100644 --- a/docs/structtelebot__message.html +++ b/docs/structtelebot__message.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_message Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    @@ -63,8 +73,7 @@ -
    -
    telebot_message Struct Reference
    +
    telebot_message Struct Reference
    @@ -73,128 +82,212 @@

    #include <telebot-types.h>

    - - + - + + + - + + + + + + + + + - + - + + + - + - + - + - + - + - + + + + + - + + + + + + + + + - + + + + + - + - + - + - - - - - - + + + + + + + - + - - - - - + + + - - + - + - - - + - + + + - + + + + + + + - - - - - - - + - + + + + + + + + + - - + - - + - + - - + - + - + - + - + + + - + - + - + - + - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Attributes

    int message_id
    int message_id
     
    struct telebot_userfrom
    int message_thread_id
     
    struct telebot_userfrom
     
    long date
    struct telebot_chatsender_chat
     
    int sender_boost_count
     
    struct telebot_usersender_business_bot
     
    char * business_connection_id
     
    long date
     
    struct telebot_chatchat
    struct telebot_chatchat
     
    struct telebot_userforward_from
    struct telebot_message_originforward_origin
     
    struct telebot_userforward_from
     
    struct telebot_chatforward_from_chat
    struct telebot_chatforward_from_chat
     
    int forward_from_message_id
    int forward_from_message_id
     
    char * forward_signature
    char * forward_signature
     
    char * forward_sender_name
    char * forward_sender_name
     
    long forward_date
    long forward_date
     
    struct telebot_messagereply_to_message
    bool is_topic_message
     
    bool is_automatic_forward
     
    struct telebot_messagereply_to_message
     
    long edit_date
    struct telebot_external_reply_infoexternal_reply
     
    struct telebot_text_quotequote
     
    struct telebot_storyreply_to_story
     
    struct telebot_uservia_bot
     
    long edit_date
     
    char * media_group_id
    bool has_protected_content
     
    bool is_paid_post
     
    char * media_group_id
     
    char * author_signature
    char * author_signature
     
    char * text
    char * text
     
    struct telebot_message_entityentities
    struct telebot_message_entityentities
     
    +
    int count_entities
     
    struct telebot_message_entitycaption_entities
     
    -int count_caption_entities
     
    struct telebot_audioaudio
    struct telebot_link_preview_optionslink_preview_options
     
    char * effect_id
     
    struct telebot_animationanimation
     
    struct telebot_audioaudio
     
    struct telebot_documentdocument
    struct telebot_documentdocument
     
    struct telebot_animationanimation
     
    struct telebot_game * game
     
    struct telebot_photophotos
    struct telebot_paid_media_infopaid_media
     
    struct telebot_photophotos
     
    +
    int count_photos
     
    struct telebot_stickersticker
    struct telebot_stickersticker
     
    struct telebot_videovideo
    struct telebot_videovideo
     
    struct telebot_voicevoice
     
    struct telebot_video_notevideo_note
    struct telebot_video_notevideo_note
     
    char * caption
    struct telebot_voicevoice
     
    char * caption
     
    struct telebot_contactcontact
    struct telebot_message_entitycaption_entities
     
    +int count_caption_entities
     
    bool show_caption_above_media
     
    struct telebot_contactcontact
     
    struct telebot_locationlocation
     
    struct telebot_venuevenue
     
    struct telebot_pollpoll
     
    struct telebot_dicedice
    struct telebot_dicedice
     
    struct telebot_usernew_chat_members
    struct telebot_gamegame
     
    struct telebot_pollpoll
     
    struct telebot_venuevenue
     
    struct telebot_locationlocation
     
    struct telebot_usernew_chat_members
     
    +
    int count_new_chat_members
     
    struct telebot_userleft_chat_members
    struct telebot_userleft_chat_members
     
    +
    int count_left_chat_members
     
    char * new_chat_title
    char * new_chat_title
     
    struct telebot_photonew_chat_photos
    struct telebot_photonew_chat_photos
     
    +
    int count_new_chat_photos
     
    bool delete_chat_photo
    bool delete_chat_photo
     
    bool group_chat_created
    bool group_chat_created
     
    bool supergroup_chat_created
    bool supergroup_chat_created
     
    bool channel_chat_created
    bool channel_chat_created
     
    long long int migrate_to_chat_id
    struct telebot_message_auto_delete_timer_changedmessage_auto_delete_timer_changed
     
    long long int migrate_to_chat_id
     
    long long int migrate_from_chat_id
    long long int migrate_from_chat_id
     
    struct telebot_messagepinned_message
    struct telebot_messagepinned_message
     
    struct telebot_invoice * invoice
    struct telebot_invoiceinvoice
     
    struct telebot_successful_payment * successful_payment
    struct telebot_successful_paymentsuccessful_payment
     
    char * connected_website
    struct telebot_refunded_paymentrefunded_payment
     
    struct telebot_write_access_allowedwrite_access_allowed
     
    char * connected_website
     
    struct telebot_passport_data * passport_data
    struct telebot_passport_datapassport_data
     
    struct inline_keyboard_markup * reply_markup
     
    struct telebot_proximity_alert_triggeredproximity_alert_triggered
     
    struct telebot_forum_topic_createdforum_topic_created
     
    struct telebot_forum_topic_editedforum_topic_edited
     
    struct telebot_forum_topic_closedforum_topic_closed
     
    struct telebot_forum_topic_reopenedforum_topic_reopened
     
    struct telebot_general_forum_topic_hiddengeneral_forum_topic_hidden
     
    struct telebot_general_forum_topic_unhiddengeneral_forum_topic_unhidden
     
    struct telebot_video_chat_scheduledvideo_chat_scheduled
     
    struct telebot_video_chat_startedvideo_chat_started
     
    struct telebot_video_chat_endedvideo_chat_ended
     
    struct telebot_video_chat_participants_invitedvideo_chat_participants_invited
     
    struct telebot_web_app_dataweb_app_data
     
    struct telebot_users_sharedusers_shared
     
    struct telebot_chat_sharedchat_shared
     
    struct telebot_gift_infogift
     
    struct telebot_unique_gift_infounique_gift
     
    struct telebot_chat_boost_addedboost_added
     
    struct telebot_chat_backgroundchat_background_set
     
    struct telebot_giveaway_createdgiveaway_created
     
    struct telebot_giveaway_completedgiveaway_completed
     
    bool has_media_spoiler
     
    struct telebot_inline_keyboard_markupreply_markup
     

    Detailed Description

    This object represents a message.

    Member Data Documentation

    - -

    ◆ animation

    + +

    ◆ animation

    - -

    ◆ audio

    + +

    ◆ audio

    @@ -223,8 +316,8 @@

    -

    ◆ author_signature

    + +

    ◆ author_signature

    @@ -238,8 +331,38 @@

    -

    ◆ caption

    + +

    ◆ boost_added

    + +
    +
    + + + + +
    struct telebot_chat_boost_added* telebot_message::boost_added
    +
    +

    Optional. Service message: user boosted the chat

    + +
    +
    + +

    ◆ business_connection_id

    + +
    +
    + + + + +
    char* telebot_message::business_connection_id
    +
    +

    Optional. Unique identifier of the business connection

    + +
    +
    + +

    ◆ caption

    @@ -253,8 +376,8 @@

    -

    ◆ caption_entities

    + +

    ◆ caption_entities

    @@ -268,8 +391,8 @@

    -

    ◆ channel_chat_created

    + +

    ◆ channel_chat_created

    @@ -283,8 +406,8 @@

    -

    ◆ chat

    + +

    ◆ chat

    @@ -298,8 +421,38 @@

    -

    ◆ connected_website

    + +

    ◆ chat_background_set

    + +
    +
    + + + + +
    struct telebot_chat_background* telebot_message::chat_background_set
    +
    +

    Optional. Service message: chat background set

    + +
    +
    + +

    ◆ chat_shared

    + +
    +
    + + + + +
    struct telebot_chat_shared* telebot_message::chat_shared
    +
    +

    Optional. Service message: a chat was shared with the bot

    + +
    +
    + +

    ◆ connected_website

    @@ -313,8 +466,8 @@

    -

    ◆ contact

    + +

    ◆ contact

    @@ -328,8 +481,8 @@

    -

    ◆ date

    + +

    ◆ date

    @@ -343,8 +496,8 @@

    -

    ◆ delete_chat_photo

    + +

    ◆ delete_chat_photo

    @@ -358,8 +511,8 @@

    -

    ◆ dice

    + +

    ◆ dice

    @@ -373,8 +526,8 @@

    -

    ◆ document

    + +

    ◆ document

    @@ -388,8 +541,8 @@

    -

    ◆ edit_date

    + +

    ◆ edit_date

    @@ -403,8 +556,23 @@

    -

    ◆ entities

    + +

    ◆ effect_id

    + +
    +
    + + + + +
    char* telebot_message::effect_id
    +
    +

    Optional. Unique identifier of the message effect added to the message

    + +
    +
    + +

    ◆ entities

    @@ -418,8 +586,83 @@

    -

    ◆ forward_date

    + +

    ◆ external_reply

    + +
    +
    + + + + +
    struct telebot_external_reply_info* telebot_message::external_reply
    +
    +

    Optional. Information about the message that is being replied to

    + +
    +
    + +

    ◆ forum_topic_closed

    + +
    +
    + + + + +
    struct telebot_forum_topic_closed* telebot_message::forum_topic_closed
    +
    +

    Optional. Service message: forum topic closed.

    + +
    +
    + +

    ◆ forum_topic_created

    + +
    +
    + + + + +
    struct telebot_forum_topic_created* telebot_message::forum_topic_created
    +
    +

    Optional. Service message: forum topic created.

    + +
    +
    + +

    ◆ forum_topic_edited

    + +
    +
    + + + + +
    struct telebot_forum_topic_edited* telebot_message::forum_topic_edited
    +
    +

    Optional. Service message: forum topic edited.

    + +
    +
    + +

    ◆ forum_topic_reopened

    + +
    +
    + + + + +
    struct telebot_forum_topic_reopened* telebot_message::forum_topic_reopened
    +
    +

    Optional. Service message: forum topic reopened.

    + +
    +
    + +

    ◆ forward_date

    @@ -433,8 +676,8 @@

    -

    ◆ forward_from

    + +

    ◆ forward_from

    @@ -448,8 +691,8 @@

    -

    ◆ forward_from_chat

    + +

    ◆ forward_from_chat

    @@ -463,8 +706,8 @@

    -

    ◆ forward_from_message_id

    + +

    ◆ forward_from_message_id

    @@ -478,8 +721,23 @@

    -

    ◆ forward_sender_name

    + +

    ◆ forward_origin

    + +
    +
    + + + + +
    struct telebot_message_origin* telebot_message::forward_origin
    +
    +

    Optional. Information about the original message for forwarded messages

    + +
    +
    + +

    ◆ forward_sender_name

    @@ -493,8 +751,8 @@

    -

    ◆ forward_signature

    + +

    ◆ forward_signature

    @@ -508,8 +766,8 @@

    -

    ◆ from

    + +

    ◆ from

    @@ -523,14 +781,14 @@

    -

    ◆ game

    + +

    ◆ game

    - +
    struct telebot_game* telebot_message::gamestruct telebot_game* telebot_message::game
    @@ -538,8 +796,83 @@

    -

    ◆ group_chat_created

    + +

    ◆ general_forum_topic_hidden

    + +
    +
    + + + + +
    struct telebot_general_forum_topic_hidden* telebot_message::general_forum_topic_hidden
    +
    +

    Optional. Service message: general forum topic hidden.

    + +
    +
    + +

    ◆ general_forum_topic_unhidden

    + +
    +
    + + + + +
    struct telebot_general_forum_topic_unhidden* telebot_message::general_forum_topic_unhidden
    +
    +

    Optional. Service message: general forum topic unhidden.

    + +
    +
    + +

    ◆ gift

    + +
    +
    + + + + +
    struct telebot_gift_info* telebot_message::gift
    +
    +

    Optional. Service message: a regular gift was sent or received

    + +
    +
    + +

    ◆ giveaway_completed

    + +
    +
    + + + + +
    struct telebot_giveaway_completed* telebot_message::giveaway_completed
    +
    +

    Optional. Service message: giveaway completed

    + +
    +
    + +

    ◆ giveaway_created

    + +
    +
    + + + + +
    struct telebot_giveaway_created* telebot_message::giveaway_created
    +
    +

    Optional. Service message: giveaway created

    + +
    +
    + +

    ◆ group_chat_created

    @@ -553,14 +886,44 @@

    -

    ◆ invoice

    + +

    ◆ has_media_spoiler

    + +
    +
    + + + + +
    bool telebot_message::has_media_spoiler
    +
    +

    Optional. True, if the message media is covered by a spoiler animation

    + +
    +
    + +

    ◆ has_protected_content

    + +
    +
    + + + + +
    bool telebot_message::has_protected_content
    +
    +

    Optional. True, if the message can't be forwarded

    + +
    +
    + +

    ◆ invoice

    - +
    struct telebot_invoice* telebot_message::invoicestruct telebot_invoice* telebot_message::invoice
    @@ -568,8 +931,53 @@

    -

    ◆ left_chat_members

    + +

    ◆ is_automatic_forward

    + +
    +
    + + + + +
    bool telebot_message::is_automatic_forward
    +
    +

    Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group

    + +
    +
    + +

    ◆ is_paid_post

    + +
    +
    + + + + +
    bool telebot_message::is_paid_post
    +
    +

    Optional. True, if the message is a paid post

    + +
    +
    + +

    ◆ is_topic_message

    + +
    +
    + + + + +
    bool telebot_message::is_topic_message
    +
    +

    Optional. True, if the message is sent to a forum topic

    + +
    +
    + +

    ◆ left_chat_members

    @@ -583,8 +991,23 @@

    -

    ◆ location

    + +

    ◆ link_preview_options

    + +
    +
    + + + + +
    struct telebot_link_preview_options* telebot_message::link_preview_options
    +
    +

    Optional. Options used for link preview generation for the message

    + +
    +
    + +

    ◆ location

    @@ -598,8 +1021,8 @@

    -

    ◆ media_group_id

    + +

    ◆ media_group_id

    @@ -613,8 +1036,23 @@

    -

    ◆ message_id

    + +

    ◆ message_auto_delete_timer_changed

    + +
    +
    + + + + +
    struct telebot_message_auto_delete_timer_changed* telebot_message::message_auto_delete_timer_changed
    +
    +

    Optional. Service message: auto-delete timer settings changed in the chat

    + +
    +
    + +

    ◆ message_id

    @@ -628,8 +1066,23 @@

    -

    ◆ migrate_from_chat_id

    + +

    ◆ message_thread_id

    + +
    +
    + + + + +
    int telebot_message::message_thread_id
    +
    +

    Unique identifier of a message thread to which the message belongs; for supergroups only

    + +
    +
    + +

    ◆ migrate_from_chat_id

    @@ -643,8 +1096,8 @@

    -

    ◆ migrate_to_chat_id

    + +

    ◆ migrate_to_chat_id

    @@ -658,8 +1111,8 @@

    -

    ◆ new_chat_members

    + +

    ◆ new_chat_members

    @@ -673,8 +1126,8 @@

    -

    ◆ new_chat_photos

    + +

    ◆ new_chat_photos

    @@ -688,8 +1141,8 @@

    -

    ◆ new_chat_title

    + +

    ◆ new_chat_title

    @@ -703,14 +1156,29 @@

    -

    ◆ passport_data

    + +

    ◆ paid_media

    + +
    +
    + + + + +
    struct telebot_paid_media_info* telebot_message::paid_media
    +
    +

    Optional. Message contains paid media; information about the paid media

    + +
    +
    + +

    ◆ passport_data

    - +
    struct telebot_passport_data* telebot_message::passport_datastruct telebot_passport_data* telebot_message::passport_data
    @@ -718,8 +1186,8 @@

    -

    ◆ photos

    + +

    ◆ photos

    @@ -733,8 +1201,8 @@

    -

    ◆ pinned_message

    + +

    ◆ pinned_message

    @@ -748,8 +1216,8 @@

    -

    ◆ poll

    + +

    ◆ poll

    @@ -763,14 +1231,59 @@

    -

    ◆ reply_markup

    + +

    ◆ proximity_alert_triggered

    - + + +
    struct inline_keyboard_markup* telebot_message::reply_markupstruct telebot_proximity_alert_triggered* telebot_message::proximity_alert_triggered
    +
    +

    Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

    + +
    +
    + +

    ◆ quote

    + +
    +
    + + + + +
    struct telebot_text_quote* telebot_message::quote
    +
    +

    Optional. For replies that quote part of the original message, the quoted part

    + +
    +
    + +

    ◆ refunded_payment

    + +
    +
    + + + + +
    struct telebot_refunded_payment* telebot_message::refunded_payment
    +
    +

    Optional. Message is a service message about a refunded payment

    + +
    +
    + +

    ◆ reply_markup

    + +
    +
    + + +
    struct telebot_inline_keyboard_markup* telebot_message::reply_markup
    @@ -778,8 +1291,8 @@

    -

    ◆ reply_to_message

    + +

    ◆ reply_to_message

    @@ -793,8 +1306,83 @@

    -

    ◆ sticker

    + +

    ◆ reply_to_story

    + +
    +
    + + + + +
    struct telebot_story* telebot_message::reply_to_story
    +
    +

    Optional. For replies to a story, the original story

    + +
    +
    + +

    ◆ sender_boost_count

    + +
    +
    + + + + +
    int telebot_message::sender_boost_count
    +
    +

    Optional. If the sender of the message boosted the chat, the number of boosts

    + +
    +
    + +

    ◆ sender_business_bot

    + +
    +
    + + + + +
    struct telebot_user* telebot_message::sender_business_bot
    +
    +

    Optional. The bot that actually sent the message on behalf of the business account.

    + +
    +
    + +

    ◆ sender_chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_message::sender_chat
    +
    +

    Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

    + +
    +
    + +

    ◆ show_caption_above_media

    + +
    +
    + + + + +
    bool telebot_message::show_caption_above_media
    +
    +

    Optional. True, if the caption must be shown above the message media

    + +
    +
    + +

    ◆ sticker

    @@ -808,14 +1396,14 @@

    -

    ◆ successful_payment

    + +

    ◆ successful_payment

    - +
    struct telebot_successful_payment* telebot_message::successful_paymentstruct telebot_successful_payment* telebot_message::successful_payment
    @@ -823,8 +1411,8 @@

    -

    ◆ supergroup_chat_created

    + +

    ◆ supergroup_chat_created

    @@ -838,8 +1426,8 @@

    -

    ◆ text

    + +

    ◆ text

    @@ -853,8 +1441,38 @@

    -

    ◆ venue

    + +

    ◆ unique_gift

    + +
    +
    + + + + +
    struct telebot_unique_gift_info* telebot_message::unique_gift
    +
    +

    Optional. Service message: a unique gift was sent or received

    + +
    +
    + +

    ◆ users_shared

    + +
    +
    + + + + +
    struct telebot_users_shared* telebot_message::users_shared
    +
    +

    Optional. Service message: users were shared with the bot

    + +
    +
    + +

    ◆ venue

    @@ -868,8 +1486,23 @@

    -

    ◆ video

    + +

    ◆ via_bot

    + +
    +
    + + + + +
    struct telebot_user* telebot_message::via_bot
    +
    +

    Optional. Bot through which the message was sent

    + +
    +
    + +

    ◆ video

    @@ -883,8 +1516,68 @@

    -

    ◆ video_note

    + +

    ◆ video_chat_ended

    + +
    +
    + + + + +
    struct telebot_video_chat_ended* telebot_message::video_chat_ended
    +
    +

    Optional. Service message: video chat ended.

    + +
    +
    + +

    ◆ video_chat_participants_invited

    + +
    +
    + + + + +
    struct telebot_video_chat_participants_invited* telebot_message::video_chat_participants_invited
    +
    +

    Optional. Service message: new participants invited to a video chat.

    + +
    +
    + +

    ◆ video_chat_scheduled

    + +
    +
    + + + + +
    struct telebot_video_chat_scheduled* telebot_message::video_chat_scheduled
    +
    +

    Optional. Service message: video chat scheduled.

    + +
    +
    + +

    ◆ video_chat_started

    + +
    +
    + + + + +
    struct telebot_video_chat_started* telebot_message::video_chat_started
    +
    +

    Optional. Service message: video chat started.

    + +
    +
    + +

    ◆ video_note

    @@ -898,8 +1591,8 @@

    -

    ◆ voice

    + +

    ◆ voice

    + +

    ◆ web_app_data

    + +
    +
    + + + + +
    struct telebot_web_app_data* telebot_message::web_app_data
    +
    +

    Optional. Service message: data sent by a Web App.

    + +
    +
    + +

    ◆ write_access_allowed

    + +
    +
    + + + + +
    struct telebot_write_access_allowed* telebot_message::write_access_allowed
    +
    +

    Optional. Service message: the user allowed the bot to write messages

    +

    The documentation for this struct was generated from the following file:
      @@ -919,9 +1642,7 @@

      diff --git a/docs/structtelebot__message__auto__delete__timer__changed-members.html b/docs/structtelebot__message__auto__delete__timer__changed-members.html new file mode 100644 index 0000000..d0651e3 --- /dev/null +++ b/docs/structtelebot__message__auto__delete__timer__changed-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
      +
      + + + + + + +
      +
      Telebot 9.4 +
      +
      Library for Telegram bot API
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      +
      telebot_message_auto_delete_timer_changed Member List
      +
      +
      + +

      This is the complete list of members for telebot_message_auto_delete_timer_changed, including all inherited members.

      + + +
      message_auto_delete_timetelebot_message_auto_delete_timer_changed
      + + + + diff --git a/docs/structtelebot__message__auto__delete__timer__changed.html b/docs/structtelebot__message__auto__delete__timer__changed.html new file mode 100644 index 0000000..237a3fd --- /dev/null +++ b/docs/structtelebot__message__auto__delete__timer__changed.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_message_auto_delete_timer_changed Struct Reference + + + + + + + + + +
      +
      + + + + + + +
      +
      Telebot 9.4 +
      +
      Library for Telegram bot API
      +
      +
      + + + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +
      +
      + +
      +
      + +
      telebot_message_auto_delete_timer_changed Struct Reference
      +
      +
      + +

      This object represents a service message about a change in auto-delete timer settings. + More...

      + +

      #include <telebot-types.h>

      + + + + +

      +Public Attributes

      int message_auto_delete_time
       
      +

      Detailed Description

      +

      This object represents a service message about a change in auto-delete timer settings.

      +

      Member Data Documentation

      + +

      ◆ message_auto_delete_time

      + +
      +
      + + + + +
      int telebot_message_auto_delete_timer_changed::message_auto_delete_time
      +
      +

      New auto-delete time for messages in the chat; in seconds

      + +
      +
      +
      The documentation for this struct was generated from the following file: +
      + + + + diff --git a/docs/structtelebot__message__entity-members.html b/docs/structtelebot__message__entity-members.html index 4006404..422ad3f 100644 --- a/docs/structtelebot__message__entity-members.html +++ b/docs/structtelebot__message__entity-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
      - - + @@ -31,17 +30,21 @@
      -
      Telebot -  4.7.0 +
      +
      Telebot 9.4
      Library for Telegram bot API
      - + @@ -53,32 +56,36 @@
      - +
      +
      +
      +
      +
      Loading...
      +
      Searching...
      +
      No Matches
      +
      +
      +

    -
    -
    telebot_message_entity Member List
    +
    telebot_message_entity Member List
    diff --git a/docs/structtelebot__message__entity.html b/docs/structtelebot__message__entity.html index c4d8b26..5a6f264 100644 --- a/docs/structtelebot__message__entity.html +++ b/docs/structtelebot__message__entity.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_message_entity Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_message_entity Struct Reference
    +
    telebot_message_entity Struct Reference

    @@ -73,26 +82,26 @@

    #include <telebot-types.h>

    - - + - + - + - + - + - +

    +

    Public Attributes

    char * type
    char * type
     
    int offset
    int offset
     
    int length
    int length
     
    char * url
    char * url
     
    telebot_user_tuser
    telebot_user_tuser
     
    char * language
    char * language
     

    Detailed Description

    This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

    Member Data Documentation

    - -

    ◆ language

    + +

    ◆ language

    @@ -106,8 +115,8 @@

    -

    ◆ length

    + +

    ◆ length

    @@ -121,8 +130,8 @@

    -

    ◆ offset

    + +

    ◆ offset

    @@ -136,8 +145,8 @@

    -

    ◆ type

    + +

    ◆ type

    - -

    ◆ url

    + +

    ◆ url

    @@ -166,14 +175,14 @@

    -

    ◆ user

    + +

    ◆ user

    - +
    telebot_user_t* telebot_message_entity::usertelebot_user_t* telebot_message_entity::user
    @@ -187,9 +196,7 @@

    diff --git a/docs/structtelebot__message__origin-members.html b/docs/structtelebot__message__origin-members.html new file mode 100644 index 0000000..879ed9d --- /dev/null +++ b/docs/structtelebot__message__origin-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_message_origin Member List
    +
    + + + + + diff --git a/docs/structtelebot__message__origin.html b/docs/structtelebot__message__origin.html new file mode 100644 index 0000000..8ee65f5 --- /dev/null +++ b/docs/structtelebot__message__origin.html @@ -0,0 +1,219 @@ + + + + + + + +Telebot: telebot_message_origin Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_message_origin Struct Reference
    +
    +
    + +

    This object describes the origin of a message. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * type
     
    long date
     
    struct telebot_usersender_user
     
    char * sender_user_name
     
    struct telebot_chatsender_chat
     
    char * author_signature
     
    int message_id
     
    +

    Detailed Description

    +

    This object describes the origin of a message.

    +

    Member Data Documentation

    + +

    ◆ author_signature

    + +
    +
    + + + + +
    char* telebot_message_origin::author_signature
    +
    +

    Optional. For messages originally sent by an anonymous chat administrator, original message author signature

    + +
    +
    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_message_origin::date
    +
    +

    Date the message was sent originally in Unix time

    + +
    +
    + +

    ◆ message_id

    + +
    +
    + + + + +
    int telebot_message_origin::message_id
    +
    +

    Optional. Unique message identifier inside the chat

    + +
    +
    + +

    ◆ sender_chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_message_origin::sender_chat
    +
    +

    Optional. Chat that sent the message originally

    + +
    +
    + +

    ◆ sender_user

    + +
    +
    + + + + +
    struct telebot_user* telebot_message_origin::sender_user
    +
    +

    Optional. User that sent the message originally

    + +
    +
    + +

    ◆ sender_user_name

    + +
    +
    + + + + +
    char* telebot_message_origin::sender_user_name
    +
    +

    Optional. Name of the user that sent the message originally

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_message_origin::type
    +
    +

    Type of the message origin, can be "user", "hidden_user", "chat", "channel"

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__message__reaction__count__updated-members.html b/docs/structtelebot__message__reaction__count__updated-members.html new file mode 100644 index 0000000..77af436 --- /dev/null +++ b/docs/structtelebot__message__reaction__count__updated-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_message_reaction_count_updated Member List
    +
    + + + + + diff --git a/docs/structtelebot__message__reaction__count__updated.html b/docs/structtelebot__message__reaction__count__updated.html new file mode 100644 index 0000000..904e3b1 --- /dev/null +++ b/docs/structtelebot__message__reaction__count__updated.html @@ -0,0 +1,171 @@ + + + + + + + +Telebot: telebot_message_reaction_count_updated Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_message_reaction_count_updated Struct Reference
    +
    +
    + +

    This object represents reaction changes on a message with anonymous reactions. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + +

    +Public Attributes

    struct telebot_chatchat
     
    int message_id
     
    long date
     
    struct telebot_reaction_countreactions
     
    +int count_reactions
     
    +

    Detailed Description

    +

    This object represents reaction changes on a message with anonymous reactions.

    +

    Member Data Documentation

    + +

    ◆ chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_message_reaction_count_updated::chat
    +
    +

    The chat where the reactions were changed

    + +
    +
    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_message_reaction_count_updated::date
    +
    +

    Date of the change in Unix time

    + +
    +
    + +

    ◆ message_id

    + +
    +
    + + + + +
    int telebot_message_reaction_count_updated::message_id
    +
    +

    Unique identifier of the message inside the chat

    + +
    +
    + +

    ◆ reactions

    + +
    +
    + + + + +
    struct telebot_reaction_count* telebot_message_reaction_count_updated::reactions
    +
    +

    List of reactions that are present on the message

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__message__reaction__updated-members.html b/docs/structtelebot__message__reaction__updated-members.html new file mode 100644 index 0000000..f929a2e --- /dev/null +++ b/docs/structtelebot__message__reaction__updated-members.html @@ -0,0 +1,94 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_message_reaction_updated Member List
    +
    + + + + + diff --git a/docs/structtelebot__message__reaction__updated.html b/docs/structtelebot__message__reaction__updated.html new file mode 100644 index 0000000..f2be9c5 --- /dev/null +++ b/docs/structtelebot__message__reaction__updated.html @@ -0,0 +1,225 @@ + + + + + + + +Telebot: telebot_message_reaction_updated Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_message_reaction_updated Struct Reference
    +
    +
    + +

    This object represents a change of a reaction on a message performed by a user. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    struct telebot_chatchat
     
    int message_id
     
    struct telebot_useruser
     
    struct telebot_chatactor_chat
     
    long date
     
    struct telebot_reaction_typeold_reaction
     
    +int count_old_reaction
     
    struct telebot_reaction_typenew_reaction
     
    +int count_new_reaction
     
    +

    Detailed Description

    +

    This object represents a change of a reaction on a message performed by a user.

    +

    Member Data Documentation

    + +

    ◆ actor_chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_message_reaction_updated::actor_chat
    +
    +

    Optional. The chat on behalf of which the reaction was changed, if the reaction was changed on behalf of a chat

    + +
    +
    + +

    ◆ chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_message_reaction_updated::chat
    +
    +

    The chat where the reaction was changed

    + +
    +
    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_message_reaction_updated::date
    +
    +

    Date of the change in Unix time

    + +
    +
    + +

    ◆ message_id

    + +
    +
    + + + + +
    int telebot_message_reaction_updated::message_id
    +
    +

    Unique identifier of the message inside the chat

    + +
    +
    + +

    ◆ new_reaction

    + +
    +
    + + + + +
    struct telebot_reaction_type* telebot_message_reaction_updated::new_reaction
    +
    +

    List of reaction types that are set by the user

    + +
    +
    + +

    ◆ old_reaction

    + +
    +
    + + + + +
    struct telebot_reaction_type* telebot_message_reaction_updated::old_reaction
    +
    +

    List of reaction types that were set by the user

    + +
    +
    + +

    ◆ user

    + +
    +
    + + + + +
    struct telebot_user* telebot_message_reaction_updated::user
    +
    +

    Optional. The user that changed the reaction, if the reaction was changed on behalf of a user

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__order__info-members.html b/docs/structtelebot__order__info-members.html new file mode 100644 index 0000000..0da286e --- /dev/null +++ b/docs/structtelebot__order__info-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_order_info Member List
    +
    +
    + +

    This is the complete list of members for telebot_order_info, including all inherited members.

    + + + + + +
    emailtelebot_order_info
    nametelebot_order_info
    phone_numbertelebot_order_info
    shipping_addresstelebot_order_info
    + + + + diff --git a/docs/structtelebot__order__info.html b/docs/structtelebot__order__info.html new file mode 100644 index 0000000..b75c6e8 --- /dev/null +++ b/docs/structtelebot__order__info.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_order_info Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_order_info Struct Reference
    +
    +
    + +

    This object represents information about an order. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + +

    +Public Attributes

    char * name
     
    char * phone_number
     
    char * email
     
    struct telebot_shipping_addressshipping_address
     
    +

    Detailed Description

    +

    This object represents information about an order.

    +

    Member Data Documentation

    + +

    ◆ email

    + +
    +
    + + + + +
    char* telebot_order_info::email
    +
    +

    Optional. User's email address

    + +
    +
    + +

    ◆ name

    + +
    +
    + + + + +
    char* telebot_order_info::name
    +
    +

    Optional. User name

    + +
    +
    + +

    ◆ phone_number

    + +
    +
    + + + + +
    char* telebot_order_info::phone_number
    +
    +

    Optional. User's phone number

    + +
    +
    + +

    ◆ shipping_address

    + +
    +
    + + + + +
    struct telebot_shipping_address* telebot_order_info::shipping_address
    +
    +

    Optional. User's shipping address

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__paid__media-members.html b/docs/structtelebot__paid__media-members.html new file mode 100644 index 0000000..98f5039 --- /dev/null +++ b/docs/structtelebot__paid__media-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_paid_media Member List
    +
    + + + + + diff --git a/docs/structtelebot__paid__media.html b/docs/structtelebot__paid__media.html new file mode 100644 index 0000000..d4feec0 --- /dev/null +++ b/docs/structtelebot__paid__media.html @@ -0,0 +1,205 @@ + + + + + + + +Telebot: telebot_paid_media Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_paid_media Struct Reference
    +
    +
    + +

    This object describes paid media. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * type
     
    int width
     
    int height
     
    int duration
     
    struct telebot_photophotos
     
    +int count_photos
     
    struct telebot_videovideo
     
    +

    Detailed Description

    +

    This object describes paid media.

    +

    Member Data Documentation

    + +

    ◆ duration

    + +
    +
    + + + + +
    int telebot_paid_media::duration
    +
    +

    Optional. Duration of the media in seconds as defined by the sender

    + +
    +
    + +

    ◆ height

    + +
    +
    + + + + +
    int telebot_paid_media::height
    +
    +

    Optional. Media height as defined by the sender

    + +
    +
    + +

    ◆ photos

    + +
    +
    + + + + +
    struct telebot_photo* telebot_paid_media::photos
    +
    +

    Optional. The photo

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_paid_media::type
    +
    +

    Type of the paid media, can be "preview", "photo", "video"

    + +
    +
    + +

    ◆ video

    + +
    +
    + + + + +
    struct telebot_video* telebot_paid_media::video
    +
    +

    Optional. The video

    + +
    +
    + +

    ◆ width

    + +
    +
    + + + + +
    int telebot_paid_media::width
    +
    +

    Optional. Media width as defined by the sender

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__paid__media__info-members.html b/docs/structtelebot__paid__media__info-members.html new file mode 100644 index 0000000..6eeabc8 --- /dev/null +++ b/docs/structtelebot__paid__media__info-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_paid_media_info Member List
    +
    +
    + +

    This is the complete list of members for telebot_paid_media_info, including all inherited members.

    + + + + +
    count_paid_media (defined in telebot_paid_media_info)telebot_paid_media_info
    paid_mediatelebot_paid_media_info
    star_counttelebot_paid_media_info
    + + + + diff --git a/docs/structtelebot__paid__media__info.html b/docs/structtelebot__paid__media__info.html new file mode 100644 index 0000000..3a9fa9f --- /dev/null +++ b/docs/structtelebot__paid__media__info.html @@ -0,0 +1,137 @@ + + + + + + + +Telebot: telebot_paid_media_info Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_paid_media_info Struct Reference
    +
    +
    + +

    Describes the paid media added to a message. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    int star_count
     
    struct telebot_paid_mediapaid_media
     
    +int count_paid_media
     
    +

    Detailed Description

    +

    Describes the paid media added to a message.

    +

    Member Data Documentation

    + +

    ◆ paid_media

    + +
    +
    + + + + +
    struct telebot_paid_media* telebot_paid_media_info::paid_media
    +
    +

    Information about the paid media

    + +
    +
    + +

    ◆ star_count

    + +
    +
    + + + + +
    int telebot_paid_media_info::star_count
    +
    +

    The number of Telegram Stars that must be paid to buy access to the media

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__paid__media__purchased-members.html b/docs/structtelebot__paid__media__purchased-members.html new file mode 100644 index 0000000..7d56518 --- /dev/null +++ b/docs/structtelebot__paid__media__purchased-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_paid_media_purchased Member List
    +
    +
    + +

    This is the complete list of members for telebot_paid_media_purchased, including all inherited members.

    + + + +
    fromtelebot_paid_media_purchased
    paid_media_payloadtelebot_paid_media_purchased
    + + + + diff --git a/docs/structtelebot__paid__media__purchased.html b/docs/structtelebot__paid__media__purchased.html new file mode 100644 index 0000000..01f89c4 --- /dev/null +++ b/docs/structtelebot__paid__media__purchased.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_paid_media_purchased Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_paid_media_purchased Struct Reference
    +
    +
    + +

    This object contains information about a paid media purchase. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    struct telebot_userfrom
     
    char * paid_media_payload
     
    +

    Detailed Description

    +

    This object contains information about a paid media purchase.

    +

    Member Data Documentation

    + +

    ◆ from

    + +
    +
    + + + + +
    struct telebot_user* telebot_paid_media_purchased::from
    +
    +

    User who purchased the media

    + +
    +
    + +

    ◆ paid_media_payload

    + +
    +
    + + + + +
    char* telebot_paid_media_purchased::paid_media_payload
    +
    +

    Bot-specified paid media payload

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__passport__data-members.html b/docs/structtelebot__passport__data-members.html new file mode 100644 index 0000000..7414988 --- /dev/null +++ b/docs/structtelebot__passport__data-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_passport_data Member List
    +
    +
    + +

    This is the complete list of members for telebot_passport_data, including all inherited members.

    + + + + +
    count_data (defined in telebot_passport_data)telebot_passport_data
    credentialstelebot_passport_data
    datatelebot_passport_data
    + + + + diff --git a/docs/structtelebot__passport__data.html b/docs/structtelebot__passport__data.html new file mode 100644 index 0000000..fb30029 --- /dev/null +++ b/docs/structtelebot__passport__data.html @@ -0,0 +1,137 @@ + + + + + + + +Telebot: telebot_passport_data Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_passport_data Struct Reference
    +
    +
    + +

    Contains information about Telegram Passport data which was shared with the bot by the user. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    struct telebot_encrypted_passport_elementdata
     
    +int count_data
     
    struct telebot_encrypted_credentialscredentials
     
    +

    Detailed Description

    +

    Contains information about Telegram Passport data which was shared with the bot by the user.

    +

    Member Data Documentation

    + +

    ◆ credentials

    + +
    +
    + + + + +
    struct telebot_encrypted_credentials* telebot_passport_data::credentials
    +
    +

    Encrypted credentials required to decrypt the data

    + +
    +
    + +

    ◆ data

    + +
    +
    + + + + +
    struct telebot_encrypted_passport_element* telebot_passport_data::data
    +
    +

    Array with information about documents and other Telegram Passport elements that were shared with the bot

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__passport__element__error-members.html b/docs/structtelebot__passport__element__error-members.html new file mode 100644 index 0000000..8da93a4 --- /dev/null +++ b/docs/structtelebot__passport__element__error-members.html @@ -0,0 +1,94 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_passport_element_error Member List
    +
    + + + + + diff --git a/docs/structtelebot__passport__element__error.html b/docs/structtelebot__passport__element__error.html new file mode 100644 index 0000000..e414620 --- /dev/null +++ b/docs/structtelebot__passport__element__error.html @@ -0,0 +1,239 @@ + + + + + + + +Telebot: telebot_passport_element_error Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_passport_element_error Struct Reference
    +
    +
    + +

    This object represents an error in the Telegram Passport element. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * source
     
    char * type
     
    char * field_name
     
    char * data_hash
     
    char * message
     
    char * file_hash
     
    char ** file_hashes
     
    +int count_file_hashes
     
    char * element_hash
     
    +

    Detailed Description

    +

    This object represents an error in the Telegram Passport element.

    +

    Member Data Documentation

    + +

    ◆ data_hash

    + +
    +
    + + + + +
    char* telebot_passport_element_error::data_hash
    +
    +

    Base64-encoded data hash

    + +
    +
    + +

    ◆ element_hash

    + +
    +
    + + + + +
    char* telebot_passport_element_error::element_hash
    +
    +

    Base64-encoded element hash

    + +
    +
    + +

    ◆ field_name

    + +
    +
    + + + + +
    char* telebot_passport_element_error::field_name
    +
    +

    Name of the data field which has the error

    + +
    +
    + +

    ◆ file_hash

    + +
    +
    + + + + +
    char* telebot_passport_element_error::file_hash
    +
    +

    Base64-encoded file hash

    + +
    +
    + +

    ◆ file_hashes

    + +
    +
    + + + + +
    char** telebot_passport_element_error::file_hashes
    +
    +

    List of base64-encoded file hashes

    + +
    +
    + +

    ◆ message

    + +
    +
    + + + + +
    char* telebot_passport_element_error::message
    +
    +

    Error message

    + +
    +
    + +

    ◆ source

    + +
    +
    + + + + +
    char* telebot_passport_element_error::source
    +
    +

    Error source

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_passport_element_error::type
    +
    +

    The section of the user's Telegram Passport which has the error

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__passport__file-members.html b/docs/structtelebot__passport__file-members.html new file mode 100644 index 0000000..bd7fc0a --- /dev/null +++ b/docs/structtelebot__passport__file-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_passport_file Member List
    +
    + + + + + diff --git a/docs/structtelebot__passport__file.html b/docs/structtelebot__passport__file.html new file mode 100644 index 0000000..78767b7 --- /dev/null +++ b/docs/structtelebot__passport__file.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_passport_file Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_passport_file Struct Reference
    +
    +
    + +

    This object represents an internal identifier of a user in Telegram Passport. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + +

    +Public Attributes

    char * file_id
     
    char * file_unique_id
     
    int file_size
     
    long date
     
    +

    Detailed Description

    +

    This object represents an internal identifier of a user in Telegram Passport.

    +

    Member Data Documentation

    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_passport_file::date
    +
    +

    Unix time when the file was uploaded

    + +
    +
    + +

    ◆ file_id

    + +
    +
    + + + + +
    char* telebot_passport_file::file_id
    +
    +

    Identifier for this file, which can be used to download or reuse the file

    + +
    +
    + +

    ◆ file_size

    + +
    +
    + + + + +
    int telebot_passport_file::file_size
    +
    +

    File size

    + +
    +
    + +

    ◆ file_unique_id

    + +
    +
    + + + + +
    char* telebot_passport_file::file_unique_id
    +
    +

    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.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__photo-members.html b/docs/structtelebot__photo-members.html index 455ca63..62794c7 100644 --- a/docs/structtelebot__photo-members.html +++ b/docs/structtelebot__photo-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,31 +56,35 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_photo Member List
    +
    telebot_photo Member List
    diff --git a/docs/structtelebot__photo.html b/docs/structtelebot__photo.html index 75e48bc..a12a01a 100644 --- a/docs/structtelebot__photo.html +++ b/docs/structtelebot__photo.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_photo Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_photo Struct Reference
    +
    telebot_photo Struct Reference

    @@ -73,24 +82,24 @@

    #include <telebot-types.h>

    - - + - + - + - + - +

    +

    Public Attributes

    char * file_id
    char * file_id
     
    char * file_unique_id
    char * file_unique_id
     
    int width
    int width
     
    int height
    int height
     
    int file_size
    int file_size
     

    Detailed Description

    This object represents one size of a photo or a file / sticker thumbnail.

    Member Data Documentation

    - -

    ◆ file_id

    + +

    ◆ file_id

    @@ -104,8 +113,8 @@

    -

    ◆ file_size

    + +

    ◆ file_size

    @@ -119,8 +128,8 @@

    -

    ◆ file_unique_id

    + +

    ◆ file_unique_id

    @@ -134,8 +143,8 @@

    -

    ◆ height

    + +

    ◆ height

    @@ -149,8 +158,8 @@

    -

    ◆ width

    + +

    ◆ width

    @@ -170,9 +179,7 @@

    diff --git a/docs/structtelebot__poll-members.html b/docs/structtelebot__poll-members.html index 4d75592..9f9f782 100644 --- a/docs/structtelebot__poll-members.html +++ b/docs/structtelebot__poll-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,36 +56,40 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_poll Member List
    +
    telebot_poll Member List
    diff --git a/docs/structtelebot__poll.html b/docs/structtelebot__poll.html index 6a101c8..27fa7f7 100644 --- a/docs/structtelebot__poll.html +++ b/docs/structtelebot__poll.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_poll Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_poll Struct Reference
    +
    telebot_poll Struct Reference

    @@ -73,35 +82,35 @@

    #include <telebot-types.h>

    - - + - + - + - - + - + - + - + - + - +

    +

    Public Attributes

    char * id
    char * id
     
    char * question
    char * question
     
    telebot_poll_option_toptions
    telebot_poll_option_toptions
     
    +
    int count_options
     
    int total_voter_count
    int total_voter_count
     
    bool is_closed
    bool is_closed
     
    bool is_anonymous
    bool is_anonymous
     
    char * type
    char * type
     
    bool allows_multiple_answers
    bool allows_multiple_answers
     
    int correct_option_id
    int correct_option_id
     

    Detailed Description

    This object contains information about a poll.

    Member Data Documentation

    - -

    ◆ allows_multiple_answers

    + +

    ◆ allows_multiple_answers

    @@ -115,8 +124,8 @@

    -

    ◆ correct_option_id

    + +

    ◆ correct_option_id

    @@ -130,8 +139,8 @@

    -

    ◆ id

    + +

    ◆ id

    @@ -145,8 +154,8 @@

    -

    ◆ is_anonymous

    + +

    ◆ is_anonymous

    @@ -160,8 +169,8 @@

    -

    ◆ is_closed

    + +

    ◆ is_closed

    @@ -175,14 +184,14 @@

    -

    ◆ options

    + +

    ◆ options

    - +
    telebot_poll_option_t* telebot_poll::optionstelebot_poll_option_t* telebot_poll::options
    @@ -190,8 +199,8 @@

    -

    ◆ question

    + +

    ◆ question

    @@ -205,8 +214,8 @@

    -

    ◆ total_voter_count

    + +

    ◆ total_voter_count

    @@ -220,8 +229,8 @@

    -

    ◆ type

    + +

    ◆ type

    @@ -241,9 +250,7 @@

    diff --git a/docs/structtelebot__poll__answer-members.html b/docs/structtelebot__poll__answer-members.html index de880c1..703a2c2 100644 --- a/docs/structtelebot__poll__answer-members.html +++ b/docs/structtelebot__poll__answer-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,30 +56,34 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_poll_answer Member List
    +
    telebot_poll_answer Member List
    diff --git a/docs/structtelebot__poll__answer.html b/docs/structtelebot__poll__answer.html index 066f1e9..ae7e093 100644 --- a/docs/structtelebot__poll__answer.html +++ b/docs/structtelebot__poll__answer.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_poll_answer Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_poll_answer Struct Reference
    +
    telebot_poll_answer Struct Reference

    @@ -73,23 +82,23 @@

    #include <telebot-types.h>

    - - + - + - + -

    +

    Public Attributes

    char * poll_id
    char * poll_id
     
    struct telebot_useruser
    struct telebot_useruser
     
    int * option_ids
    int * option_ids
     
    +
    int count_option_ids
     

    Detailed Description

    This object represents an answer of a user in a non-anonymous poll.

    Member Data Documentation

    - -

    ◆ option_ids

    + +

    ◆ option_ids

    @@ -103,8 +112,8 @@

    -

    ◆ poll_id

    + +

    ◆ poll_id

    @@ -118,8 +127,8 @@

    -

    ◆ user

    + +

    ◆ user

    @@ -139,9 +148,7 @@

    diff --git a/docs/structtelebot__poll__option-members.html b/docs/structtelebot__poll__option-members.html index f1caef1..0252a74 100644 --- a/docs/structtelebot__poll__option-members.html +++ b/docs/structtelebot__poll__option-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,28 +56,32 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_poll_option Member List
    +
    telebot_poll_option Member List

    This is the complete list of members for telebot_poll_option, including all inherited members.

    - +
    texttelebot_poll_option
    voter_counttelebot_poll_option
    voter_counttelebot_poll_option
    diff --git a/docs/structtelebot__poll__option.html b/docs/structtelebot__poll__option.html index 48dff14..d508820 100644 --- a/docs/structtelebot__poll__option.html +++ b/docs/structtelebot__poll__option.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_poll_option Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_poll_option Struct Reference
    +
    telebot_poll_option Struct Reference

    @@ -73,18 +82,18 @@

    #include <telebot-types.h>

    - - + - +

    +

    Public Attributes

    char * text
    char * text
     
    int voter_count
    int voter_count
     

    Detailed Description

    This object contains information about one answer option in a poll.

    Member Data Documentation

    - -

    ◆ text

    + +

    ◆ text

    @@ -98,8 +107,8 @@

    -

    ◆ voter_count

    + +

    ◆ voter_count

    @@ -119,9 +128,7 @@

    diff --git a/docs/structtelebot__pre__checkout__query-members.html b/docs/structtelebot__pre__checkout__query-members.html new file mode 100644 index 0000000..2f344c4 --- /dev/null +++ b/docs/structtelebot__pre__checkout__query-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_pre_checkout_query Member List
    +
    + + + + + diff --git a/docs/structtelebot__pre__checkout__query.html b/docs/structtelebot__pre__checkout__query.html new file mode 100644 index 0000000..7e40562 --- /dev/null +++ b/docs/structtelebot__pre__checkout__query.html @@ -0,0 +1,219 @@ + + + + + + + +Telebot: telebot_pre_checkout_query Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_pre_checkout_query Struct Reference
    +
    +
    + +

    This object contains information about an incoming pre-checkout query. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * id
     
    struct telebot_userfrom
     
    char * currency
     
    int total_amount
     
    char * invoice_payload
     
    char * shipping_option_id
     
    struct telebot_order_infoorder_info
     
    +

    Detailed Description

    +

    This object contains information about an incoming pre-checkout query.

    +

    Member Data Documentation

    + +

    ◆ currency

    + +
    +
    + + + + +
    char* telebot_pre_checkout_query::currency
    +
    +

    Three-letter ISO 4217 currency code

    + +
    +
    + +

    ◆ from

    + +
    +
    + + + + +
    struct telebot_user* telebot_pre_checkout_query::from
    +
    +

    User who sent the query

    + +
    +
    + +

    ◆ id

    + +
    +
    + + + + +
    char* telebot_pre_checkout_query::id
    +
    +

    Unique query identifier

    + +
    +
    + +

    ◆ invoice_payload

    + +
    +
    + + + + +
    char* telebot_pre_checkout_query::invoice_payload
    +
    +

    Bot specified invoice payload

    + +
    +
    + +

    ◆ order_info

    + +
    +
    + + + + +
    struct telebot_order_info* telebot_pre_checkout_query::order_info
    +
    +

    Optional. Order info provided by the user

    + +
    +
    + +

    ◆ shipping_option_id

    + +
    +
    + + + + +
    char* telebot_pre_checkout_query::shipping_option_id
    +
    +

    Optional. Identifier of the shipping option chosen by the user

    + +
    +
    + +

    ◆ total_amount

    + +
    +
    + + + + +
    int telebot_pre_checkout_query::total_amount
    +
    +

    Total amount in the smallest units of the currency (integer, not float/double).

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__prepared__inline__message-members.html b/docs/structtelebot__prepared__inline__message-members.html new file mode 100644 index 0000000..84f68cd --- /dev/null +++ b/docs/structtelebot__prepared__inline__message-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_prepared_inline_message Member List
    +
    +
    + +

    This is the complete list of members for telebot_prepared_inline_message, including all inherited members.

    + + + +
    expiration_datetelebot_prepared_inline_message
    idtelebot_prepared_inline_message
    + + + + diff --git a/docs/structtelebot__prepared__inline__message.html b/docs/structtelebot__prepared__inline__message.html new file mode 100644 index 0000000..558ddfb --- /dev/null +++ b/docs/structtelebot__prepared__inline__message.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_prepared_inline_message Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_prepared_inline_message Struct Reference
    +
    +
    + +

    This object represents a prepared inline message. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    char * id
     
    long expiration_date
     
    +

    Detailed Description

    +

    This object represents a prepared inline message.

    +

    Member Data Documentation

    + +

    ◆ expiration_date

    + +
    +
    + + + + +
    long telebot_prepared_inline_message::expiration_date
    +
    +

    Expiration date of the prepared message

    + +
    +
    + +

    ◆ id

    + +
    +
    + + + + +
    char* telebot_prepared_inline_message::id
    +
    +

    Unique identifier of the prepared message

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__proximity__alert__triggered-members.html b/docs/structtelebot__proximity__alert__triggered-members.html new file mode 100644 index 0000000..5276352 --- /dev/null +++ b/docs/structtelebot__proximity__alert__triggered-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_proximity_alert_triggered Member List
    +
    + + + + + diff --git a/docs/structtelebot__proximity__alert__triggered.html b/docs/structtelebot__proximity__alert__triggered.html new file mode 100644 index 0000000..b504cff --- /dev/null +++ b/docs/structtelebot__proximity__alert__triggered.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_proximity_alert_triggered Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_proximity_alert_triggered Struct Reference
    +
    +
    + +

    This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    struct telebot_usertraveler
     
    struct telebot_userwatcher
     
    int distance
     
    +

    Detailed Description

    +

    This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location.

    +

    Member Data Documentation

    + +

    ◆ distance

    + +
    +
    + + + + +
    int telebot_proximity_alert_triggered::distance
    +
    +

    The distance between the users

    + +
    +
    + +

    ◆ traveler

    + +
    +
    + + + + +
    struct telebot_user* telebot_proximity_alert_triggered::traveler
    +
    +

    User that triggered the alert

    + +
    +
    + +

    ◆ watcher

    + +
    +
    + + + + +
    struct telebot_user* telebot_proximity_alert_triggered::watcher
    +
    +

    User that set the alert

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__reaction__count-members.html b/docs/structtelebot__reaction__count-members.html new file mode 100644 index 0000000..82851fd --- /dev/null +++ b/docs/structtelebot__reaction__count-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_reaction_count Member List
    +
    +
    + +

    This is the complete list of members for telebot_reaction_count, including all inherited members.

    + + + +
    total_counttelebot_reaction_count
    typetelebot_reaction_count
    + + + + diff --git a/docs/structtelebot__reaction__count.html b/docs/structtelebot__reaction__count.html new file mode 100644 index 0000000..fe63400 --- /dev/null +++ b/docs/structtelebot__reaction__count.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_reaction_count Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_reaction_count Struct Reference
    +
    +
    + +

    This object represents a reaction count. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    struct telebot_reaction_type type
     
    int total_count
     
    +

    Detailed Description

    +

    This object represents a reaction count.

    +

    Member Data Documentation

    + +

    ◆ total_count

    + +
    +
    + + + + +
    int telebot_reaction_count::total_count
    +
    +

    Number of times the reaction was added

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    struct telebot_reaction_type telebot_reaction_count::type
    +
    +

    Type of the reaction

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__reaction__type-members.html b/docs/structtelebot__reaction__type-members.html new file mode 100644 index 0000000..bfd7968 --- /dev/null +++ b/docs/structtelebot__reaction__type-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_reaction_type Member List
    +
    +
    + +

    This is the complete list of members for telebot_reaction_type, including all inherited members.

    + + + + +
    custom_emoji_idtelebot_reaction_type
    emojitelebot_reaction_type
    typetelebot_reaction_type
    + + + + diff --git a/docs/structtelebot__reaction__type.html b/docs/structtelebot__reaction__type.html new file mode 100644 index 0000000..e76239b --- /dev/null +++ b/docs/structtelebot__reaction__type.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_reaction_type Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_reaction_type Struct Reference
    +
    +
    + +

    This object represents a reaction type. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    char * type
     
    char * emoji
     
    char * custom_emoji_id
     
    +

    Detailed Description

    +

    This object represents a reaction type.

    +

    Member Data Documentation

    + +

    ◆ custom_emoji_id

    + +
    +
    + + + + +
    char* telebot_reaction_type::custom_emoji_id
    +
    +

    Optional. Custom emoji identifier.

    + +
    +
    + +

    ◆ emoji

    + +
    +
    + + + + +
    char* telebot_reaction_type::emoji
    +
    +

    Optional. Reaction emoji.

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_reaction_type::type
    +
    +

    Type of the reaction, currently can be "emoji" or "custom_emoji"

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__refunded__payment-members.html b/docs/structtelebot__refunded__payment-members.html new file mode 100644 index 0000000..6423255 --- /dev/null +++ b/docs/structtelebot__refunded__payment-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_refunded_payment Member List
    +
    + + + + + diff --git a/docs/structtelebot__refunded__payment.html b/docs/structtelebot__refunded__payment.html new file mode 100644 index 0000000..2d4ad30 --- /dev/null +++ b/docs/structtelebot__refunded__payment.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: telebot_refunded_payment Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_refunded_payment Struct Reference
    +
    +
    + +

    This object represents a service message about a refunded payment. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + +

    +Public Attributes

    char * currency
     
    int total_amount
     
    char * invoice_payload
     
    char * telegram_payment_charge_id
     
    char * provider_payment_charge_id
     
    +

    Detailed Description

    +

    This object represents a service message about a refunded payment.

    +

    Member Data Documentation

    + +

    ◆ currency

    + +
    +
    + + + + +
    char* telebot_refunded_payment::currency
    +
    +

    Three-letter ISO 4217 currency code

    + +
    +
    + +

    ◆ invoice_payload

    + +
    +
    + + + + +
    char* telebot_refunded_payment::invoice_payload
    +
    +

    Bot specified invoice payload

    + +
    +
    + +

    ◆ provider_payment_charge_id

    + +
    +
    + + + + +
    char* telebot_refunded_payment::provider_payment_charge_id
    +
    +

    Optional. Provider payment identifier

    + +
    +
    + +

    ◆ telegram_payment_charge_id

    + +
    +
    + + + + +
    char* telebot_refunded_payment::telegram_payment_charge_id
    +
    +

    Telegram payment identifier

    + +
    +
    + +

    ◆ total_amount

    + +
    +
    + + + + +
    int telebot_refunded_payment::total_amount
    +
    +

    Total amount in the smallest units of the currency

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__reply__keyboard__markup-members.html b/docs/structtelebot__reply__keyboard__markup-members.html index c7ba485..1d5e27c 100644 --- a/docs/structtelebot__reply__keyboard__markup-members.html +++ b/docs/structtelebot__reply__keyboard__markup-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,32 +56,37 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_reply_keyboard_markup Member List
    +
    telebot_reply_keyboard_markup Member List
    diff --git a/docs/structtelebot__reply__keyboard__markup.html b/docs/structtelebot__reply__keyboard__markup.html index 035b060..1202685 100644 --- a/docs/structtelebot__reply__keyboard__markup.html +++ b/docs/structtelebot__reply__keyboard__markup.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_reply_keyboard_markup Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_reply_keyboard_markup Struct Reference
    +
    telebot_reply_keyboard_markup Struct Reference

    @@ -73,34 +82,51 @@

    #include <telebot-types.h>

    - - + - - - + + + - + - +

    +

    Public Attributes

    telebot_keyboard_button_tkeyboard
    telebot_keyboard_button_tkeyboard
     
    +
    int keyboard_rows
     
    +
    int keyboard_cols
     
    bool resize_keyboard
    bool is_persistent
     
    bool resize_keyboard
     
    bool one_time_keyboard
    bool one_time_keyboard
     
    bool selective
    bool selective
     

    Detailed Description

    This object represents a custom keyboard with reply options.

    Member Data Documentation

    - -

    ◆ keyboard

    + +

    ◆ is_persistent

    + +
    +
    + + + + +
    bool telebot_reply_keyboard_markup::is_persistent
    +
    +

    Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false.

    + +
    +
    + +

    ◆ keyboard

    - +
    telebot_keyboard_button_t* telebot_reply_keyboard_markup::keyboardtelebot_keyboard_button_t* telebot_reply_keyboard_markup::keyboard
    @@ -108,8 +134,8 @@

    -

    ◆ one_time_keyboard

    + +

    ◆ one_time_keyboard

    @@ -123,8 +149,8 @@

    -

    ◆ resize_keyboard

    + +

    ◆ resize_keyboard

    @@ -138,8 +164,8 @@

    -

    ◆ selective

    + +

    ◆ selective

    @@ -159,9 +185,7 @@

    diff --git a/docs/structtelebot__reply__keyboard__remove-members.html b/docs/structtelebot__reply__keyboard__remove-members.html index b1438d1..8e4bde3 100644 --- a/docs/structtelebot__reply__keyboard__remove-members.html +++ b/docs/structtelebot__reply__keyboard__remove-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,28 +56,32 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_reply_keyboard_remove Member List
    +
    telebot_reply_keyboard_remove Member List
    diff --git a/docs/structtelebot__reply__keyboard__remove.html b/docs/structtelebot__reply__keyboard__remove.html index 36b3d11..b69f372 100644 --- a/docs/structtelebot__reply__keyboard__remove.html +++ b/docs/structtelebot__reply__keyboard__remove.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_reply_keyboard_remove Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,28 +73,27 @@ -
    -
    telebot_reply_keyboard_remove Struct Reference
    +
    telebot_reply_keyboard_remove Struct Reference

    -

    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). +

    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). More...

    #include <telebot-types.h>

    - - + - +

    +

    Public Attributes

    bool remove_keyboard
    bool remove_keyboard
     
    bool selective
    bool selective
     

    Detailed Description

    -

    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).

    +

    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).

    Member Data Documentation

    - -

    ◆ remove_keyboard

    + +

    ◆ remove_keyboard

    @@ -98,8 +107,8 @@

    -

    ◆ selective

    + +

    ◆ selective

    @@ -119,9 +128,7 @@

    diff --git a/docs/structtelebot__response__paramters-members.html b/docs/structtelebot__response__paramters-members.html index 21153a8..f449f6c 100644 --- a/docs/structtelebot__response__paramters-members.html +++ b/docs/structtelebot__response__paramters-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,28 +56,32 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_response_paramters Member List
    +
    telebot_response_paramters Member List
    diff --git a/docs/structtelebot__response__paramters.html b/docs/structtelebot__response__paramters.html index 2415697..cad0e96 100644 --- a/docs/structtelebot__response__paramters.html +++ b/docs/structtelebot__response__paramters.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_response_paramters Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_response_paramters Struct Reference
    +
    telebot_response_paramters Struct Reference
    @@ -73,18 +82,18 @@

    #include <telebot-types.h>

    - - + - +

    +

    Public Attributes

    int migrate_to_chat_id
    int migrate_to_chat_id
     
    int retry_after
    int retry_after
     

    Detailed Description

    Contains information about why a request was unsuccessful.

    Member Data Documentation

    - -

    ◆ migrate_to_chat_id

    + +

    ◆ migrate_to_chat_id

    @@ -98,8 +107,8 @@

    -

    ◆ retry_after

    + +

    ◆ retry_after

    @@ -119,9 +128,7 @@

    diff --git a/docs/structtelebot__revenue__withdrawal__state-members.html b/docs/structtelebot__revenue__withdrawal__state-members.html new file mode 100644 index 0000000..e532d7f --- /dev/null +++ b/docs/structtelebot__revenue__withdrawal__state-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_revenue_withdrawal_state Member List
    +
    + + + + + diff --git a/docs/structtelebot__revenue__withdrawal__state.html b/docs/structtelebot__revenue__withdrawal__state.html new file mode 100644 index 0000000..c5710b3 --- /dev/null +++ b/docs/structtelebot__revenue__withdrawal__state.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_revenue_withdrawal_state Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_revenue_withdrawal_state Struct Reference
    +
    +
    + +

    This object describes the state of a revenue withdrawal operation. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    char * type
     
    long date
     
    char * url
     
    +

    Detailed Description

    +

    This object describes the state of a revenue withdrawal operation.

    +

    Member Data Documentation

    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_revenue_withdrawal_state::date
    +
    +

    Optional. Date the withdrawal was completed in Unix time

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_revenue_withdrawal_state::type
    +
    +

    Type of the state, currently one of "pending", "succeeded", "failed"

    + +
    +
    + +

    ◆ url

    + +
    +
    + + + + +
    char* telebot_revenue_withdrawal_state::url
    +
    +

    Optional. An HTTPS URL that can be used to see transaction details

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__sent__web__app__message-members.html b/docs/structtelebot__sent__web__app__message-members.html new file mode 100644 index 0000000..74ba817 --- /dev/null +++ b/docs/structtelebot__sent__web__app__message-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_sent_web_app_message Member List
    +
    +
    + +

    This is the complete list of members for telebot_sent_web_app_message, including all inherited members.

    + + +
    inline_message_idtelebot_sent_web_app_message
    + + + + diff --git a/docs/structtelebot__sent__web__app__message.html b/docs/structtelebot__sent__web__app__message.html new file mode 100644 index 0000000..c631349 --- /dev/null +++ b/docs/structtelebot__sent__web__app__message.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_sent_web_app_message Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_sent_web_app_message Struct Reference
    +
    +
    + +

    This object represents a message sent via a Web App. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    char * inline_message_id
     
    +

    Detailed Description

    +

    This object represents a message sent via a Web App.

    +

    Member Data Documentation

    + +

    ◆ inline_message_id

    + +
    +
    + + + + +
    char* telebot_sent_web_app_message::inline_message_id
    +
    +

    Optional. Identifier of the sent inline message.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__shared__user-members.html b/docs/structtelebot__shared__user-members.html new file mode 100644 index 0000000..a681797 --- /dev/null +++ b/docs/structtelebot__shared__user-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_shared_user Member List
    +
    + + + + + diff --git a/docs/structtelebot__shared__user.html b/docs/structtelebot__shared__user.html new file mode 100644 index 0000000..a8ed372 --- /dev/null +++ b/docs/structtelebot__shared__user.html @@ -0,0 +1,188 @@ + + + + + + + +Telebot: telebot_shared_user Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_shared_user Struct Reference
    +
    +
    + +

    This object contains information about a user that was shared with the bot. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + +

    +Public Attributes

    long long int user_id
     
    char * first_name
     
    char * last_name
     
    char * username
     
    struct telebot_photophoto
     
    +int count_photo
     
    +

    Detailed Description

    +

    This object contains information about a user that was shared with the bot.

    +

    Member Data Documentation

    + +

    ◆ first_name

    + +
    +
    + + + + +
    char* telebot_shared_user::first_name
    +
    +

    Optional. First name of the user

    + +
    +
    + +

    ◆ last_name

    + +
    +
    + + + + +
    char* telebot_shared_user::last_name
    +
    +

    Optional. Last name of the user

    + +
    +
    + +

    ◆ photo

    + +
    +
    + + + + +
    struct telebot_photo* telebot_shared_user::photo
    +
    +

    Optional. Available sizes of the chat photo

    + +
    +
    + +

    ◆ user_id

    + +
    +
    + + + + +
    long long int telebot_shared_user::user_id
    +
    +

    Identifier of the shared user.

    + +
    +
    + +

    ◆ username

    + +
    +
    + + + + +
    char* telebot_shared_user::username
    +
    +

    Optional. Username of the user

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__shipping__address-members.html b/docs/structtelebot__shipping__address-members.html new file mode 100644 index 0000000..1c53284 --- /dev/null +++ b/docs/structtelebot__shipping__address-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_shipping_address Member List
    +
    + + + + + diff --git a/docs/structtelebot__shipping__address.html b/docs/structtelebot__shipping__address.html new file mode 100644 index 0000000..ef435cf --- /dev/null +++ b/docs/structtelebot__shipping__address.html @@ -0,0 +1,202 @@ + + + + + + + +Telebot: telebot_shipping_address Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_shipping_address Struct Reference
    +
    +
    + +

    This object represents a shipping address. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + +

    +Public Attributes

    char * country_code
     
    char * state
     
    char * city
     
    char * street_line1
     
    char * street_line2
     
    char * post_code
     
    +

    Detailed Description

    +

    This object represents a shipping address.

    +

    Member Data Documentation

    + +

    ◆ city

    + +
    +
    + + + + +
    char* telebot_shipping_address::city
    +
    +

    City

    + +
    +
    + +

    ◆ country_code

    + +
    +
    + + + + +
    char* telebot_shipping_address::country_code
    +
    +

    ISO 3166-1 alpha-2 country code

    + +
    +
    + +

    ◆ post_code

    + +
    +
    + + + + +
    char* telebot_shipping_address::post_code
    +
    +

    Address post code

    + +
    +
    + +

    ◆ state

    + +
    +
    + + + + +
    char* telebot_shipping_address::state
    +
    +

    State, if applicable

    + +
    +
    + +

    ◆ street_line1

    + +
    +
    + + + + +
    char* telebot_shipping_address::street_line1
    +
    +

    First line for the address

    + +
    +
    + +

    ◆ street_line2

    + +
    +
    + + + + +
    char* telebot_shipping_address::street_line2
    +
    +

    Second line for the address

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__shipping__query-members.html b/docs/structtelebot__shipping__query-members.html new file mode 100644 index 0000000..cc2ce6f --- /dev/null +++ b/docs/structtelebot__shipping__query-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_shipping_query Member List
    +
    + + + + + diff --git a/docs/structtelebot__shipping__query.html b/docs/structtelebot__shipping__query.html new file mode 100644 index 0000000..d17629f --- /dev/null +++ b/docs/structtelebot__shipping__query.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_shipping_query Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_shipping_query Struct Reference
    +
    +
    + +

    This object contains information about an incoming shipping query. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + +

    +Public Attributes

    char * id
     
    struct telebot_userfrom
     
    char * invoice_payload
     
    struct telebot_shipping_addressshipping_address
     
    +

    Detailed Description

    +

    This object contains information about an incoming shipping query.

    +

    Member Data Documentation

    + +

    ◆ from

    + +
    +
    + + + + +
    struct telebot_user* telebot_shipping_query::from
    +
    +

    User who sent the query

    + +
    +
    + +

    ◆ id

    + +
    +
    + + + + +
    char* telebot_shipping_query::id
    +
    +

    Unique query identifier

    + +
    +
    + +

    ◆ invoice_payload

    + +
    +
    + + + + +
    char* telebot_shipping_query::invoice_payload
    +
    +

    Bot specified invoice payload

    + +
    +
    + +

    ◆ shipping_address

    + +
    +
    + + + + +
    struct telebot_shipping_address* telebot_shipping_query::shipping_address
    +
    +

    User specified shipping address

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__star__amount-members.html b/docs/structtelebot__star__amount-members.html new file mode 100644 index 0000000..864418c --- /dev/null +++ b/docs/structtelebot__star__amount-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_star_amount Member List
    +
    +
    + +

    This is the complete list of members for telebot_star_amount, including all inherited members.

    + + + +
    amounttelebot_star_amount
    nanostar_amounttelebot_star_amount
    + + + + diff --git a/docs/structtelebot__star__amount.html b/docs/structtelebot__star__amount.html new file mode 100644 index 0000000..42f3173 --- /dev/null +++ b/docs/structtelebot__star__amount.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_star_amount Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_star_amount Struct Reference
    +
    +
    + +

    Describes an amount of Telegram Stars. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    int amount
     
    int nanostar_amount
     
    +

    Detailed Description

    +

    Describes an amount of Telegram Stars.

    +

    Member Data Documentation

    + +

    ◆ amount

    + +
    +
    + + + + +
    int telebot_star_amount::amount
    +
    +

    Integer amount of Telegram Stars, rounded to 0; can be negative

    + +
    +
    + +

    ◆ nanostar_amount

    + +
    +
    + + + + +
    int telebot_star_amount::nanostar_amount
    +
    +

    Optional. The number of 1/1000000000 shares of Telegram Stars

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__star__transaction-members.html b/docs/structtelebot__star__transaction-members.html new file mode 100644 index 0000000..f219b55 --- /dev/null +++ b/docs/structtelebot__star__transaction-members.html @@ -0,0 +1,91 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_star_transaction Member List
    +
    + + + + + diff --git a/docs/structtelebot__star__transaction.html b/docs/structtelebot__star__transaction.html new file mode 100644 index 0000000..87259ae --- /dev/null +++ b/docs/structtelebot__star__transaction.html @@ -0,0 +1,202 @@ + + + + + + + +Telebot: telebot_star_transaction Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_star_transaction Struct Reference
    +
    +
    + +

    Describes a Telegram Star transaction. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + +

    +Public Attributes

    char * id
     
    int amount
     
    int nanostar_amount
     
    long date
     
    struct telebot_transaction_partnersource
     
    struct telebot_transaction_partnerreceiver
     
    +

    Detailed Description

    +

    Describes a Telegram Star transaction.

    +

    Member Data Documentation

    + +

    ◆ amount

    + +
    +
    + + + + +
    int telebot_star_transaction::amount
    +
    +

    Integer amount of Telegram Stars transferred by the transaction

    + +
    +
    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_star_transaction::date
    +
    +

    Date the transaction was created in Unix time

    + +
    +
    + +

    ◆ id

    + +
    +
    + + + + +
    char* telebot_star_transaction::id
    +
    +

    Unique identifier of the transaction.

    + +
    +
    + +

    ◆ nanostar_amount

    + +
    +
    + + + + +
    int telebot_star_transaction::nanostar_amount
    +
    +

    Optional. The number of 1/1000000000 shares of Telegram Stars

    + +
    +
    + +

    ◆ receiver

    + +
    +
    + + + + +
    struct telebot_transaction_partner* telebot_star_transaction::receiver
    +
    +

    Optional. Receiver of an outgoing transaction

    + +
    +
    + +

    ◆ source

    + +
    +
    + + + + +
    struct telebot_transaction_partner* telebot_star_transaction::source
    +
    +

    Optional. Source of an incoming transaction

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__star__transactions-members.html b/docs/structtelebot__star__transactions-members.html new file mode 100644 index 0000000..404e7ba --- /dev/null +++ b/docs/structtelebot__star__transactions-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_star_transactions Member List
    +
    +
    + +

    This is the complete list of members for telebot_star_transactions, including all inherited members.

    + + + +
    count_transactions (defined in telebot_star_transactions)telebot_star_transactions
    transactionstelebot_star_transactions
    + + + + diff --git a/docs/structtelebot__star__transactions.html b/docs/structtelebot__star__transactions.html new file mode 100644 index 0000000..bed62d5 --- /dev/null +++ b/docs/structtelebot__star__transactions.html @@ -0,0 +1,120 @@ + + + + + + + +Telebot: telebot_star_transactions Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_star_transactions Struct Reference
    +
    +
    + +

    Contains a list of Telegram Star transactions. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    struct telebot_star_transactiontransactions
     
    +int count_transactions
     
    +

    Detailed Description

    +

    Contains a list of Telegram Star transactions.

    +

    Member Data Documentation

    + +

    ◆ transactions

    + +
    +
    + + + + +
    struct telebot_star_transaction* telebot_star_transactions::transactions
    +
    +

    The list of transactions

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__sticker-members.html b/docs/structtelebot__sticker-members.html index d99cea6..45085a9 100644 --- a/docs/structtelebot__sticker-members.html +++ b/docs/structtelebot__sticker-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,36 +56,40 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_sticker Member List
    +
    telebot_sticker Member List
    diff --git a/docs/structtelebot__sticker.html b/docs/structtelebot__sticker.html index b0d00a0..3444d0e 100644 --- a/docs/structtelebot__sticker.html +++ b/docs/structtelebot__sticker.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_sticker Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,44 +73,43 @@ -
    -
    telebot_sticker Struct Reference
    +
    telebot_sticker Struct Reference

    This object represents a sticker. More...

    -

    #include <telebot-stickers.h>

    +

    #include <telebot-types.h>

    - - + - + - + - + - + - + - + - + - + - +

    +

    Public Attributes

    char * file_id
    char * file_id
     
    char * file_unique_id
    char * file_unique_id
     
    int width
    int width
     
    int height
    int height
     
    bool is_animated
    bool is_animated
     
    struct telebot_photothumb
    struct telebot_photothumb
     
    char * emoji
    char * emoji
     
    char * set_name
    char * set_name
     
    struct telebot_mask_positionmask_position
    struct telebot_mask_positionmask_position
     
    int file_size
    int file_size
     

    Detailed Description

    This object represents a sticker.

    Member Data Documentation

    - -

    ◆ emoji

    + +

    ◆ emoji

    @@ -114,8 +123,8 @@

    -

    ◆ file_id

    + +

    ◆ file_id

    @@ -129,8 +138,8 @@

    -

    ◆ file_size

    + +

    ◆ file_size

    @@ -144,8 +153,8 @@

    -

    ◆ file_unique_id

    + +

    ◆ file_unique_id

    @@ -159,8 +168,8 @@

    -

    ◆ height

    + +

    ◆ height

    @@ -174,8 +183,8 @@

    -

    ◆ is_animated

    + +

    ◆ is_animated

    @@ -189,8 +198,8 @@

    -

    ◆ mask_position

    + +

    ◆ mask_position

    @@ -204,8 +213,8 @@

    -

    ◆ set_name

    + +

    ◆ set_name

    @@ -219,8 +228,8 @@

    -

    ◆ thumb

    + +

    ◆ thumb

    @@ -234,8 +243,8 @@

    -

    ◆ width

    + +

    ◆ width

    @@ -250,14 +259,12 @@

    telebot-stickers.h +
  • include/telebot-types.h
  • diff --git a/docs/structtelebot__sticker__set-members.html b/docs/structtelebot__sticker__set-members.html index f84f561..c65555a 100644 --- a/docs/structtelebot__sticker__set-members.html +++ b/docs/structtelebot__sticker__set-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,33 +56,37 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot_sticker_set Member List
    +
    telebot_sticker_set Member List
    diff --git a/docs/structtelebot__sticker__set.html b/docs/structtelebot__sticker__set.html index 7d5d89c..06bbaa5 100644 --- a/docs/structtelebot__sticker__set.html +++ b/docs/structtelebot__sticker__set.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_sticker_set Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    @@ -63,8 +73,7 @@ -
    -
    telebot_sticker_set Struct Reference
    +
    telebot_sticker_set Struct Reference
    @@ -73,29 +82,29 @@

    #include <telebot-stickers.h>

    - - + - + - + - + - + - - +

    +

    Public Attributes

    char * name
    char * name
     
    char * title
    char * title
     
    bool is_animated
    bool is_animated
     
    bool contains_masks
    bool contains_masks
     
    telebot_sticker_tstickers
    telebot_sticker_tstickers
     
    +
    int count_stickers
     
    struct telebot_photothumb
    struct telebot_photothumb
     

    Detailed Description

    This object represents a sticker set.

    Member Data Documentation

    - -

    ◆ contains_masks

    + +

    ◆ contains_masks

    @@ -109,8 +118,8 @@

    -

    ◆ is_animated

    + +

    ◆ is_animated

    @@ -124,8 +133,8 @@

    -

    ◆ name

    + +

    ◆ name

    @@ -139,14 +148,14 @@

    -

    ◆ stickers

    + +

    ◆ stickers

    - +
    telebot_sticker_t* telebot_sticker_set::stickerstelebot_sticker_t* telebot_sticker_set::stickers
    @@ -154,8 +163,8 @@

    -

    ◆ thumb

    + +

    ◆ thumb

    @@ -169,8 +178,8 @@

    -

    ◆ title

    + +

    ◆ title

    @@ -190,9 +199,7 @@

    diff --git a/docs/structtelebot__story-members.html b/docs/structtelebot__story-members.html new file mode 100644 index 0000000..09a20e4 --- /dev/null +++ b/docs/structtelebot__story-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_story Member List
    +
    +
    + +

    This is the complete list of members for telebot_story, including all inherited members.

    + + + +
    chattelebot_story
    idtelebot_story
    + + + + diff --git a/docs/structtelebot__story.html b/docs/structtelebot__story.html new file mode 100644 index 0000000..27a8ecf --- /dev/null +++ b/docs/structtelebot__story.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_story Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_story Struct Reference
    +
    +
    + +

    This object contains information about a story. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    struct telebot_chatchat
     
    int id
     
    +

    Detailed Description

    +

    This object contains information about a story.

    +

    Member Data Documentation

    + +

    ◆ chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_story::chat
    +
    +

    Chat that posted the story

    + +
    +
    + +

    ◆ id

    + +
    +
    + + + + +
    int telebot_story::id
    +
    +

    Unique identifier for the story in the chat

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__successful__payment-members.html b/docs/structtelebot__successful__payment-members.html new file mode 100644 index 0000000..f3c68c7 --- /dev/null +++ b/docs/structtelebot__successful__payment-members.html @@ -0,0 +1,92 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_successful_payment Member List
    +
    + + + + + diff --git a/docs/structtelebot__successful__payment.html b/docs/structtelebot__successful__payment.html new file mode 100644 index 0000000..9b7c8ff --- /dev/null +++ b/docs/structtelebot__successful__payment.html @@ -0,0 +1,219 @@ + + + + + + + +Telebot: telebot_successful_payment Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_successful_payment Struct Reference
    +
    +
    + +

    This object contains basic information about a successful payment. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * currency
     
    int total_amount
     
    char * invoice_payload
     
    char * shipping_option_id
     
    struct telebot_order_infoorder_info
     
    char * telegram_payment_charge_id
     
    char * provider_payment_charge_id
     
    +

    Detailed Description

    +

    This object contains basic information about a successful payment.

    +

    Member Data Documentation

    + +

    ◆ currency

    + +
    +
    + + + + +
    char* telebot_successful_payment::currency
    +
    +

    Three-letter ISO 4217 currency code

    + +
    +
    + +

    ◆ invoice_payload

    + +
    +
    + + + + +
    char* telebot_successful_payment::invoice_payload
    +
    +

    Bot specified invoice payload

    + +
    +
    + +

    ◆ order_info

    + +
    +
    + + + + +
    struct telebot_order_info* telebot_successful_payment::order_info
    +
    +

    Optional. Order info provided by the user

    + +
    +
    + +

    ◆ provider_payment_charge_id

    + +
    +
    + + + + +
    char* telebot_successful_payment::provider_payment_charge_id
    +
    +

    Provider payment identifier

    + +
    +
    + +

    ◆ shipping_option_id

    + +
    +
    + + + + +
    char* telebot_successful_payment::shipping_option_id
    +
    +

    Optional. Identifier of the shipping option chosen by the user

    + +
    +
    + +

    ◆ telegram_payment_charge_id

    + +
    +
    + + + + +
    char* telebot_successful_payment::telegram_payment_charge_id
    +
    +

    Telegram payment identifier

    + +
    +
    + +

    ◆ total_amount

    + +
    +
    + + + + +
    int telebot_successful_payment::total_amount
    +
    +

    Total amount in the smallest units of the currency (integer, not float/double).

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__switch__inline__query__chosen__chat-members.html b/docs/structtelebot__switch__inline__query__chosen__chat-members.html new file mode 100644 index 0000000..23242f5 --- /dev/null +++ b/docs/structtelebot__switch__inline__query__chosen__chat-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_switch_inline_query_chosen_chat Member List
    +
    + + + + + diff --git a/docs/structtelebot__switch__inline__query__chosen__chat.html b/docs/structtelebot__switch__inline__query__chosen__chat.html new file mode 100644 index 0000000..8a0266b --- /dev/null +++ b/docs/structtelebot__switch__inline__query__chosen__chat.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: telebot_switch_inline_query_chosen_chat Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_switch_inline_query_chosen_chat Struct Reference
    +
    +
    + +

    This object represents an inline button that switches the current user to inline mode in a chosen chat. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + +

    +Public Attributes

    char * query
     
    bool allow_user_chats
     
    bool allow_bot_chats
     
    bool allow_group_chats
     
    bool allow_channel_chats
     
    +

    Detailed Description

    +

    This object represents an inline button that switches the current user to inline mode in a chosen chat.

    +

    Member Data Documentation

    + +

    ◆ allow_bot_chats

    + +
    +
    + + + + +
    bool telebot_switch_inline_query_chosen_chat::allow_bot_chats
    +
    +

    Optional. True, if private chats with bots can be chosen

    + +
    +
    + +

    ◆ allow_channel_chats

    + +
    +
    + + + + +
    bool telebot_switch_inline_query_chosen_chat::allow_channel_chats
    +
    +

    Optional. True, if channel chats can be chosen

    + +
    +
    + +

    ◆ allow_group_chats

    + +
    +
    + + + + +
    bool telebot_switch_inline_query_chosen_chat::allow_group_chats
    +
    +

    Optional. True, if group and supergroup chats can be chosen

    + +
    +
    + +

    ◆ allow_user_chats

    + +
    +
    + + + + +
    bool telebot_switch_inline_query_chosen_chat::allow_user_chats
    +
    +

    Optional. True, if private chats with users can be chosen

    + +
    +
    + +

    ◆ query

    + +
    +
    + + + + +
    char* telebot_switch_inline_query_chosen_chat::query
    +
    +

    Optional. The default inline query to be inserted in the input field.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__text__quote-members.html b/docs/structtelebot__text__quote-members.html new file mode 100644 index 0000000..bd342bf --- /dev/null +++ b/docs/structtelebot__text__quote-members.html @@ -0,0 +1,90 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_text_quote Member List
    +
    +
    + +

    This is the complete list of members for telebot_text_quote, including all inherited members.

    + + + + + + +
    count_entities (defined in telebot_text_quote)telebot_text_quote
    entitiestelebot_text_quote
    is_manualtelebot_text_quote
    positiontelebot_text_quote
    texttelebot_text_quote
    + + + + diff --git a/docs/structtelebot__text__quote.html b/docs/structtelebot__text__quote.html new file mode 100644 index 0000000..7f39d62 --- /dev/null +++ b/docs/structtelebot__text__quote.html @@ -0,0 +1,171 @@ + + + + + + + +Telebot: telebot_text_quote Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_text_quote Struct Reference
    +
    +
    + +

    This object contains information about the quoted part of a message that is replied to by the given message. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + +

    +Public Attributes

    char * text
     
    struct telebot_message_entityentities
     
    +int count_entities
     
    int position
     
    bool is_manual
     
    +

    Detailed Description

    +

    This object contains information about the quoted part of a message that is replied to by the given message.

    +

    Member Data Documentation

    + +

    ◆ entities

    + +
    +
    + + + + +
    struct telebot_message_entity* telebot_text_quote::entities
    +
    +

    Optional. Special entities that appear in the quote.

    + +
    +
    + +

    ◆ is_manual

    + +
    +
    + + + + +
    bool telebot_text_quote::is_manual
    +
    +

    Optional. True, if the quote was chosen manually by the message sender.

    + +
    +
    + +

    ◆ position

    + +
    +
    + + + + +
    int telebot_text_quote::position
    +
    +

    Approximate quote position in the original message

    + +
    +
    + +

    ◆ text

    + +
    +
    + + + + +
    char* telebot_text_quote::text
    +
    +

    Text of the quoted part of a message

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__transaction__partner-members.html b/docs/structtelebot__transaction__partner-members.html new file mode 100644 index 0000000..1b0e6ac --- /dev/null +++ b/docs/structtelebot__transaction__partner-members.html @@ -0,0 +1,101 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_transaction_partner Member List
    +
    + + + + + diff --git a/docs/structtelebot__transaction__partner.html b/docs/structtelebot__transaction__partner.html new file mode 100644 index 0000000..34a485b --- /dev/null +++ b/docs/structtelebot__transaction__partner.html @@ -0,0 +1,358 @@ + + + + + + + +Telebot: telebot_transaction_partner Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_transaction_partner Struct Reference
    +
    +
    + +

    This object describes the source of a transaction. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * type
     
    char * transaction_type
     
    struct telebot_useruser
     
    struct telebot_chatchat
     
    struct telebot_affiliate_infoaffiliate
     
    char * invoice_payload
     
    int subscription_period
     
    struct telebot_paid_mediapaid_media
     
    +int count_paid_media
     
    char * paid_media_payload
     
    struct telebot_giftgift
     
    int premium_subscription_duration
     
    struct telebot_revenue_withdrawal_statewithdrawal_state
     
    struct telebot_usersponsor_user
     
    int commission_per_mille
     
    int request_count
     
    +

    Detailed Description

    +

    This object describes the source of a transaction.

    +

    Member Data Documentation

    + +

    ◆ affiliate

    + +
    +
    + + + + +
    struct telebot_affiliate_info* telebot_transaction_partner::affiliate
    +
    +

    Optional. Information about the affiliate

    + +
    +
    + +

    ◆ chat

    + +
    +
    + + + + +
    struct telebot_chat* telebot_transaction_partner::chat
    +
    +

    Optional. Information about the chat

    + +
    +
    + +

    ◆ commission_per_mille

    + +
    +
    + + + + +
    int telebot_transaction_partner::commission_per_mille
    +
    +

    Optional. The number of Telegram Stars received by the bot for each 1000 Stars

    + +
    +
    + +

    ◆ gift

    + +
    +
    + + + + +
    struct telebot_gift* telebot_transaction_partner::gift
    +
    +

    Optional. The gift sent to the user by the bot

    + +
    +
    + +

    ◆ invoice_payload

    + +
    +
    + + + + +
    char* telebot_transaction_partner::invoice_payload
    +
    +

    Optional. Bot-specified invoice payload

    + +
    +
    + +

    ◆ paid_media

    + +
    +
    + + + + +
    struct telebot_paid_media* telebot_transaction_partner::paid_media
    +
    +

    Optional. Information about the paid media bought by the user

    + +
    +
    + +

    ◆ paid_media_payload

    + +
    +
    + + + + +
    char* telebot_transaction_partner::paid_media_payload
    +
    +

    Optional. Bot-specified paid media payload

    + +
    +
    + +

    ◆ premium_subscription_duration

    + +
    +
    + + + + +
    int telebot_transaction_partner::premium_subscription_duration
    +
    +

    Optional. Number of months the gifted Telegram Premium subscription will be active for

    + +
    +
    + +

    ◆ request_count

    + +
    +
    + + + + +
    int telebot_transaction_partner::request_count
    +
    +

    Optional. The number of successful requests that exceeded regular limits

    + +
    +
    + +

    ◆ sponsor_user

    + +
    +
    + + + + +
    struct telebot_user* telebot_transaction_partner::sponsor_user
    +
    +

    Optional. Information about the bot that sponsored the affiliate program

    + +
    +
    + +

    ◆ subscription_period

    + +
    +
    + + + + +
    int telebot_transaction_partner::subscription_period
    +
    +

    Optional. The duration of the paid subscription

    + +
    +
    + +

    ◆ transaction_type

    + +
    +
    + + + + +
    char* telebot_transaction_partner::transaction_type
    +
    +

    Optional. Type of the transaction

    + +
    +
    + +

    ◆ type

    + +
    +
    + + + + +
    char* telebot_transaction_partner::type
    +
    +

    Type of the transaction partner

    + +
    +
    + +

    ◆ user

    + +
    +
    + + + + +
    struct telebot_user* telebot_transaction_partner::user
    +
    +

    Optional. Information about the user

    + +
    +
    + +

    ◆ withdrawal_state

    + +
    +
    + + + + +
    struct telebot_revenue_withdrawal_state* telebot_transaction_partner::withdrawal_state
    +
    +

    Optional. State of the transaction if the transaction is outgoing

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__unique__gift-members.html b/docs/structtelebot__unique__gift-members.html new file mode 100644 index 0000000..9288e40 --- /dev/null +++ b/docs/structtelebot__unique__gift-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_unique_gift Member List
    +
    +
    + +

    This is the complete list of members for telebot_unique_gift, including all inherited members.

    + + + + + +
    gift_idtelebot_unique_gift
    nametelebot_unique_gift
    numbertelebot_unique_gift
    stickertelebot_unique_gift
    + + + + diff --git a/docs/structtelebot__unique__gift.html b/docs/structtelebot__unique__gift.html new file mode 100644 index 0000000..aa896a4 --- /dev/null +++ b/docs/structtelebot__unique__gift.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_unique_gift Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_unique_gift Struct Reference
    +
    +
    + +

    This object describes a unique gift that was upgraded from a regular gift. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + +

    +Public Attributes

    char * gift_id
     
    char * name
     
    int number
     
    struct telebot_stickersticker
     
    +

    Detailed Description

    +

    This object describes a unique gift that was upgraded from a regular gift.

    +

    Member Data Documentation

    + +

    ◆ gift_id

    + +
    +
    + + + + +
    char* telebot_unique_gift::gift_id
    +
    +

    Identifier of the regular gift

    + +
    +
    + +

    ◆ name

    + +
    +
    + + + + +
    char* telebot_unique_gift::name
    +
    +

    Unique name of the gift

    + +
    +
    + +

    ◆ number

    + +
    +
    + + + + +
    int telebot_unique_gift::number
    +
    +

    Unique number of the upgraded gift

    + +
    +
    + +

    ◆ sticker

    + +
    +
    + + + + +
    struct telebot_sticker* telebot_unique_gift::sticker
    +
    +

    Optional. Model of the gift

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__unique__gift__info-members.html b/docs/structtelebot__unique__gift__info-members.html new file mode 100644 index 0000000..9045fad --- /dev/null +++ b/docs/structtelebot__unique__gift__info-members.html @@ -0,0 +1,89 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_unique_gift_info Member List
    +
    + + + + + diff --git a/docs/structtelebot__unique__gift__info.html b/docs/structtelebot__unique__gift__info.html new file mode 100644 index 0000000..8211fca --- /dev/null +++ b/docs/structtelebot__unique__gift__info.html @@ -0,0 +1,168 @@ + + + + + + + +Telebot: telebot_unique_gift_info Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_unique_gift_info Struct Reference
    +
    +
    + +

    Describes a unique gift that was sent or received. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + +

    +Public Attributes

    struct telebot_unique_giftgift
     
    char * origin
     
    char * last_resale_currency
     
    long long int last_resale_amount
     
    +

    Detailed Description

    +

    Describes a unique gift that was sent or received.

    +

    Member Data Documentation

    + +

    ◆ gift

    + +
    +
    + + + + +
    struct telebot_unique_gift* telebot_unique_gift_info::gift
    +
    +

    Information about the gift

    + +
    +
    + +

    ◆ last_resale_amount

    + +
    +
    + + + + +
    long long int telebot_unique_gift_info::last_resale_amount
    +
    +

    Optional. Price paid for the gift

    + +
    +
    + +

    ◆ last_resale_currency

    + +
    +
    + + + + +
    char* telebot_unique_gift_info::last_resale_currency
    +
    +

    Optional. Currency in which the payment for the gift was done

    + +
    +
    + +

    ◆ origin

    + +
    +
    + + + + +
    char* telebot_unique_gift_info::origin
    +
    +

    Origin of the gift

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__update-members.html b/docs/structtelebot__update-members.html index d1eca3c..d621f34 100644 --- a/docs/structtelebot__update-members.html +++ b/docs/structtelebot__update-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,35 +56,55 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_update Member List
    +
    telebot_update Member List
    diff --git a/docs/structtelebot__update.html b/docs/structtelebot__update.html index 158d52b..508f559 100644 --- a/docs/structtelebot__update.html +++ b/docs/structtelebot__update.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_update Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_update Struct Reference
    +
    telebot_update Struct Reference

    @@ -73,57 +82,120 @@

    #include <telebot-types.h>

    - - + - + - - + + + - + - + - + - + + + + + + + + + + + + + - + + + + + + + - - - + + + + + + + + + + + + + + + + +

    +

    Public Attributes

    int update_id
    int update_id
     
    telebot_update_type_e update_type
    telebot_update_type_e update_type
     
    -union {
       telebot_message_t   message
    +union { 
     
       telebot_message_t   message 
     
       telebot_message_t   edited_message
       telebot_message_t   edited_message 
     
       telebot_message_t   channel_post
       telebot_message_t   channel_post 
     
       telebot_message_t   edited_channel_post
       telebot_message_t   edited_channel_post 
     
       telebot_callback_query_t   callback_query
       telebot_business_connection_t   business_connection 
     
       telebot_message_t   business_message 
     
       telebot_message_t   edited_business_message 
     
       telebot_business_messages_deleted_t   deleted_business_messages 
     
       telebot_inline_query_t   inline_query 
     
       telebot_chosen_inline_result_t   chosen_inline_result 
     
       telebot_callback_query_t   callback_query 
     
       telebot_poll_t   poll
       telebot_shipping_query_t   shipping_query 
     
       telebot_pre_checkout_query_t   pre_checkout_query 
     
       telebot_paid_media_purchased_t   purchased_paid_media 
     
       telebot_poll_t   poll 
     
       telebot_poll_answer_t   poll_anser
     
    }; 
       telebot_poll_answer_t   poll_answer 
     
       telebot_chat_member_updated_t   my_chat_member 
     
       telebot_chat_member_updated_t   chat_member 
     
       telebot_chat_join_request_t   chat_join_request 
     
       telebot_message_reaction_updated_t   message_reaction 
     
       telebot_message_reaction_count_updated_t   message_reaction_count 
     
       telebot_chat_boost_updated_t   chat_boost 
     
       telebot_chat_boost_removed_t   chat_boost_removed 
     
    };  
     

    Detailed Description

    This object represents an incoming update.

    Member Data Documentation

    - -

    ◆ callback_query

    + +

    ◆ business_connection

    - +
    telebot_callback_query_t telebot_update::callback_querytelebot_business_connection_t telebot_update::business_connection
    -

    New incoming inline query The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.New incoming callback query

    +

    The bot was connected to or disconnected from a business account

    - -

    ◆ channel_post

    + +

    ◆ business_message

    - + + +
    telebot_message_t telebot_update::channel_posttelebot_message_t telebot_update::business_message
    +
    +

    New message from a connected business account

    + +
    +
    + +

    ◆ callback_query

    + +
    +
    + + + + +
    telebot_callback_query_t telebot_update::callback_query
    +
    +

    New incoming callback query

    + +
    +
    + +

    ◆ channel_post

    + +
    +
    + + +
    telebot_message_t telebot_update::channel_post
    @@ -131,14 +203,119 @@

    -

    ◆ edited_channel_post

    + +

    ◆ chat_boost

    + +
    +
    + + + + +
    telebot_chat_boost_updated_t telebot_update::chat_boost
    +
    +

    A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.

    + +
    +
    + +

    ◆ chat_boost_removed

    + +
    +
    + + + + +
    telebot_chat_boost_removed_t telebot_update::chat_boost_removed
    +
    +

    A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

    + +
    +
    + +

    ◆ chat_join_request

    - + + +
    telebot_message_t telebot_update::edited_channel_posttelebot_chat_join_request_t telebot_update::chat_join_request
    +
    +

    A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

    + +
    +
    + +

    ◆ chat_member

    + +
    +
    + + + + +
    telebot_chat_member_updated_t telebot_update::chat_member
    +
    +

    A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.

    + +
    +
    + +

    ◆ chosen_inline_result

    + +
    +
    + + + + +
    telebot_chosen_inline_result_t telebot_update::chosen_inline_result
    +
    +

    The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

    + +
    +
    + +

    ◆ deleted_business_messages

    + +
    +
    + + + + +
    telebot_business_messages_deleted_t telebot_update::deleted_business_messages
    +
    +

    Messages were deleted from a connected business account

    + +
    +
    + +

    ◆ edited_business_message

    + +
    +
    + + + + +
    telebot_message_t telebot_update::edited_business_message
    +
    +

    New version of a message from a connected business account

    + +
    +
    + +

    ◆ edited_channel_post

    + +
    +
    + + +
    telebot_message_t telebot_update::edited_channel_post
    @@ -146,14 +323,14 @@

    -

    ◆ edited_message

    + +

    ◆ edited_message

    - +
    telebot_message_t telebot_update::edited_messagetelebot_message_t telebot_update::edited_message
    @@ -161,14 +338,29 @@

    -

    ◆ message

    + +

    ◆ inline_query

    + +
    +
    + + + + +
    telebot_inline_query_t telebot_update::inline_query
    +
    +

    New incoming inline query

    + +
    +
    + +

    ◆ message

    - +
    telebot_message_t telebot_update::messagetelebot_message_t telebot_update::message
    @@ -176,29 +368,74 @@

    -

    ◆ poll

    + +

    ◆ message_reaction

    + +
    +
    + + + + +
    telebot_message_reaction_updated_t telebot_update::message_reaction
    +
    +

    A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates.

    + +
    +
    + +

    ◆ message_reaction_count

    + +
    +
    + + + + +
    telebot_message_reaction_count_updated_t telebot_update::message_reaction_count
    +
    +

    Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates.

    + +
    +
    + +

    ◆ my_chat_member

    - +
    telebot_poll_t telebot_update::polltelebot_chat_member_updated_t telebot_update::my_chat_member
    -

    New incoming shipping query. Only for invoices with flexible price New incoming pre-checkout query. Contains full information about checkout New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot

    +

    The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

    - -

    ◆ poll_anser

    + +

    ◆ poll

    - + + +
    telebot_poll_answer_t telebot_update::poll_ansertelebot_poll_t telebot_update::poll
    +
    +

    New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot

    + +
    +
    + +

    ◆ poll_answer

    + +
    +
    + + +
    telebot_poll_answer_t telebot_update::poll_answer
    @@ -206,8 +443,53 @@

    -

    ◆ update_id

    + +

    ◆ pre_checkout_query

    + +
    +
    + + + + +
    telebot_pre_checkout_query_t telebot_update::pre_checkout_query
    +
    +

    New incoming pre-checkout query. Contains full information about checkout

    + +
    +
    + +

    ◆ purchased_paid_media

    + +
    +
    + + + + +
    telebot_paid_media_purchased_t telebot_update::purchased_paid_media
    +
    +

    A user purchased paid media

    + +
    +
    + +

    ◆ shipping_query

    + +
    +
    + + + + +
    telebot_shipping_query_t telebot_update::shipping_query
    +
    +

    New incoming shipping query. Only for invoices with flexible price

    + +
    +
    + +

    ◆ update_id

    @@ -221,14 +503,14 @@

    -

    ◆ update_type

    + +

    ◆ update_type

    - +
    telebot_update_type_e telebot_update::update_typetelebot_update_type_e telebot_update::update_type
    @@ -242,9 +524,7 @@

    diff --git a/docs/structtelebot__user-members.html b/docs/structtelebot__user-members.html index 0a1eaf2..bbc30c4 100644 --- a/docs/structtelebot__user-members.html +++ b/docs/structtelebot__user-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,35 +56,45 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_user Member List
    +
    telebot_user Member List
    diff --git a/docs/structtelebot__user.html b/docs/structtelebot__user.html index 7335d65..b4d04ee 100644 --- a/docs/structtelebot__user.html +++ b/docs/structtelebot__user.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_user Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_user Struct Reference
    +
    telebot_user Struct Reference

    @@ -73,32 +82,89 @@

    #include <telebot-types.h>

    - - - - + + + - + - + - + - + - + + + + + - + - + + + + + + + + +

    +

    Public Attributes

    int id
     
    bool is_bot
    long long int id
     
    bool is_bot
     
    char * first_name
    char * first_name
     
    char * last_name
    char * last_name
     
    char * username
    char * username
     
    char * language_code
    char * language_code
     
    bool can_join_groups
    bool is_premium
     
    bool added_to_attachment_menu
     
    bool can_join_groups
     
    bool can_read_all_group_messages
    bool can_read_all_group_messages
     
    bool supports_inline_queries
    bool supports_inline_queries
     
    bool can_connect_to_business
     
    bool has_main_web_app
     
    bool has_topics_enabled
     
    bool allows_users_to_create_topics
     

    Detailed Description

    This object represents a Telegram user or bot.

    Member Data Documentation

    - -

    ◆ can_join_groups

    + +

    ◆ added_to_attachment_menu

    + +
    +
    + + + + +
    bool telebot_user::added_to_attachment_menu
    +
    +

    Optional. True, if this user added the bot to the attachment menu.

    + +
    +
    + +

    ◆ allows_users_to_create_topics

    + +
    +
    + + + + +
    bool telebot_user::allows_users_to_create_topics
    +
    +

    Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.

    + +
    +
    + +

    ◆ can_connect_to_business

    + +
    +
    + + + + +
    bool telebot_user::can_connect_to_business
    +
    +

    Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe.

    + +
    +
    + +

    ◆ can_join_groups

    @@ -112,8 +178,8 @@

    -

    ◆ can_read_all_group_messages

    + +

    ◆ can_read_all_group_messages

    @@ -127,8 +193,8 @@

    -

    ◆ first_name

    + +

    ◆ first_name

    @@ -142,14 +208,44 @@

    -

    ◆ id

    + +

    ◆ has_main_web_app

    + +
    +
    + + + + +
    bool telebot_user::has_main_web_app
    +
    +

    Optional. True, if the bot has a main Web App. Returned only in getMe.

    + +
    +
    + +

    ◆ has_topics_enabled

    + +
    +
    + + + + +
    bool telebot_user::has_topics_enabled
    +
    +

    Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.

    + +
    +
    + +

    ◆ id

    - +
    int telebot_user::idlong long int telebot_user::id
    @@ -157,8 +253,8 @@

    -

    ◆ is_bot

    + +

    ◆ is_bot

    @@ -172,8 +268,23 @@

    -

    ◆ language_code

    + +

    ◆ is_premium

    + +
    +
    + + + + +
    bool telebot_user::is_premium
    +
    +

    Optional. True, if this user is a Telegram Premium user.

    + +
    +
    + +

    ◆ language_code

    @@ -187,8 +298,8 @@

    -

    ◆ last_name

    + +

    ◆ last_name

    @@ -202,8 +313,8 @@

    -

    ◆ supports_inline_queries

    + +

    ◆ supports_inline_queries

    @@ -217,8 +328,8 @@

    -

    ◆ username

    + +

    ◆ username

    @@ -238,9 +349,7 @@

    diff --git a/docs/structtelebot__user__chat__boosts-members.html b/docs/structtelebot__user__chat__boosts-members.html new file mode 100644 index 0000000..f8f27c3 --- /dev/null +++ b/docs/structtelebot__user__chat__boosts-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_user_chat_boosts Member List
    +
    +
    + +

    This is the complete list of members for telebot_user_chat_boosts, including all inherited members.

    + + + +
    booststelebot_user_chat_boosts
    counttelebot_user_chat_boosts
    + + + + diff --git a/docs/structtelebot__user__chat__boosts.html b/docs/structtelebot__user__chat__boosts.html new file mode 100644 index 0000000..ebc08cf --- /dev/null +++ b/docs/structtelebot__user__chat__boosts.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_user_chat_boosts Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_user_chat_boosts Struct Reference
    +
    +
    + +

    This object represents a list of user chat boosts. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    telebot_chat_boost_tboosts
     
    int count
     
    +

    Detailed Description

    +

    This object represents a list of user chat boosts.

    +

    Member Data Documentation

    + +

    ◆ boosts

    + +
    +
    + + + + +
    telebot_chat_boost_t* telebot_user_chat_boosts::boosts
    +
    +

    The list of boosts

    + +
    +
    + +

    ◆ count

    + +
    +
    + + + + +
    int telebot_user_chat_boosts::count
    +
    +

    Number of boosts

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__user__gift-members.html b/docs/structtelebot__user__gift-members.html new file mode 100644 index 0000000..eeb0458 --- /dev/null +++ b/docs/structtelebot__user__gift-members.html @@ -0,0 +1,95 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_user_gift Member List
    +
    + + + + + diff --git a/docs/structtelebot__user__gift.html b/docs/structtelebot__user__gift.html new file mode 100644 index 0000000..7cd9921 --- /dev/null +++ b/docs/structtelebot__user__gift.html @@ -0,0 +1,270 @@ + + + + + + + +Telebot: telebot_user_gift Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_user_gift Struct Reference
    +
    +
    + +

    This object represents a gift received by a user. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    char * gift_id
     
    struct telebot_usersender_user
     
    char * text
     
    struct telebot_message_entityentities
     
    int count_entities
     
    telebot_gift_tgift
     
    long date
     
    int message_id
     
    int upgrade_star_count
     
    bool is_upgraded
     
    +

    Detailed Description

    +

    This object represents a gift received by a user.

    +

    Member Data Documentation

    + +

    ◆ count_entities

    + +
    +
    + + + + +
    int telebot_user_gift::count_entities
    +
    +

    Number of entities

    + +
    +
    + +

    ◆ date

    + +
    +
    + + + + +
    long telebot_user_gift::date
    +
    +

    Date the gift was sent

    + +
    +
    + +

    ◆ entities

    + +
    +
    + + + + +
    struct telebot_message_entity* telebot_user_gift::entities
    +
    +

    Optional. Special entities that appear in the text

    + +
    +
    + +

    ◆ gift

    + +
    +
    + + + + +
    telebot_gift_t* telebot_user_gift::gift
    +
    +

    Information about the gift

    + +
    +
    + +

    ◆ gift_id

    + +
    +
    + + + + +
    char* telebot_user_gift::gift_id
    +
    +

    Unique identifier of the gift

    + +
    +
    + +

    ◆ is_upgraded

    + +
    +
    + + + + +
    bool telebot_user_gift::is_upgraded
    +
    +

    Optional. True, if the gift is upgraded

    + +
    +
    + +

    ◆ message_id

    + +
    +
    + + + + +
    int telebot_user_gift::message_id
    +
    +

    Optional. Message identifier of the message with the gift

    + +
    +
    + +

    ◆ sender_user

    + +
    +
    + + + + +
    struct telebot_user* telebot_user_gift::sender_user
    +
    +

    Optional. The user that sent the gift

    + +
    +
    + +

    ◆ text

    + +
    +
    + + + + +
    char* telebot_user_gift::text
    +
    +

    Optional. Message text added to the gift

    + +
    +
    + +

    ◆ upgrade_star_count

    + +
    +
    + + + + +
    int telebot_user_gift::upgrade_star_count
    +
    +

    Optional. The number of Telegram Stars that must be paid to upgrade the gift

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__user__gifts-members.html b/docs/structtelebot__user__gifts-members.html new file mode 100644 index 0000000..ca737dc --- /dev/null +++ b/docs/structtelebot__user__gifts-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_user_gifts Member List
    +
    +
    + +

    This is the complete list of members for telebot_user_gifts, including all inherited members.

    + + + + +
    counttelebot_user_gifts
    giftstelebot_user_gifts
    total_counttelebot_user_gifts
    + + + + diff --git a/docs/structtelebot__user__gifts.html b/docs/structtelebot__user__gifts.html new file mode 100644 index 0000000..2737988 --- /dev/null +++ b/docs/structtelebot__user__gifts.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_user_gifts Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_user_gifts Struct Reference
    +
    +
    + +

    This object represents a list of gifts received by a user. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    int total_count
     
    telebot_user_gift_tgifts
     
    int count
     
    +

    Detailed Description

    +

    This object represents a list of gifts received by a user.

    +

    Member Data Documentation

    + +

    ◆ count

    + +
    +
    + + + + +
    int telebot_user_gifts::count
    +
    +

    Number of gifts in the list

    + +
    +
    + +

    ◆ gifts

    + +
    +
    + + + + +
    telebot_user_gift_t* telebot_user_gifts::gifts
    +
    +

    The list of gifts

    + +
    +
    + +

    ◆ total_count

    + +
    +
    + + + + +
    int telebot_user_gifts::total_count
    +
    +

    Total number of gifts in the list

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__user__profile__audios-members.html b/docs/structtelebot__user__profile__audios-members.html new file mode 100644 index 0000000..1ba1da0 --- /dev/null +++ b/docs/structtelebot__user__profile__audios-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_user_profile_audios Member List
    +
    +
    + +

    This is the complete list of members for telebot_user_profile_audios, including all inherited members.

    + + + + +
    audiostelebot_user_profile_audios
    counttelebot_user_profile_audios
    total_counttelebot_user_profile_audios
    + + + + diff --git a/docs/structtelebot__user__profile__audios.html b/docs/structtelebot__user__profile__audios.html new file mode 100644 index 0000000..a056b19 --- /dev/null +++ b/docs/structtelebot__user__profile__audios.html @@ -0,0 +1,151 @@ + + + + + + + +Telebot: telebot_user_profile_audios Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_user_profile_audios Struct Reference
    +
    +
    + +

    This object represents a list of user profile audios. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    int total_count
     
    telebot_audio_taudios
     
    int count
     
    +

    Detailed Description

    +

    This object represents a list of user profile audios.

    +

    Member Data Documentation

    + +

    ◆ audios

    + +
    +
    + + + + +
    telebot_audio_t* telebot_user_profile_audios::audios
    +
    +

    The list of audios

    + +
    +
    + +

    ◆ count

    + +
    +
    + + + + +
    int telebot_user_profile_audios::count
    +
    +

    Number of audios in the list

    + +
    +
    + +

    ◆ total_count

    + +
    +
    + + + + +
    int telebot_user_profile_audios::total_count
    +
    +

    Total number of audios in the list

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__user__profile__photos-members.html b/docs/structtelebot__user__profile__photos-members.html index 18f53eb..f3c444c 100644 --- a/docs/structtelebot__user__profile__photos-members.html +++ b/docs/structtelebot__user__profile__photos-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,29 +56,33 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_user_profile_photos Member List
    +
    telebot_user_profile_photos Member List
    diff --git a/docs/structtelebot__user__profile__photos.html b/docs/structtelebot__user__profile__photos.html index 1a84515..64c11f1 100644 --- a/docs/structtelebot__user__profile__photos.html +++ b/docs/structtelebot__user__profile__photos.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_user_profile_photos Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_user_profile_photos Struct Reference
    +
    telebot_user_profile_photos Struct Reference

    @@ -73,20 +82,20 @@

    #include <telebot-types.h>

    - - + - + - +

    +

    Public Attributes

    int total_count
    int total_count
     
    int current_count
    int current_count
     
    struct telebot_photophotos [4]
    struct telebot_photophotos [4]
     

    Detailed Description

    This object represent a user's profile pictures.

    Member Data Documentation

    - -

    ◆ current_count

    + +

    ◆ current_count

    @@ -100,8 +109,8 @@

    -

    ◆ photos

    + +

    ◆ photos

    @@ -115,8 +124,8 @@

    -

    ◆ total_count

    + +

    ◆ total_count

    @@ -136,9 +145,7 @@

    diff --git a/docs/structtelebot__user__shared-members.html b/docs/structtelebot__user__shared-members.html new file mode 100644 index 0000000..568c611 --- /dev/null +++ b/docs/structtelebot__user__shared-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_user_shared Member List
    +
    +
    + +

    This is the complete list of members for telebot_user_shared, including all inherited members.

    + + + +
    request_idtelebot_user_shared
    user_idtelebot_user_shared
    + + + + diff --git a/docs/structtelebot__user__shared.html b/docs/structtelebot__user__shared.html new file mode 100644 index 0000000..5918d83 --- /dev/null +++ b/docs/structtelebot__user__shared.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_user_shared Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_user_shared Struct Reference
    +
    +
    + +

    This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    int request_id
     
    long long int user_id
     
    +

    Detailed Description

    +

    This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.

    +

    Member Data Documentation

    + +

    ◆ request_id

    + +
    +
    + + + + +
    int telebot_user_shared::request_id
    +
    +

    Identifier of the request

    + +
    +
    + +

    ◆ user_id

    + +
    +
    + + + + +
    long long int telebot_user_shared::user_id
    +
    +

    Identifier of the shared user.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__users__shared-members.html b/docs/structtelebot__users__shared-members.html new file mode 100644 index 0000000..cd42363 --- /dev/null +++ b/docs/structtelebot__users__shared-members.html @@ -0,0 +1,88 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_users_shared Member List
    +
    +
    + +

    This is the complete list of members for telebot_users_shared, including all inherited members.

    + + + + +
    count_users (defined in telebot_users_shared)telebot_users_shared
    request_idtelebot_users_shared
    userstelebot_users_shared
    + + + + diff --git a/docs/structtelebot__users__shared.html b/docs/structtelebot__users__shared.html new file mode 100644 index 0000000..4cb41bf --- /dev/null +++ b/docs/structtelebot__users__shared.html @@ -0,0 +1,137 @@ + + + + + + + +Telebot: telebot_users_shared Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_users_shared Struct Reference
    +
    +
    + +

    This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. + More...

    + +

    #include <telebot-types.h>

    + + + + + + + + +

    +Public Attributes

    int request_id
     
    struct telebot_shared_userusers
     
    +int count_users
     
    +

    Detailed Description

    +

    This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

    +

    Member Data Documentation

    + +

    ◆ request_id

    + +
    +
    + + + + +
    int telebot_users_shared::request_id
    +
    +

    Identifier of the request

    + +
    +
    + +

    ◆ users

    + +
    +
    + + + + +
    struct telebot_shared_user* telebot_users_shared::users
    +
    +

    Information about users shared with the bot.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__venue-members.html b/docs/structtelebot__venue-members.html index ef4f7df..ae44f26 100644 --- a/docs/structtelebot__venue-members.html +++ b/docs/structtelebot__venue-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,31 +56,35 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_venue Member List
    +
    telebot_venue Member List
    diff --git a/docs/structtelebot__venue.html b/docs/structtelebot__venue.html index 4f5dc76..4bd10eb 100644 --- a/docs/structtelebot__venue.html +++ b/docs/structtelebot__venue.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_venue Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_venue Struct Reference
    +
    telebot_venue Struct Reference

    @@ -73,24 +82,24 @@

    #include <telebot-types.h>

    - - + - + - + - + - +

    +

    Public Attributes

    struct telebot_locationlocation
    struct telebot_locationlocation
     
    char * title
    char * title
     
    char * address
    char * address
     
    char * foursquare_id
    char * foursquare_id
     
    char * foursquare_type
    char * foursquare_type
     

    Detailed Description

    This object represents a venue.

    Member Data Documentation

    - -

    ◆ address

    + +

    ◆ address

    @@ -104,8 +113,8 @@

    -

    ◆ foursquare_id

    + +

    ◆ foursquare_id

    @@ -119,8 +128,8 @@

    -

    ◆ foursquare_type

    + +

    ◆ foursquare_type

    @@ -134,8 +143,8 @@

    -

    ◆ location

    + +

    ◆ location

    @@ -149,8 +158,8 @@

    -

    ◆ title

    + +

    ◆ title

    @@ -170,9 +179,7 @@

    diff --git a/docs/structtelebot__video-members.html b/docs/structtelebot__video-members.html index 23c46df..ca4d184 100644 --- a/docs/structtelebot__video-members.html +++ b/docs/structtelebot__video-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,34 +56,38 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_video Member List
    +
    telebot_video Member List
    diff --git a/docs/structtelebot__video.html b/docs/structtelebot__video.html index 4bd8c29..d60157f 100644 --- a/docs/structtelebot__video.html +++ b/docs/structtelebot__video.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_video Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_video Struct Reference
    +
    telebot_video Struct Reference

    @@ -73,30 +82,30 @@

    #include <telebot-types.h>

    - - + - + - + - + - + - + - + - +

    +

    Public Attributes

    char * file_id
    char * file_id
     
    char * file_unique_id
    char * file_unique_id
     
    int width
    int width
     
    int height
    int height
     
    int duration
    int duration
     
    struct telebot_photothumb
    struct telebot_photothumb
     
    char * mime_type
    char * mime_type
     
    int file_size
    int file_size
     

    Detailed Description

    This object represents a video file.

    Member Data Documentation

    - -

    ◆ duration

    + +

    ◆ duration

    @@ -110,8 +119,8 @@

    -

    ◆ file_id

    + +

    ◆ file_id

    @@ -125,8 +134,8 @@

    -

    ◆ file_size

    + +

    ◆ file_size

    @@ -140,8 +149,8 @@

    -

    ◆ file_unique_id

    + +

    ◆ file_unique_id

    @@ -155,8 +164,8 @@

    -

    ◆ height

    + +

    ◆ height

    @@ -170,8 +179,8 @@

    -

    ◆ mime_type

    + +

    ◆ mime_type

    @@ -185,8 +194,8 @@

    -

    ◆ thumb

    + +

    ◆ thumb

    @@ -200,8 +209,8 @@

    -

    ◆ width

    + +

    ◆ width

    @@ -221,9 +230,7 @@

    diff --git a/docs/structtelebot__core__handler-members.html b/docs/structtelebot__video__chat__ended-members.html similarity index 55% rename from docs/structtelebot__core__handler-members.html rename to docs/structtelebot__video__chat__ended-members.html index cc58947..7ec3be2 100644 --- a/docs/structtelebot__core__handler-members.html +++ b/docs/structtelebot__video__chat__ended-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,29 +56,31 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_core_handler Member List
    +
    telebot_video_chat_ended Member List
    -

    This is the complete list of members for telebot_core_handler, including all inherited members.

    +

    This is the complete list of members for telebot_video_chat_ended, including all inherited members.

    - - - +
    proxy_addr (defined in telebot_core_handler)telebot_core_handler
    proxy_auth (defined in telebot_core_handler)telebot_core_handler
    tokentelebot_core_handler
    durationtelebot_video_chat_ended
    diff --git a/docs/structtelebot__video__chat__ended.html b/docs/structtelebot__video__chat__ended.html new file mode 100644 index 0000000..9d39a7d --- /dev/null +++ b/docs/structtelebot__video__chat__ended.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_video_chat_ended Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_video_chat_ended Struct Reference
    +
    +
    + +

    This object represents a service message about a video chat ended in the chat. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    int duration
     
    +

    Detailed Description

    +

    This object represents a service message about a video chat ended in the chat.

    +

    Member Data Documentation

    + +

    ◆ duration

    + +
    +
    + + + + +
    int telebot_video_chat_ended::duration
    +
    +

    Video chat duration in seconds

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__video__chat__participants__invited-members.html b/docs/structtelebot__video__chat__participants__invited-members.html new file mode 100644 index 0000000..501cc4d --- /dev/null +++ b/docs/structtelebot__video__chat__participants__invited-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_video_chat_participants_invited Member List
    +
    +
    + +

    This is the complete list of members for telebot_video_chat_participants_invited, including all inherited members.

    + + + +
    count_users (defined in telebot_video_chat_participants_invited)telebot_video_chat_participants_invited
    userstelebot_video_chat_participants_invited
    + + + + diff --git a/docs/structtelebot__video__chat__participants__invited.html b/docs/structtelebot__video__chat__participants__invited.html new file mode 100644 index 0000000..45a70e1 --- /dev/null +++ b/docs/structtelebot__video__chat__participants__invited.html @@ -0,0 +1,120 @@ + + + + + + + +Telebot: telebot_video_chat_participants_invited Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_video_chat_participants_invited Struct Reference
    +
    +
    + +

    This object represents a service message about new members invited to a video chat. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    struct telebot_userusers
     
    +int count_users
     
    +

    Detailed Description

    +

    This object represents a service message about new members invited to a video chat.

    +

    Member Data Documentation

    + +

    ◆ users

    + +
    +
    + + + + +
    struct telebot_user* telebot_video_chat_participants_invited::users
    +
    +

    New members that were invited to the video chat

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__video__chat__scheduled-members.html b/docs/structtelebot__video__chat__scheduled-members.html new file mode 100644 index 0000000..5d58c35 --- /dev/null +++ b/docs/structtelebot__video__chat__scheduled-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_video_chat_scheduled Member List
    +
    +
    + +

    This is the complete list of members for telebot_video_chat_scheduled, including all inherited members.

    + + +
    start_datetelebot_video_chat_scheduled
    + + + + diff --git a/docs/structtelebot__video__chat__scheduled.html b/docs/structtelebot__video__chat__scheduled.html new file mode 100644 index 0000000..cb7b22d --- /dev/null +++ b/docs/structtelebot__video__chat__scheduled.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_video_chat_scheduled Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_video_chat_scheduled Struct Reference
    +
    +
    + +

    This object represents a service message about a video chat scheduled in the chat. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    long start_date
     
    +

    Detailed Description

    +

    This object represents a service message about a video chat scheduled in the chat.

    +

    Member Data Documentation

    + +

    ◆ start_date

    + +
    +
    + + + + +
    long telebot_video_chat_scheduled::start_date
    +
    +

    Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__video__chat__started-members.html b/docs/structtelebot__video__chat__started-members.html new file mode 100644 index 0000000..fe0a9d5 --- /dev/null +++ b/docs/structtelebot__video__chat__started-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_video_chat_started Member List
    +
    +
    + +

    This is the complete list of members for telebot_video_chat_started, including all inherited members.

    + + +
    dummytelebot_video_chat_started
    + + + + diff --git a/docs/structtelebot__video__chat__started.html b/docs/structtelebot__video__chat__started.html new file mode 100644 index 0000000..e34090b --- /dev/null +++ b/docs/structtelebot__video__chat__started.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_video_chat_started Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_video_chat_started Struct Reference
    +
    +
    + +

    This object represents a service message about a video chat started in the chat. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    bool dummy
     
    +

    Detailed Description

    +

    This object represents a service message about a video chat started in the chat.

    +

    Member Data Documentation

    + +

    ◆ dummy

    + +
    +
    + + + + +
    bool telebot_video_chat_started::dummy
    +
    +

    Empty struct as per Telegram API

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__video__note-members.html b/docs/structtelebot__video__note-members.html index 0a28504..df5f503 100644 --- a/docs/structtelebot__video__note-members.html +++ b/docs/structtelebot__video__note-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,32 +56,36 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot_video_note Member List
    +
    telebot_video_note Member List
    diff --git a/docs/structtelebot__video__note.html b/docs/structtelebot__video__note.html index 905a242..95cc3b0 100644 --- a/docs/structtelebot__video__note.html +++ b/docs/structtelebot__video__note.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_video_note Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    @@ -63,8 +73,7 @@ -
    -
    telebot_video_note Struct Reference
    +
    telebot_video_note Struct Reference
    @@ -73,26 +82,26 @@

    #include <telebot-types.h>

    - - + - + - + - + - + - +

    +

    Public Attributes

    char * file_id
    char * file_id
     
    char * file_unique_id
    char * file_unique_id
     
    int length
    int length
     
    int duration
    int duration
     
    struct telebot_photothumb
    struct telebot_photothumb
     
    int file_size
    int file_size
     

    Detailed Description

    This object represents a video message (available in Telegram apps as of v.4.0).

    Member Data Documentation

    - -

    ◆ duration

    + +

    ◆ duration

    @@ -106,8 +115,8 @@

    -

    ◆ file_id

    + +

    ◆ file_id

    @@ -121,8 +130,8 @@

    -

    ◆ file_size

    + +

    ◆ file_size

    @@ -136,8 +145,8 @@

    -

    ◆ file_unique_id

    + +

    ◆ file_unique_id

    @@ -151,8 +160,8 @@

    -

    ◆ length

    + +

    ◆ length

    @@ -166,8 +175,8 @@

    -

    ◆ thumb

    + +

    ◆ thumb

    @@ -187,9 +196,7 @@

    diff --git a/docs/structtelebot__voice-members.html b/docs/structtelebot__voice-members.html index bf4e6df..88a4e56 100644 --- a/docs/structtelebot__voice-members.html +++ b/docs/structtelebot__voice-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,31 +56,35 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_voice Member List
    +
    telebot_voice Member List
    diff --git a/docs/structtelebot__voice.html b/docs/structtelebot__voice.html index a56ca90..acfe9ef 100644 --- a/docs/structtelebot__voice.html +++ b/docs/structtelebot__voice.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_voice Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    @@ -63,8 +73,7 @@ -
    -
    telebot_voice Struct Reference
    +
    telebot_voice Struct Reference

    @@ -73,24 +82,24 @@

    #include <telebot-types.h>

    - - + - + - + - + - +

    +

    Public Attributes

    char * file_id
    char * file_id
     
    char * file_unique_id
    char * file_unique_id
     
    int duration
    int duration
     
    char * mime_type
    char * mime_type
     
    int file_size
    int file_size
     

    Detailed Description

    This object represents a voice note.

    Member Data Documentation

    - -

    ◆ duration

    + +

    ◆ duration

    @@ -104,8 +113,8 @@

    -

    ◆ file_id

    + +

    ◆ file_id

    @@ -119,8 +128,8 @@

    -

    ◆ file_size

    + +

    ◆ file_size

    @@ -134,8 +143,8 @@

    -

    ◆ file_unique_id

    + +

    ◆ file_unique_id

    @@ -149,8 +158,8 @@

    -

    ◆ mime_type

    + +

    ◆ mime_type

    @@ -170,9 +179,7 @@

    diff --git a/docs/structtelebot__web__app__data-members.html b/docs/structtelebot__web__app__data-members.html new file mode 100644 index 0000000..4b86f4f --- /dev/null +++ b/docs/structtelebot__web__app__data-members.html @@ -0,0 +1,87 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_web_app_data Member List
    +
    +
    + +

    This is the complete list of members for telebot_web_app_data, including all inherited members.

    + + + +
    button_texttelebot_web_app_data
    datatelebot_web_app_data
    + + + + diff --git a/docs/structtelebot__web__app__data.html b/docs/structtelebot__web__app__data.html new file mode 100644 index 0000000..59a6f0e --- /dev/null +++ b/docs/structtelebot__web__app__data.html @@ -0,0 +1,134 @@ + + + + + + + +Telebot: telebot_web_app_data Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_web_app_data Struct Reference
    +
    +
    + +

    This object represents data sent by a Web App to the bot. + More...

    + +

    #include <telebot-types.h>

    + + + + + + +

    +Public Attributes

    char * data
     
    char * button_text
     
    +

    Detailed Description

    +

    This object represents data sent by a Web App to the bot.

    +

    Member Data Documentation

    + +

    ◆ button_text

    + +
    +
    + + + + +
    char* telebot_web_app_data::button_text
    +
    +

    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.

    + +
    +
    + +

    ◆ data

    + +
    +
    + + + + +
    char* telebot_web_app_data::data
    +
    +

    The data. Be aware that a bad client can send arbitrary data in this field.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__core__response-members.html b/docs/structtelebot__web__app__info-members.html similarity index 57% rename from docs/structtelebot__core__response-members.html rename to docs/structtelebot__web__app__info-members.html index b14d750..171e7e3 100644 --- a/docs/structtelebot__core__response-members.html +++ b/docs/structtelebot__web__app__info-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,28 +56,31 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    -
    -
    telebot_core_response Member List
    +
    telebot_web_app_info Member List
    -

    This is the complete list of members for telebot_core_response, including all inherited members.

    +

    This is the complete list of members for telebot_web_app_info, including all inherited members.

    - - +
    datatelebot_core_response
    sizetelebot_core_response
    urltelebot_web_app_info
    diff --git a/docs/structtelebot__web__app__info.html b/docs/structtelebot__web__app__info.html new file mode 100644 index 0000000..ddf7cc1 --- /dev/null +++ b/docs/structtelebot__web__app__info.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_web_app_info Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_web_app_info Struct Reference
    +
    +
    + +

    Describes a Web App. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    char * url
     
    +

    Detailed Description

    +

    Describes a Web App.

    +

    Member Data Documentation

    + +

    ◆ url

    + +
    +
    + + + + +
    char* telebot_web_app_info::url
    +
    +

    An HTTPS URL of a Web App to be opened

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/structtelebot__webhook__info-members.html b/docs/structtelebot__webhook__info-members.html index 37478e8..7578b63 100644 --- a/docs/structtelebot__webhook__info-members.html +++ b/docs/structtelebot__webhook__info-members.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: Member List @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,34 +56,38 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot_webhook_info Member List
    +
    telebot_webhook_info Member List
    diff --git a/docs/structtelebot__webhook__info.html b/docs/structtelebot__webhook__info.html index a92ed43..fa3e06c 100644 --- a/docs/structtelebot__webhook__info.html +++ b/docs/structtelebot__webhook__info.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: telebot_webhook_info Struct Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +

    @@ -63,8 +73,7 @@ -
    -
    telebot_webhook_info Struct Reference
    +
    telebot_webhook_info Struct Reference
    @@ -73,36 +82,36 @@

    #include <telebot-types.h>

    - - + - + - + - + - + - + - + - +

    +

    Public Attributes

    char * url
    char * url
     
    bool has_custom_certificate
    bool has_custom_certificate
     
    int pending_update_count
    int pending_update_count
     
    long last_error_date
    long last_error_date
     
    char * last_error_message
    char * last_error_message
     
    int max_connections
    int max_connections
     
    telebot_update_type_e allowed_updates [TELEBOT_UPDATE_TYPE_MAX]
    telebot_update_type_e allowed_updates [TELEBOT_UPDATE_TYPE_MAX]
     
    int allowed_updates_count
    int allowed_updates_count
     

    Detailed Description

    Thi object represetns information about the current status of a webhook.

    Member Data Documentation

    - -

    ◆ allowed_updates

    + +

    ◆ allowed_updates

    - +
    telebot_update_type_e telebot_webhook_info::allowed_updates[TELEBOT_UPDATE_TYPE_MAX]telebot_update_type_e telebot_webhook_info::allowed_updates[TELEBOT_UPDATE_TYPE_MAX]
    @@ -110,8 +119,8 @@

    -

    ◆ allowed_updates_count

    + +

    ◆ allowed_updates_count

    @@ -125,8 +134,8 @@

    -

    ◆ has_custom_certificate

    + +

    ◆ has_custom_certificate

    @@ -140,8 +149,8 @@

    -

    ◆ last_error_date

    + +

    ◆ last_error_date

    @@ -155,8 +164,8 @@

    -

    ◆ last_error_message

    + +

    ◆ last_error_message

    @@ -170,8 +179,8 @@

    -

    ◆ max_connections

    + +

    ◆ max_connections

    @@ -185,8 +194,8 @@

    -

    ◆ pending_update_count

    + +

    ◆ pending_update_count

    @@ -200,8 +209,8 @@

    -

    ◆ url

    + +

    ◆ url

    @@ -221,9 +230,7 @@

    diff --git a/docs/structtelebot__write__access__allowed-members.html b/docs/structtelebot__write__access__allowed-members.html new file mode 100644 index 0000000..304cf8d --- /dev/null +++ b/docs/structtelebot__write__access__allowed-members.html @@ -0,0 +1,86 @@ + + + + + + + +Telebot: Member List + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    +
    telebot_write_access_allowed Member List
    +
    +
    + +

    This is the complete list of members for telebot_write_access_allowed, including all inherited members.

    + + +
    web_app_nametelebot_write_access_allowed
    + + + + diff --git a/docs/structtelebot__write__access__allowed.html b/docs/structtelebot__write__access__allowed.html new file mode 100644 index 0000000..f679f78 --- /dev/null +++ b/docs/structtelebot__write__access__allowed.html @@ -0,0 +1,117 @@ + + + + + + + +Telebot: telebot_write_access_allowed Struct Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    + +
    telebot_write_access_allowed Struct Reference
    +
    +
    + +

    This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. + More...

    + +

    #include <telebot-types.h>

    + + + + +

    +Public Attributes

    char * web_app_name
     
    +

    Detailed Description

    +

    This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.

    +

    Member Data Documentation

    + +

    ◆ web_app_name

    + +
    +
    + + + + +
    char* telebot_write_access_allowed::web_app_name
    +
    +

    Optional. Name of the Web App which was launched from a link

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    + + + + diff --git a/docs/tab_ad.png b/docs/tab_ad.png new file mode 100644 index 0000000..e34850a Binary files /dev/null and b/docs/tab_ad.png differ diff --git a/docs/tab_bd.png b/docs/tab_bd.png new file mode 100644 index 0000000..91c2524 Binary files /dev/null and b/docs/tab_bd.png differ diff --git a/docs/tab_hd.png b/docs/tab_hd.png new file mode 100644 index 0000000..2489273 Binary files /dev/null and b/docs/tab_hd.png differ diff --git a/docs/tab_sd.png b/docs/tab_sd.png new file mode 100644 index 0000000..757a565 Binary files /dev/null and b/docs/tab_sd.png differ diff --git a/docs/tabs.css b/docs/tabs.css index bbde11e..df7944b 100644 --- a/docs/tabs.css +++ b/docs/tabs.css @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:transparent}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all 0.25s;transition:all 0.25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked~.main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked~.main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked~.main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px, 1px, 1px, 1px)}#main-menu-state:not(:checked)~#main-menu{display:none}#main-menu-state:checked~#main-menu{display:block}@media (min-width: 768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked)~#main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:none}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} diff --git a/docs/telebot-common_8h.html b/docs/telebot-common_8h.html index 3b73ea3..03eae40 100644 --- a/docs/telebot-common_8h.html +++ b/docs/telebot-common_8h.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-common.h File Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    diff --git a/docs/telebot-common_8h_source.html b/docs/telebot-common_8h_source.html index 9ef4fd4..d1444f0 100644 --- a/docs/telebot-common_8h_source.html +++ b/docs/telebot-common_8h_source.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-common.h Source File @@ -19,10 +19,9 @@
    - - + @@ -31,19 +30,28 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + +
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot-common.h
    +
    telebot-common.h
    -Go to the documentation of this file.
    1 /*
    2  * telebot
    3  *
    4  * Copyright (c) 2015 Elmurod Talipov.
    5  *
    6  * Licensed under the Apache License, Version 2.0 (the License);
    7  * you may not use this file except in compliance with the License.
    8  * You may obtain a copy of the License at
    9  *
    10  * http://www.apache.org/licenses/LICENSE-2.0
    11  *
    12  * Unless required by applicable law or agreed to in writing, software
    13  * distributed under the License is distributed on an "AS IS" BASIS,
    14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  * See the License for the specific language governing permissions and
    16  * limitations under the License.
    17  */
    18 
    19 #ifndef __TELEBOT_COMMON_H__
    20 #define __TELEBOT_COMMON_H__
    21 
    22 #ifdef __cplusplus
    23 extern "C" {
    24 #endif
    25 
    45 typedef enum {
    53 
    58 #ifdef __cplusplus
    59 }
    60 #endif
    61 
    62 #endif /* __TELEBOT_COMMON_H__ */
    63 
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition: telebot-common.h:45
    -
    Definition: telebot-common.h:46
    -
    Definition: telebot-common.h:47
    -
    Definition: telebot-common.h:50
    -
    Definition: telebot-common.h:51
    -
    Definition: telebot-common.h:48
    -
    Definition: telebot-common.h:49
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_COMMON_H__
    +
    20#define __TELEBOT_COMMON_H__
    +
    21
    +
    22#ifdef __cplusplus
    +
    23extern "C" {
    +
    24#endif
    +
    25
    + +
    53
    +
    58#ifdef __cplusplus
    +
    59}
    +
    60#endif
    +
    61
    +
    62#endif /* __TELEBOT_COMMON_H__ */
    +
    63
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    @ TELEBOT_ERROR_NOT_SUPPORTED
    Definition telebot-common.h:48
    +
    @ TELEBOT_ERROR_NO_CONNECTION
    Definition telebot-common.h:50
    +
    @ TELEBOT_ERROR_INVALID_PARAMETER
    Definition telebot-common.h:51
    +
    @ TELEBOT_ERROR_OPERATION_FAILED
    Definition telebot-common.h:47
    +
    @ TELEBOT_ERROR_NONE
    Definition telebot-common.h:46
    +
    @ TELEBOT_ERROR_OUT_OF_MEMORY
    Definition telebot-common.h:49
    diff --git a/docs/telebot-core_8h.html b/docs/telebot-core_8h.html new file mode 100644 index 0000000..678448a --- /dev/null +++ b/docs/telebot-core_8h.html @@ -0,0 +1,514 @@ + + + + + + + +Telebot: include/telebot-core.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    telebot-core.h File Reference
    +
    +
    + +

    This file contains core API for the telegram bot interface. +More...

    +
    #include <stdbool.h>
    +#include <pthread.h>
    +#include "telebot-common.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + +

    +Typedefs

    +typedef struct telebot_core_handler * telebot_core_handler_t
     Telebot core handler opaque type.
     
    +typedef struct telebot_core_response * telebot_core_response_t
     Telebot core response opaque type.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    telebot_error_e telebot_core_get_response_code (telebot_core_response_t response)
     Get response error code.
     
    const char * telebot_core_get_response_data (telebot_core_response_t response)
     Get response data.
     
    void telebot_core_put_response (telebot_core_response_t response)
     Release response data obtained with telebot core methods.
     
    telebot_error_e telebot_core_create (telebot_core_handler_t *core_h, const char *token)
     Start function to use telebot core APIs.
     
    telebot_error_e telebot_core_destroy (telebot_core_handler_t *core_h)
     Final function to use telebot core APIs.
     
    telebot_error_e telebot_core_set_proxy (telebot_core_handler_t core_h, const char *addr, const char *auth)
     Set proxy address to use telebot behind proxy.
     
    telebot_error_e telebot_core_get_proxy (telebot_core_handler_t core_h, char **addr)
     Get currently used proxy address.
     
    telebot_core_response_t telebot_core_get_updates (telebot_core_handler_t core_h, int offset, int limit, int timeout, const char *allowed_updates)
     Receive incoming updates (long polling). It will not work if an outgoing webhook is set up. In order to avoid getting duplicate updates, recalculate offset after each server response.
     
    telebot_core_response_t telebot_core_set_webhook (telebot_core_handler_t core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates)
     Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
     
    telebot_core_response_t telebot_core_delete_webhook (telebot_core_handler_t core_h)
     Remove webhook integration if you decide to switch back to getUpdates.
     
    telebot_core_response_t telebot_core_get_webhook_info (telebot_core_handler_t core_h)
     Get current webhook status.
     
    telebot_core_response_t telebot_core_get_me (telebot_core_handler_t core_h)
     Get basic information about the bot.
     
    telebot_core_response_t telebot_core_send_message (telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send text messages.
     
    telebot_core_response_t telebot_core_forward_message (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
     Forward messages of any kind.
     
    telebot_core_response_t telebot_core_send_photo (telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send photos.
     
    telebot_core_response_t telebot_core_send_audio (telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.
     
    telebot_core_response_t telebot_core_send_document (telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send general files.
     
    telebot_core_response_t telebot_core_send_video (telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
     
    telebot_core_response_t telebot_core_send_animation (telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send animation files (GIF or H.264/MPEG-4 AVC without sound).
     
    telebot_core_response_t telebot_core_send_voice (telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document).
     
    telebot_core_response_t telebot_core_send_video_note (telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
     
    telebot_core_response_t telebot_core_send_media_group (telebot_core_handler_t core_h, long long int chat_id, char *media_paths[], int count, bool disable_notification, int reply_to_message_id)
     Send a group of photos as an album.
     
    telebot_core_response_t telebot_core_send_location (telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send point on the map.
     
    telebot_core_response_t telebot_core_edit_message_live_location (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
     Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edited until its live_period expires or editing is explicitly disabled by a call to telebot_core_stop_message_live_location().
     
    telebot_core_response_t telebot_core_stop_message_live_location (telebot_core_handler_t core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
     Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires.
     
    telebot_core_response_t telebot_core_send_venue (telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send information about a venue.
     
    telebot_core_response_t telebot_core_send_contact (telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send phone contacts.
     
    telebot_core_response_t telebot_core_send_poll (telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send a native poll.
     
    telebot_core_response_t telebot_core_send_dice (telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
     Send a dice, which will have a random value from 1 to 6.
     
    telebot_core_response_t telebot_core_send_chat_action (telebot_core_handler_t core_h, long long int chat_id, const char *action)
     Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait…", the bot may use telebot_core_send_chat_action() with action = upload_photo. The user will see a "sending photo" status for the bot. It is only recommended to use when a response from the bot will take a noticeable amount of time to arrive.
     
    telebot_core_response_t telebot_core_get_user_profile_photos (telebot_core_handler_t core_h, int user_id, int offset, int limit)
     Get user profile pictures object.
     
    telebot_core_response_t telebot_core_get_file (telebot_core_handler_t core_h, const char *file_id)
     Get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.
     
    telebot_error_e telebot_core_download_file (telebot_core_handler_t core_h, const char *file_path, const char *out_file)
     Download file using file_path obtained with telebot_core_get_file(). 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 telebot_core_get_file() again.
     
    telebot_core_response_t telebot_core_kick_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date)
     Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
     
    telebot_core_response_t telebot_core_unban_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id)
     Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.
     
    telebot_core_response_t telebot_core_restrict_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
     Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass true for all boolean parameters to lift restrictions from a user.
     
    telebot_core_response_t telebot_core_promote_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
     Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
     
    telebot_core_response_t telebot_core_set_chat_admin_custom_title (telebot_core_handler_t core_h, long long int chat_id, int user_id, const char *custom_title)
     Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
     
    telebot_core_response_t telebot_core_set_chat_permissions (telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
     Set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the 'can_restrict_members' admin rights.
     
    telebot_core_response_t telebot_core_export_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id)
     Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
     
    telebot_core_response_t telebot_core_set_chat_photo (telebot_core_handler_t core_h, long long int chat_id, const char *photo)
     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 admin rights.
     
    telebot_core_response_t telebot_core_delete_chat_photo (telebot_core_handler_t core_h, long long int chat_id)
     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 admin rights.
     
    telebot_core_response_t telebot_core_set_chat_title (telebot_core_handler_t core_h, long long int chat_id, const char *title)
     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 admin rights.
     
    telebot_core_response_t telebot_core_set_chat_description (telebot_core_handler_t core_h, long long int chat_id, const char *description)
     Change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
     
    telebot_core_response_t telebot_core_pin_chat_message (telebot_core_handler_t core_h, long long int chat_id, int message_id, bool disable_notification)
     Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
     
    telebot_core_response_t telebot_core_unpin_chat_message (telebot_core_handler_t core_h, long long int chat_id)
     Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
     
    telebot_core_response_t telebot_core_leave_chat (telebot_core_handler_t core_h, long long int chat_id)
     Leave a group, supergroup or channel.
     
    telebot_core_response_t telebot_core_get_chat (telebot_core_handler_t core_h, long long int chat_id)
     Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc).
     
    telebot_core_response_t telebot_core_get_chat_admins (telebot_core_handler_t core_h, long long int chat_id)
     Get a list of administrators in a chat. Response contains an array of objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
     
    telebot_core_response_t telebot_core_get_chat_members_count (telebot_core_handler_t core_h, long long int chat_id)
     Get the number of members in a chat.
     
    telebot_core_response_t telebot_core_get_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id)
     Get information about a member of a chat.
     
    telebot_core_response_t telebot_core_set_chat_sticker_set (telebot_core_handler_t core_h, long long int chat_id, const char *sticker_set_name)
     Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use it.
     
    telebot_core_response_t telebot_core_delete_chat_sticker_set (telebot_core_handler_t core_h, long long int chat_id)
     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 admin rights. Use the field can_set_sticker_set optionally returned in telebot_core_get_chat requests to check if the bot can use this method.
     
    telebot_core_response_t telebot_core_answer_callback_query (telebot_core_handler_t core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
     Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
     
    telebot_core_response_t telebot_core_set_my_commands (telebot_core_handler_t core_h, const char *commands)
     Change the list of the bot's commands.
     
    telebot_core_response_t telebot_core_get_my_commands (telebot_core_handler_t core_h)
     Get the current list of the bot's commands..
     
    telebot_core_response_t telebot_core_edit_message_text (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
     Edit text and game messages sent by the bot or via the bot (for inline bots).
     
    telebot_core_response_t telebot_core_edit_message_caption (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
     Edit captions of messages sent by the bot or via the bot (for inline bots).
     
    telebot_core_response_t telebot_core_edit_message_reply_markup (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
     Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
     
    telebot_core_response_t telebot_core_edit_message_media (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *media, const char *reply_markup)
     Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio of the same type and with the same caption.
     
    telebot_core_response_t telebot_core_stop_poll (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reply_markup)
     Stop a poll which was sent by the bot.
     
    telebot_core_response_t telebot_core_delete_message (telebot_core_handler_t core_h, long long int chat_id, int message_id)
     Delete a message, including service messages, with the following limitations:
     
    telebot_core_response_t telebot_core_log_out (telebot_core_handler_t core_h)
     Use this method to log out from the cloud Bot API server before launching the bot locally.
     
    telebot_core_response_t telebot_core_close (telebot_core_handler_t core_h)
     Use this method to close the bot instance before moving it from one local server to another.
     
    telebot_core_response_t telebot_core_set_my_name (telebot_core_handler_t core_h, const char *name, const char *language_code)
     Use this method to change the bot's name.
     
    telebot_core_response_t telebot_core_get_my_name (telebot_core_handler_t core_h, const char *language_code)
     Use this method to get the current bot name for the given user language.
     
    telebot_core_response_t telebot_core_set_my_description (telebot_core_handler_t core_h, const char *description, const char *language_code)
     Use this method to change the bot's description.
     
    telebot_core_response_t telebot_core_get_my_description (telebot_core_handler_t core_h, const char *language_code)
     Use this method to get the current bot description for the given user language.
     
    telebot_core_response_t telebot_core_set_my_short_description (telebot_core_handler_t core_h, const char *short_description, const char *language_code)
     Use this method to change the bot's short description.
     
    telebot_core_response_t telebot_core_get_my_short_description (telebot_core_handler_t core_h, const char *language_code)
     Use this method to get the current bot short description for the given user language.
     
    telebot_core_response_t telebot_core_set_chat_menu_button (telebot_core_handler_t core_h, long long int chat_id, const char *menu_button)
     Use this method to change the bot's menu button in a private chat, or the default menu button.
     
    telebot_core_response_t telebot_core_get_chat_menu_button (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
     
    telebot_core_response_t telebot_core_set_my_default_administrator_rights (telebot_core_handler_t core_h, const char *rights, bool for_channels)
     Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
     
    telebot_core_response_t telebot_core_get_my_default_administrator_rights (telebot_core_handler_t core_h, bool for_channels)
     Use this method to get the current default administrator rights of the bot.
     
    telebot_core_response_t telebot_core_delete_my_commands (telebot_core_handler_t core_h, const char *scope, const char *language_code)
     Use this method to delete the list of the bot's commands for the given scope and user language.
     
    telebot_core_response_t telebot_core_copy_message (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, int message_id, const char *caption, const char *parse_mode, const char *caption_entities, bool disable_notification, bool protect_content, int reply_to_message_id, bool allow_sending_without_reply, const char *reply_markup)
     Use this method to copy messages of any kind.
     
    telebot_core_response_t telebot_core_copy_messages (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, bool remove_caption)
     Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
     
    telebot_core_response_t telebot_core_forward_messages (telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content)
     Use this method to forward multiple messages of any kind.
     
    telebot_core_response_t telebot_core_delete_messages (telebot_core_handler_t core_h, long long int chat_id, const char *message_ids)
     Use this method to delete multiple messages in a chat.
     
    telebot_core_response_t telebot_core_ban_chat_member (telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool revoke_messages)
     Use this method to ban a user in a group, a supergroup or a channel.
     
    telebot_core_response_t telebot_core_ban_chat_sender_chat (telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
     Use this method to ban a channel chat in a supergroup or a channel.
     
    telebot_core_response_t telebot_core_unban_chat_sender_chat (telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
     Use this method to unban a previously banned channel chat in a supergroup or a channel.
     
    telebot_core_response_t telebot_core_create_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *name, long expire_date, int member_limit, bool creates_join_request)
     Use this method to create an additional invite link for a chat.
     
    telebot_core_response_t telebot_core_edit_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *invite_link, const char *name, long expire_date, int member_limit, bool creates_join_request)
     Use this method to edit a non-primary invite link created by the bot.
     
    telebot_core_response_t telebot_core_revoke_chat_invite_link (telebot_core_handler_t core_h, long long int chat_id, const char *invite_link)
     Use this method to revoke an invite link created by the bot.
     
    telebot_core_response_t telebot_core_approve_chat_join_request (telebot_core_handler_t core_h, long long int chat_id, int user_id)
     Use this method to approve a chat join request.
     
    telebot_core_response_t telebot_core_decline_chat_join_request (telebot_core_handler_t core_h, long long int chat_id, int user_id)
     Use this method to decline a chat join request.
     
    telebot_core_response_t telebot_core_set_message_reaction (telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reaction, bool is_big)
     Use this method to set a new message reaction.
     
    telebot_core_response_t telebot_core_create_forum_topic (telebot_core_handler_t core_h, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id)
     Use this method to create a topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_edit_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
     Use this method to edit name and icon of a topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_close_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
     Use this method to close an open topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_reopen_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
     Use this method to reopen a closed topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_delete_forum_topic (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
     Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_unpin_all_forum_topic_messages (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
     Use this method to unpin all messages in a forum topic.
     
    telebot_core_response_t telebot_core_get_forum_topic_icon_stickers (telebot_core_handler_t core_h)
     Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
     
    telebot_core_response_t telebot_core_edit_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id, const char *name)
     Use this method to edit the name of the 'General' topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_close_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to close an open 'General' topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_reopen_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to reopen a closed 'General' topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_hide_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to hide the 'General' topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_unhide_general_forum_topic (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to unhide the 'General' topic in a forum supergroup chat.
     
    telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages (telebot_core_handler_t core_h, long long int chat_id)
     Use this method to unpin all messages in a General forum topic.
     
    telebot_core_response_t telebot_core_get_custom_emoji_stickers (telebot_core_handler_t core_h, const char *custom_emoji_ids)
     Use this method to get information about custom emoji stickers by their identifiers.
     
    telebot_core_response_t telebot_core_answer_web_app_query (telebot_core_handler_t core_h, const char *web_app_query_id, const char *result)
     Use this method to send answers to an inline query to a user from a Web App.
     
    telebot_core_response_t telebot_core_send_paid_media (telebot_core_handler_t core_h, long long int chat_id, int star_count, const char *media, const char *caption, const char *parse_mode, const char *caption_entities, bool show_caption_above_media, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
     Use this method to send paid media to a user.
     
    telebot_core_response_t telebot_core_answer_inline_query (telebot_core_handler_t core_h, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
     Use this method to send answers to an inline query.
     
    telebot_core_response_t telebot_core_save_prepared_inline_message (telebot_core_handler_t core_h, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats)
     Use this method to save a prepared inline message.
     
    telebot_core_response_t telebot_core_send_gift (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
     Use this method to send a gift.
     
    telebot_core_response_t telebot_core_gift_premium_subscription (telebot_core_handler_t core_h, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
     Use this method to gift a Telegram Premium subscription to a user.
     
    telebot_core_response_t telebot_core_get_my_star_balance (telebot_core_handler_t core_h)
     Use this method to get the current Telegram Stars balance of the bot.
     
    telebot_core_response_t telebot_core_get_star_transactions (telebot_core_handler_t core_h, int offset, int limit)
     Use this method to get the bot's Telegram Star transactions.
     
    telebot_core_response_t telebot_core_refund_star_payment (telebot_core_handler_t core_h, long long int user_id, const char *telegram_payment_charge_id)
     Use this method to refund a successful payment in Telegram Stars.
     
    telebot_core_response_t telebot_core_get_available_gifts (telebot_core_handler_t core_h)
     Use this method to get a list of gifts that can be sent by the bot to users.
     
    telebot_core_response_t telebot_core_get_user_gifts (telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
     Use this method to get a list of gifts received by a user.
     
    telebot_core_response_t telebot_core_get_chat_gifts (telebot_core_handler_t core_h, long long int chat_id, int offset, int limit)
     Use this method to get a list of gifts received by a chat.
     
    telebot_core_response_t telebot_core_upgrade_gift (telebot_core_handler_t core_h, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
     Use this method to upgrade a gift.
     
    telebot_core_response_t telebot_core_transfer_gift (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id)
     Use this method to transfer a gift.
     
    telebot_core_response_t telebot_core_convert_gift_to_stars (telebot_core_handler_t core_h, const char *gift_id)
     Use this method to convert a gift to Telegram Stars.
     
    telebot_core_response_t telebot_core_get_user_profile_audios (telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
     Use this method to get user profile audios.
     
    telebot_core_response_t telebot_core_set_my_profile_photo (telebot_core_handler_t core_h, const char *photo)
     Use this method to set the bot's profile photo.
     
    telebot_core_response_t telebot_core_remove_my_profile_photo (telebot_core_handler_t core_h, const char *photo_id)
     Use this method to remove the bot's profile photo.
     
    telebot_core_response_t telebot_core_get_business_connection (telebot_core_handler_t core_h, const char *business_connection_id)
     Use this method to get information about the business connection.
     
    telebot_core_response_t telebot_core_get_user_chat_boosts (telebot_core_handler_t core_h, long long int chat_id, long long int user_id)
     Use this method to get user chat boosts.
     
    +telebot_core_response_t telebot_core_set_game_score (telebot_core_handler_t core_h, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id)
     Use this method to set the score of the specified user in a game.
     
    +telebot_core_response_t telebot_core_get_game_high_scores (telebot_core_handler_t core_h, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id)
     Use this method to get data for high score tables.
     
    +telebot_core_response_t telebot_core_send_game (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
     Use this method to send a game.
     
    +telebot_core_response_t telebot_core_set_passport_data_errors (telebot_core_handler_t core_h, long long int user_id, const char *errors)
     Use this method to set passport data errors.
     
    +telebot_core_response_t telebot_core_send_invoice (telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
     Use this method to send an invoice.
     
    +telebot_core_response_t telebot_core_create_invoice_link (telebot_core_handler_t core_h, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible)
     Use this method to create a link for an invoice.
     
    +telebot_core_response_t telebot_core_answer_shipping_query (telebot_core_handler_t core_h, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
     Use this method to reply to shipping queries.
     
    +telebot_core_response_t telebot_core_answer_pre_checkout_query (telebot_core_handler_t core_h, const char *pre_checkout_query_id, bool ok, const char *error_message)
     Use this method to respond to pre-checkout queries.
     
    +

    Detailed Description

    +

    This file contains core API for the telegram bot interface.

    +
    Author
    Elmurod Talipov
    +
    Date
    2026-02-28
    +
    + + + + diff --git a/docs/telebot-core_8h_source.html b/docs/telebot-core_8h_source.html index 87e346f..d01efda 100644 --- a/docs/telebot-core_8h_source.html +++ b/docs/telebot-core_8h_source.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-core.h Source File @@ -19,10 +19,9 @@
    - - + @@ -31,19 +30,28 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + +
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot-core.h
    +
    telebot-core.h
    -
    1 /*
    2  * telebot
    3  *
    4  * Copyright (c) 2015 Elmurod Talipov.
    5  *
    6  * Licensed under the Apache License, Version 2.0 (the License);
    7  * you may not use this file except in compliance with the License.
    8  * You may obtain a copy of the License at
    9  *
    10  * http://www.apache.org/licenses/LICENSE-2.0
    11  *
    12  * Unless required by applicable law or agreed to in writing, software
    13  * distributed under the License is distributed on an "AS IS" BASIS,
    14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  * See the License for the specific language governing permissions and
    16  * limitations under the License.
    17  */
    18 
    19 #ifndef __TELEBOT_CORE_API_H__
    20 #define __TELEBOT_CORE_API_H__
    21 
    22 #include <stdbool.h>
    23 #include <pthread.h>
    24 
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    50 typedef struct telebot_core_handler {
    51  char *token;
    52  char *proxy_addr;
    53  char *proxy_auth;
    55 
    59 typedef struct telebot_core_response {
    60  size_t size;
    61  char *data;
    63 
    76 
    88 
    98  const char *auth);
    99 
    108 
    129  int limit, int timeout, const char *allowed_updates,
    130  telebot_core_response_t *response);
    131 
    152  const char *certificate, int max_connections, const char *allowed_updates,
    153  telebot_core_response_t *response);
    154 
    162  telebot_core_response_t *response);
    163 
    171  telebot_core_response_t *response);
    172 
    180  telebot_core_response_t *response);
    181 
    201  long long int chat_id, const char *text, const char *parse_mode,
    202  bool disable_web_page_preview, bool disable_notification, int reply_to_message_id,
    203  const char *reply_markup, telebot_core_response_t *response);
    204 
    220  long long int chat_id, long long int from_chat_id, bool disable_notification,
    221  int message_id, telebot_core_response_t *response);
    222 
    245  long long int chat_id, const char *photo, bool is_file, const char *caption,
    246  const char *parse_mode, bool disable_notification, int reply_to_message_id,
    247  const char *reply_markup, telebot_core_response_t *response);
    248 
    283  long long int chat_id, const char *audio, bool is_file, const char *caption,
    284  const char *parse_mode, int duration, const char *performer, const char *title,
    285  const char *thumb, bool disable_notification, int reply_to_message_id,
    286  const char *reply_markup, telebot_core_response_t *response);
    287 
    313  long long int chat_id, const char *document, bool is_file, const char *thumb,
    314  const char *caption, const char *parse_mode, bool disable_notification,
    315  int reply_to_message_id, const char *reply_markup,
    316  telebot_core_response_t *response);
    317 
    348  long long int chat_id, const char *video, bool is_file, int duration,
    349  int width, int height, const char *thumb, const char *caption,
    350  const char *parse_mode, bool supports_streaming, bool disable_notification,
    351  int reply_to_message_id, const char *reply_markup,
    352  telebot_core_response_t *response);
    353 
    381  long long int chat_id, const char *animation, bool is_file, int duration,
    382  int width, int height, const char *thumb, const char *caption,
    383  const char *parse_mode, bool disable_notification, int reply_to_message_id,
    384  const char *reply_markup, telebot_core_response_t *response);
    385 
    409  long long int chat_id, const char *voice, bool is_file, const char *caption,
    410  const char *parse_mode, int duration, bool disable_notification,
    411  int reply_to_message_id, const char *reply_markup,
    412  telebot_core_response_t *response);
    413 
    439  long long int chat_id, char *video_note, bool is_file, int duration, int length,
    440  const char *thumb, bool disable_notification, int reply_to_message_id,
    441  const char *reply_markup, telebot_core_response_t *response);
    442 
    462  long long int chat_id, float latitude, float longitude, int live_period,
    463  bool disable_notification, int reply_to_message_id, const char *reply_markup,
    464  telebot_core_response_t *response);
    465 
    485  long long int chat_id, int message_id, const char *inline_message_id,
    486  float latitude, float longitude, const char *reply_markup,
    487  telebot_core_response_t *response);
    488 
    505  long long int chat_id, int message_id, char *inline_message_id,
    506  const char *reply_markup, telebot_core_response_t *response);
    507 
    530  long long int chat_id, float latitude, float longitude, const char *title,
    531  const char *address, const char *foursquare_id, const char *foursquare_type,
    532  bool disable_notification, int reply_to_message_id, const char *reply_markup,
    533  telebot_core_response_t *response);
    534 
    555  long long int chat_id, const char *phone_number, const char *first_name,
    556  const char *last_name, const char *vcard, bool disable_notification,
    557  int reply_to_message_id, const char *reply_markup,
    558  telebot_core_response_t *response);
    559 
    587  long long int chat_id, const char *question, const char *options,
    588  bool is_anonymous, const char *type, bool allows_multiple_answers,
    589  int correct_option_id, bool is_closed, bool disable_notification,
    590  int reply_to_message_id, const char *reply_markup,
    591  telebot_core_response_t *response);
    592 
    609  long long int chat_id, bool disable_notification,
    610  int reply_to_message_id, const char *reply_markup,
    611  telebot_core_response_t *response);
    612 
    635  long long int chat_id, const char *action, telebot_core_response_t *response);
    636 
    650  int user_id, int offset, int limit, telebot_core_response_t *response);
    651 
    662  telebot_core_response_t *response);
    663 
    676  const char *file_path, const char *out_file);
    677 
    696  long long int chat_id, int user_id, long until_date,
    697  telebot_core_response_t *response);
    698 
    712  long long int chat_id, int user_id, telebot_core_response_t *response);
    713 
    747  long long int chat_id, int user_id, long until_date, bool can_send_messages,
    748  bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages,
    749  bool can_add_web_page_previews, bool can_change_info, bool can_invite_users,
    750  bool can_pin_messages, telebot_core_response_t *response);
    751 
    783  long long int chat_id, int user_id, bool can_change_info, bool can_post_messages,
    784  bool can_edit_messages, bool can_delete_messages, bool can_invite_users,
    785  bool can_restrict_members, bool can_pin_messages, bool can_promote_members,
    786  telebot_core_response_t *response);
    787 
    803  long long int chat_id, int user_id, const char *custom_title,
    804  telebot_core_response_t *response);
    805 
    835  long long int chat_id, bool can_send_messages, bool can_send_media_messages,
    836  bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews,
    837  bool can_change_info, bool can_invite_users, bool can_pin_messages,
    838  telebot_core_response_t *response);
    839 
    852  long long int chat_id, telebot_core_response_t *response);
    853 
    867  long long int chat_id, const char *photo, telebot_core_response_t *response);
    868 
    881  long long int chat_id, telebot_core_response_t *response);
    882 
    896  long long int chat_id, const char *title, telebot_core_response_t *response);
    897 
    911  long long int chat_id, const char *description,
    912  telebot_core_response_t *response);
    913 
    930  long long int chat_id, int message_id, bool disable_notification,
    931  telebot_core_response_t *response);
    932 
    945  long long int chat_id, telebot_core_response_t *response);
    946 
    957  long long int chat_id, telebot_core_response_t *response);
    958 
    970  long long int chat_id, telebot_core_response_t *response);
    971 
    985  long long int chat_id, telebot_core_response_t *response);
    986 
    997  long long int chat_id, telebot_core_response_t *response);
    998 
    1010  long long int chat_id, int user_id, telebot_core_response_t *response);
    1011 
    1027  long long int chat_id, const char *sticker_set_name,
    1028  telebot_core_response_t *response);
    1029 
    1043  long long int chat_id, telebot_core_response_t *response);
    1044 
    1067  const char *callback_query_id, const char *text, bool show_alert,
    1068  const char *url, int cache_time, telebot_core_response_t *response);
    1069 
    1080  const char *commands, telebot_core_response_t *response);
    1081 
    1090  telebot_core_response_t *response);
    1091 
    1111  long long int chat_id, int message_id, const char *inline_message_id,
    1112  const char *text, const char *parse_mode, bool disable_web_page_preview,
    1113  const char *reply_markup, telebot_core_response_t *response);
    1114 
    1131  long long int chat_id, int message_id, const char *inline_message_id,
    1132  const char *caption, const char *parse_mode, const char *reply_markup,
    1133  telebot_core_response_t *response);
    1134 
    1152  long long int chat_id, int message_id, const char *inline_message_id,
    1153  const char *reply_markup, telebot_core_response_t *response);
    1154 
    1171  long long int chat_id, int message_id, const char *reply_markup,
    1172  telebot_core_response_t *response);
    1173 
    1174 
    1193  long long int chat_id, int message_id, telebot_core_response_t *response);
    1194 
    1195 
    1201 
    1206 #ifdef __cplusplus
    1207 }
    1208 #endif
    1209 
    1210 #endif /* __TELEBOT_CORE_API_H__ */
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition: telebot-common.h:45
    -
    telebot_error_e telebot_core_send_message(telebot_core_handler_t *core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send text messages.
    -
    telebot_error_e telebot_core_export_chat_invite_link(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an a...
    -
    telebot_error_e telebot_core_get_chat(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Get up to date information about the chat (current name of the user for one-on-one conversations...
    -
    telebot_error_e telebot_core_send_poll(telebot_core_handler_t *core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send a native poll.
    -
    telebot_error_e telebot_core_edit_message_text(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup, telebot_core_response_t *response)
    Edit text and game messages sent by the bot or via the bot (for inline bots).
    -
    telebot_error_e telebot_core_get_user_profile_photos(telebot_core_handler_t *core_h, int user_id, int offset, int limit, telebot_core_response_t *response)
    Get user profile pictures object.
    -
    telebot_error_e telebot_core_get_me(telebot_core_handler_t *core_h, telebot_core_response_t *response)
    Get basic information about the bot.
    -
    This object represents a core telebot handler.
    Definition: telebot-core.h:50
    -
    telebot_error_e telebot_core_stop_poll(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *reply_markup, telebot_core_response_t *response)
    Stop a poll which was sent by the bot.
    -
    telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **addr)
    Get currently used proxy address.
    -
    telebot_error_e telebot_core_set_chat_title(telebot_core_handler_t *core_h, long long int chat_id, const char *title, telebot_core_response_t *response)
    Change the title of a chat. Titles can&#39;t be changed for private chats. The bot must be an administrat...
    -
    telebot_error_e telebot_core_edit_message_caption(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup, telebot_core_response_t *response)
    Edit captions of messages sent by the bot or via the bot (for inline bots).
    -
    telebot_error_e telebot_core_answer_callback_query(telebot_core_handler_t *core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time, telebot_core_response_t *response)
    Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user...
    -
    telebot_error_e telebot_core_get_chat_admins(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Get a list of administrators in a chat. Response contains an array of objects that contains informati...
    -
    telebot_error_e telebot_core_set_my_commands(telebot_core_handler_t *core_h, const char *commands, telebot_core_response_t *response)
    Change the list of the bot&#39;s commands.
    -
    void telebot_core_put_response(telebot_core_response_t *response)
    Release response data obtained with telebot core methods.
    -
    telebot_error_e telebot_core_get_webhook_info(telebot_core_handler_t *core_h, telebot_core_response_t *response)
    Get current webhook status.
    -
    telebot_error_e telebot_core_stop_message_live_location(telebot_core_handler_t *core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
    Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_pe...
    -
    telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h)
    Final function to use telebot core APIs.
    -
    telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char *token)
    Start function to use telebot core APIs.
    -
    telebot_error_e telebot_core_send_audio(telebot_core_handler_t *core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.
    -
    telebot_error_e telebot_core_delete_chat_photo(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Delete a chat photo. Photos can&#39;t be changed for private chats. The bot must be an administrator in t...
    -
    telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, const char *file_path, const char *out_file)
    Download file using file_path obtained with telebot_core_get_file(). It is guaranteed that the link w...
    -
    telebot_error_e telebot_core_send_photo(telebot_core_handler_t *core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send photos.
    -
    telebot_error_e telebot_core_get_chat_members_count(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Get the number of members in a chat.
    -
    char * token
    Definition: telebot-core.h:51
    -
    telebot_error_e telebot_core_restrict_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
    Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work ...
    -
    telebot_error_e telebot_core_unpin_chat_message(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this t...
    -
    telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, const char *addr, const char *auth)
    Set proxy address to use telebot behind proxy.
    -
    telebot_error_e telebot_core_send_voice(telebot_core_handler_t *core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send audio files, if you want Telegram clients to display the file as a playable voice message...
    -
    telebot_error_e telebot_core_forward_message(telebot_core_handler_t *core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id, telebot_core_response_t *response)
    Forward messages of any kind.
    -
    struct telebot_core_response telebot_core_response_t
    This object represents a telegram bot response.
    -
    telebot_error_e telebot_core_unban_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
    Unban a previously kicked user in a supergroup or channel. The user will not return to the group or c...
    -
    This object represents a telegram bot response.
    Definition: telebot-core.h:59
    -
    telebot_error_e telebot_core_edit_message_reply_markup(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
    Edit only the reply markup of messages sent by the bot or via the bot (for inline bots)...
    -
    telebot_error_e telebot_core_send_video_note(telebot_core_handler_t *core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minut...
    -
    telebot_error_e telebot_core_set_chat_photo(telebot_core_handler_t *core_h, long long int chat_id, const char *photo, telebot_core_response_t *response)
    Set a new profile photo for the chat. Photos can&#39;t be changed for private chats. The bot must be an a...
    -
    telebot_error_e telebot_core_send_venue(telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send information about a venue.
    -
    telebot_error_e telebot_core_send_location(telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send point on the map.
    -
    telebot_error_e telebot_core_kick_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, telebot_core_response_t *response)
    Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels...
    -
    telebot_error_e telebot_core_get_file(telebot_core_handler_t *core_h, const char *file_id, telebot_core_response_t *response)
    Get basic info about a file and prepare it for downloading. For the moment, bots can download files o...
    -
    telebot_error_e telebot_core_set_chat_description(telebot_core_handler_t *core_h, long long int chat_id, const char *description, telebot_core_response_t *response)
    Change the description of a supergroup or a channel. The bot must be an administrator in the chat for...
    -
    telebot_error_e telebot_core_leave_chat(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Leave a group, supergroup or channel.
    -
    telebot_error_e telebot_core_delete_message(telebot_core_handler_t *core_h, long long int chat_id, int message_id, telebot_core_response_t *response)
    Delete a message, including service messages, with the following limitations:
    -
    telebot_error_e telebot_core_get_updates(telebot_core_handler_t *core_h, int offset, int limit, int timeout, const char *allowed_updates, telebot_core_response_t *response)
    Receive incoming updates (long polling). It will not work if an outgoing webhook is set up...
    -
    telebot_error_e telebot_core_send_chat_action(telebot_core_handler_t *core_h, long long int chat_id, const char *action, telebot_core_response_t *response)
    Tell the user that something is happening on the bot&#39;s side. The status is set for 5 seconds or less ...
    -
    char * data
    Definition: telebot-core.h:61
    -
    telebot_error_e telebot_core_send_dice(telebot_core_handler_t *core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send a dice, which will have a random value from 1 to 6.
    -
    struct telebot_core_handler telebot_core_handler_t
    This object represents a core telebot handler.
    -
    size_t size
    Definition: telebot-core.h:60
    -
    telebot_error_e telebot_core_set_chat_permissions(telebot_core_handler_t *core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
    Set default chat permissions for all members. The bot must be an administrator in the group or a supe...
    -
    telebot_error_e telebot_core_promote_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members, telebot_core_response_t *response)
    Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat f...
    -
    telebot_error_e telebot_core_send_video(telebot_core_handler_t *core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send video files, Telegram clients support mp4 videos (other formats may be sent as Document)...
    -
    telebot_error_e telebot_core_send_document(telebot_core_handler_t *core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send general files.
    -
    telebot_error_e telebot_core_delete_webhook(telebot_core_handler_t *core_h, telebot_core_response_t *response)
    Remove webhook integration if you decide to switch back to getUpdates.
    -
    telebot_error_e telebot_core_send_contact(telebot_core_handler_t *core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send phone contacts.
    -
    telebot_error_e telebot_core_send_animation(telebot_core_handler_t *core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
    Send animation files (GIF or H.264/MPEG-4 AVC without sound).
    -
    telebot_error_e telebot_core_get_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
    Get information about a member of a chat.
    -
    telebot_error_e telebot_core_pin_chat_message(telebot_core_handler_t *core_h, long long int chat_id, int message_id, bool disable_notification, telebot_core_response_t *response)
    Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to ...
    -
    telebot_error_e telebot_core_edit_message_live_location(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup, telebot_core_response_t *response)
    Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edite...
    -
    telebot_error_e telebot_core_set_chat_sticker_set(telebot_core_handler_t *core_h, long long int chat_id, const char *sticker_set_name, telebot_core_response_t *response)
    Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this t...
    -
    telebot_error_e telebot_core_get_my_commands(telebot_core_handler_t *core_h, telebot_core_response_t *response)
    Get the current list of the bot&#39;s commands..
    -
    telebot_error_e telebot_core_delete_chat_sticker_set(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
    Delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this t...
    -
    telebot_error_e telebot_core_set_chat_admin_custom_title(telebot_core_handler_t *core_h, long long int chat_id, int user_id, const char *custom_title, telebot_core_response_t *response)
    Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for ...
    -
    telebot_error_e telebot_core_set_webhook(telebot_core_handler_t *core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates, telebot_core_response_t *response)
    Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for t...
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_CORE_API_H__
    +
    20#define __TELEBOT_CORE_API_H__
    +
    21
    +
    22#include <stdbool.h>
    +
    23#include <pthread.h>
    +
    24#include "telebot-common.h"
    +
    25
    +
    26#ifdef __cplusplus
    +
    27extern "C"
    +
    28{
    +
    29#endif
    +
    30
    +
    51typedef struct telebot_core_handler *telebot_core_handler_t;
    +
    52
    +
    56typedef struct telebot_core_response *telebot_core_response_t;
    +
    57
    + +
    65
    + +
    73
    + +
    79
    + +
    92
    + +
    104
    + +
    114 const char *auth);
    +
    115
    + +
    124
    + +
    147 int offset, int limit, int timeout, const char *allowed_updates);
    +
    148
    + +
    171 const char *url, const char *certificate, int max_connections,
    +
    172 const char *allowed_updates);
    +
    173
    + +
    183
    + +
    193
    + +
    204
    + +
    225 long long int chat_id, const char *text, const char *parse_mode,
    +
    226 bool disable_web_page_preview, bool disable_notification,
    +
    227 int reply_to_message_id, const char *reply_markup);
    +
    228
    + +
    245 long long int chat_id, long long int from_chat_id, bool disable_notification,
    +
    246 int message_id);
    +
    247
    + +
    271 long long int chat_id, const char *photo, bool is_file, const char *caption,
    +
    272 const char *parse_mode, bool disable_notification, int reply_to_message_id,
    +
    273 const char *reply_markup);
    +
    274
    + +
    310 long long int chat_id, const char *audio, bool is_file, const char *caption,
    +
    311 const char *parse_mode, int duration, const char *performer, const char *title,
    +
    312 const char *thumb, bool disable_notification, int reply_to_message_id,
    +
    313 const char *reply_markup);
    +
    314
    + +
    341 long long int chat_id, const char *document, bool is_file, const char *thumb,
    +
    342 const char *caption, const char *parse_mode, bool disable_notification,
    +
    343 int reply_to_message_id, const char *reply_markup);
    +
    344
    + +
    376 long long int chat_id, const char *video, bool is_file, int duration,
    +
    377 int width, int height, const char *thumb, const char *caption,
    +
    378 const char *parse_mode, bool supports_streaming, bool disable_notification,
    +
    379 int reply_to_message_id, const char *reply_markup);
    +
    380
    + +
    409 long long int chat_id, const char *animation, bool is_file, int duration,
    +
    410 int width, int height, const char *thumb, const char *caption,
    +
    411 const char *parse_mode, bool disable_notification, int reply_to_message_id,
    +
    412 const char *reply_markup);
    +
    413
    + +
    438 long long int chat_id, const char *voice, bool is_file, const char *caption,
    +
    439 const char *parse_mode, int duration, bool disable_notification,
    +
    440 int reply_to_message_id, const char *reply_markup);
    +
    441
    + +
    468 long long int chat_id, char *video_note, bool is_file, int duration, int length,
    +
    469 const char *thumb, bool disable_notification, int reply_to_message_id,
    +
    470 const char *reply_markup);
    +
    471
    + +
    487 long long int chat_id, char *media_paths[], int count, bool disable_notification,
    +
    488 int reply_to_message_id);
    +
    489
    + +
    510 long long int chat_id, float latitude, float longitude, int live_period,
    +
    511 bool disable_notification, int reply_to_message_id, const char *reply_markup);
    +
    512
    + +
    533 long long int chat_id, int message_id, const char *inline_message_id,
    +
    534 float latitude, float longitude, const char *reply_markup);
    +
    535
    + +
    553 long long int chat_id, int message_id, char *inline_message_id,
    +
    554 const char *reply_markup);
    +
    555
    + +
    579 long long int chat_id, float latitude, float longitude, const char *title,
    +
    580 const char *address, const char *foursquare_id, const char *foursquare_type,
    +
    581 bool disable_notification, int reply_to_message_id, const char *reply_markup);
    +
    582
    + +
    604 long long int chat_id, const char *phone_number, const char *first_name,
    +
    605 const char *last_name, const char *vcard, bool disable_notification,
    +
    606 int reply_to_message_id, const char *reply_markup);
    +
    607
    + +
    636 long long int chat_id, const char *question, const char *options,
    +
    637 bool is_anonymous, const char *type, bool allows_multiple_answers,
    +
    638 int correct_option_id, bool is_closed, bool disable_notification,
    +
    639 int reply_to_message_id, const char *reply_markup);
    +
    640
    + +
    658 long long int chat_id, bool disable_notification,
    +
    659 int reply_to_message_id, const char *reply_markup);
    +
    660
    + +
    684 long long int chat_id, const char *action);
    +
    685
    + +
    700 int user_id, int offset, int limit);
    +
    701
    + +
    713
    + +
    726 const char *file_path, const char *out_file);
    +
    727
    + +
    747 long long int chat_id, int user_id, long until_date);
    +
    748
    + +
    763 long long int chat_id, int user_id);
    +
    764
    + +
    799 long long int chat_id, int user_id, long until_date, bool can_send_messages,
    +
    800 bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages,
    +
    801 bool can_add_web_page_previews, bool can_change_info, bool can_invite_users,
    +
    802 bool can_pin_messages);
    +
    803
    + +
    836 long long int chat_id, int user_id, bool can_change_info, bool can_post_messages,
    +
    837 bool can_edit_messages, bool can_delete_messages, bool can_invite_users,
    +
    838 bool can_restrict_members, bool can_pin_messages, bool can_promote_members);
    +
    839
    + +
    856 long long int chat_id, int user_id, const char *custom_title);
    +
    857
    + +
    888 long long int chat_id, bool can_send_messages, bool can_send_media_messages,
    +
    889 bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews,
    +
    890 bool can_change_info, bool can_invite_users, bool can_pin_messages);
    +
    891
    + +
    905 long long int chat_id);
    +
    906
    + +
    921 long long int chat_id, const char *photo);
    +
    922
    + +
    936 long long int chat_id);
    +
    937
    + +
    952 long long int chat_id, const char *title);
    +
    953
    + +
    968 long long int chat_id, const char *description);
    +
    969
    + +
    987 long long int chat_id, int message_id, bool disable_notification);
    +
    988
    + +
    1002 long long int chat_id);
    +
    1003
    + +
    1015
    + +
    1028 long long int chat_id);
    +
    1029
    + +
    1044 long long int chat_id);
    +
    1045
    + +
    1057 long long int chat_id);
    +
    1058
    + +
    1071 long long int chat_id, int user_id);
    +
    1072
    + +
    1089 long long int chat_id, const char *sticker_set_name);
    +
    1090
    + +
    1105 long long int chat_id);
    +
    1106
    + +
    1130 const char *callback_query_id, const char *text, bool show_alert,
    +
    1131 const char *url, int cache_time);
    +
    1132
    + +
    1144 const char *commands);
    +
    1145
    + +
    1155
    + +
    1176 long long int chat_id, int message_id, const char *inline_message_id,
    +
    1177 const char *text, const char *parse_mode, bool disable_web_page_preview,
    +
    1178 const char *reply_markup);
    +
    1179
    + +
    1197 long long int chat_id, int message_id, const char *inline_message_id,
    +
    1198 const char *caption, const char *parse_mode, const char *reply_markup);
    +
    1199
    + +
    1217 long long int chat_id, int message_id, const char *inline_message_id,
    +
    1218 const char *reply_markup);
    +
    1219
    + +
    1233 long long int chat_id, int message_id, const char *inline_message_id,
    +
    1234 const char *media, const char *reply_markup);
    +
    1235
    + +
    1252 long long int chat_id, int message_id, const char *reply_markup);
    +
    1253
    + +
    1273 long long int chat_id, int message_id);
    +
    1274
    + +
    1282
    + +
    1290
    + +
    1299 const char *name, const char *language_code);
    +
    1300
    + +
    1308 const char *language_code);
    +
    1309
    + +
    1318 const char *description, const char *language_code);
    +
    1319
    + +
    1327 const char *language_code);
    +
    1328
    + +
    1337 const char *short_description, const char *language_code);
    +
    1338
    + +
    1346 const char *language_code);
    +
    1347
    + +
    1356 long long int chat_id, const char *menu_button);
    +
    1357
    + +
    1365 long long int chat_id);
    +
    1366
    + +
    1375 const char *rights, bool for_channels);
    +
    1376
    + +
    1384 bool for_channels);
    +
    1385
    + +
    1394 const char *scope, const char *language_code);
    +
    1395
    + +
    1413 long long int chat_id, long long int from_chat_id, int message_id,
    +
    1414 const char *caption, const char *parse_mode, const char *caption_entities,
    +
    1415 bool disable_notification, bool protect_content, int reply_to_message_id,
    +
    1416 bool allow_sending_without_reply, const char *reply_markup);
    +
    1417
    + +
    1432 long long int chat_id, long long int from_chat_id, const char *message_ids,
    +
    1433 bool disable_notification, bool protect_content, bool remove_caption);
    +
    1434
    + +
    1446 long long int chat_id, long long int from_chat_id, const char *message_ids,
    +
    1447 bool disable_notification, bool protect_content);
    +
    1448
    + +
    1457 long long int chat_id, const char *message_ids);
    +
    1458
    + +
    1469 long long int chat_id, int user_id, long until_date, bool revoke_messages);
    +
    1470
    + +
    1479 long long int chat_id, long long int sender_chat_id);
    +
    1480
    + +
    1489 long long int chat_id, long long int sender_chat_id);
    +
    1490
    + +
    1502 long long int chat_id, const char *name, long expire_date, int member_limit,
    +
    1503 bool creates_join_request);
    +
    1504
    + +
    1517 long long int chat_id, const char *invite_link, const char *name,
    +
    1518 long expire_date, int member_limit, bool creates_join_request);
    +
    1519
    + +
    1528 long long int chat_id, const char *invite_link);
    +
    1529
    + +
    1538 long long int chat_id, int user_id);
    +
    1539
    + +
    1548 long long int chat_id, int user_id);
    +
    1549
    + +
    1560 long long int chat_id, int message_id, const char *reaction, bool is_big);
    +
    1561
    + +
    1572 long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id);
    +
    1573
    + +
    1584 long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id);
    +
    1585
    + +
    1594 long long int chat_id, int message_thread_id);
    +
    1595
    + +
    1604 long long int chat_id, int message_thread_id);
    +
    1605
    + +
    1614 long long int chat_id, int message_thread_id);
    +
    1615
    + +
    1624 long long int chat_id, int message_thread_id);
    +
    1625
    + +
    1632
    + +
    1641 long long int chat_id, const char *name);
    +
    1642
    + +
    1650 long long int chat_id);
    +
    1651
    + +
    1659 long long int chat_id);
    +
    1660
    + +
    1668 long long int chat_id);
    +
    1669
    + +
    1677 long long int chat_id);
    +
    1678
    + +
    1686 long long int chat_id);
    +
    1687
    + +
    1695 const char *custom_emoji_ids);
    +
    1696
    + +
    1705 const char *web_app_query_id, const char *result);
    +
    1706
    + +
    1724 long long int chat_id, int star_count, const char *media, const char *caption,
    +
    1725 const char *parse_mode, const char *caption_entities, bool show_caption_above_media,
    +
    1726 bool disable_notification, bool protect_content, const char *reply_parameters,
    +
    1727 const char *reply_markup);
    +
    1728
    + +
    1745 const char *inline_query_id, const char *results, int cache_time,
    +
    1746 bool is_personal, const char *next_offset, const char *button);
    +
    1747
    + +
    1760 long long int user_id, const char *result, bool allow_user_chats,
    +
    1761 bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats);
    +
    1762
    + +
    1776 long long int user_id, long long int chat_id, const char *gift_id,
    +
    1777 bool pay_for_upgrade, const char *text, const char *text_parse_mode,
    +
    1778 const char *text_entities);
    +
    1779
    + +
    1792 long long int user_id, int month_count, int star_count, const char *text,
    +
    1793 const char *text_parse_mode, const char *text_entities);
    +
    1794
    + +
    1801
    + +
    1810 int offset, int limit);
    +
    1811
    + +
    1820 long long int user_id, const char *telegram_payment_charge_id);
    +
    1821
    + +
    1828
    + +
    1838 long long int user_id, int offset, int limit);
    +
    1839
    + +
    1849 long long int chat_id, int offset, int limit);
    +
    1850
    + +
    1862 const char *gift_id, bool pay_for_upgrade, const char *text,
    +
    1863 const char *text_parse_mode, const char *text_entities);
    +
    1864
    + +
    1874 long long int user_id, long long int chat_id, const char *gift_id);
    +
    1875
    + +
    1883 const char *gift_id);
    +
    1884
    + +
    1894 long long int user_id, int offset, int limit);
    +
    1895
    + +
    1903 const char *photo);
    +
    1904
    + +
    1912 const char *photo_id);
    +
    1913
    + +
    1921 const char *business_connection_id);
    +
    1922
    + +
    1931 long long int chat_id, long long int user_id);
    +
    1932
    + +
    1937 long long int user_id, int score, bool force, bool disable_edit_message,
    +
    1938 long long int chat_id, int message_id, const char *inline_message_id);
    +
    1939
    + +
    1944 long long int user_id, long long int chat_id, int message_id, const char *inline_message_id);
    +
    1945
    + +
    1950 long long int chat_id, int message_thread_id, const char *game_short_name,
    +
    1951 bool disable_notification, bool protect_content, const char *reply_parameters,
    +
    1952 const char *reply_markup);
    +
    1953
    + +
    1958 long long int user_id, const char *errors);
    +
    1959
    + +
    1964 long long int chat_id, int message_thread_id, const char *title,
    +
    1965 const char *description, const char *payload, const char *provider_token,
    +
    1966 const char *currency, const char *prices, int max_tip_amount,
    +
    1967 const char *suggested_tip_amounts, const char *start_parameter,
    +
    1968 const char *provider_data, const char *photo_url, int photo_size,
    +
    1969 int photo_width, int photo_height, bool need_name, bool need_phone_number,
    +
    1970 bool need_email, bool need_shipping_address, bool send_phone_number_to_provider,
    +
    1971 bool send_email_to_provider, bool is_flexible, bool disable_notification,
    +
    1972 bool protect_content, const char *reply_parameters, const char *reply_markup);
    +
    1973
    + +
    1978 const char *title, const char *description, const char *payload,
    +
    1979 const char *provider_token, const char *currency, const char *prices,
    +
    1980 int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data,
    +
    1981 const char *photo_url, int photo_size, int photo_width, int photo_height,
    +
    1982 bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address,
    +
    1983 bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible);
    +
    1984
    + +
    1989 const char *shipping_query_id, bool ok, const char *shipping_options,
    +
    1990 const char *error_message);
    +
    1991
    + +
    1996 const char *pre_checkout_query_id, bool ok, const char *error_message);
    +
    1997
    +
    2002#ifdef __cplusplus
    +
    2003}
    +
    2004#endif
    +
    2005
    +
    2006#endif /* __TELEBOT_CORE_API_H__ */
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    telebot_core_response_t telebot_core_delete_chat_photo(telebot_core_handler_t core_h, long long int chat_id)
    Delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in t...
    +
    telebot_core_response_t telebot_core_decline_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id)
    Use this method to decline a chat join request.
    +
    telebot_core_response_t telebot_core_get_my_description(telebot_core_handler_t core_h, const char *language_code)
    Use this method to get the current bot description for the given user language.
    +
    telebot_core_response_t telebot_core_unpin_all_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
    Use this method to unpin all messages in a forum topic.
    +
    telebot_core_response_t telebot_core_send_location(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send point on the map.
    +
    telebot_core_response_t telebot_core_answer_shipping_query(telebot_core_handler_t core_h, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
    Use this method to reply to shipping queries.
    +
    telebot_core_response_t telebot_core_reopen_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to reopen a closed 'General' topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_close_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to close an open 'General' topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_set_my_name(telebot_core_handler_t core_h, const char *name, const char *language_code)
    Use this method to change the bot's name.
    +
    telebot_core_response_t telebot_core_send_venue(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send information about a venue.
    +
    telebot_core_response_t telebot_core_answer_inline_query(telebot_core_handler_t core_h, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
    Use this method to send answers to an inline query.
    +
    struct telebot_core_response * telebot_core_response_t
    Telebot core response opaque type.
    Definition telebot-core.h:56
    +
    telebot_core_response_t telebot_core_unhide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to unhide the 'General' topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_delete_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id)
    Delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this t...
    +
    telebot_core_response_t telebot_core_set_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id, const char *sticker_set_name)
    Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this t...
    +
    telebot_core_response_t telebot_core_get_user_profile_photos(telebot_core_handler_t core_h, int user_id, int offset, int limit)
    Get user profile pictures object.
    +
    telebot_core_response_t telebot_core_edit_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link, const char *name, long expire_date, int member_limit, bool creates_join_request)
    Use this method to edit a non-primary invite link created by the bot.
    +
    telebot_core_response_t telebot_core_get_chat_members_count(telebot_core_handler_t core_h, long long int chat_id)
    Get the number of members in a chat.
    +
    telebot_core_response_t telebot_core_restrict_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
    Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work ...
    +
    struct telebot_core_handler * telebot_core_handler_t
    Telebot core handler opaque type.
    Definition telebot-core.h:51
    +
    telebot_core_response_t telebot_core_send_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
    Use this method to send a gift.
    +
    telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to unpin all messages in a General forum topic.
    +
    telebot_core_response_t telebot_core_get_my_short_description(telebot_core_handler_t core_h, const char *language_code)
    Use this method to get the current bot short description for the given user language.
    +
    telebot_core_response_t telebot_core_set_my_profile_photo(telebot_core_handler_t core_h, const char *photo)
    Use this method to set the bot's profile photo.
    +
    telebot_core_response_t telebot_core_get_my_star_balance(telebot_core_handler_t core_h)
    Use this method to get the current Telegram Stars balance of the bot.
    +
    telebot_core_response_t telebot_core_copy_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, bool remove_caption)
    Use this method to copy messages of any kind. Service messages, giveaway messages,...
    +
    telebot_core_response_t telebot_core_pin_chat_message(telebot_core_handler_t core_h, long long int chat_id, int message_id, bool disable_notification)
    Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to ...
    +
    telebot_core_response_t telebot_core_set_chat_title(telebot_core_handler_t core_h, long long int chat_id, const char *title)
    Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrat...
    +
    telebot_core_response_t telebot_core_gift_premium_subscription(telebot_core_handler_t core_h, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
    Use this method to gift a Telegram Premium subscription to a user.
    +
    void telebot_core_put_response(telebot_core_response_t response)
    Release response data obtained with telebot core methods.
    +
    telebot_core_response_t telebot_core_hide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to hide the 'General' topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_unban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
    Use this method to unban a previously banned channel chat in a supergroup or a channel.
    +
    telebot_core_response_t telebot_core_upgrade_gift(telebot_core_handler_t core_h, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
    Use this method to upgrade a gift.
    +
    telebot_core_response_t telebot_core_forward_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content)
    Use this method to forward multiple messages of any kind.
    +
    const char * telebot_core_get_response_data(telebot_core_response_t response)
    Get response data.
    +
    telebot_error_e telebot_core_get_proxy(telebot_core_handler_t core_h, char **addr)
    Get currently used proxy address.
    +
    telebot_core_response_t telebot_core_set_chat_admin_custom_title(telebot_core_handler_t core_h, long long int chat_id, int user_id, const char *custom_title)
    Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for ...
    +
    telebot_core_response_t telebot_core_send_contact(telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send phone contacts.
    +
    telebot_core_response_t telebot_core_send_paid_media(telebot_core_handler_t core_h, long long int chat_id, int star_count, const char *media, const char *caption, const char *parse_mode, const char *caption_entities, bool show_caption_above_media, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
    Use this method to send paid media to a user.
    +
    telebot_core_response_t telebot_core_edit_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
    Use this method to edit name and icon of a topic in a forum supergroup chat.
    +
    telebot_error_e telebot_core_create(telebot_core_handler_t *core_h, const char *token)
    Start function to use telebot core APIs.
    +
    telebot_core_response_t telebot_core_send_video(telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
    +
    telebot_core_response_t telebot_core_get_business_connection(telebot_core_handler_t core_h, const char *business_connection_id)
    Use this method to get information about the business connection.
    +
    telebot_core_response_t telebot_core_close(telebot_core_handler_t core_h)
    Use this method to close the bot instance before moving it from one local server to another.
    +
    telebot_core_response_t telebot_core_edit_message_reply_markup(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
    Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
    +
    telebot_core_response_t telebot_core_set_my_description(telebot_core_handler_t core_h, const char *description, const char *language_code)
    Use this method to change the bot's description.
    +
    telebot_core_response_t telebot_core_get_my_commands(telebot_core_handler_t core_h)
    Get the current list of the bot's commands..
    +
    telebot_core_response_t telebot_core_get_available_gifts(telebot_core_handler_t core_h)
    Use this method to get a list of gifts that can be sent by the bot to users.
    +
    telebot_core_response_t telebot_core_export_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id)
    Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an a...
    +
    telebot_core_response_t telebot_core_get_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id)
    Use this method to get the current value of the bot's menu button in a private chat,...
    +
    telebot_core_response_t telebot_core_set_my_default_administrator_rights(telebot_core_handler_t core_h, const char *rights, bool for_channels)
    Use this method to change the default administrator rights requested by the bot when it's added as an...
    +
    telebot_core_response_t telebot_core_get_chat_admins(telebot_core_handler_t core_h, long long int chat_id)
    Get a list of administrators in a chat. Response contains an array of objects that contains informati...
    +
    telebot_core_response_t telebot_core_delete_webhook(telebot_core_handler_t core_h)
    Remove webhook integration if you decide to switch back to getUpdates.
    +
    telebot_core_response_t telebot_core_save_prepared_inline_message(telebot_core_handler_t core_h, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats)
    Use this method to save a prepared inline message.
    +
    telebot_core_response_t telebot_core_set_game_score(telebot_core_handler_t core_h, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id)
    Use this method to set the score of the specified user in a game.
    +
    telebot_core_response_t telebot_core_create_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id)
    Use this method to create a topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_edit_message_text(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
    Edit text and game messages sent by the bot or via the bot (for inline bots).
    +
    telebot_core_response_t telebot_core_set_my_commands(telebot_core_handler_t core_h, const char *commands)
    Change the list of the bot's commands.
    +
    telebot_core_response_t telebot_core_get_my_name(telebot_core_handler_t core_h, const char *language_code)
    Use this method to get the current bot name for the given user language.
    +
    telebot_core_response_t telebot_core_set_webhook(telebot_core_handler_t core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates)
    Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for t...
    +
    telebot_core_response_t telebot_core_reopen_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
    Use this method to reopen a closed topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_delete_messages(telebot_core_handler_t core_h, long long int chat_id, const char *message_ids)
    Use this method to delete multiple messages in a chat.
    +
    telebot_core_response_t telebot_core_set_chat_description(telebot_core_handler_t core_h, long long int chat_id, const char *description)
    Change the description of a supergroup or a channel. The bot must be an administrator in the chat for...
    +
    telebot_core_response_t telebot_core_get_forum_topic_icon_stickers(telebot_core_handler_t core_h)
    Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
    +
    telebot_core_response_t telebot_core_approve_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id)
    Use this method to approve a chat join request.
    +
    telebot_core_response_t telebot_core_send_video_note(telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minut...
    +
    telebot_core_response_t telebot_core_stop_poll(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reply_markup)
    Stop a poll which was sent by the bot.
    +
    telebot_core_response_t telebot_core_get_updates(telebot_core_handler_t core_h, int offset, int limit, int timeout, const char *allowed_updates)
    Receive incoming updates (long polling). It will not work if an outgoing webhook is set up....
    +
    telebot_core_response_t telebot_core_set_passport_data_errors(telebot_core_handler_t core_h, long long int user_id, const char *errors)
    Use this method to set passport data errors.
    +
    telebot_core_response_t telebot_core_convert_gift_to_stars(telebot_core_handler_t core_h, const char *gift_id)
    Use this method to convert a gift to Telegram Stars.
    +
    telebot_core_response_t telebot_core_get_user_profile_audios(telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
    Use this method to get user profile audios.
    +
    telebot_core_response_t telebot_core_edit_message_media(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *media, const char *reply_markup)
    Use this method to edit animation, audio, document, photo, or video messages. If a message is part of...
    +
    telebot_core_response_t telebot_core_refund_star_payment(telebot_core_handler_t core_h, long long int user_id, const char *telegram_payment_charge_id)
    Use this method to refund a successful payment in Telegram Stars.
    +
    telebot_core_response_t telebot_core_delete_my_commands(telebot_core_handler_t core_h, const char *scope, const char *language_code)
    Use this method to delete the list of the bot's commands for the given scope and user language.
    +
    telebot_core_response_t telebot_core_send_chat_action(telebot_core_handler_t core_h, long long int chat_id, const char *action)
    Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less ...
    +
    telebot_core_response_t telebot_core_get_webhook_info(telebot_core_handler_t core_h)
    Get current webhook status.
    +
    telebot_core_response_t telebot_core_unban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id)
    Unban a previously kicked user in a supergroup or channel. The user will not return to the group or c...
    +
    telebot_core_response_t telebot_core_get_file(telebot_core_handler_t core_h, const char *file_id)
    Get basic info about a file and prepare it for downloading. For the moment, bots can download files o...
    +
    telebot_core_response_t telebot_core_get_user_gifts(telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
    Use this method to get a list of gifts received by a user.
    +
    telebot_core_response_t telebot_core_send_animation(telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send animation files (GIF or H.264/MPEG-4 AVC without sound).
    +
    telebot_core_response_t telebot_core_send_message(telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send text messages.
    +
    telebot_core_response_t telebot_core_delete_message(telebot_core_handler_t core_h, long long int chat_id, int message_id)
    Delete a message, including service messages, with the following limitations:
    +
    telebot_core_response_t telebot_core_create_invoice_link(telebot_core_handler_t core_h, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible)
    Use this method to create a link for an invoice.
    +
    telebot_core_response_t telebot_core_edit_message_caption(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
    Edit captions of messages sent by the bot or via the bot (for inline bots).
    +
    telebot_error_e telebot_core_set_proxy(telebot_core_handler_t core_h, const char *addr, const char *auth)
    Set proxy address to use telebot behind proxy.
    +
    telebot_core_response_t telebot_core_answer_web_app_query(telebot_core_handler_t core_h, const char *web_app_query_id, const char *result)
    Use this method to send answers to an inline query to a user from a Web App.
    +
    telebot_core_response_t telebot_core_delete_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
    Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_forward_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
    Forward messages of any kind.
    +
    telebot_error_e telebot_core_destroy(telebot_core_handler_t *core_h)
    Final function to use telebot core APIs.
    +
    telebot_core_response_t telebot_core_edit_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name)
    Use this method to edit the name of the 'General' topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_send_poll(telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send a native poll.
    +
    telebot_core_response_t telebot_core_send_document(telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send general files.
    +
    telebot_core_response_t telebot_core_set_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id, const char *menu_button)
    Use this method to change the bot's menu button in a private chat, or the default menu button.
    +
    telebot_core_response_t telebot_core_send_audio(telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send audio files. if you want Telegram clients to display them in the music player....
    +
    telebot_core_response_t telebot_core_create_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *name, long expire_date, int member_limit, bool creates_join_request)
    Use this method to create an additional invite link for a chat.
    +
    telebot_core_response_t telebot_core_ban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool revoke_messages)
    Use this method to ban a user in a group, a supergroup or a channel.
    +
    telebot_core_response_t telebot_core_unpin_chat_message(telebot_core_handler_t core_h, long long int chat_id)
    Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this t...
    +
    telebot_core_response_t telebot_core_get_chat_gifts(telebot_core_handler_t core_h, long long int chat_id, int offset, int limit)
    Use this method to get a list of gifts received by a chat.
    +
    telebot_core_response_t telebot_core_get_game_high_scores(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id)
    Use this method to get data for high score tables.
    +
    telebot_core_response_t telebot_core_get_me(telebot_core_handler_t core_h)
    Get basic information about the bot.
    +
    telebot_core_response_t telebot_core_stop_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
    Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_pe...
    +
    telebot_core_response_t telebot_core_get_star_transactions(telebot_core_handler_t core_h, int offset, int limit)
    Use this method to get the bot's Telegram Star transactions.
    +
    telebot_core_response_t telebot_core_get_chat(telebot_core_handler_t core_h, long long int chat_id)
    Get up to date information about the chat (current name of the user for one-on-one conversations,...
    +
    telebot_core_response_t telebot_core_send_game(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
    Use this method to send a game.
    +
    telebot_core_response_t telebot_core_promote_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
    Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat f...
    +
    telebot_core_response_t telebot_core_set_my_short_description(telebot_core_handler_t core_h, const char *short_description, const char *language_code)
    Use this method to change the bot's short description.
    +
    telebot_core_response_t telebot_core_send_invoice(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
    Use this method to send an invoice.
    +
    telebot_core_response_t telebot_core_revoke_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link)
    Use this method to revoke an invite link created by the bot.
    +
    telebot_core_response_t telebot_core_edit_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
    Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edite...
    +
    telebot_core_response_t telebot_core_get_my_default_administrator_rights(telebot_core_handler_t core_h, bool for_channels)
    Use this method to get the current default administrator rights of the bot.
    +
    telebot_core_response_t telebot_core_set_chat_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo)
    Set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an a...
    +
    telebot_error_e telebot_core_get_response_code(telebot_core_response_t response)
    Get response error code.
    +
    telebot_core_response_t telebot_core_copy_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, int message_id, const char *caption, const char *parse_mode, const char *caption_entities, bool disable_notification, bool protect_content, int reply_to_message_id, bool allow_sending_without_reply, const char *reply_markup)
    Use this method to copy messages of any kind.
    +
    telebot_core_response_t telebot_core_ban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
    Use this method to ban a channel chat in a supergroup or a channel.
    +
    telebot_core_response_t telebot_core_kick_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date)
    Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels,...
    +
    telebot_core_response_t telebot_core_transfer_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id)
    Use this method to transfer a gift.
    +
    telebot_core_response_t telebot_core_get_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id)
    Get information about a member of a chat.
    +
    telebot_core_response_t telebot_core_log_out(telebot_core_handler_t core_h)
    Use this method to log out from the cloud Bot API server before launching the bot locally.
    +
    telebot_core_response_t telebot_core_get_user_chat_boosts(telebot_core_handler_t core_h, long long int chat_id, long long int user_id)
    Use this method to get user chat boosts.
    +
    telebot_core_response_t telebot_core_get_custom_emoji_stickers(telebot_core_handler_t core_h, const char *custom_emoji_ids)
    Use this method to get information about custom emoji stickers by their identifiers.
    +
    telebot_core_response_t telebot_core_close_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
    Use this method to close an open topic in a forum supergroup chat.
    +
    telebot_core_response_t telebot_core_send_media_group(telebot_core_handler_t core_h, long long int chat_id, char *media_paths[], int count, bool disable_notification, int reply_to_message_id)
    Send a group of photos as an album.
    +
    telebot_core_response_t telebot_core_send_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send photos.
    +
    telebot_core_response_t telebot_core_set_message_reaction(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reaction, bool is_big)
    Use this method to set a new message reaction.
    +
    telebot_core_response_t telebot_core_send_dice(telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send a dice, which will have a random value from 1 to 6.
    +
    telebot_core_response_t telebot_core_leave_chat(telebot_core_handler_t core_h, long long int chat_id)
    Leave a group, supergroup or channel.
    +
    telebot_core_response_t telebot_core_set_chat_permissions(telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
    Set default chat permissions for all members. The bot must be an administrator in the group or a supe...
    +
    telebot_core_response_t telebot_core_answer_pre_checkout_query(telebot_core_handler_t core_h, const char *pre_checkout_query_id, bool ok, const char *error_message)
    Use this method to respond to pre-checkout queries.
    +
    telebot_core_response_t telebot_core_answer_callback_query(telebot_core_handler_t core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
    Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user...
    +
    telebot_core_response_t telebot_core_remove_my_profile_photo(telebot_core_handler_t core_h, const char *photo_id)
    Use this method to remove the bot's profile photo.
    +
    telebot_core_response_t telebot_core_send_voice(telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
    Send audio files, if you want Telegram clients to display the file as a playable voice message....
    +
    telebot_error_e telebot_core_download_file(telebot_core_handler_t core_h, const char *file_path, const char *out_file)
    Download file using file_path obtained with telebot_core_get_file(). It is guaranteed that the link w...
    +
    This file contains telegram bot common defintions.
    diff --git a/docs/telebot-forums_8h.html b/docs/telebot-forums_8h.html new file mode 100644 index 0000000..ef24430 --- /dev/null +++ b/docs/telebot-forums_8h.html @@ -0,0 +1,145 @@ + + + + + + + +Telebot: include/telebot-forums.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    telebot-forums.h File Reference
    +
    +
    + +

    This file contains forums feature of telegram bot. +More...

    +
    #include <stdbool.h>
    +#include "telebot-types.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    telebot_error_e telebot_create_forum_topic (telebot_handler_t handle, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id, telebot_forum_topic_t *topic)
     Use this method to create a topic in a forum supergroup chat.
     
    telebot_error_e telebot_put_forum_topic (telebot_forum_topic_t *topic)
     Release forum topic obtained with telebot_create_forum_topic.
     
    telebot_error_e telebot_edit_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
     Use this method to edit name and icon of a topic in a forum supergroup chat.
     
    telebot_error_e telebot_close_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
     Use this method to close an open topic in a forum supergroup chat.
     
    telebot_error_e telebot_reopen_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
     Use this method to reopen a closed topic in a forum supergroup chat.
     
    telebot_error_e telebot_delete_forum_topic (telebot_handler_t handle, long long int chat_id, int message_thread_id)
     Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
     
    telebot_error_e telebot_unpin_all_forum_topic_messages (telebot_handler_t handle, long long int chat_id, int message_thread_id)
     Use this method to unpin all messages in a forum topic.
     
    telebot_error_e telebot_get_forum_topic_icon_stickers (telebot_handler_t handle, telebot_sticker_t **stickers, int *count)
     Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
     
    telebot_error_e telebot_edit_general_forum_topic (telebot_handler_t handle, long long int chat_id, const char *name)
     Use this method to edit the name of the 'General' topic in a forum supergroup chat.
     
    telebot_error_e telebot_close_general_forum_topic (telebot_handler_t handle, long long int chat_id)
     Use this method to close an open 'General' topic in a forum supergroup chat.
     
    telebot_error_e telebot_reopen_general_forum_topic (telebot_handler_t handle, long long int chat_id)
     Use this method to reopen a closed 'General' topic in a forum supergroup chat.
     
    telebot_error_e telebot_hide_general_forum_topic (telebot_handler_t handle, long long int chat_id)
     Use this method to hide the 'General' topic in a forum supergroup chat.
     
    telebot_error_e telebot_unhide_general_forum_topic (telebot_handler_t handle, long long int chat_id)
     Use this method to unhide the 'General' topic in a forum supergroup chat.
     
    telebot_error_e telebot_unpin_all_general_forum_topic_messages (telebot_handler_t handle, long long int chat_id)
     Use this method to unpin all messages in a General forum topic.
     
    +

    Detailed Description

    +

    This file contains forums feature of telegram bot.

    +
    Author
    Elmurod Talipov
    +
    Date
    2026-02-27
    +
    + + + + diff --git a/docs/telebot-forums_8h_source.html b/docs/telebot-forums_8h_source.html new file mode 100644 index 0000000..9e0e15e --- /dev/null +++ b/docs/telebot-forums_8h_source.html @@ -0,0 +1,185 @@ + + + + + + + +Telebot: include/telebot-forums.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    telebot-forums.h
    +
    +
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_FORUMS_H__
    +
    20#define __TELEBOT_FORUMS_H__
    +
    21
    +
    22#include <stdbool.h>
    +
    23#include "telebot-types.h"
    +
    24
    +
    25#ifdef __cplusplus
    +
    26extern "C" {
    +
    27#endif
    +
    28
    + +
    54 long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id,
    + +
    56
    + +
    63
    + +
    75 long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id);
    +
    76
    + +
    86 long long int chat_id, int message_thread_id);
    +
    87
    + +
    97 long long int chat_id, int message_thread_id);
    +
    98
    + +
    108 long long int chat_id, int message_thread_id);
    +
    109
    + +
    119 long long int chat_id, int message_thread_id);
    +
    120
    + +
    130 telebot_sticker_t **stickers, int *count);
    +
    131
    + +
    141 long long int chat_id, const char *name);
    +
    142
    + +
    151 long long int chat_id);
    +
    152
    + +
    161 long long int chat_id);
    +
    162
    + +
    171 long long int chat_id);
    +
    172
    + +
    181 long long int chat_id);
    +
    182
    + +
    191 long long int chat_id);
    +
    192
    +
    197#ifdef __cplusplus
    +
    198}
    +
    199#endif
    +
    200
    +
    201#endif /* __TELEBOT_FORUMS_H__ */
    +
    telebot_error_e telebot_hide_general_forum_topic(telebot_handler_t handle, long long int chat_id)
    Use this method to hide the 'General' topic in a forum supergroup chat.
    +
    telebot_error_e telebot_unhide_general_forum_topic(telebot_handler_t handle, long long int chat_id)
    Use this method to unhide the 'General' topic in a forum supergroup chat.
    +
    telebot_error_e telebot_reopen_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id)
    Use this method to reopen a closed topic in a forum supergroup chat.
    +
    telebot_error_e telebot_reopen_general_forum_topic(telebot_handler_t handle, long long int chat_id)
    Use this method to reopen a closed 'General' topic in a forum supergroup chat.
    +
    telebot_error_e telebot_get_forum_topic_icon_stickers(telebot_handler_t handle, telebot_sticker_t **stickers, int *count)
    Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
    +
    struct telebot_handler * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition telebot-types.h:3489
    +
    telebot_error_e telebot_edit_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
    Use this method to edit name and icon of a topic in a forum supergroup chat.
    +
    telebot_error_e telebot_put_forum_topic(telebot_forum_topic_t *topic)
    Release forum topic obtained with telebot_create_forum_topic.
    +
    telebot_error_e telebot_unpin_all_general_forum_topic_messages(telebot_handler_t handle, long long int chat_id)
    Use this method to unpin all messages in a General forum topic.
    +
    telebot_error_e telebot_unpin_all_forum_topic_messages(telebot_handler_t handle, long long int chat_id, int message_thread_id)
    Use this method to unpin all messages in a forum topic.
    +
    telebot_error_e telebot_delete_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id)
    Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
    +
    telebot_error_e telebot_close_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id)
    Use this method to close an open topic in a forum supergroup chat.
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    telebot_error_e telebot_edit_general_forum_topic(telebot_handler_t handle, long long int chat_id, const char *name)
    Use this method to edit the name of the 'General' topic in a forum supergroup chat.
    +
    telebot_error_e telebot_create_forum_topic(telebot_handler_t handle, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id, telebot_forum_topic_t *topic)
    Use this method to create a topic in a forum supergroup chat.
    +
    telebot_error_e telebot_close_general_forum_topic(telebot_handler_t handle, long long int chat_id)
    Use this method to close an open 'General' topic in a forum supergroup chat.
    +
    This object represents a forum topic.
    Definition telebot-types.h:3292
    +
    This object represents a sticker.
    Definition telebot-types.h:3254
    +
    This file contains types used to create telegram bot.
    +
    + + + + diff --git a/docs/telebot-games_8h.html b/docs/telebot-games_8h.html new file mode 100644 index 0000000..9ea0394 --- /dev/null +++ b/docs/telebot-games_8h.html @@ -0,0 +1,119 @@ + + + + + + + +Telebot: include/telebot-games.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    telebot-games.h File Reference
    +
    +
    + +

    This file contains games feature of telegram bot. +More...

    +
    #include <stdbool.h>
    +#include "telebot-types.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + +

    +Functions

    +telebot_error_e telebot_send_game (telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup, telebot_message_t *message)
     Use this method to send a game.
     
    +telebot_error_e telebot_set_game_score (telebot_handler_t handle, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id, telebot_message_t *message)
     Use this method to set the score of the specified user in a game.
     
    +telebot_error_e telebot_get_game_high_scores (telebot_handler_t handle, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id, telebot_game_high_score_t **high_scores, int *count)
     Use this method to get data for high score tables.
     
    +telebot_error_e telebot_put_game_high_scores (telebot_game_high_score_t *high_scores, int count)
     Release game high scores obtained with telebot_get_game_high_scores.
     
    +

    Detailed Description

    +

    This file contains games feature of telegram bot.

    +
    Author
    Elmurod Talipov
    +
    Date
    2026-02-27
    +
    + + + + diff --git a/docs/telebot-games_8h_source.html b/docs/telebot-games_8h_source.html new file mode 100644 index 0000000..b8899b0 --- /dev/null +++ b/docs/telebot-games_8h_source.html @@ -0,0 +1,149 @@ + + + + + + + +Telebot: include/telebot-games.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    telebot-games.h
    +
    +
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_GAMES_H__
    +
    20#define __TELEBOT_GAMES_H__
    +
    21
    +
    22#include <stdbool.h>
    +
    23#include "telebot-types.h"
    +
    24
    +
    25#ifdef __cplusplus
    +
    26extern "C" {
    +
    27#endif
    +
    28
    + +
    46 long long int chat_id, int message_thread_id, const char *game_short_name,
    +
    47 bool disable_notification, bool protect_content, const char *reply_parameters,
    +
    48 const char *reply_markup, telebot_message_t *message);
    +
    49
    + +
    54 long long int user_id, int score, bool force, bool disable_edit_message,
    +
    55 long long int chat_id, int message_id, const char *inline_message_id,
    +
    56 telebot_message_t *message);
    +
    57
    + +
    62 long long int user_id, long long int chat_id, int message_id, const char *inline_message_id,
    +
    63 telebot_game_high_score_t **high_scores, int *count);
    +
    64
    + +
    69
    +
    74#ifdef __cplusplus
    +
    75}
    +
    76#endif
    +
    77
    +
    78#endif /* __TELEBOT_GAMES_H__ */
    +
    telebot_error_e telebot_send_game(telebot_handler_t handle, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup, telebot_message_t *message)
    Use this method to send a game.
    +
    telebot_error_e telebot_put_game_high_scores(telebot_game_high_score_t *high_scores, int count)
    Release game high scores obtained with telebot_get_game_high_scores.
    +
    struct telebot_handler * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition telebot-types.h:3489
    +
    telebot_error_e telebot_get_game_high_scores(telebot_handler_t handle, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id, telebot_game_high_score_t **high_scores, int *count)
    Use this method to get data for high score tables.
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    telebot_error_e telebot_set_game_score(telebot_handler_t handle, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id, telebot_message_t *message)
    Use this method to set the score of the specified user in a game.
    +
    This object represents a game high score row.
    Definition telebot-types.h:1763
    +
    This object represents a message.
    Definition telebot-types.h:1777
    +
    This file contains types used to create telegram bot.
    +
    + + + + diff --git a/docs/telebot-inline_8h.html b/docs/telebot-inline_8h.html new file mode 100644 index 0000000..9d69c53 --- /dev/null +++ b/docs/telebot-inline_8h.html @@ -0,0 +1,119 @@ + + + + + + + +Telebot: include/telebot-inline.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    telebot-inline.h File Reference
    +
    +
    + +

    This file contains inline mode feature of telegram bot. +More...

    +
    #include <stdbool.h>
    +#include "telebot-types.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + +

    +Functions

    +telebot_error_e telebot_answer_inline_query (telebot_handler_t handle, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
     Use this method to send answers to an inline query.
     
    +telebot_error_e telebot_save_prepared_inline_message (telebot_handler_t handle, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats, telebot_prepared_inline_message_t *prepared_message)
     Use this method to save a prepared inline message.
     
    +telebot_error_e telebot_put_prepared_inline_message (telebot_prepared_inline_message_t *prepared_message)
     Release prepared inline message.
     
    +telebot_error_e telebot_answer_web_app_query (telebot_handler_t handle, const char *web_app_query_id, const char *result, char **inline_message_id)
     Use this method to send answers to an inline query to a user from a Web App.
     
    +

    Detailed Description

    +

    This file contains inline mode feature of telegram bot.

    +
    Author
    Elmurod Talipov
    +
    Date
    2026-02-27
    +
    + + + + diff --git a/docs/telebot-inline_8h_source.html b/docs/telebot-inline_8h_source.html new file mode 100644 index 0000000..afa3aed --- /dev/null +++ b/docs/telebot-inline_8h_source.html @@ -0,0 +1,146 @@ + + + + + + + +Telebot: include/telebot-inline.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    telebot-inline.h
    +
    +
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_INLINE_H__
    +
    20#define __TELEBOT_INLINE_H__
    +
    21
    +
    22#include <stdbool.h>
    +
    23#include "telebot-types.h"
    +
    24
    +
    25#ifdef __cplusplus
    +
    26extern "C" {
    +
    27#endif
    +
    28
    + +
    46 const char *inline_query_id, const char *results, int cache_time,
    +
    47 bool is_personal, const char *next_offset, const char *button);
    +
    48
    + +
    53 long long int user_id, const char *result, bool allow_user_chats,
    +
    54 bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats,
    +
    55 telebot_prepared_inline_message_t *prepared_message);
    +
    56
    + +
    61
    + +
    66 const char *web_app_query_id, const char *result, char **inline_message_id);
    +
    67
    +
    72#ifdef __cplusplus
    +
    73}
    +
    74#endif
    +
    75
    +
    76#endif /* __TELEBOT_INLINE_H__ */
    +
    telebot_error_e telebot_save_prepared_inline_message(telebot_handler_t handle, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats, telebot_prepared_inline_message_t *prepared_message)
    Use this method to save a prepared inline message.
    +
    telebot_error_e telebot_answer_web_app_query(telebot_handler_t handle, const char *web_app_query_id, const char *result, char **inline_message_id)
    Use this method to send answers to an inline query to a user from a Web App.
    +
    struct telebot_handler * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition telebot-types.h:3489
    +
    telebot_error_e telebot_answer_inline_query(telebot_handler_t handle, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
    Use this method to send answers to an inline query.
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    telebot_error_e telebot_put_prepared_inline_message(telebot_prepared_inline_message_t *prepared_message)
    Release prepared inline message.
    +
    This object represents a prepared inline message.
    Definition telebot-types.h:3309
    +
    This file contains types used to create telegram bot.
    +
    + + + + diff --git a/docs/telebot-methods_8h.html b/docs/telebot-methods_8h.html index b87e862..1d79f74 100644 --- a/docs/telebot-methods_8h.html +++ b/docs/telebot-methods_8h.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-methods.h File Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    diff --git a/docs/telebot-stickers_8h_source.html b/docs/telebot-stickers_8h_source.html index a4943f0..e937804 100644 --- a/docs/telebot-stickers_8h_source.html +++ b/docs/telebot-stickers_8h_source.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-stickers.h Source File @@ -19,10 +19,9 @@
    - - + @@ -31,19 +30,28 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + +
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot-stickers.h
    +
    telebot-stickers.h
    -Go to the documentation of this file.
    1 
    2 /*
    3  * telebot
    4  *
    5  * Copyright (c) 2020 Elmurod Talipov.
    6  *
    7  * Licensed under the Apache License, Version 2.0 (the License);
    8  * you may not use this file except in compliance with the License.
    9  * You may obtain a copy of the License at
    10  *
    11  * http://www.apache.org/licenses/LICENSE-2.0
    12  *
    13  * Unless required by applicable law or agreed to in writing, software
    14  * distributed under the License is distributed on an "AS IS" BASIS,
    15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16  * See the License for the specific language governing permissions and
    17  * limitations under the License.
    18  */
    19 
    20 #ifndef __TELEBOT_STICKERS_H__
    21 #define __TELEBOT_STICKERS_H__
    22 
    23 #include <stdbool.h>
    24 
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    46 typedef struct telebot_mask_position {
    51  char *point;
    52 
    58  float x_shift;
    59 
    65  float y_shift;
    66 
    68  float scale;
    70 
    71 
    75 typedef struct telebot_sticker {
    77  char *file_id;
    78 
    84 
    86  int width;
    87 
    89  int height;
    90 
    93 
    96 
    98  char *emoji;
    99 
    101  char *set_name;
    102 
    105 
    109 
    110 
    114 typedef struct telebot_sticker_set {
    116  char *name;
    117 
    119  char *title;
    120 
    123 
    126 
    129 
    130  /* Number of stickers */
    131  int count_stickers;
    132 
    135 
    137 
    154 telebot_error_e telebot_send_sticker(telebot_handler_t handle, long long int chat_id,
    155  const char *sticker, bool is_file, bool disable_notification,
    156  int reply_to_message_id, char *reply_markup);
    157 
    169  telebot_sticker_set_t *stickers);
    170 
    180 
    185 #ifdef __cplusplus
    186 }
    187 #endif
    188 
    189 #endif /* __TELEBOT_STICKERS_H__ */
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition: telebot-common.h:45
    -
    struct telebot_photo * thumb
    Definition: telebot-stickers.h:95
    -
    struct telebot_photo * thumb
    Definition: telebot-stickers.h:134
    -
    bool is_animated
    Definition: telebot-stickers.h:92
    -
    This object represents one size of a photo or a file / sticker thumbnail.
    Definition: telebot-types.h:402
    -
    telebot_error_e telebot_get_sticker_set(telebot_handler_t handle, const char *name, telebot_sticker_set_t *stickers)
    Get a sticker set.
    -
    char * title
    Definition: telebot-stickers.h:119
    -
    char * point
    Definition: telebot-stickers.h:51
    -
    struct telebot_mask_position * mask_position
    Definition: telebot-stickers.h:104
    -
    struct telebot_sticker telebot_sticker_t
    This object represents a sticker.
    -
    telebot_sticker_t * stickers
    Definition: telebot-stickers.h:128
    -
    float scale
    Definition: telebot-stickers.h:68
    -
    char * file_unique_id
    Definition: telebot-stickers.h:83
    -
    char * file_id
    Definition: telebot-stickers.h:77
    -
    int width
    Definition: telebot-stickers.h:86
    -
    telebot_error_e telebot_send_sticker(telebot_handler_t handle, long long int chat_id, const char *sticker, bool is_file, bool disable_notification, int reply_to_message_id, char *reply_markup)
    Send static .WEBP or animated .TGS stickers.
    -
    int file_size
    Definition: telebot-stickers.h:107
    -
    float x_shift
    Definition: telebot-stickers.h:58
    -
    telebot_error_e telebot_put_sticker_set(telebot_sticker_set_t *stickers)
    Release sticker set obtained with telebot_get_sticker_set()
    -
    This object represents a sticker.
    Definition: telebot-stickers.h:75
    -
    char * set_name
    Definition: telebot-stickers.h:101
    -
    bool contains_masks
    Definition: telebot-stickers.h:125
    -
    This object describes the position on faces where a mask should be placed by default.
    Definition: telebot-stickers.h:46
    -
    char * emoji
    Definition: telebot-stickers.h:98
    -
    This object represents a sticker set.
    Definition: telebot-stickers.h:114
    -
    struct telebot_mask_position telebot_mask_position_t
    This object describes the position on faces where a mask should be placed by default.
    -
    float y_shift
    Definition: telebot-stickers.h:65
    -
    bool is_animated
    Definition: telebot-stickers.h:122
    -
    int height
    Definition: telebot-stickers.h:89
    -
    char * name
    Definition: telebot-stickers.h:116
    -
    struct telebot_sticker_set telebot_sticker_set_t
    This object represents a sticker set.
    -
    struct telebot_handler_s * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition: telebot-types.h:1296
    +Go to the documentation of this file.
    1
    +
    2/*
    +
    3 * telebot
    +
    4 *
    +
    5 * Copyright (c) 2020 Elmurod Talipov.
    +
    6 *
    +
    7 * Licensed under the Apache License, Version 2.0 (the License);
    +
    8 * you may not use this file except in compliance with the License.
    +
    9 * You may obtain a copy of the License at
    +
    10 *
    +
    11 * http://www.apache.org/licenses/LICENSE-2.0
    +
    12 *
    +
    13 * Unless required by applicable law or agreed to in writing, software
    +
    14 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    16 * See the License for the specific language governing permissions and
    +
    17 * limitations under the License.
    +
    18 */
    +
    19
    +
    20#ifndef __TELEBOT_STICKERS_H__
    +
    21#define __TELEBOT_STICKERS_H__
    +
    22
    +
    23#include <stdbool.h>
    +
    24
    +
    25#ifdef __cplusplus
    +
    26extern "C" {
    +
    27#endif
    +
    28
    +
    +
    45typedef struct telebot_sticker_set {
    +
    47 char *name;
    +
    48
    +
    50 char *title;
    +
    51
    + +
    54
    + +
    57
    + +
    60
    +
    61 /* Number of stickers */
    +
    62 int count_stickers;
    +
    63
    + +
    66
    + +
    +
    68
    + +
    86 const char *sticker, bool is_file, bool disable_notification,
    +
    87 int reply_to_message_id, char *reply_markup);
    +
    88
    + +
    100 telebot_sticker_set_t *stickers);
    +
    101
    + +
    110
    + +
    119
    +
    124#ifdef __cplusplus
    +
    125}
    +
    126#endif
    +
    127
    +
    128#endif /* __TELEBOT_STICKERS_H__ */
    +
    telebot_error_e telebot_send_sticker(telebot_handler_t handle, long long int chat_id, const char *sticker, bool is_file, bool disable_notification, int reply_to_message_id, char *reply_markup)
    Send static .WEBP or animated .TGS stickers.
    +
    telebot_error_e telebot_put_sticker(telebot_sticker_t *sticker)
    Release a sticker object.
    +
    telebot_error_e telebot_put_sticker_set(telebot_sticker_set_t *stickers)
    Release sticker set obtained with telebot_get_sticker_set()
    +
    telebot_error_e telebot_get_sticker_set(telebot_handler_t handle, const char *name, telebot_sticker_set_t *stickers)
    Get a sticker set.
    +
    struct telebot_handler * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition telebot-types.h:3489
    +
    telebot_error_e
    Enumerations of error code for telebot programming interface.
    Definition telebot-common.h:45
    +
    struct telebot_sticker_set telebot_sticker_set_t
    This object represents a sticker set.
    +
    This object represents one size of a photo or a file / sticker thumbnail.
    Definition telebot-types.h:2165
    +
    This object represents a sticker set.
    Definition telebot-stickers.h:45
    +
    telebot_sticker_t * stickers
    Definition telebot-stickers.h:59
    +
    char * name
    Definition telebot-stickers.h:47
    +
    bool contains_masks
    Definition telebot-stickers.h:56
    +
    char * title
    Definition telebot-stickers.h:50
    +
    struct telebot_photo * thumb
    Definition telebot-stickers.h:65
    +
    bool is_animated
    Definition telebot-stickers.h:53
    +
    This object represents a sticker.
    Definition telebot-types.h:3254
    diff --git a/docs/telebot-types_8h.html b/docs/telebot-types_8h.html index 0ef7162..cc09f44 100644 --- a/docs/telebot-types_8h.html +++ b/docs/telebot-types_8h.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-types.h File Reference @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + @@ -53,9 +56,16 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot-types.h File Reference
    +
    telebot-types.h File Reference
    @@ -79,14 +88,248 @@

    Go to the source code of this file.

    - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -99,6 +342,21 @@ + + + + + + + + + + + + + + + @@ -144,6 +402,15 @@ + + + + + + + + + @@ -151,7 +418,7 @@ - + @@ -174,175 +441,611 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Classes

    struct  telebot_birthdate
     Describes the birthdate of a user. More...
     
    struct  telebot_business_intro
     Contains information about the start page settings of a Telegram Business account. More...
     
    struct  telebot_business_location
     Contains information about the location of a Telegram Business account. More...
     
    struct  telebot_business_opening_hours_interval
     Describes an interval of time during which a business is open. More...
     
    struct  telebot_business_opening_hours
     Describes the opening hours of a business. More...
     
    struct  telebot_business_bot_rights
     Represents the rights of a business bot. More...
     
    struct  telebot_business_connection
     Describes the connection of the bot with a business account. More...
     
    struct  telebot_business_messages_deleted
     This object is received when messages are deleted from a connected business account. More...
     
    struct  telebot_user
     This object represents a Telegram user or bot. More...
     
    struct  telebot_chat
     This object represents a chat. More...
     
    struct  telebot_game
     This object represents a game. More...
     
    struct  telebot_shipping_address
     This object represents a shipping address. More...
     
    struct  telebot_order_info
     This object represents information about an order. More...
     
    struct  telebot_invoice
     This object contains basic information about an invoice. More...
     
    struct  telebot_successful_payment
     This object contains basic information about a successful payment. More...
     
    struct  telebot_passport_file
     This object represents an internal identifier of a user in Telegram Passport. More...
     
    struct  telebot_encrypted_passport_element
     This object represents one element of the Telegram Passport data. More...
     
    struct  telebot_encrypted_credentials
     This object represents credentials required to decrypt the data. More...
     
    struct  telebot_passport_data
     Contains information about Telegram Passport data which was shared with the bot by the user. More...
     
    struct  telebot_proximity_alert_triggered
     This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location. More...
     
    struct  telebot_forum_topic_created
     This object represents a service message about a new forum topic created in the chat. More...
     
    struct  telebot_forum_topic_closed
     This object represents a service message about a forum topic closed in the chat. More...
     
    struct  telebot_forum_topic_reopened
     This object represents a service message about a forum topic reopened in the chat. More...
     
    struct  telebot_video_chat_scheduled
     This object represents a service message about a video chat scheduled in the chat. More...
     
    struct  telebot_video_chat_started
     This object represents a service message about a video chat started in the chat. More...
     
    struct  telebot_video_chat_ended
     This object represents a service message about a video chat ended in the chat. More...
     
    struct  telebot_video_chat_participants_invited
     This object represents a service message about new members invited to a video chat. More...
     
    struct  telebot_web_app_data
     This object represents data sent by a Web App to the bot. More...
     
    struct  telebot_callback_game
     A placeholder, currently holds no information. Use BotFather to set up your game. More...
     
    struct  telebot_login_url
     This object represents a parameter of the inline keyboard button used to automatically authorize a user. More...
     
    struct  telebot_switch_inline_query_chosen_chat
     This object represents an inline button that switches the current user to inline mode in a chosen chat. More...
     
    struct  telebot_copy_text_button
     This object represents an inline keyboard button that copies specified text to the clipboard. More...
     
    struct  telebot_inline_keyboard_button
     This object represents one button of an inline keyboard. You must use exactly one of the optional fields. More...
     
    struct  telebot_inline_keyboard_markup
     This object represents an inline keyboard that appears right next to the message it belongs to. More...
     
    struct  telebot_forum_topic_edited
     This object represents a service message about a forum topic edited in the chat. More...
     
    struct  telebot_general_forum_topic_hidden
     This object represents a service message about a general forum topic hidden in the chat. More...
     
    struct  telebot_general_forum_topic_unhidden
     This object represents a service message about a general forum topic unhidden in the chat. More...
     
    struct  telebot_write_access_allowed
     This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link. More...
     
    struct  telebot_user_shared
     This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. More...
     
    struct  telebot_chat_shared
     This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. More...
     
    struct  telebot_chat_invite_link
     This object represents a chat invite link. More...
     
    struct  telebot_chat_member_updated
     This object represents changes in the status of a chat member. More...
     
    struct  telebot_chat_join_request
     This object represents a join request sent to a chat. More...
     
    struct  telebot_message_reaction_updated
     This object represents a change of a reaction on a message performed by a user. More...
     
    struct  telebot_message_reaction_count_updated
     This object represents reaction changes on a message with anonymous reactions. More...
     
    struct  telebot_reaction_type
     This object represents a reaction type. More...
     
    struct  telebot_reaction_count
     This object represents a reaction count. More...
     
    struct  telebot_chat_boost_updated
     This object represents a boost added to a chat. More...
     
    struct  telebot_chat_boost
     This object contains information about a chat boost. More...
     
    struct  telebot_chat_boost_source
     This object represents the source of a chat boost. More...
     
    struct  telebot_chat_boost_removed
     This object represents a boost removed from a chat. More...
     
    struct  telebot_message_origin
     This object describes the origin of a message. More...
     
    struct  telebot_text_quote
     This object contains information about the quoted part of a message that is replied to by the given message. More...
     
    struct  telebot_story
     This object contains information about a story. More...
     
    struct  telebot_external_reply_info
     This object contains information about the message that is being replied to, which may come from another chat or forum topic. More...
     
    struct  telebot_link_preview_options
     Describes the options used for link preview generation. More...
     
    struct  telebot_paid_media
     This object describes paid media. More...
     
    struct  telebot_paid_media_info
     Describes the paid media added to a message. More...
     
    struct  telebot_giveaway
     This object represents a message about a scheduled giveaway. More...
     
    struct  telebot_giveaway_winners
     This object represents a message about the completion of a giveaway with public winners. More...
     
    struct  telebot_refunded_payment
     This object represents a service message about a refunded payment. More...
     
    struct  telebot_users_shared
     This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. More...
     
    struct  telebot_shared_user
     This object contains information about a user that was shared with the bot. More...
     
    struct  telebot_gift
     This object represents a gift that can be sent by the bot. More...
     
    struct  telebot_gift_info
     Describes a regular gift that was sent or received. More...
     
    struct  telebot_unique_gift_info
     Describes a unique gift that was sent or received. More...
     
    struct  telebot_unique_gift
     This object describes a unique gift that was upgraded from a regular gift. More...
     
    struct  telebot_chat_boost_added
     This object represents a service message about a user boosting a chat. More...
     
    struct  telebot_chat_background
     This object represents a chat background. More...
     
    struct  telebot_giveaway_created
     This object represents a service message about the creation of a scheduled giveaway. More...
     
    struct  telebot_giveaway_completed
     This object represents a service message about the completion of a giveaway without public winners. More...
     
    struct  telebot_star_amount
     Describes an amount of Telegram Stars. More...
     
    struct  telebot_affiliate_info
     Contains information about the affiliate that received a commission. More...
     
    struct  telebot_revenue_withdrawal_state
     This object describes the state of a revenue withdrawal operation. More...
     
    struct  telebot_transaction_partner
     This object describes the source of a transaction. More...
     
    struct  telebot_star_transaction
     Describes a Telegram Star transaction. More...
     
    struct  telebot_star_transactions
     Contains a list of Telegram Star transactions. More...
     
    struct  telebot_paid_media_purchased
     This object contains information about a paid media purchase. More...
     
    struct  telebot_passport_element_error
     This object represents an error in the Telegram Passport element. More...
     
    struct  telebot_game_high_score
     This object represents a game high score row. More...
     
    struct  telebot_message
     This object represents a message. More...
     
    struct  telebot_audio
     This object represents an audio file to be treated as music by the Telegram clients. More...
     
    struct  telebot_gifts
     This object represent a list of gifts. More...
     
    struct  telebot_user_profile_audios
     This object represents a list of user profile audios. More...
     
    struct  telebot_user_gift
     This object represents a gift received by a user. More...
     
    struct  telebot_user_gifts
     This object represents a list of gifts received by a user. More...
     
    struct  telebot_user_chat_boosts
     This object represents a list of user chat boosts. More...
     
    struct  telebot_document
     This object represents a general file (as opposed to photos, voice messages and audio files). More...
     
    struct  telebot_keyboard_button_poll_type
     This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. More...
     
    struct  telebot_keyboard_button_request_users
     This object defines the criteria used to request suitable users. More...
     
    struct  telebot_keyboard_button_request_chat
     This object defines the criteria used to request a suitable chat. More...
     
    struct  telebot_web_app_info
     Describes a Web App. More...
     
    struct  telebot_keyboard_button
     This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive. More...
     
     This object represents a custom keyboard with reply options. More...
     
    struct  telebot_reply_keyboard_remove
     Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). More...
     Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t). More...
     
    struct  telebot_callback_query
     This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. More...
    struct  telebot_response_paramters
     Contains information about why a request was unsuccessful. More...
     
    struct  telebot_inline_query
     This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. More...
     
    struct  telebot_chosen_inline_result
     Represents a result of an inline query that was chosen by the user and sent to their chat partner. More...
     
    struct  telebot_shipping_query
     This object contains information about an incoming shipping query. More...
     
    struct  telebot_pre_checkout_query
     This object contains information about an incoming pre-checkout query. More...
     
    struct  telebot_mask_position
     This object describes the position on faces where a mask should be placed by default. More...
     
    struct  telebot_sticker
     This object represents a sticker. More...
     
    struct  telebot_forum_topic
     This object represents a forum topic. More...
     
    struct  telebot_prepared_inline_message
     This object represents a prepared inline message. More...
     
    struct  telebot_sent_web_app_message
     This object represents a message sent via a Web App. More...
     
    struct  telebot_update
     This object represents an incoming update. More...
     
    struct  telebot_webhook_info
     Thi object represetns information about the current status of a webhook. More...
     
    struct  telebot_chat_location
     Thi object represetns information about the current status of a webhook. More...
     
    struct  telebot_message_auto_delete_timer_changed
     This object represents a service message about a change in auto-delete timer settings. More...
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Typedefs

    -typedef enum telebot_update_type telebot_update_type_e
     Enumerations of telegram update types.
     
    -typedef struct telebot_user telebot_user_t
     This object represents a Telegram user or bot.
     
    -typedef struct telebot_chat telebot_chat_t
     This object represents a chat.
     
    -typedef struct telebot_message telebot_message_t
     This object represents a message.
     
    -typedef struct telebot_message_entity telebot_message_entity_t
     This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
     
    -typedef struct telebot_photo telebot_photo_t
     This object represents one size of a photo or a file / sticker thumbnail.
     
    -typedef struct telebot_audio telebot_audio_t
     This object represents an audio file to be treated as music by the Telegram clients.
     
    -typedef struct telebot_document telebot_document_t
     This object represents a general file (as opposed to photos, voice messages and audio files).
     
    -typedef struct telebot_video telebot_video_t
     This object represents a video file.
     
    -typedef struct telebot_animation telebot_animation_t
     This object represents a video file.
     
    -typedef struct telebot_voice telebot_voice_t
     This object represents a voice note.
     
    -typedef struct telebot_video_note telebot_video_note_t
     This object represents a video message (available in Telegram apps as of v.4.0).
     
    -typedef struct telebot_contact telebot_contact_t
     This object represents a phone contact.
     
    -typedef struct telebot_location telebot_location_t
     This object represents a point on the map.
     
    -typedef struct telebot_venue telebot_venue_t
     This object represents a venue.
     
    -typedef struct telebot_poll_option telebot_poll_option_t
     This object contains information about one answer option in a poll.
     
    -typedef struct telebot_poll_answer telebot_poll_answer_t
     This object represents an answer of a user in a non-anonymous poll.
     
    -typedef struct telebot_poll telebot_poll_t
     This object contains information about a poll.
     
    -typedef struct telebot_dice telebot_dice_t
     This object represents a dice with random value from 1 to 6.
     
    -typedef struct telebot_user_profile_photos telebot_user_profile_photos_t
     This object represent a user's profile pictures.
     
    typedef struct telebot_file telebot_file_t
     This object represents a file ready to be downloaded. More...
     
    -typedef struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
     This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
     
    -typedef struct telebot_keyboard_button telebot_keyboard_button_t
     This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
     
    -typedef struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
     This object represents a custom keyboard with reply options.
     
    -typedef struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
     Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).
     
    -typedef struct telebot_callback_query telebot_callback_query_t
     This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
     
    -typedef struct telebot_force_reply telebot_force_reply_t
     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.
     
    -typedef struct telebot_chat_photo telebot_chat_photo_t
     This object represents a chat photo.
     
    -typedef struct telebot_chat_member telebot_chat_member_t
     This object contains information about one member of a chat.
     
    -typedef struct telebot_chat_permissions telebot_chat_permissions_t
     Describes actions that a non-administrator user is allowed to take in a chat.
     
    -typedef struct telebot_bot_command telebot_bot_command_t
     This object represents a bot command.
     
    -typedef struct telebot_response_paramters telebot_response_paramters_t
     Contains information about why a request was unsuccessful.
     
    -typedef struct telebot_update telebot_update_t
     This object represents an incoming update.
     
    -typedef struct telebot_webhook_info telebot_webhook_info_t
     Thi object represetns information about the current status of a webhook.
     
    -typedef struct telebot_handler_s * telebot_handler_t
     This is opaque object to represent a telebot handler.
     
    +typedef enum telebot_update_type telebot_update_type_e
     Enumerations of telegram update types.
     
    +typedef struct telebot_birthdate telebot_birthdate_t
     Describes the birthdate of a user.
     
    +typedef struct telebot_business_intro telebot_business_intro_t
     Contains information about the start page settings of a Telegram Business account.
     
    +typedef struct telebot_business_location telebot_business_location_t
     Contains information about the location of a Telegram Business account.
     
    +typedef struct telebot_business_opening_hours_interval telebot_business_opening_hours_interval_t
     Describes an interval of time during which a business is open.
     
    +typedef struct telebot_business_opening_hours telebot_business_opening_hours_t
     Describes the opening hours of a business.
     
    +typedef struct telebot_business_bot_rights telebot_business_bot_rights_t
     Represents the rights of a business bot.
     
    +typedef struct telebot_business_connection telebot_business_connection_t
     Describes the connection of the bot with a business account.
     
    +typedef struct telebot_business_messages_deleted telebot_business_messages_deleted_t
     This object is received when messages are deleted from a connected business account.
     
    +typedef struct telebot_user telebot_user_t
     This object represents a Telegram user or bot.
     
    +typedef struct telebot_chat telebot_chat_t
     This object represents a chat.
     
    +typedef struct telebot_game telebot_game_t
     This object represents a game.
     
    +typedef struct telebot_shipping_address telebot_shipping_address_t
     This object represents a shipping address.
     
    +typedef struct telebot_order_info telebot_order_info_t
     This object represents information about an order.
     
    +typedef struct telebot_invoice telebot_invoice_t
     This object contains basic information about an invoice.
     
    +typedef struct telebot_successful_payment telebot_successful_payment_t
     This object contains basic information about a successful payment.
     
    +typedef struct telebot_passport_file telebot_passport_file_t
     This object represents an internal identifier of a user in Telegram Passport.
     
    +typedef struct telebot_encrypted_passport_element telebot_encrypted_passport_element_t
     This object represents one element of the Telegram Passport data.
     
    +typedef struct telebot_encrypted_credentials telebot_encrypted_credentials_t
     This object represents credentials required to decrypt the data.
     
    +typedef struct telebot_passport_data telebot_passport_data_t
     Contains information about Telegram Passport data which was shared with the bot by the user.
     
    +typedef struct telebot_proximity_alert_triggered telebot_proximity_alert_triggered_t
     This object represents a service message about a user in the chat triggered another user's proximity alert while sharing Live Location.
     
    +typedef struct telebot_forum_topic_created telebot_forum_topic_created_t
     This object represents a service message about a new forum topic created in the chat.
     
    +typedef struct telebot_forum_topic_closed telebot_forum_topic_closed_t
     This object represents a service message about a forum topic closed in the chat.
     
    +typedef struct telebot_forum_topic_reopened telebot_forum_topic_reopened_t
     This object represents a service message about a forum topic reopened in the chat.
     
    +typedef struct telebot_video_chat_scheduled telebot_video_chat_scheduled_t
     This object represents a service message about a video chat scheduled in the chat.
     
    +typedef struct telebot_video_chat_started telebot_video_chat_started_t
     This object represents a service message about a video chat started in the chat.
     
    +typedef struct telebot_video_chat_ended telebot_video_chat_ended_t
     This object represents a service message about a video chat ended in the chat.
     
    +typedef struct telebot_video_chat_participants_invited telebot_video_chat_participants_invited_t
     This object represents a service message about new members invited to a video chat.
     
    +typedef struct telebot_web_app_data telebot_web_app_data_t
     This object represents data sent by a Web App to the bot.
     
    +typedef struct telebot_callback_game telebot_callback_game_t
     A placeholder, currently holds no information. Use BotFather to set up your game.
     
    +typedef struct telebot_login_url telebot_login_url_t
     This object represents a parameter of the inline keyboard button used to automatically authorize a user.
     
    +typedef struct telebot_switch_inline_query_chosen_chat telebot_switch_inline_query_chosen_chat_t
     This object represents an inline button that switches the current user to inline mode in a chosen chat.
     
    +typedef struct telebot_copy_text_button telebot_copy_text_button_t
     This object represents an inline keyboard button that copies specified text to the clipboard.
     
    +typedef struct telebot_inline_keyboard_button telebot_inline_keyboard_button_t
     This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
     
    +typedef struct telebot_inline_keyboard_markup telebot_inline_keyboard_markup_t
     This object represents an inline keyboard that appears right next to the message it belongs to.
     
    +typedef struct telebot_forum_topic_edited telebot_forum_topic_edited_t
     This object represents a service message about a forum topic edited in the chat.
     
    +typedef struct telebot_general_forum_topic_hidden telebot_general_forum_topic_hidden_t
     This object represents a service message about a general forum topic hidden in the chat.
     
    +typedef struct telebot_general_forum_topic_unhidden telebot_general_forum_topic_unhidden_t
     This object represents a service message about a general forum topic unhidden in the chat.
     
    +typedef struct telebot_write_access_allowed telebot_write_access_allowed_t
     This object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.
     
    +typedef struct telebot_user_shared telebot_user_shared_t
     This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
     
    +typedef struct telebot_chat_shared telebot_chat_shared_t
     This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
     
    +typedef struct telebot_chat_invite_link telebot_chat_invite_link_t
     This object represents a chat invite link.
     
    +typedef struct telebot_chat_member_updated telebot_chat_member_updated_t
     This object represents changes in the status of a chat member.
     
    +typedef struct telebot_chat_join_request telebot_chat_join_request_t
     This object represents a join request sent to a chat.
     
    +typedef struct telebot_message_reaction_updated telebot_message_reaction_updated_t
     This object represents a change of a reaction on a message performed by a user.
     
    +typedef struct telebot_message_reaction_count_updated telebot_message_reaction_count_updated_t
     This object represents reaction changes on a message with anonymous reactions.
     
    +typedef struct telebot_reaction_type telebot_reaction_type_t
     This object represents a reaction type.
     
    +typedef struct telebot_reaction_count telebot_reaction_count_t
     This object represents a reaction count.
     
    +typedef struct telebot_chat_boost_updated telebot_chat_boost_updated_t
     This object represents a boost added to a chat.
     
    +typedef struct telebot_chat_boost telebot_chat_boost_t
     This object contains information about a chat boost.
     
    +typedef struct telebot_chat_boost_source telebot_chat_boost_source_t
     This object represents the source of a chat boost.
     
    +typedef struct telebot_chat_boost_removed telebot_chat_boost_removed_t
     This object represents a boost removed from a chat.
     
    +typedef struct telebot_message_origin telebot_message_origin_t
     This object describes the origin of a message.
     
    +typedef struct telebot_text_quote telebot_text_quote_t
     This object contains information about the quoted part of a message that is replied to by the given message.
     
    +typedef struct telebot_story telebot_story_t
     This object contains information about a story.
     
    +typedef struct telebot_external_reply_info telebot_external_reply_info_t
     This object contains information about the message that is being replied to, which may come from another chat or forum topic.
     
    +typedef struct telebot_link_preview_options telebot_link_preview_options_t
     Describes the options used for link preview generation.
     
    +typedef struct telebot_paid_media telebot_paid_media_t
     This object describes paid media.
     
    +typedef struct telebot_paid_media_info telebot_paid_media_info_t
     Describes the paid media added to a message.
     
    +typedef struct telebot_giveaway telebot_giveaway_t
     This object represents a message about a scheduled giveaway.
     
    +typedef struct telebot_giveaway_winners telebot_giveaway_winners_t
     This object represents a message about the completion of a giveaway with public winners.
     
    +typedef struct telebot_refunded_payment telebot_refunded_payment_t
     This object represents a service message about a refunded payment.
     
    +typedef struct telebot_users_shared telebot_users_shared_t
     This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
     
    +typedef struct telebot_shared_user telebot_shared_user_t
     This object contains information about a user that was shared with the bot.
     
    +typedef struct telebot_gift telebot_gift_t
     This object represents a gift that can be sent by the bot.
     
    +typedef struct telebot_gift_info telebot_gift_info_t
     Describes a regular gift that was sent or received.
     
    +typedef struct telebot_unique_gift_info telebot_unique_gift_info_t
     Describes a unique gift that was sent or received.
     
    +typedef struct telebot_unique_gift telebot_unique_gift_t
     This object describes a unique gift that was upgraded from a regular gift.
     
    +typedef struct telebot_chat_boost_added telebot_chat_boost_added_t
     This object represents a service message about a user boosting a chat.
     
    +typedef struct telebot_chat_background telebot_chat_background_t
     This object represents a chat background.
     
    +typedef struct telebot_giveaway_created telebot_giveaway_created_t
     This object represents a service message about the creation of a scheduled giveaway.
     
    +typedef struct telebot_giveaway_completed telebot_giveaway_completed_t
     This object represents a service message about the completion of a giveaway without public winners.
     
    +typedef struct telebot_star_amount telebot_star_amount_t
     Describes an amount of Telegram Stars.
     
    +typedef struct telebot_affiliate_info telebot_affiliate_info_t
     Contains information about the affiliate that received a commission.
     
    +typedef struct telebot_revenue_withdrawal_state telebot_revenue_withdrawal_state_t
     This object describes the state of a revenue withdrawal operation.
     
    +typedef struct telebot_transaction_partner telebot_transaction_partner_t
     This object describes the source of a transaction.
     
    +typedef struct telebot_star_transaction telebot_star_transaction_t
     Describes a Telegram Star transaction.
     
    +typedef struct telebot_star_transactions telebot_star_transactions_t
     Contains a list of Telegram Star transactions.
     
    +typedef struct telebot_paid_media_purchased telebot_paid_media_purchased_t
     This object contains information about a paid media purchase.
     
    +typedef struct telebot_passport_element_error telebot_passport_element_error_t
     This object represents an error in the Telegram Passport element.
     
    +typedef struct telebot_game_high_score telebot_game_high_score_t
     This object represents a game high score row.
     
    +typedef struct telebot_message telebot_message_t
     This object represents a message.
     
    +typedef struct telebot_message_entity telebot_message_entity_t
     This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
     
    +typedef struct telebot_photo telebot_photo_t
     This object represents one size of a photo or a file / sticker thumbnail.
     
    +typedef struct telebot_audio telebot_audio_t
     This object represents an audio file to be treated as music by the Telegram clients.
     
    +typedef struct telebot_gifts telebot_gifts_t
     This object represent a list of gifts.
     
    +typedef struct telebot_user_profile_audios telebot_user_profile_audios_t
     This object represents a list of user profile audios.
     
    +typedef struct telebot_user_gift telebot_user_gift_t
     This object represents a gift received by a user.
     
    +typedef struct telebot_user_gifts telebot_user_gifts_t
     This object represents a list of gifts received by a user.
     
    +typedef struct telebot_user_chat_boosts telebot_user_chat_boosts_t
     This object represents a list of user chat boosts.
     
    +typedef struct telebot_document telebot_document_t
     This object represents a general file (as opposed to photos, voice messages and audio files).
     
    +typedef struct telebot_video telebot_video_t
     This object represents a video file.
     
    +typedef struct telebot_animation telebot_animation_t
     This object represents a video file.
     
    +typedef struct telebot_voice telebot_voice_t
     This object represents a voice note.
     
    +typedef struct telebot_video_note telebot_video_note_t
     This object represents a video message (available in Telegram apps as of v.4.0).
     
    +typedef struct telebot_contact telebot_contact_t
     This object represents a phone contact.
     
    +typedef struct telebot_location telebot_location_t
     This object represents a point on the map.
     
    +typedef struct telebot_venue telebot_venue_t
     This object represents a venue.
     
    +typedef struct telebot_poll_option telebot_poll_option_t
     This object contains information about one answer option in a poll.
     
    +typedef struct telebot_poll_answer telebot_poll_answer_t
     This object represents an answer of a user in a non-anonymous poll.
     
    +typedef struct telebot_poll telebot_poll_t
     This object contains information about a poll.
     
    +typedef struct telebot_dice telebot_dice_t
     This object represents a dice with random value from 1 to 6.
     
    +typedef struct telebot_user_profile_photos telebot_user_profile_photos_t
     This object represent a user's profile pictures.
     
    typedef struct telebot_file telebot_file_t
     This object represents a file ready to be downloaded.
     
    +typedef struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
     This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
     
    +typedef struct telebot_keyboard_button_request_users telebot_keyboard_button_request_users_t
     This object defines the criteria used to request suitable users.
     
    +typedef struct telebot_keyboard_button_request_chat telebot_keyboard_button_request_chat_t
     This object defines the criteria used to request a suitable chat.
     
    +typedef struct telebot_web_app_info telebot_web_app_info_t
     Describes a Web App.
     
    +typedef struct telebot_keyboard_button telebot_keyboard_button_t
     This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
     
    +typedef struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
     This object represents a custom keyboard with reply options.
     
    +typedef struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
     Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see telebot_reply_keyboard_markup_t).
     
    +typedef struct telebot_callback_query telebot_callback_query_t
     This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
     
    +typedef struct telebot_force_reply telebot_force_reply_t
     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.
     
    +typedef struct telebot_chat_photo telebot_chat_photo_t
     This object represents a chat photo.
     
    +typedef struct telebot_chat_member telebot_chat_member_t
     This object contains information about one member of a chat.
     
    +typedef struct telebot_chat_permissions telebot_chat_permissions_t
     Describes actions that a non-administrator user is allowed to take in a chat.
     
    +typedef struct telebot_bot_command telebot_bot_command_t
     This object represents a bot command.
     
    +typedef struct telebot_response_paramters telebot_response_paramters_t
     Contains information about why a request was unsuccessful.
     
    +typedef struct telebot_inline_query telebot_inline_query_t
     This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
     
    +typedef struct telebot_chosen_inline_result telebot_chosen_inline_result_t
     Represents a result of an inline query that was chosen by the user and sent to their chat partner.
     
    +typedef struct telebot_shipping_query telebot_shipping_query_t
     This object contains information about an incoming shipping query.
     
    +typedef struct telebot_pre_checkout_query telebot_pre_checkout_query_t
     This object contains information about an incoming pre-checkout query.
     
    +typedef struct telebot_mask_position telebot_mask_position_t
     This object describes the position on faces where a mask should be placed by default.
     
    +typedef struct telebot_sticker telebot_sticker_t
     This object represents a sticker.
     
    +typedef struct telebot_forum_topic telebot_forum_topic_t
     This object represents a forum topic.
     
    +typedef struct telebot_prepared_inline_message telebot_prepared_inline_message_t
     This object represents a prepared inline message.
     
    +typedef struct telebot_sent_web_app_message telebot_sent_web_app_message_t
     This object represents a message sent via a Web App.
     
    +typedef struct telebot_update telebot_update_t
     This object represents an incoming update.
     
    +typedef struct telebot_webhook_info telebot_webhook_info_t
     Thi object represetns information about the current status of a webhook.
     
    +typedef struct telebot_chat_location telebot_chat_location_t
     Thi object represetns information about the current status of a webhook.
     
    +typedef struct telebot_message_auto_delete_timer_changed telebot_message_auto_delete_timer_changed_t
     This object represents a service message about a change in auto-delete timer settings.
     
    +typedef struct telebot_handler * telebot_handler_t
     This is opaque object to represent a telebot handler.
     
    - - - + } +

    +

    Enumerations

    enum  telebot_update_type {
    -  TELEBOT_UPDATE_TYPE_MESSAGE = 0, -TELEBOT_UPDATE_TYPE_EDITED_MESSAGE, -TELEBOT_UPDATE_TYPE_CHANNEL_POST, -TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST, -
    -  TELEBOT_UPDATE_TYPE_INLINE_QUERY, -TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT, -TELEBOT_UPDATE_TYPE_CALLBACK_QUERY, -TELEBOT_UPDATE_TYPE_SHIPPING_QUERY, -
    -  TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY, -TELEBOT_UPDATE_TYPE_POLL, -TELEBOT_UPDATE_TYPE_POLL_ANSWER, -TELEBOT_UPDATE_TYPE_MAX +
    enum  telebot_update_type {
    +  TELEBOT_UPDATE_TYPE_MESSAGE = 0 +, TELEBOT_UPDATE_TYPE_EDITED_MESSAGE +, TELEBOT_UPDATE_TYPE_CHANNEL_POST +, TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST +,
    +  TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION +, TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE +, TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE +, TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES +,
    +  TELEBOT_UPDATE_TYPE_MESSAGE_REACTION +, TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT +, TELEBOT_UPDATE_TYPE_INLINE_QUERY +, TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT +,
    +  TELEBOT_UPDATE_TYPE_CALLBACK_QUERY +, TELEBOT_UPDATE_TYPE_SHIPPING_QUERY +, TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY +, TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA +,
    +  TELEBOT_UPDATE_TYPE_POLL +, TELEBOT_UPDATE_TYPE_POLL_ANSWER +, TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER +, TELEBOT_UPDATE_TYPE_CHAT_MEMBER +,
    +  TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST +, TELEBOT_UPDATE_TYPE_CHAT_BOOST +, TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST +, TELEBOT_UPDATE_TYPE_MAX
    - }
     Enumerations of telegram update types. More...
     Enumerations of telegram update types. More...
     

    Detailed Description

    @@ -352,9 +1055,7 @@
    diff --git a/docs/telebot-types_8h_source.html b/docs/telebot-types_8h_source.html index b3cbada..ef42065 100644 --- a/docs/telebot-types_8h_source.html +++ b/docs/telebot-types_8h_source.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot-types.h Source File @@ -19,10 +19,9 @@
    - - + @@ -31,19 +30,28 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + +
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot-types.h
    +
    telebot-types.h
    -Go to the documentation of this file.
    1 /*
    2  * telebot
    3  *
    4  * Copyright (c) 2015 Elmurod Talipov.
    5  *
    6  * Licensed under the Apache License, Version 2.0 (the License);
    7  * you may not use this file except in compliance with the License.
    8  * You may obtain a copy of the License at
    9  *
    10  * http://www.apache.org/licenses/LICENSE-2.0
    11  *
    12  * Unless required by applicable law or agreed to in writing, software
    13  * distributed under the License is distributed on an "AS IS" BASIS,
    14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  * See the License for the specific language governing permissions and
    16  * limitations under the License.
    17  */
    18 
    19 #ifndef __TELEBOT_TYPES_H__
    20 #define __TELEBOT_TYPES_H__
    21 
    22 #include <stdbool.h>
    23 
    24 #ifdef __cplusplus
    25 extern "C" {
    26 #endif
    27 
    44 typedef enum telebot_update_type {
    58 
    62 typedef struct telebot_user {
    64  int id;
    65 
    67  bool is_bot;
    68 
    70  char *first_name;
    71 
    73  char *last_name;
    74 
    76  char *username;
    77 
    80 
    83 
    86 
    89 
    91 
    95 typedef struct telebot_chat {
    97  long long int id;
    98 
    100  char *type;
    101 
    103  char *title;
    104 
    106  char *username;
    107 
    109  char *first_name;
    110 
    112  char *last_name;
    113 
    116 
    121  char *description;
    122 
    127  char *invite_link;
    128 
    131 
    136 
    141 
    147 
    153 
    155 
    156 
    160 typedef struct telebot_message {
    163 
    166 
    168  long date;
    169 
    172 
    175 
    181 
    187 
    193 
    199 
    205 
    212 
    214  long edit_date;
    215 
    221 
    224 
    226  char *text;
    227 
    233  int count_entities;
    234 
    240  int count_caption_entities;
    241 
    244 
    247 
    250 
    252  struct telebot_game *game; //TODO:define type
    253 
    256  int count_photos;
    257 
    260 
    263 
    266 
    269 
    271  char *caption;
    272 
    275 
    278 
    281 
    284 
    287 
    293  int count_new_chat_members;
    294 
    300  int count_left_chat_members;
    301 
    304 
    307  int count_new_chat_photos;
    308 
    311 
    314 
    317 
    320 
    325  long long int migrate_to_chat_id;
    326 
    331  long long int migrate_from_chat_id;
    332 
    339 
    344  struct telebot_invoice *invoice; //TODO:define type
    345 
    350  struct telebot_successful_payment *successful_payment; //TODO:define type
    351 
    354 
    356  struct telebot_passport_data *passport_data; //TODO:define type
    357 
    362  struct inline_keyboard_markup *reply_markup; //TODO:define type
    364 
    369 typedef struct telebot_message_entity {
    376  char *type;
    377 
    379  int offset;
    380 
    382  int length;
    383 
    388  char *url;
    389 
    392 
    394  char *language;
    396 
    397 
    402 typedef struct telebot_photo {
    404  char *file_id;
    405 
    411 
    413  int width;
    414 
    416  int height;
    417 
    421 
    422 
    427 typedef struct telebot_audio {
    429  char *file_id;
    430 
    436 
    438  int duration;
    439 
    441  char *performer;
    442 
    444  char *title;
    445 
    447  char *mime_type;
    448 
    451 
    455 
    456 
    461 typedef struct telebot_document {
    463  char *file_id;
    464 
    470 
    473 
    475  char *file_name;
    476 
    478  char *mime_type;
    479 
    483 
    484 
    488 typedef struct telebot_video {
    490  char *file_id;
    491 
    497 
    499  int width;
    500 
    502  int height;
    503 
    505  int duration;
    506 
    509 
    511  char *mime_type;
    512 
    516 
    520 typedef struct telebot_animation {
    522  char *file_id;
    523 
    529 
    531  int width;
    532 
    534  int height;
    535 
    537  int duration;
    538 
    541 
    543  char *file_name;
    544 
    546  char *mime_type;
    547 
    551 
    555 typedef struct telebot_voice {
    557  char *file_id;
    558 
    564 
    566  int duration;
    567 
    569  char *mime_type;
    570 
    574 
    575 
    580 typedef struct telebot_video_note {
    582  char *file_id;
    583 
    589 
    591  int length;
    592 
    594  int duration;
    595 
    598 
    602 
    603 
    607 typedef struct telebot_contact {
    610 
    612  char *first_name;
    613 
    615  char *last_name;
    616 
    618  int user_id;
    619 
    621  char *vcard;
    623 
    624 
    628 typedef struct telebot_location {
    630  float longitude;
    631 
    633  float latitude;
    635 
    636 
    640 typedef struct telebot_venue {
    643 
    645  char *title;
    646 
    648  char *address;
    649 
    652 
    660 
    664 typedef struct telebot_poll_option {
    666  char *text;
    667 
    671 
    675 typedef struct telebot_poll_answer {
    677  char *poll_id;
    678 
    681 
    687 
    688  /* Number of option ids */
    689  int count_option_ids;
    691 
    695 typedef struct telebot_poll {
    697  char *id;
    698 
    700  char *question;
    701 
    704 
    705  /* Number of options */
    706  int count_options;
    707 
    710 
    712  bool is_closed;
    713 
    716 
    718  char *type;
    719 
    722 
    730 
    734 typedef struct telebot_dice {
    736  int value;
    738 
    745 
    748 
    750  struct telebot_photo *photos[4];
    752 
    762 typedef struct telebot_file {
    764  char *file_id;
    765 
    771 
    774 
    776  char *file_path;
    778 
    784 
    790  char *type;
    792 
    799 typedef struct telebot_keyboard_button {
    804  char *text;
    805 
    816 
    823 
    833 
    834  /* Number of keyboard rows */
    835  int keyboard_rows;
    836 
    837  /* Number of keyboard columns */
    838  int keyboard_cols;
    839 
    847 
    856 
    863  bool selective;
    865 
    873 {
    880 
    887  bool selective;
    889 
    898 typedef struct telebot_callback_query {
    900  char *id;
    901 
    904 
    911 
    917 
    924 
    929  char *data;
    930 
    937 
    945 typedef struct telebot_force_reply
    946 {
    952 
    960  bool selective;
    962 
    963 
    967 typedef struct telebot_chat_photo {
    973 
    980 
    985  char *big_file_id;
    986 
    993 
    997 typedef struct telebot_chat_member {
    1000 
    1005  char *status;
    1006 
    1009 
    1015 
    1021 
    1027 
    1033 
    1039 
    1045 
    1053 
    1059 
    1065 
    1071 
    1077 
    1083 
    1089 
    1092 
    1098 
    1105 
    1115 
    1121 
    1127 
    1133 
    1139 
    1145 
    1148 
    1155 
    1157 typedef struct telebot_bot_command {
    1162  char *command;
    1163 
    1167 
    1180 
    1187 
    1191 typedef struct telebot_update {
    1197 
    1201  telebot_update_type_e update_type;
    1202 
    1203  union {
    1206 
    1209 
    1212 
    1215 
    1217  //TODO: telebot_inline_query_t inline_query;
    1218 
    1224  //TODO: telebot_inline_query_result_t chosen_inline_result;
    1225 
    1228 
    1230  //TODO: telebot_shipping_query_t shipping_query;
    1231 
    1233  //TODO: telebot_pre_checkout_query_t pre_checkout_query;
    1234 
    1240 
    1246  };
    1248 
    1252 typedef struct telebot_webhook_info {
    1254  char *url;
    1255 
    1258 
    1261 
    1267 
    1273 
    1279 
    1284  telebot_update_type_e allowed_updates[TELEBOT_UPDATE_TYPE_MAX];
    1285 
    1290 
    1292 
    1296 typedef struct telebot_handler_s *telebot_handler_t;
    1297 
    1302 #ifdef __cplusplus
    1303 }
    1304 #endif
    1305 
    1306 #endif /* __TELEBOT_TYPES_H__ */
    int update_id
    Definition: telebot-types.h:1196
    -
    struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
    This object represents type of a poll, which is allowed to be created and sent when the corresponding...
    -
    long long int migrate_to_chat_id
    Definition: telebot-types.h:325
    -
    char * file_id
    Definition: telebot-types.h:404
    -
    int offset
    Definition: telebot-types.h:379
    -
    Upon receiving a message with this object, Telegram clients will display a reply interface to the use...
    Definition: telebot-types.h:945
    -
    int correct_option_id
    Definition: telebot-types.h:728
    -
    int current_count
    Definition: telebot-types.h:747
    -
    This object represents a chat photo.
    Definition: telebot-types.h:967
    -
    char * id
    Definition: telebot-types.h:900
    -
    bool can_join_groups
    Definition: telebot-types.h:82
    -
    int forward_from_message_id
    Definition: telebot-types.h:186
    -
    bool is_member
    Definition: telebot-types.h:1076
    -
    int width
    Definition: telebot-types.h:499
    -
    struct telebot_video_note * video_note
    Definition: telebot-types.h:268
    -
    struct telebot_message * reply_to_message
    Definition: telebot-types.h:211
    -
    bool can_send_messages
    Definition: telebot-types.h:1082
    -
    struct telebot_user telebot_user_t
    This object represents a Telegram user or bot.
    -
    char * media_group_id
    Definition: telebot-types.h:220
    -
    char * file_unique_id
    Definition: telebot-types.h:770
    -
    struct telebot_animation * animation
    Definition: telebot-types.h:249
    -
    Definition: telebot-types.h:56
    -
    struct telebot_dice telebot_dice_t
    This object represents a dice with random value from 1 to 6.
    -
    This object contains information about one answer option in a poll.
    Definition: telebot-types.h:664
    -
    char * foursquare_id
    Definition: telebot-types.h:651
    -
    bool can_restrict_members
    Definition: telebot-types.h:1044
    -
    long long int migrate_from_chat_id
    Definition: telebot-types.h:331
    -
    bool selective
    Definition: telebot-types.h:887
    -
    int height
    Definition: telebot-types.h:502
    -
    long edit_date
    Definition: telebot-types.h:214
    -
    char * language
    Definition: telebot-types.h:394
    -
    char * inline_message_id
    Definition: telebot-types.h:916
    -
    telebot_callback_query_t callback_query
    Definition: telebot-types.h:1227
    -
    int file_size
    Definition: telebot-types.h:572
    -
    telebot_keyboard_button_poll_type_t * request_poll
    Definition: telebot-types.h:821
    -
    int id
    Definition: telebot-types.h:64
    -
    int file_size
    Definition: telebot-types.h:600
    -
    This object represents one size of a photo or a file / sticker thumbnail.
    Definition: telebot-types.h:402
    -
    bool resize_keyboard
    Definition: telebot-types.h:846
    -
    char * mime_type
    Definition: telebot-types.h:511
    -
    char * author_signature
    Definition: telebot-types.h:223
    -
    struct telebot_passport_data * passport_data
    Definition: telebot-types.h:356
    -
    struct telebot_photo * thumb
    Definition: telebot-types.h:453
    -
    char * type
    Definition: telebot-types.h:790
    -
    char * title
    Definition: telebot-types.h:444
    -
    This object represents an incoming update.
    Definition: telebot-types.h:1191
    -
    char * command
    Definition: telebot-types.h:1162
    -
    char * mime_type
    Definition: telebot-types.h:546
    -
    int total_voter_count
    Definition: telebot-types.h:709
    -
    This object contains information about a poll.
    Definition: telebot-types.h:695
    -
    char * file_unique_id
    Definition: telebot-types.h:410
    -
    char * game_short_name
    Definition: telebot-types.h:935
    -
    char * small_file_unique_id
    Definition: telebot-types.h:979
    -
    int height
    Definition: telebot-types.h:534
    -
    char * language_code
    Definition: telebot-types.h:79
    -
    char * custom_title
    Definition: telebot-types.h:1008
    -
    This object represents one button of the reply keyboard. For simple text buttons String can be used i...
    Definition: telebot-types.h:799
    -
    struct telebot_user * from
    Definition: telebot-types.h:903
    -
    bool is_anonymous
    Definition: telebot-types.h:715
    -
    char * file_unique_id
    Definition: telebot-types.h:435
    -
    struct telebot_user * new_chat_members
    Definition: telebot-types.h:292
    -
    char * file_id
    Definition: telebot-types.h:557
    -
    char * data
    Definition: telebot-types.h:929
    -
    This object represents type of a poll, which is allowed to be created and sent when the corresponding...
    Definition: telebot-types.h:783
    -
    Describes actions that a non-administrator user is allowed to take in a chat.
    Definition: telebot-types.h:1109
    -
    enum telebot_update_type telebot_update_type_e
    Enumerations of telegram update types.
    -
    struct telebot_location telebot_location_t
    This object represents a point on the map.
    -
    int total_count
    Definition: telebot-types.h:744
    -
    char * forward_sender_name
    Definition: telebot-types.h:198
    -
    bool can_add_web_page_previews
    Definition: telebot-types.h:1103
    -
    This object represents a video file.
    Definition: telebot-types.h:488
    -
    int * option_ids
    Definition: telebot-types.h:686
    -
    char * first_name
    Definition: telebot-types.h:612
    -
    bool can_send_media_messages
    Definition: telebot-types.h:1120
    -
    telebot_poll_option_t * options
    Definition: telebot-types.h:703
    -
    char * file_unique_id
    Definition: telebot-types.h:588
    -
    struct telebot_message * message
    Definition: telebot-types.h:910
    -
    bool can_send_other_messages
    Definition: telebot-types.h:1097
    -
    char * type
    Definition: telebot-types.h:718
    -
    int length
    Definition: telebot-types.h:382
    -
    struct telebot_update telebot_update_t
    This object represents an incoming update.
    -
    struct telebot_animation telebot_animation_t
    This object represents a video file.
    -
    struct telebot_photo * thumb
    Definition: telebot-types.h:472
    -
    bool can_be_edited
    Definition: telebot-types.h:1020
    -
    telebot_update_type_e update_type
    Definition: telebot-types.h:1201
    -
    char * file_unique_id
    Definition: telebot-types.h:563
    -
    telebot_message_t edited_message
    Definition: telebot-types.h:1208
    -
    struct telebot_video_note telebot_video_note_t
    This object represents a video message (available in Telegram apps as of v.4.0).
    -
    int duration
    Definition: telebot-types.h:594
    -
    char * address
    Definition: telebot-types.h:648
    -
    struct telebot_chat telebot_chat_t
    This object represents a chat.
    -
    char * description
    Definition: telebot-types.h:1165
    -
    This object represents a point on the map.
    Definition: telebot-types.h:628
    -
    char * file_path
    Definition: telebot-types.h:776
    -
    struct telebot_poll_option telebot_poll_option_t
    This object contains information about one answer option in a poll.
    -
    int duration
    Definition: telebot-types.h:505
    -
    struct telebot_audio telebot_audio_t
    This object represents an audio file to be treated as music by the Telegram clients.
    -
    char * status
    Definition: telebot-types.h:1005
    -
    char * file_unique_id
    Definition: telebot-types.h:496
    -
    char * invite_link
    Definition: telebot-types.h:127
    -
    telebot_update_type
    Enumerations of telegram update types.
    Definition: telebot-types.h:44
    -
    struct telebot_location * location
    Definition: telebot-types.h:642
    -
    struct telebot_chat * chat
    Definition: telebot-types.h:171
    -
    struct telebot_successful_payment * successful_payment
    Definition: telebot-types.h:350
    -
    Definition: telebot-types.h:54
    -
    int duration
    Definition: telebot-types.h:537
    -
    char * file_id
    Definition: telebot-types.h:522
    -
    struct telebot_callback_query telebot_callback_query_t
    This object represents an incoming callback query from a callback button in an inline keyboard...
    -
    This object represents a voice note.
    Definition: telebot-types.h:555
    -
    long long int id
    Definition: telebot-types.h:97
    -
    Contains information about why a request was unsuccessful.
    Definition: telebot-types.h:1171
    -
    char * vcard
    Definition: telebot-types.h:621
    -
    int allowed_updates_count
    Definition: telebot-types.h:1289
    -
    struct telebot_video * video
    Definition: telebot-types.h:262
    -
    struct telebot_chat_permissions * permissions
    Definition: telebot-types.h:135
    -
    struct telebot_response_paramters telebot_response_paramters_t
    Contains information about why a request was unsuccessful.
    -
    bool request_contact
    Definition: telebot-types.h:810
    -
    struct telebot_dice * dice
    Definition: telebot-types.h:286
    -
    This object represents a chat.
    Definition: telebot-types.h:95
    -
    bool can_promote_members
    Definition: telebot-types.h:1052
    -
    char * new_chat_title
    Definition: telebot-types.h:303
    -
    This object represents a file ready to be downloaded.
    Definition: telebot-types.h:762
    -
    bool can_add_web_page_previews
    Definition: telebot-types.h:1138
    -
    struct telebot_poll * poll
    Definition: telebot-types.h:283
    -
    struct telebot_venue * venue
    Definition: telebot-types.h:280
    -
    char * file_name
    Definition: telebot-types.h:543
    -
    struct inline_keyboard_markup * reply_markup
    Definition: telebot-types.h:362
    -
    struct telebot_chat_permissions telebot_chat_permissions_t
    Describes actions that a non-administrator user is allowed to take in a chat.
    -
    This object represents a bot command.
    Definition: telebot-types.h:1157
    -
    struct telebot_venue telebot_venue_t
    This object represents a venue.
    -
    This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
    Definition: telebot-types.h:369
    -
    long forward_date
    Definition: telebot-types.h:204
    -
    bool one_time_keyboard
    Definition: telebot-types.h:855
    -
    bool remove_keyboard
    Definition: telebot-types.h:879
    -
    float latitude
    Definition: telebot-types.h:633
    -
    This object contains information about one member of a chat.
    Definition: telebot-types.h:997
    -
    This object represents a venue.
    Definition: telebot-types.h:640
    -
    bool can_send_media_messages
    Definition: telebot-types.h:1088
    -
    telebot_poll_answer_t poll_anser
    Definition: telebot-types.h:1245
    -
    struct telebot_user * left_chat_members
    Definition: telebot-types.h:299
    -
    int slow_mode_delay
    Definition: telebot-types.h:140
    -
    struct telebot_photo * new_chat_photos
    Definition: telebot-types.h:306
    -
    char * description
    Definition: telebot-types.h:121
    -
    struct telebot_message_entity telebot_message_entity_t
    This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
    -
    struct telebot_document telebot_document_t
    This object represents a general file (as opposed to photos, voice messages and audio files)...
    -
    int retry_after
    Definition: telebot-types.h:1185
    -
    char * question
    Definition: telebot-types.h:700
    -
    char * text
    Definition: telebot-types.h:666
    -
    int file_size
    Definition: telebot-types.h:773
    -
    telebot_poll_t poll
    Definition: telebot-types.h:1239
    -
    struct telebot_user_profile_photos telebot_user_profile_photos_t
    This object represent a user&#39;s profile pictures.
    -
    char * mime_type
    Definition: telebot-types.h:447
    -
    This object represents a dice with random value from 1 to 6.
    Definition: telebot-types.h:734
    -
    bool can_invite_users
    Definition: telebot-types.h:1064
    -
    struct telebot_invoice * invoice
    Definition: telebot-types.h:344
    -
    int value
    Definition: telebot-types.h:736
    -
    bool delete_chat_photo
    Definition: telebot-types.h:310
    -
    struct telebot_photo * thumb
    Definition: telebot-types.h:540
    -
    struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard a...
    -
    struct telebot_photo * photos
    Definition: telebot-types.h:255
    -
    bool can_post_messages
    Definition: telebot-types.h:1026
    -
    char * phone_number
    Definition: telebot-types.h:609
    -
    int file_size
    Definition: telebot-types.h:514
    -
    int duration
    Definition: telebot-types.h:438
    -
    struct telebot_photo telebot_photo_t
    This object represents one size of a photo or a file / sticker thumbnail.
    -
    char * big_file_unique_id
    Definition: telebot-types.h:991
    -
    char * mime_type
    Definition: telebot-types.h:569
    -
    struct telebot_location * location
    Definition: telebot-types.h:277
    -
    char * file_name
    Definition: telebot-types.h:475
    -
    struct telebot_user * user
    Definition: telebot-types.h:680
    -
    bool can_delete_messages
    Definition: telebot-types.h:1038
    -
    telebot_message_t edited_channel_post
    Definition: telebot-types.h:1214
    -
    This object represents a sticker.
    Definition: telebot-stickers.h:75
    -
    bool supergroup_chat_created
    Definition: telebot-types.h:316
    -
    struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
    This object represents a custom keyboard with reply options.
    -
    char * url
    Definition: telebot-types.h:1254
    -
    struct telebot_photo * thumb
    Definition: telebot-types.h:597
    -
    char * first_name
    Definition: telebot-types.h:109
    -
    This object represents a video message (available in Telegram apps as of v.4.0).
    Definition: telebot-types.h:580
    -
    int message_id
    Definition: telebot-types.h:162
    -
    char * file_unique_id
    Definition: telebot-types.h:528
    -
    Definition: telebot-types.h:55
    -
    struct telebot_voice * voice
    Definition: telebot-types.h:265
    -
    This object represents an audio file to be treated as music by the Telegram clients.
    Definition: telebot-types.h:427
    -
    struct telebot_photo * thumb
    Definition: telebot-types.h:508
    -
    struct telebot_game * game
    Definition: telebot-types.h:252
    -
    char * title
    Definition: telebot-types.h:645
    -
    bool channel_chat_created
    Definition: telebot-types.h:319
    -
    Thi object represetns information about the current status of a webhook.
    Definition: telebot-types.h:1252
    -
    bool can_set_sticker_set
    Definition: telebot-types.h:152
    -
    struct telebot_message telebot_message_t
    This object represents a message.
    -
    bool selective
    Definition: telebot-types.h:960
    -
    long date
    Definition: telebot-types.h:168
    -
    bool can_change_info
    Definition: telebot-types.h:1144
    -
    int max_connections
    Definition: telebot-types.h:1278
    -
    Definition: telebot-types.h:45
    -
    char * file_id
    Definition: telebot-types.h:463
    -
    char * sticker_set_name
    Definition: telebot-types.h:146
    -
    int file_size
    Definition: telebot-types.h:450
    -
    struct telebot_poll telebot_poll_t
    This object contains information about a poll.
    -
    char * last_name
    Definition: telebot-types.h:615
    -
    char * last_name
    Definition: telebot-types.h:112
    -
    telebot_keyboard_button_t * keyboard
    Definition: telebot-types.h:832
    -
    bool can_read_all_group_messages
    Definition: telebot-types.h:85
    -
    char * file_id
    Definition: telebot-types.h:429
    -
    char * username
    Definition: telebot-types.h:106
    -
    int width
    Definition: telebot-types.h:531
    -
    bool group_chat_created
    Definition: telebot-types.h:313
    -
    Definition: telebot-types.h:53
    -
    char * last_name
    Definition: telebot-types.h:73
    -
    This object represents a general file (as opposed to photos, voice messages and audio files)...
    Definition: telebot-types.h:461
    -
    char * url
    Definition: telebot-types.h:388
    -
    int height
    Definition: telebot-types.h:416
    -
    struct telebot_webhook_info telebot_webhook_info_t
    Thi object represetns information about the current status of a webhook.
    -
    This object represents a phone contact.
    Definition: telebot-types.h:607
    -
    struct telebot_audio * audio
    Definition: telebot-types.h:243
    -
    bool is_bot
    Definition: telebot-types.h:67
    -
    Definition: telebot-types.h:50
    -
    struct telebot_video telebot_video_t
    This object represents a video file.
    -
    This object represents a custom keyboard with reply options.
    Definition: telebot-types.h:827
    -
    char * type
    Definition: telebot-types.h:376
    -
    char * text
    Definition: telebot-types.h:804
    -
    bool can_pin_messages
    Definition: telebot-types.h:1153
    -
    struct telebot_contact * contact
    Definition: telebot-types.h:274
    -
    Definition: telebot-types.h:46
    -
    char * file_unique_id
    Definition: telebot-types.h:469
    -
    struct telebot_user * user
    Definition: telebot-types.h:999
    -
    bool can_send_messages
    Definition: telebot-types.h:1114
    -
    struct telebot_message_entity * caption_entities
    Definition: telebot-types.h:239
    -
    struct telebot_chat_photo telebot_chat_photo_t
    This object represents a chat photo.
    -
    bool can_send_other_messages
    Definition: telebot-types.h:1132
    -
    This object represents a video file.
    Definition: telebot-types.h:520
    -
    char * file_id
    Definition: telebot-types.h:582
    -
    char * connected_website
    Definition: telebot-types.h:353
    -
    Definition: telebot-types.h:49
    -
    int length
    Definition: telebot-types.h:591
    -
    struct telebot_document * document
    Definition: telebot-types.h:246
    -
    struct telebot_chat_member telebot_chat_member_t
    This object contains information about one member of a chat.
    -
    int voter_count
    Definition: telebot-types.h:669
    -
    This object represents an answer of a user in a non-anonymous poll.
    Definition: telebot-types.h:675
    -
    Definition: telebot-types.h:47
    -
    Definition: telebot-types.h:52
    -
    char * file_id
    Definition: telebot-types.h:490
    -
    struct telebot_user * from
    Definition: telebot-types.h:165
    -
    char * last_error_message
    Definition: telebot-types.h:1272
    -
    int pending_update_count
    Definition: telebot-types.h:1260
    -
    int file_size
    Definition: telebot-types.h:481
    -
    bool can_pin_messages
    Definition: telebot-types.h:1070
    -
    char * performer
    Definition: telebot-types.h:441
    -
    struct telebot_message_entity * entities
    Definition: telebot-types.h:232
    -
    char * poll_id
    Definition: telebot-types.h:677
    -
    char * type
    Definition: telebot-types.h:100
    -
    char * first_name
    Definition: telebot-types.h:70
    -
    bool supports_inline_queries
    Definition: telebot-types.h:88
    -
    bool can_send_polls
    Definition: telebot-types.h:1091
    -
    This object represents a message.
    Definition: telebot-types.h:160
    -
    struct telebot_contact telebot_contact_t
    This object represents a phone contact.
    -
    char * small_file_id
    Definition: telebot-types.h:972
    -
    struct telebot_keyboard_button telebot_keyboard_button_t
    This object represents one button of the reply keyboard. For simple text buttons String can be used i...
    -
    float longitude
    Definition: telebot-types.h:630
    -
    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard a...
    Definition: telebot-types.h:872
    -
    bool has_custom_certificate
    Definition: telebot-types.h:1257
    -
    char * caption
    Definition: telebot-types.h:271
    -
    bool force_reply
    Definition: telebot-types.h:951
    -
    struct telebot_chat_photo * photo
    Definition: telebot-types.h:115
    -
    char * text
    Definition: telebot-types.h:226
    -
    struct telebot_bot_command telebot_bot_command_t
    This object represents a bot command.
    -
    char * chat_instance
    Definition: telebot-types.h:923
    -
    char * username
    Definition: telebot-types.h:76
    -
    int file_size
    Definition: telebot-types.h:419
    -
    int user_id
    Definition: telebot-types.h:618
    -
    telebot_message_t message
    Definition: telebot-types.h:1205
    -
    This object represent a user&#39;s profile pictures.
    Definition: telebot-types.h:742
    -
    telebot_user_t * user
    Definition: telebot-types.h:391
    -
    char * file_id
    Definition: telebot-types.h:764
    -
    char * foursquare_type
    Definition: telebot-types.h:658
    -
    bool can_edit_messages
    Definition: telebot-types.h:1032
    -
    telebot_message_t channel_post
    Definition: telebot-types.h:1211
    -
    struct telebot_voice telebot_voice_t
    This object represents a voice note.
    -
    int width
    Definition: telebot-types.h:413
    -
    struct telebot_force_reply telebot_force_reply_t
    Upon receiving a message with this object, Telegram clients will display a reply interface to the use...
    -
    bool allows_multiple_answers
    Definition: telebot-types.h:721
    -
    struct telebot_message * pinned_message
    Definition: telebot-types.h:130
    -
    bool can_send_polls
    Definition: telebot-types.h:1126
    -
    int migrate_to_chat_id
    Definition: telebot-types.h:1179
    -
    long until_date
    Definition: telebot-types.h:1014
    -
    char * forward_signature
    Definition: telebot-types.h:192
    -
    struct telebot_user * forward_from
    Definition: telebot-types.h:174
    -
    Definition: telebot-types.h:51
    -
    int duration
    Definition: telebot-types.h:566
    -
    struct telebot_message * pinned_message
    Definition: telebot-types.h:338
    -
    This object represents a Telegram user or bot.
    Definition: telebot-types.h:62
    -
    Definition: telebot-types.h:48
    -
    char * title
    Definition: telebot-types.h:103
    -
    struct telebot_sticker * sticker
    Definition: telebot-types.h:259
    -
    char * big_file_id
    Definition: telebot-types.h:985
    -
    struct telebot_poll_answer telebot_poll_answer_t
    This object represents an answer of a user in a non-anonymous poll.
    -
    struct telebot_chat * forward_from_chat
    Definition: telebot-types.h:180
    -
    int file_size
    Definition: telebot-types.h:549
    -
    bool request_location
    Definition: telebot-types.h:815
    -
    struct telebot_file telebot_file_t
    This object represents a file ready to be downloaded.
    -
    char * mime_type
    Definition: telebot-types.h:478
    -
    This object represents an incoming callback query from a callback button in an inline keyboard...
    Definition: telebot-types.h:898
    -
    struct telebot_handler_s * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition: telebot-types.h:1296
    -
    long last_error_date
    Definition: telebot-types.h:1266
    -
    bool can_change_info
    Definition: telebot-types.h:1058
    -
    char * id
    Definition: telebot-types.h:697
    -
    bool selective
    Definition: telebot-types.h:863
    -
    bool can_invite_users
    Definition: telebot-types.h:1147
    -
    bool is_closed
    Definition: telebot-types.h:712
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_TYPES_H__
    +
    20#define __TELEBOT_TYPES_H__
    +
    21
    +
    22#include <stdbool.h>
    +
    23
    +
    24#ifdef __cplusplus
    +
    25extern "C" {
    +
    26#endif
    +
    27
    + +
    70
    +
    +
    74typedef struct telebot_birthdate {
    +
    76 int day;
    +
    77
    +
    79 int month;
    +
    80
    +
    82 int year;
    + +
    +
    84
    +
    +
    88typedef struct telebot_business_intro {
    +
    90 char *title;
    +
    91
    +
    93 char *message;
    +
    94
    + + +
    +
    98
    + +
    109
    + +
    120
    + +
    132
    +
    + +
    137 bool can_reply;
    +
    138 bool can_read_messages;
    +
    139 bool can_delete_sent_messages;
    +
    140 bool can_delete_all_messages;
    +
    141 bool can_edit_name;
    +
    142 bool can_edit_bio;
    +
    143 bool can_edit_profile_photo;
    +
    144 bool can_edit_username;
    +
    145 bool can_change_gift_settings;
    +
    146 bool can_view_gifts_and_stars;
    +
    147 bool can_convert_gifts_to_stars;
    +
    148 bool can_transfer_and_upgrade_gifts;
    +
    149 bool can_transfer_stars;
    +
    150 bool can_manage_stories;
    + +
    +
    152
    +
    + +
    157 char *id;
    +
    158 struct telebot_user *user;
    +
    159 long long int user_chat_id;
    +
    160 long date;
    +
    161 bool can_reply;
    +
    162 bool is_enabled;
    + +
    +
    164
    +
    + +
    169 char *business_connection_id;
    +
    170 struct telebot_chat *chat;
    +
    171 int *message_ids;
    +
    172 int count_message_ids;
    + +
    +
    174
    +
    +
    178typedef struct telebot_user {
    +
    180 long long int id;
    +
    181
    +
    183 bool is_bot;
    +
    184
    + +
    187
    + +
    190
    +
    192 char *username;
    +
    193
    + +
    196
    + +
    199
    + +
    202
    + +
    205
    + +
    208
    + +
    211
    + +
    214
    + +
    217
    + +
    220
    + +
    223
    + +
    +
    225
    +
    +
    229typedef struct telebot_chat {
    +
    231 long long int id;
    +
    232
    +
    234 char *type;
    +
    235
    +
    237 char *title;
    +
    238
    +
    240 char *username;
    +
    241
    + +
    244
    + +
    247
    + +
    250
    + +
    253
    + +
    256
    + +
    259
    + +
    262
    + +
    267 int count_active_usernames;
    +
    268
    + +
    271
    + +
    274
    + +
    277
    + +
    280
    + +
    283
    + +
    286
    + +
    292
    + +
    295
    +
    297 char *bio;
    +
    298
    + +
    305
    + +
    312
    + +
    318
    + +
    324
    + +
    330
    + +
    336
    + +
    341
    + +
    347
    + +
    353
    + +
    356
    + +
    362
    + +
    365
    + +
    368
    + +
    374
    + +
    377
    + +
    383
    + +
    389
    + +
    392
    +
    398 long long int linked_chat_id;
    +
    399
    + + +
    +
    406
    +
    +
    410typedef struct telebot_game {
    +
    412 char *title;
    +
    413
    + +
    416
    + +
    419
    + +
    422
    +
    427 char *text;
    +
    428
    + +
    434 int count_text_entities;
    +
    435
    + + +
    +
    441
    +
    + + +
    448
    +
    450 char *state;
    +
    451
    +
    453 char *city;
    +
    454
    + +
    457
    + +
    460
    + + +
    +
    464
    +
    +
    468typedef struct telebot_order_info {
    +
    470 char *name;
    +
    471
    + +
    474
    +
    476 char *email;
    +
    477
    + + +
    +
    481
    +
    +
    485typedef struct telebot_invoice {
    +
    487 char *title;
    +
    488
    + +
    491
    + +
    497
    +
    499 char *currency;
    +
    500
    + + +
    +
    507
    + +
    536
    +
    +
    540typedef struct telebot_passport_file {
    +
    542 char *file_id;
    +
    543
    + +
    549
    + +
    552
    +
    554 long date;
    + +
    +
    556
    +
    + +
    567 char *type;
    +
    568
    +
    573 char *data;
    +
    574
    + +
    577
    +
    579 char *email;
    +
    580
    + +
    583 int count_files;
    +
    584
    + +
    587
    + +
    590
    + +
    593
    + +
    596 int count_translation;
    +
    597
    +
    599 char *hash;
    + +
    +
    601
    +
    + +
    607 char *data;
    +
    608
    +
    610 char *hash;
    +
    611
    +
    613 char *secret;
    + +
    +
    615
    + +
    631
    + +
    646
    + +
    661
    + +
    670
    + +
    679
    + +
    688
    + +
    697
    + +
    706
    + +
    716
    +
    +
    720typedef struct telebot_web_app_data {
    +
    722 char *data;
    +
    723
    + + +
    +
    730
    +
    +
    734typedef struct telebot_callback_game {
    +
    735 bool dummy;
    + +
    +
    737
    +
    +
    742typedef struct telebot_login_url {
    +
    744 char *url;
    +
    745
    + +
    748
    + +
    751
    + + +
    +
    755
    + +
    776
    + +
    785
    + +
    852
    + +
    870
    + +
    882
    + +
    891
    + +
    900
    + +
    910
    +
    +
    915typedef struct telebot_user_shared {
    + +
    918
    +
    920 long long int user_id;
    + +
    +
    922
    +
    +
    927typedef struct telebot_chat_shared {
    + +
    930
    +
    932 long long int chat_id;
    + +
    +
    934
    +
    + + +
    941
    + +
    944
    + +
    947
    + +
    950
    + +
    953
    +
    955 char *name;
    +
    956
    + +
    959
    + +
    962
    + + +
    +
    966
    + +
    992
    +
    + + +
    999
    + +
    1002
    +
    1004 long long int user_chat_id;
    +
    1005
    +
    1007 long date;
    +
    1008
    +
    1010 char *bio;
    +
    1011
    + + +
    +
    1015
    +
    + + +
    1023
    + +
    1026
    + +
    1029
    + +
    1032
    +
    1034 long date;
    +
    1035
    + +
    1038 int count_old_reaction;
    +
    1039
    + +
    1042 int count_new_reaction;
    + +
    +
    1044
    +
    + + +
    1052
    + +
    1055
    +
    1057 long date;
    +
    1058
    + +
    1061 int count_reactions;
    + +
    +
    1063
    +
    + +
    1069 char *type;
    +
    1070
    +
    1072 char *emoji;
    +
    1073
    + + +
    +
    1077
    + +
    1088
    + +
    1099
    +
    +
    1103typedef struct telebot_chat_boost {
    + +
    1106
    + +
    1109
    + +
    1112
    + + +
    +
    1116
    + +
    1127
    + +
    1144
    +
    + +
    1150 char *type;
    +
    1151
    +
    1153 long date;
    +
    1154
    + +
    1157
    + +
    1160
    + +
    1163
    + +
    1166
    + + +
    +
    1170
    +
    +
    1175typedef struct telebot_text_quote {
    +
    1177 char *text;
    +
    1178
    + +
    1181 int count_entities;
    +
    1182
    + +
    1185
    + + +
    +
    1189
    +
    +
    1193typedef struct telebot_story {
    + +
    1196
    +
    1198 int id;
    + +
    +
    1200
    +
    + + +
    1208
    + +
    1211
    + +
    1214
    + +
    1217
    + +
    1220
    + +
    1223
    + +
    1226
    + +
    1229
    + +
    1232 int count_photos;
    +
    1233
    + +
    1236
    + +
    1239
    + +
    1242
    + +
    1245
    + +
    1248
    + +
    1251
    + +
    1254
    + +
    1257
    + +
    1260
    + +
    1263
    + +
    1266
    + +
    1269
    + +
    1272
    + +
    1275
    + + +
    +
    1279
    + +
    1299
    +
    +
    1303typedef struct telebot_paid_media {
    +
    1305 char *type;
    +
    1306
    + +
    1309
    + +
    1312
    + +
    1315
    + +
    1318 int count_photos;
    +
    1319
    + + +
    +
    1323
    +
    + + +
    1330
    + +
    1333 int count_paid_media;
    + +
    +
    1335
    +
    +
    1339typedef struct telebot_giveaway {
    + +
    1342 int count_chats;
    +
    1343
    + +
    1346
    + +
    1349
    + +
    1352
    + +
    1355
    + +
    1358
    + +
    1361 int count_country_codes;
    +
    1362
    + +
    1365
    + + +
    +
    1369
    +
    + + +
    1377
    + +
    1380
    + +
    1383
    + +
    1386
    + +
    1389 int count_winners;
    +
    1390
    + +
    1393
    + +
    1396
    + +
    1399
    + +
    1402
    + +
    1405
    + +
    1408
    + + +
    +
    1412
    + +
    1432
    +
    +
    1437typedef struct telebot_users_shared {
    + +
    1440
    + +
    1443 int count_users;
    + +
    +
    1445
    +
    +
    1450typedef struct telebot_shared_user {
    +
    1452 long long int user_id;
    +
    1453
    + +
    1456
    + +
    1459
    + +
    1462
    + +
    1465 int count_photo;
    + +
    +
    1467
    +
    +
    1471typedef struct telebot_gift {
    +
    1473 char *id;
    +
    1474
    + +
    1477
    + +
    1480
    + +
    1483
    + +
    1486
    + +
    1489
    + +
    1492
    + + +
    +
    1496
    +
    +
    1500typedef struct telebot_gift_info {
    + +
    1503
    +
    1505 char *text;
    +
    1506
    + +
    1509 int count_entities;
    +
    1510
    + + +
    +
    1514
    +
    + + +
    1521
    +
    1523 char *origin;
    +
    1524
    + +
    1527
    +
    1529 long long int last_resale_amount;
    + +
    +
    1531
    +
    +
    1535typedef struct telebot_unique_gift {
    +
    1537 char *gift_id;
    +
    1538
    +
    1540 char *name;
    +
    1541
    + +
    1544
    + + +
    +
    1548
    + +
    1556
    + +
    1564
    + +
    1572
    + +
    1590
    + +
    1601
    + +
    1621
    +
    + +
    1627 char *type;
    +
    1628
    +
    1630 long date;
    +
    1631
    +
    1633 char *url;
    + +
    +
    1635
    +
    + +
    1641 char *type;
    +
    1642
    + +
    1645
    + +
    1648
    + +
    1651
    + +
    1654
    + +
    1657
    + +
    1660
    + +
    1663 int count_paid_media;
    +
    1664
    + +
    1667
    + +
    1670
    + +
    1673
    + +
    1676
    + +
    1679
    + +
    1682
    + + +
    +
    1686
    + +
    1709
    +
    + + +
    1716 int count_transactions;
    + +
    +
    1718
    + +
    1729
    +
    + +
    1735 char *source;
    +
    1736
    +
    1738 char *type;
    +
    1739
    + +
    1742
    + +
    1745
    +
    1747 char *message;
    +
    1748
    + +
    1751
    + +
    1754 int count_file_hashes;
    +
    1755
    + + +
    +
    1759
    +
    + + +
    1766
    + +
    1769
    + + +
    +
    1773
    +
    +
    1777typedef struct telebot_message {
    + +
    1780
    + +
    1786
    + +
    1789
    + +
    1799
    + +
    1802
    + +
    1805
    + +
    1808
    +
    1810 long date;
    +
    1811
    + +
    1814
    + +
    1817
    + +
    1820
    + +
    1826
    + +
    1832
    + +
    1838
    + +
    1844
    + +
    1850
    + +
    1853
    + +
    1859
    + +
    1866
    + +
    1869
    + +
    1872
    + +
    1875
    + +
    1878
    + +
    1881
    + +
    1884
    + +
    1887
    + +
    1893
    + +
    1896
    +
    1898 char *text;
    +
    1899
    + +
    1905 int count_entities;
    +
    1906
    + +
    1909
    + +
    1912
    + +
    1919
    + +
    1922
    + +
    1925
    + +
    1928
    + +
    1931 int count_photos;
    +
    1932
    + +
    1935
    + +
    1938
    + +
    1941
    + +
    1944
    +
    1946 char *caption;
    +
    1947
    + +
    1953 int count_caption_entities;
    +
    1954
    + +
    1957
    + +
    1960
    + +
    1963
    + +
    1966
    + +
    1969
    + +
    1972
    + +
    1975
    + +
    1981 int count_new_chat_members;
    +
    1982
    + +
    1988 int count_left_chat_members;
    +
    1989
    + +
    1992
    + +
    1995 int count_new_chat_photos;
    +
    1996
    + +
    1999
    + +
    2002
    + +
    2005
    + +
    2008
    + +
    2011
    +
    2016 long long int migrate_to_chat_id;
    +
    2017
    + +
    2023
    + +
    2030
    + +
    2036
    + +
    2042
    + +
    2045
    + +
    2048
    + +
    2051
    + +
    2054
    + +
    2060
    + +
    2063
    + +
    2066
    + +
    2069
    + +
    2072
    + +
    2075
    + +
    2078
    + +
    2081
    + +
    2084
    + +
    2087
    + +
    2090
    + +
    2093
    + +
    2096
    + +
    2099
    + +
    2102
    + +
    2105
    + +
    2108
    + +
    2111
    + +
    2114
    + +
    2117
    + +
    2120
    + + +
    +
    2127
    +
    + +
    2139 char *type;
    +
    2140
    + +
    2143
    + +
    2146
    +
    2151 char *url;
    +
    2152
    + +
    2155
    + + +
    +
    2159
    +
    2160
    +
    +
    2165typedef struct telebot_photo {
    +
    2167 char *file_id;
    +
    2168
    + +
    2174
    + +
    2177
    + +
    2180
    + + +
    +
    2184
    +
    2185
    +
    +
    2190typedef struct telebot_audio {
    +
    2192 char *file_id;
    +
    2193
    + +
    2199
    + +
    2202
    + +
    2205
    +
    2207 char *title;
    +
    2208
    + +
    2211
    + +
    2214
    + + +
    +
    2218
    + +
    2228
    + +
    2240
    +
    +
    2244typedef struct telebot_user_gift {
    +
    2246 char *gift_id;
    +
    2247
    + +
    2250
    +
    2252 char *text;
    +
    2253
    + + +
    2258
    + +
    2261
    +
    2263 long date;
    +
    2264
    + +
    2267
    + +
    2270
    + + +
    +
    2274
    + +
    2286
    + +
    2296
    +
    +
    2301typedef struct telebot_document {
    +
    2303 char *file_id;
    +
    2304
    + +
    2310
    + +
    2313
    + +
    2316
    + +
    2319
    + + +
    +
    2323
    +
    2324
    +
    +
    2328typedef struct telebot_video {
    +
    2330 char *file_id;
    +
    2331
    + +
    2337
    + +
    2340
    + +
    2343
    + +
    2346
    + +
    2349
    + +
    2352
    + + +
    +
    2356
    +
    +
    2360typedef struct telebot_animation {
    +
    2362 char *file_id;
    +
    2363
    + +
    2369
    + +
    2372
    + +
    2375
    + +
    2378
    + +
    2381
    + +
    2384
    + +
    2387
    + + +
    +
    2391
    +
    +
    2395typedef struct telebot_voice {
    +
    2397 char *file_id;
    +
    2398
    + +
    2404
    + +
    2407
    + +
    2410
    + + +
    +
    2414
    +
    2415
    +
    +
    2420typedef struct telebot_video_note {
    +
    2422 char *file_id;
    +
    2423
    + +
    2429
    + +
    2432
    + +
    2435
    + +
    2438
    + + +
    +
    2442
    +
    2443
    +
    +
    2447typedef struct telebot_contact {
    + +
    2450
    + +
    2453
    + +
    2456
    + +
    2459
    +
    2461 char *vcard;
    + +
    +
    2463
    +
    2464
    +
    +
    2468typedef struct telebot_location {
    + +
    2471
    + + +
    +
    2475
    +
    2476
    +
    +
    2480typedef struct telebot_venue {
    + +
    2483
    +
    2485 char *title;
    +
    2486
    +
    2488 char *address;
    +
    2489
    + +
    2492
    + + +
    +
    2500
    +
    +
    2504typedef struct telebot_poll_option {
    +
    2506 char *text;
    +
    2507
    + + +
    +
    2511
    +
    +
    2515typedef struct telebot_poll_answer {
    +
    2517 char *poll_id;
    +
    2518
    + +
    2521
    + +
    2527
    +
    2528 /* Number of option ids */
    +
    2529 int count_option_ids;
    + +
    +
    2531
    +
    +
    2535typedef struct telebot_poll {
    +
    2537 char *id;
    +
    2538
    + +
    2541
    + +
    2544
    +
    2545 /* Number of options */
    +
    2546 int count_options;
    +
    2547
    + +
    2550
    + +
    2553
    + +
    2556
    +
    2558 char *type;
    +
    2559
    + +
    2562
    + + +
    +
    2570
    +
    +
    2574typedef struct telebot_dice {
    + + +
    +
    2578
    + +
    2592
    +
    +
    2602typedef struct telebot_file {
    +
    2604 char *file_id;
    +
    2605
    + +
    2611
    + +
    2614
    + + +
    +
    2618
    + +
    2632
    + +
    2658
    +
    + + +
    2665
    + +
    2668
    + +
    2671
    + +
    2674
    + +
    2677
    +
    2679 struct telebot_chat_administrator_rights *user_administrator_rights;
    +
    2680
    +
    2682 struct telebot_chat_administrator_rights *bot_administrator_rights;
    +
    2683
    + +
    2686
    + +
    2689
    + +
    2692
    + + +
    +
    2696
    + +
    2704
    + +
    2756
    +
    + + +
    2766
    +
    2767 /* Number of keyboard rows */
    +
    2768 int keyboard_rows;
    +
    2769
    +
    2770 /* Number of keyboard columns */
    +
    2771 int keyboard_cols;
    +
    2772
    + +
    2778
    + +
    2786
    + +
    2795
    + + +
    +
    2804
    + +
    2828
    +
    + +
    2839 char *id;
    +
    2840
    + +
    2843
    + +
    2850
    + +
    2856
    + +
    2863
    +
    2868 char *data;
    +
    2869
    + + +
    +
    2876
    +
    + +
    2885{
    + +
    2891
    + + +
    +
    2901
    +
    2902
    +
    +
    2906typedef struct telebot_chat_photo {
    + +
    2912
    + +
    2919
    + +
    2925
    + + +
    +
    2932
    +
    +
    2936typedef struct telebot_chat_member {
    + +
    2939
    +
    2944 char *status;
    +
    2945
    + +
    2948
    + +
    2954
    + +
    2960
    + +
    2966
    + +
    2972
    + +
    2978
    + +
    2984
    + +
    2992
    + +
    2998
    + +
    3004
    + +
    3010
    + +
    3016
    + +
    3022
    + +
    3028
    + +
    3031
    + +
    3037
    + + +
    +
    3044
    + +
    3094
    +
    +
    3096typedef struct telebot_bot_command {
    +
    3101 char *command;
    +
    3102
    + + +
    +
    3106
    + +
    3126
    +
    +
    3131typedef struct telebot_inline_query {
    +
    3133 char *id;
    +
    3134
    + +
    3137
    +
    3139 char *query;
    +
    3140
    +
    3142 char *offset;
    +
    3143
    + +
    3146
    + + +
    +
    3150
    +
    + + +
    3158
    + +
    3161
    + +
    3164
    + +
    3171
    +
    3173 char *query;
    + +
    +
    3175
    + +
    3192
    +
    + +
    3198 char *id;
    +
    3199
    + +
    3202
    + +
    3205
    + +
    3211
    + +
    3214
    + +
    3217
    + + +
    +
    3221
    +
    + +
    3231 char *point;
    +
    3232
    +
    3238 float x_shift;
    +
    3239
    +
    3245 float y_shift;
    +
    3246
    +
    3248 float scale;
    + +
    +
    3250
    +
    +
    3254typedef struct telebot_sticker {
    +
    3256 char *file_id;
    +
    3257
    + +
    3263
    + +
    3266
    + +
    3269
    + +
    3272
    + +
    3275
    +
    3277 char *emoji;
    +
    3278
    + +
    3281
    + +
    3284
    + + +
    +
    3288
    +
    +
    3292typedef struct telebot_forum_topic {
    + +
    3295
    +
    3297 char *name;
    +
    3298
    + +
    3301
    + + +
    +
    3305
    + +
    3316
    + +
    3324
    + +
    3421
    + +
    3465
    + +
    3476
    + +
    3485
    +
    3489typedef struct telebot_handler *telebot_handler_t;
    +
    3490
    +
    3495#ifdef __cplusplus
    +
    3496}
    +
    3497#endif
    +
    3498
    +
    3499#endif /* __TELEBOT_TYPES_H__ */
    +
    struct telebot_giveaway telebot_giveaway_t
    This object represents a message about a scheduled giveaway.
    +
    struct telebot_bot_command telebot_bot_command_t
    This object represents a bot command.
    +
    struct telebot_game_high_score telebot_game_high_score_t
    This object represents a game high score row.
    +
    struct telebot_game telebot_game_t
    This object represents a game.
    +
    struct telebot_giveaway_created telebot_giveaway_created_t
    This object represents a service message about the creation of a scheduled giveaway.
    +
    struct telebot_chat_background telebot_chat_background_t
    This object represents a chat background.
    +
    struct telebot_chat_location telebot_chat_location_t
    Thi object represetns information about the current status of a webhook.
    +
    struct telebot_shipping_address telebot_shipping_address_t
    This object represents a shipping address.
    +
    struct telebot_user_gift telebot_user_gift_t
    This object represents a gift received by a user.
    +
    struct telebot_video_chat_started telebot_video_chat_started_t
    This object represents a service message about a video chat started in the chat.
    +
    struct telebot_user telebot_user_t
    This object represents a Telegram user or bot.
    +
    struct telebot_business_intro telebot_business_intro_t
    Contains information about the start page settings of a Telegram Business account.
    +
    struct telebot_user_profile_photos telebot_user_profile_photos_t
    This object represent a user's profile pictures.
    +
    struct telebot_message_reaction_updated telebot_message_reaction_updated_t
    This object represents a change of a reaction on a message performed by a user.
    +
    struct telebot_pre_checkout_query telebot_pre_checkout_query_t
    This object contains information about an incoming pre-checkout query.
    +
    struct telebot_login_url telebot_login_url_t
    This object represents a parameter of the inline keyboard button used to automatically authorize a us...
    +
    struct telebot_video_chat_participants_invited telebot_video_chat_participants_invited_t
    This object represents a service message about new members invited to a video chat.
    +
    struct telebot_link_preview_options telebot_link_preview_options_t
    Describes the options used for link preview generation.
    +
    struct telebot_message telebot_message_t
    This object represents a message.
    +
    struct telebot_keyboard_button_request_chat telebot_keyboard_button_request_chat_t
    This object defines the criteria used to request a suitable chat.
    +
    struct telebot_chat telebot_chat_t
    This object represents a chat.
    +
    struct telebot_gift telebot_gift_t
    This object represents a gift that can be sent by the bot.
    +
    struct telebot_video_chat_ended telebot_video_chat_ended_t
    This object represents a service message about a video chat ended in the chat.
    +
    struct telebot_prepared_inline_message telebot_prepared_inline_message_t
    This object represents a prepared inline message.
    +
    struct telebot_star_transactions telebot_star_transactions_t
    Contains a list of Telegram Star transactions.
    +
    struct telebot_encrypted_credentials telebot_encrypted_credentials_t
    This object represents credentials required to decrypt the data.
    +
    struct telebot_passport_data telebot_passport_data_t
    Contains information about Telegram Passport data which was shared with the bot by the user.
    +
    struct telebot_forum_topic_edited telebot_forum_topic_edited_t
    This object represents a service message about a forum topic edited in the chat.
    +
    struct telebot_reply_keyboard_markup telebot_reply_keyboard_markup_t
    This object represents a custom keyboard with reply options.
    +
    struct telebot_giveaway_winners telebot_giveaway_winners_t
    This object represents a message about the completion of a giveaway with public winners.
    +
    struct telebot_star_transaction telebot_star_transaction_t
    Describes a Telegram Star transaction.
    +
    struct telebot_business_opening_hours telebot_business_opening_hours_t
    Describes the opening hours of a business.
    +
    struct telebot_write_access_allowed telebot_write_access_allowed_t
    This object represents a service message about a user allowing a bot to write messages after adding t...
    +
    struct telebot_callback_game telebot_callback_game_t
    A placeholder, currently holds no information. Use BotFather to set up your game.
    +
    struct telebot_forum_topic_reopened telebot_forum_topic_reopened_t
    This object represents a service message about a forum topic reopened in the chat.
    +
    struct telebot_users_shared telebot_users_shared_t
    This object contains information about the users whose identifiers were shared with the bot using a K...
    +
    struct telebot_message_reaction_count_updated telebot_message_reaction_count_updated_t
    This object represents reaction changes on a message with anonymous reactions.
    +
    struct telebot_inline_keyboard_markup telebot_inline_keyboard_markup_t
    This object represents an inline keyboard that appears right next to the message it belongs to.
    +
    struct telebot_poll_answer telebot_poll_answer_t
    This object represents an answer of a user in a non-anonymous poll.
    +
    struct telebot_chat_member telebot_chat_member_t
    This object contains information about one member of a chat.
    +
    struct telebot_chat_boost telebot_chat_boost_t
    This object contains information about a chat boost.
    +
    enum telebot_update_type telebot_update_type_e
    Enumerations of telegram update types.
    +
    struct telebot_invoice telebot_invoice_t
    This object contains basic information about an invoice.
    +
    struct telebot_affiliate_info telebot_affiliate_info_t
    Contains information about the affiliate that received a commission.
    +
    struct telebot_user_gifts telebot_user_gifts_t
    This object represents a list of gifts received by a user.
    +
    struct telebot_poll telebot_poll_t
    This object contains information about a poll.
    +
    struct telebot_unique_gift telebot_unique_gift_t
    This object describes a unique gift that was upgraded from a regular gift.
    +
    struct telebot_inline_keyboard_button telebot_inline_keyboard_button_t
    This object represents one button of an inline keyboard. You must use exactly one of the optional fie...
    +
    struct telebot_paid_media telebot_paid_media_t
    This object describes paid media.
    +
    struct telebot_contact telebot_contact_t
    This object represents a phone contact.
    +
    struct telebot_passport_element_error telebot_passport_element_error_t
    This object represents an error in the Telegram Passport element.
    +
    struct telebot_document telebot_document_t
    This object represents a general file (as opposed to photos, voice messages and audio files).
    +
    struct telebot_successful_payment telebot_successful_payment_t
    This object contains basic information about a successful payment.
    +
    struct telebot_message_entity telebot_message_entity_t
    This object represents one special entity in a text message. For example, hashtags,...
    +
    struct telebot_business_connection telebot_business_connection_t
    Describes the connection of the bot with a business account.
    +
    struct telebot_poll_option telebot_poll_option_t
    This object contains information about one answer option in a poll.
    +
    struct telebot_business_location telebot_business_location_t
    Contains information about the location of a Telegram Business account.
    +
    telebot_update_type
    Enumerations of telegram update types.
    Definition telebot-types.h:44
    +
    struct telebot_video telebot_video_t
    This object represents a video file.
    +
    struct telebot_switch_inline_query_chosen_chat telebot_switch_inline_query_chosen_chat_t
    This object represents an inline button that switches the current user to inline mode in a chosen cha...
    +
    struct telebot_keyboard_button_poll_type telebot_keyboard_button_poll_type_t
    This object represents type of a poll, which is allowed to be created and sent when the corresponding...
    +
    struct telebot_copy_text_button telebot_copy_text_button_t
    This object represents an inline keyboard button that copies specified text to the clipboard.
    +
    struct telebot_shipping_query telebot_shipping_query_t
    This object contains information about an incoming shipping query.
    +
    struct telebot_message_auto_delete_timer_changed telebot_message_auto_delete_timer_changed_t
    This object represents a service message about a change in auto-delete timer settings.
    +
    struct telebot_chat_boost_updated telebot_chat_boost_updated_t
    This object represents a boost added to a chat.
    +
    struct telebot_force_reply telebot_force_reply_t
    Upon receiving a message with this object, Telegram clients will display a reply interface to the use...
    +
    struct telebot_sticker telebot_sticker_t
    This object represents a sticker.
    +
    struct telebot_story telebot_story_t
    This object contains information about a story.
    +
    struct telebot_chat_photo telebot_chat_photo_t
    This object represents a chat photo.
    +
    struct telebot_chat_boost_added telebot_chat_boost_added_t
    This object represents a service message about a user boosting a chat.
    +
    struct telebot_general_forum_topic_unhidden telebot_general_forum_topic_unhidden_t
    This object represents a service message about a general forum topic unhidden in the chat.
    +
    struct telebot_web_app_info telebot_web_app_info_t
    Describes a Web App.
    +
    struct telebot_encrypted_passport_element telebot_encrypted_passport_element_t
    This object represents one element of the Telegram Passport data.
    +
    struct telebot_proximity_alert_triggered telebot_proximity_alert_triggered_t
    This object represents a service message about a user in the chat triggered another user's proximity ...
    +
    struct telebot_chat_shared telebot_chat_shared_t
    This object contains information about the chat whose identifier was shared with the bot using a Keyb...
    +
    struct telebot_video_note telebot_video_note_t
    This object represents a video message (available in Telegram apps as of v.4.0).
    +
    struct telebot_unique_gift_info telebot_unique_gift_info_t
    Describes a unique gift that was sent or received.
    +
    struct telebot_message_origin telebot_message_origin_t
    This object describes the origin of a message.
    +
    struct telebot_mask_position telebot_mask_position_t
    This object describes the position on faces where a mask should be placed by default.
    +
    struct telebot_voice telebot_voice_t
    This object represents a voice note.
    +
    struct telebot_chosen_inline_result telebot_chosen_inline_result_t
    Represents a result of an inline query that was chosen by the user and sent to their chat partner.
    +
    struct telebot_transaction_partner telebot_transaction_partner_t
    This object describes the source of a transaction.
    +
    struct telebot_reply_keyboard_remove telebot_reply_keyboard_remove_t
    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard a...
    +
    struct telebot_handler * telebot_handler_t
    This is opaque object to represent a telebot handler.
    Definition telebot-types.h:3489
    +
    struct telebot_keyboard_button_request_users telebot_keyboard_button_request_users_t
    This object defines the criteria used to request suitable users.
    +
    struct telebot_video_chat_scheduled telebot_video_chat_scheduled_t
    This object represents a service message about a video chat scheduled in the chat.
    +
    struct telebot_general_forum_topic_hidden telebot_general_forum_topic_hidden_t
    This object represents a service message about a general forum topic hidden in the chat.
    +
    struct telebot_text_quote telebot_text_quote_t
    This object contains information about the quoted part of a message that is replied to by the given m...
    +
    struct telebot_user_profile_audios telebot_user_profile_audios_t
    This object represents a list of user profile audios.
    +
    struct telebot_gift_info telebot_gift_info_t
    Describes a regular gift that was sent or received.
    +
    struct telebot_sent_web_app_message telebot_sent_web_app_message_t
    This object represents a message sent via a Web App.
    +
    struct telebot_shared_user telebot_shared_user_t
    This object contains information about a user that was shared with the bot.
    +
    struct telebot_star_amount telebot_star_amount_t
    Describes an amount of Telegram Stars.
    +
    struct telebot_chat_member_updated telebot_chat_member_updated_t
    This object represents changes in the status of a chat member.
    +
    struct telebot_business_opening_hours_interval telebot_business_opening_hours_interval_t
    Describes an interval of time during which a business is open.
    +
    struct telebot_order_info telebot_order_info_t
    This object represents information about an order.
    +
    struct telebot_chat_boost_removed telebot_chat_boost_removed_t
    This object represents a boost removed from a chat.
    +
    struct telebot_callback_query telebot_callback_query_t
    This object represents an incoming callback query from a callback button in an inline keyboard....
    +
    struct telebot_response_paramters telebot_response_paramters_t
    Contains information about why a request was unsuccessful.
    +
    struct telebot_reaction_count telebot_reaction_count_t
    This object represents a reaction count.
    +
    struct telebot_passport_file telebot_passport_file_t
    This object represents an internal identifier of a user in Telegram Passport.
    +
    struct telebot_inline_query telebot_inline_query_t
    This object represents an incoming inline query. When the user sends an empty query,...
    +
    struct telebot_paid_media_purchased telebot_paid_media_purchased_t
    This object contains information about a paid media purchase.
    +
    struct telebot_business_messages_deleted telebot_business_messages_deleted_t
    This object is received when messages are deleted from a connected business account.
    +
    struct telebot_refunded_payment telebot_refunded_payment_t
    This object represents a service message about a refunded payment.
    +
    struct telebot_business_bot_rights telebot_business_bot_rights_t
    Represents the rights of a business bot.
    +
    struct telebot_chat_invite_link telebot_chat_invite_link_t
    This object represents a chat invite link.
    +
    struct telebot_forum_topic telebot_forum_topic_t
    This object represents a forum topic.
    +
    struct telebot_user_shared telebot_user_shared_t
    This object contains information about the user whose identifier was shared with the bot using a Keyb...
    +
    struct telebot_forum_topic_created telebot_forum_topic_created_t
    This object represents a service message about a new forum topic created in the chat.
    +
    struct telebot_chat_boost_source telebot_chat_boost_source_t
    This object represents the source of a chat boost.
    +
    struct telebot_webhook_info telebot_webhook_info_t
    Thi object represetns information about the current status of a webhook.
    +
    struct telebot_chat_join_request telebot_chat_join_request_t
    This object represents a join request sent to a chat.
    +
    struct telebot_giveaway_completed telebot_giveaway_completed_t
    This object represents a service message about the completion of a giveaway without public winners.
    +
    struct telebot_forum_topic_closed telebot_forum_topic_closed_t
    This object represents a service message about a forum topic closed in the chat.
    +
    struct telebot_keyboard_button telebot_keyboard_button_t
    This object represents one button of the reply keyboard. For simple text buttons String can be used i...
    +
    struct telebot_chat_permissions telebot_chat_permissions_t
    Describes actions that a non-administrator user is allowed to take in a chat.
    +
    struct telebot_file telebot_file_t
    This object represents a file ready to be downloaded.
    +
    struct telebot_reaction_type telebot_reaction_type_t
    This object represents a reaction type.
    +
    struct telebot_dice telebot_dice_t
    This object represents a dice with random value from 1 to 6.
    +
    struct telebot_gifts telebot_gifts_t
    This object represent a list of gifts.
    +
    struct telebot_web_app_data telebot_web_app_data_t
    This object represents data sent by a Web App to the bot.
    +
    struct telebot_birthdate telebot_birthdate_t
    Describes the birthdate of a user.
    +
    struct telebot_venue telebot_venue_t
    This object represents a venue.
    +
    struct telebot_revenue_withdrawal_state telebot_revenue_withdrawal_state_t
    This object describes the state of a revenue withdrawal operation.
    +
    struct telebot_animation telebot_animation_t
    This object represents a video file.
    +
    struct telebot_location telebot_location_t
    This object represents a point on the map.
    +
    struct telebot_user_chat_boosts telebot_user_chat_boosts_t
    This object represents a list of user chat boosts.
    +
    struct telebot_update telebot_update_t
    This object represents an incoming update.
    +
    struct telebot_external_reply_info telebot_external_reply_info_t
    This object contains information about the message that is being replied to, which may come from anot...
    +
    struct telebot_paid_media_info telebot_paid_media_info_t
    Describes the paid media added to a message.
    +
    struct telebot_photo telebot_photo_t
    This object represents one size of a photo or a file / sticker thumbnail.
    +
    struct telebot_audio telebot_audio_t
    This object represents an audio file to be treated as music by the Telegram clients.
    +
    @ TELEBOT_UPDATE_TYPE_CALLBACK_QUERY
    Definition telebot-types.h:57
    +
    @ TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES
    Definition telebot-types.h:52
    +
    @ TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT
    Definition telebot-types.h:56
    +
    @ TELEBOT_UPDATE_TYPE_SHIPPING_QUERY
    Definition telebot-types.h:58
    +
    @ TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE
    Definition telebot-types.h:50
    +
    @ TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST
    Definition telebot-types.h:48
    +
    @ TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE
    Definition telebot-types.h:51
    +
    @ TELEBOT_UPDATE_TYPE_MESSAGE
    Definition telebot-types.h:45
    +
    @ TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST
    Definition telebot-types.h:65
    +
    @ TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION
    Definition telebot-types.h:49
    +
    @ TELEBOT_UPDATE_TYPE_EDITED_MESSAGE
    Definition telebot-types.h:46
    +
    @ TELEBOT_UPDATE_TYPE_POLL_ANSWER
    Definition telebot-types.h:62
    +
    @ TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT
    Definition telebot-types.h:54
    +
    @ TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST
    Definition telebot-types.h:67
    +
    @ TELEBOT_UPDATE_TYPE_MAX
    Definition telebot-types.h:68
    +
    @ TELEBOT_UPDATE_TYPE_CHAT_BOOST
    Definition telebot-types.h:66
    +
    @ TELEBOT_UPDATE_TYPE_POLL
    Definition telebot-types.h:61
    +
    @ TELEBOT_UPDATE_TYPE_CHANNEL_POST
    Definition telebot-types.h:47
    +
    @ TELEBOT_UPDATE_TYPE_MESSAGE_REACTION
    Definition telebot-types.h:53
    +
    @ TELEBOT_UPDATE_TYPE_CHAT_MEMBER
    Definition telebot-types.h:64
    +
    @ TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY
    Definition telebot-types.h:59
    +
    @ TELEBOT_UPDATE_TYPE_INLINE_QUERY
    Definition telebot-types.h:55
    +
    @ TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER
    Definition telebot-types.h:63
    +
    @ TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA
    Definition telebot-types.h:60
    +
    Contains information about the affiliate that received a commission.
    Definition telebot-types.h:1605
    +
    int amount
    Definition telebot-types.h:1616
    +
    struct telebot_chat * affiliate_chat
    Definition telebot-types.h:1610
    +
    int commission_per_mille
    Definition telebot-types.h:1613
    +
    struct telebot_user * affiliate_user
    Definition telebot-types.h:1607
    +
    int nanostar_amount
    Definition telebot-types.h:1619
    +
    This object represents a video file.
    Definition telebot-types.h:2360
    +
    int duration
    Definition telebot-types.h:2377
    +
    char * file_name
    Definition telebot-types.h:2383
    +
    char * mime_type
    Definition telebot-types.h:2386
    +
    int height
    Definition telebot-types.h:2374
    +
    int file_size
    Definition telebot-types.h:2389
    +
    char * file_unique_id
    Definition telebot-types.h:2368
    +
    int width
    Definition telebot-types.h:2371
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:2380
    +
    char * file_id
    Definition telebot-types.h:2362
    +
    This object represents an audio file to be treated as music by the Telegram clients.
    Definition telebot-types.h:2190
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:2216
    +
    char * title
    Definition telebot-types.h:2207
    +
    char * file_unique_id
    Definition telebot-types.h:2198
    +
    int file_size
    Definition telebot-types.h:2213
    +
    char * mime_type
    Definition telebot-types.h:2210
    +
    char * performer
    Definition telebot-types.h:2204
    +
    int duration
    Definition telebot-types.h:2201
    +
    char * file_id
    Definition telebot-types.h:2192
    +
    Describes the birthdate of a user.
    Definition telebot-types.h:74
    +
    int day
    Definition telebot-types.h:76
    +
    int year
    Definition telebot-types.h:82
    +
    int month
    Definition telebot-types.h:79
    +
    This object represents a bot command.
    Definition telebot-types.h:3096
    +
    char * description
    Definition telebot-types.h:3104
    +
    char * command
    Definition telebot-types.h:3101
    +
    Represents the rights of a business bot.
    Definition telebot-types.h:136
    +
    Describes the connection of the bot with a business account.
    Definition telebot-types.h:156
    +
    Contains information about the start page settings of a Telegram Business account.
    Definition telebot-types.h:88
    +
    char * title
    Definition telebot-types.h:90
    +
    char * message
    Definition telebot-types.h:93
    +
    struct telebot_sticker * sticker
    Definition telebot-types.h:96
    +
    Contains information about the location of a Telegram Business account.
    Definition telebot-types.h:102
    +
    struct telebot_location * location
    Definition telebot-types.h:107
    +
    char * address
    Definition telebot-types.h:104
    +
    This object is received when messages are deleted from a connected business account.
    Definition telebot-types.h:168
    +
    Describes an interval of time during which a business is open.
    Definition telebot-types.h:113
    +
    int opening_minute
    Definition telebot-types.h:115
    +
    int closing_minute
    Definition telebot-types.h:118
    +
    Describes the opening hours of a business.
    Definition telebot-types.h:124
    +
    char * time_zone_name
    Definition telebot-types.h:126
    +
    struct telebot_business_opening_hours_interval * opening_hours
    Definition telebot-types.h:129
    +
    A placeholder, currently holds no information. Use BotFather to set up your game.
    Definition telebot-types.h:734
    +
    This object represents an incoming callback query from a callback button in an inline keyboard....
    Definition telebot-types.h:2837
    +
    char * data
    Definition telebot-types.h:2868
    +
    struct telebot_user * from
    Definition telebot-types.h:2842
    +
    char * chat_instance
    Definition telebot-types.h:2862
    +
    char * inline_message_id
    Definition telebot-types.h:2855
    +
    char * game_short_name
    Definition telebot-types.h:2874
    +
    char * id
    Definition telebot-types.h:2839
    +
    struct telebot_message * message
    Definition telebot-types.h:2849
    +
    This object represents a chat background.
    Definition telebot-types.h:1560
    +
    char * type
    Definition telebot-types.h:1562
    +
    This object represents a service message about a user boosting a chat.
    Definition telebot-types.h:1552
    +
    int boost_count
    Definition telebot-types.h:1554
    +
    This object represents a boost removed from a chat.
    Definition telebot-types.h:1131
    +
    char * boost_id
    Definition telebot-types.h:1136
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1133
    +
    struct telebot_chat_boost_source * source
    Definition telebot-types.h:1142
    +
    long remove_date
    Definition telebot-types.h:1139
    +
    This object represents the source of a chat boost.
    Definition telebot-types.h:1120
    +
    struct telebot_user * user
    Definition telebot-types.h:1125
    +
    char * source
    Definition telebot-types.h:1122
    +
    This object represents a boost added to a chat.
    Definition telebot-types.h:1092
    +
    struct telebot_chat_boost * boost
    Definition telebot-types.h:1097
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1094
    +
    This object contains information about a chat boost.
    Definition telebot-types.h:1103
    +
    struct telebot_chat_boost_source * source
    Definition telebot-types.h:1114
    +
    long add_date
    Definition telebot-types.h:1108
    +
    long expiration_date
    Definition telebot-types.h:1111
    +
    char * boost_id
    Definition telebot-types.h:1105
    + + + + + + + + + + +
    This object represents a join request sent to a chat.
    Definition telebot-types.h:996
    +
    long long int user_chat_id
    Definition telebot-types.h:1004
    +
    struct telebot_chat * chat
    Definition telebot-types.h:998
    +
    struct telebot_chat_invite_link * invite_link
    Definition telebot-types.h:1013
    +
    char * bio
    Definition telebot-types.h:1010
    +
    long date
    Definition telebot-types.h:1007
    +
    struct telebot_user * from
    Definition telebot-types.h:1001
    +
    Thi object represetns information about the current status of a webhook.
    Definition telebot-types.h:3469
    +
    char * address
    Definition telebot-types.h:3474
    +
    struct telebot_location * location
    Definition telebot-types.h:3471
    +
    This object represents changes in the status of a chat member.
    Definition telebot-types.h:970
    +
    bool via_chat_folder_invite_link
    Definition telebot-types.h:990
    +
    long date
    Definition telebot-types.h:978
    +
    struct telebot_chat_invite_link * invite_link
    Definition telebot-types.h:987
    +
    struct telebot_chat_member * new_chat_member
    Definition telebot-types.h:984
    +
    struct telebot_user * from
    Definition telebot-types.h:975
    +
    struct telebot_chat * chat
    Definition telebot-types.h:972
    +
    struct telebot_chat_member * old_chat_member
    Definition telebot-types.h:981
    +
    This object contains information about one member of a chat.
    Definition telebot-types.h:2936
    +
    char * status
    Definition telebot-types.h:2944
    +
    char * custom_title
    Definition telebot-types.h:2947
    +
    bool can_change_info
    Definition telebot-types.h:2997
    +
    bool can_send_media_messages
    Definition telebot-types.h:3027
    +
    bool can_send_messages
    Definition telebot-types.h:3021
    +
    struct telebot_user * user
    Definition telebot-types.h:2938
    +
    bool can_send_polls
    Definition telebot-types.h:3030
    +
    bool can_invite_users
    Definition telebot-types.h:3003
    +
    bool can_edit_messages
    Definition telebot-types.h:2971
    +
    bool can_send_other_messages
    Definition telebot-types.h:3036
    +
    bool can_pin_messages
    Definition telebot-types.h:3009
    +
    bool can_add_web_page_previews
    Definition telebot-types.h:3042
    +
    bool is_member
    Definition telebot-types.h:3015
    +
    bool can_restrict_members
    Definition telebot-types.h:2983
    +
    long until_date
    Definition telebot-types.h:2953
    +
    bool can_delete_messages
    Definition telebot-types.h:2977
    +
    bool can_be_edited
    Definition telebot-types.h:2959
    +
    bool can_post_messages
    Definition telebot-types.h:2965
    +
    bool can_promote_members
    Definition telebot-types.h:2991
    +
    Describes actions that a non-administrator user is allowed to take in a chat.
    Definition telebot-types.h:3048
    +
    bool can_send_polls
    Definition telebot-types.h:3065
    +
    bool can_send_messages
    Definition telebot-types.h:3053
    +
    bool can_invite_users
    Definition telebot-types.h:3086
    +
    bool can_pin_messages
    Definition telebot-types.h:3092
    +
    bool can_send_media_messages
    Definition telebot-types.h:3059
    +
    bool can_send_other_messages
    Definition telebot-types.h:3071
    +
    bool can_add_web_page_previews
    Definition telebot-types.h:3077
    +
    bool can_change_info
    Definition telebot-types.h:3083
    +
    This object represents a chat photo.
    Definition telebot-types.h:2906
    +
    char * big_file_unique_id
    Definition telebot-types.h:2930
    +
    char * big_file_id
    Definition telebot-types.h:2924
    +
    char * small_file_unique_id
    Definition telebot-types.h:2918
    +
    char * small_file_id
    Definition telebot-types.h:2911
    +
    This object contains information about the chat whose identifier was shared with the bot using a Keyb...
    Definition telebot-types.h:927
    +
    int request_id
    Definition telebot-types.h:929
    +
    long long int chat_id
    Definition telebot-types.h:932
    +
    This object represents a chat.
    Definition telebot-types.h:229
    +
    bool has_protected_content
    Definition telebot-types.h:373
    +
    char * sticker_set_name
    Definition telebot-types.h:382
    +
    struct telebot_chat_photo * photo
    Definition telebot-types.h:261
    +
    long emoji_status_expiration_date
    Definition telebot-types.h:294
    +
    bool has_aggressive_anti_spam_enabled
    Definition telebot-types.h:364
    +
    bool can_set_sticker_set
    Definition telebot-types.h:388
    +
    long long int linked_chat_id
    Definition telebot-types.h:398
    +
    bool is_direct_messages
    Definition telebot-types.h:252
    +
    bool has_visible_history
    Definition telebot-types.h:376
    +
    struct telebot_chat_location * location
    Definition telebot-types.h:404
    +
    long long int id
    Definition telebot-types.h:231
    +
    char * title
    Definition telebot-types.h:237
    +
    char * custom_emoji_sticker_set_name
    Definition telebot-types.h:391
    +
    struct telebot_chat_permissions * permissions
    Definition telebot-types.h:346
    +
    int unrestrict_boost_count
    Definition telebot-types.h:355
    +
    char * type
    Definition telebot-types.h:234
    +
    char * last_name
    Definition telebot-types.h:246
    +
    int message_auto_delete_time
    Definition telebot-types.h:361
    +
    struct telebot_business_location * business_location
    Definition telebot-types.h:276
    +
    int max_reaction_count
    Definition telebot-types.h:258
    +
    struct telebot_chat * parent_chat
    Definition telebot-types.h:285
    +
    bool has_restricted_voice_and_video_messages
    Definition telebot-types.h:311
    +
    struct telebot_birthdate * birthdate
    Definition telebot-types.h:270
    +
    int accent_color_id
    Definition telebot-types.h:255
    +
    char * invite_link
    Definition telebot-types.h:335
    +
    int slow_mode_delay
    Definition telebot-types.h:352
    +
    struct telebot_business_opening_hours * business_opening_hours
    Definition telebot-types.h:279
    +
    char * username
    Definition telebot-types.h:240
    +
    char * first_name
    Definition telebot-types.h:243
    +
    char * description
    Definition telebot-types.h:329
    +
    struct telebot_chat * personal_chat
    Definition telebot-types.h:282
    +
    bool has_hidden_members
    Definition telebot-types.h:367
    +
    char ** active_usernames
    Definition telebot-types.h:266
    +
    bool join_by_request
    Definition telebot-types.h:323
    +
    struct telebot_message * pinned_message
    Definition telebot-types.h:340
    +
    char * emoji_status_custom_emoji_id
    Definition telebot-types.h:291
    +
    bool join_to_send_messages
    Definition telebot-types.h:317
    +
    bool is_forum
    Definition telebot-types.h:249
    +
    struct telebot_business_intro * business_intro
    Definition telebot-types.h:273
    +
    char * bio
    Definition telebot-types.h:297
    +
    bool has_private_forwards
    Definition telebot-types.h:304
    +
    Represents a result of an inline query that was chosen by the user and sent to their chat partner.
    Definition telebot-types.h:3155
    +
    struct telebot_location * location
    Definition telebot-types.h:3163
    +
    struct telebot_user * from
    Definition telebot-types.h:3160
    +
    char * result_id
    Definition telebot-types.h:3157
    +
    char * inline_message_id
    Definition telebot-types.h:3170
    +
    char * query
    Definition telebot-types.h:3173
    +
    This object represents a phone contact.
    Definition telebot-types.h:2447
    +
    char * vcard
    Definition telebot-types.h:2461
    +
    char * last_name
    Definition telebot-types.h:2455
    +
    int user_id
    Definition telebot-types.h:2458
    +
    char * phone_number
    Definition telebot-types.h:2449
    +
    char * first_name
    Definition telebot-types.h:2452
    +
    This object represents an inline keyboard button that copies specified text to the clipboard.
    Definition telebot-types.h:781
    +
    char * text
    Definition telebot-types.h:783
    +
    This object represents a dice with random value from 1 to 6.
    Definition telebot-types.h:2574
    +
    int value
    Definition telebot-types.h:2576
    +
    This object represents a general file (as opposed to photos, voice messages and audio files).
    Definition telebot-types.h:2301
    +
    char * file_name
    Definition telebot-types.h:2315
    +
    char * file_unique_id
    Definition telebot-types.h:2309
    +
    char * file_id
    Definition telebot-types.h:2303
    +
    int file_size
    Definition telebot-types.h:2321
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:2312
    +
    char * mime_type
    Definition telebot-types.h:2318
    +
    This object represents credentials required to decrypt the data.
    Definition telebot-types.h:605
    +
    char * secret
    Definition telebot-types.h:613
    +
    char * data
    Definition telebot-types.h:607
    +
    char * hash
    Definition telebot-types.h:610
    +
    This object represents one element of the Telegram Passport data.
    Definition telebot-types.h:560
    +
    struct telebot_passport_file * files
    Definition telebot-types.h:582
    +
    char * type
    Definition telebot-types.h:567
    +
    char * email
    Definition telebot-types.h:579
    +
    char * phone_number
    Definition telebot-types.h:576
    +
    char * data
    Definition telebot-types.h:573
    +
    struct telebot_passport_file * translation
    Definition telebot-types.h:595
    +
    char * hash
    Definition telebot-types.h:599
    +
    struct telebot_passport_file * reverse_side
    Definition telebot-types.h:589
    +
    struct telebot_passport_file * front_side
    Definition telebot-types.h:586
    +
    struct telebot_passport_file * selfie
    Definition telebot-types.h:592
    +
    This object contains information about the message that is being replied to, which may come from anot...
    Definition telebot-types.h:1205
    +
    struct telebot_link_preview_options * link_preview_options
    Definition telebot-types.h:1216
    +
    struct telebot_video_note * video_note
    Definition telebot-types.h:1244
    +
    struct telebot_dice * dice
    Definition telebot-types.h:1256
    +
    struct telebot_game * game
    Definition telebot-types.h:1259
    +
    struct telebot_document * document
    Definition telebot-types.h:1225
    +
    struct telebot_animation * animation
    Definition telebot-types.h:1219
    +
    struct telebot_video * video
    Definition telebot-types.h:1241
    +
    struct telebot_poll * poll
    Definition telebot-types.h:1274
    +
    int message_id
    Definition telebot-types.h:1213
    +
    struct telebot_sticker * sticker
    Definition telebot-types.h:1235
    +
    struct telebot_giveaway * giveaway
    Definition telebot-types.h:1262
    +
    struct telebot_paid_media_info * paid_media
    Definition telebot-types.h:1228
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1210
    +
    struct telebot_message_origin origin
    Definition telebot-types.h:1207
    +
    struct telebot_photo * photos
    Definition telebot-types.h:1231
    +
    struct telebot_invoice * invoice
    Definition telebot-types.h:1268
    +
    struct telebot_audio * audio
    Definition telebot-types.h:1222
    +
    bool has_media_spoiler
    Definition telebot-types.h:1250
    +
    struct telebot_location * location
    Definition telebot-types.h:1271
    +
    struct telebot_contact * contact
    Definition telebot-types.h:1253
    +
    struct telebot_venue * venue
    Definition telebot-types.h:1277
    +
    struct telebot_story * story
    Definition telebot-types.h:1238
    +
    struct telebot_giveaway_winners * giveaway_winners
    Definition telebot-types.h:1265
    +
    struct telebot_voice * voice
    Definition telebot-types.h:1247
    +
    This object represents a file ready to be downloaded.
    Definition telebot-types.h:2602
    +
    int file_size
    Definition telebot-types.h:2613
    +
    char * file_id
    Definition telebot-types.h:2604
    +
    char * file_path
    Definition telebot-types.h:2616
    +
    char * file_unique_id
    Definition telebot-types.h:2610
    +
    Upon receiving a message with this object, Telegram clients will display a reply interface to the use...
    Definition telebot-types.h:2885
    +
    bool selective
    Definition telebot-types.h:2899
    +
    bool force_reply
    Definition telebot-types.h:2890
    +
    This object represents a service message about a forum topic closed in the chat.
    Definition telebot-types.h:666
    +
    bool dummy
    Definition telebot-types.h:668
    +
    This object represents a service message about a new forum topic created in the chat.
    Definition telebot-types.h:651
    +
    char * name
    Definition telebot-types.h:653
    +
    int icon_color
    Definition telebot-types.h:656
    +
    char * icon_custom_emoji_id
    Definition telebot-types.h:659
    +
    This object represents a service message about a forum topic edited in the chat.
    Definition telebot-types.h:875
    +
    char * icon_custom_emoji_id
    Definition telebot-types.h:880
    +
    char * name
    Definition telebot-types.h:877
    +
    This object represents a service message about a forum topic reopened in the chat.
    Definition telebot-types.h:675
    +
    bool dummy
    Definition telebot-types.h:677
    +
    This object represents a forum topic.
    Definition telebot-types.h:3292
    +
    char * name
    Definition telebot-types.h:3297
    +
    char * icon_custom_emoji_id
    Definition telebot-types.h:3303
    +
    int message_thread_id
    Definition telebot-types.h:3294
    +
    int icon_color
    Definition telebot-types.h:3300
    +
    This object represents a game high score row.
    Definition telebot-types.h:1763
    +
    struct telebot_user * user
    Definition telebot-types.h:1768
    +
    int score
    Definition telebot-types.h:1771
    +
    int position
    Definition telebot-types.h:1765
    +
    This object represents a game.
    Definition telebot-types.h:410
    +
    char * text
    Definition telebot-types.h:427
    +
    struct telebot_animation * animation
    Definition telebot-types.h:439
    +
    struct telebot_photo * photo
    Definition telebot-types.h:418
    +
    char * title
    Definition telebot-types.h:412
    +
    int count_photo
    Definition telebot-types.h:421
    +
    char * description
    Definition telebot-types.h:415
    +
    struct telebot_message_entity * text_entities
    Definition telebot-types.h:433
    +
    This object represents a service message about a general forum topic hidden in the chat.
    Definition telebot-types.h:887
    +
    bool dummy
    Definition telebot-types.h:889
    +
    This object represents a service message about a general forum topic unhidden in the chat.
    Definition telebot-types.h:896
    +
    bool dummy
    Definition telebot-types.h:898
    +
    Describes a regular gift that was sent or received.
    Definition telebot-types.h:1500
    +
    bool is_private
    Definition telebot-types.h:1512
    +
    struct telebot_message_entity * entities
    Definition telebot-types.h:1508
    +
    char * text
    Definition telebot-types.h:1505
    +
    struct telebot_gift gift
    Definition telebot-types.h:1502
    +
    This object represents a gift that can be sent by the bot.
    Definition telebot-types.h:1471
    +
    int upgrade_star_count
    Definition telebot-types.h:1482
    +
    int remaining_count
    Definition telebot-types.h:1494
    +
    int total_count
    Definition telebot-types.h:1491
    +
    int star_count
    Definition telebot-types.h:1479
    +
    char * id
    Definition telebot-types.h:1473
    +
    bool is_premium
    Definition telebot-types.h:1485
    +
    bool has_colors
    Definition telebot-types.h:1488
    +
    struct telebot_sticker * sticker
    Definition telebot-types.h:1476
    +
    This object represent a list of gifts.
    Definition telebot-types.h:2222
    +
    int count
    Definition telebot-types.h:2226
    +
    telebot_gift_t * gifts
    Definition telebot-types.h:2224
    +
    This object represents a service message about the completion of a giveaway without public winners.
    Definition telebot-types.h:1577
    +
    int unclaimed_prize_count
    Definition telebot-types.h:1582
    +
    bool is_star_giveaway
    Definition telebot-types.h:1588
    +
    struct telebot_message * giveaway_message
    Definition telebot-types.h:1585
    +
    int winner_count
    Definition telebot-types.h:1579
    +
    This object represents a service message about the creation of a scheduled giveaway.
    Definition telebot-types.h:1568
    +
    int prize_star_count
    Definition telebot-types.h:1570
    +
    This object represents a message about the completion of a giveaway with public winners.
    Definition telebot-types.h:1374
    +
    long winners_selection_date
    Definition telebot-types.h:1382
    +
    int giveaway_message_id
    Definition telebot-types.h:1379
    +
    int premium_subscription_month_count
    Definition telebot-types.h:1398
    +
    bool only_new_members
    Definition telebot-types.h:1404
    +
    char * prize_description
    Definition telebot-types.h:1410
    +
    struct telebot_user * winners
    Definition telebot-types.h:1388
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1376
    +
    bool was_refunded
    Definition telebot-types.h:1407
    +
    int unclaimed_prize_count
    Definition telebot-types.h:1401
    +
    int additional_chat_count
    Definition telebot-types.h:1392
    +
    int prize_star_count
    Definition telebot-types.h:1395
    +
    int winner_count
    Definition telebot-types.h:1385
    +
    This object represents a message about a scheduled giveaway.
    Definition telebot-types.h:1339
    +
    char ** country_codes
    Definition telebot-types.h:1360
    +
    bool only_new_members
    Definition telebot-types.h:1351
    +
    int prize_star_count
    Definition telebot-types.h:1364
    +
    char * prize_description
    Definition telebot-types.h:1357
    +
    int premium_subscription_month_count
    Definition telebot-types.h:1367
    +
    bool has_public_winners
    Definition telebot-types.h:1354
    +
    struct telebot_chat * chats
    Definition telebot-types.h:1341
    +
    long winners_selection_date
    Definition telebot-types.h:1345
    +
    int winner_count
    Definition telebot-types.h:1348
    +
    This object represents one button of an inline keyboard. You must use exactly one of the optional fie...
    Definition telebot-types.h:790
    +
    bool pay
    Definition telebot-types.h:850
    +
    struct telebot_login_url * login_url
    Definition telebot-types.h:812
    +
    struct telebot_callback_game * callback_game
    Definition telebot-types.h:844
    +
    char * callback_data
    Definition telebot-types.h:801
    +
    char * switch_inline_query
    Definition telebot-types.h:820
    +
    char * switch_inline_query_current_chat
    Definition telebot-types.h:827
    +
    char * url
    Definition telebot-types.h:795
    +
    struct telebot_copy_text_button * copy_text
    Definition telebot-types.h:838
    +
    struct telebot_switch_inline_query_chosen_chat * switch_inline_query_chosen_chat
    Definition telebot-types.h:833
    +
    char * text
    Definition telebot-types.h:792
    +
    struct telebot_web_app_info * web_app
    Definition telebot-types.h:807
    +
    This object represents an inline keyboard that appears right next to the message it belongs to.
    Definition telebot-types.h:857
    +
    int cols
    Definition telebot-types.h:868
    +
    telebot_inline_keyboard_button_t * inline_keyboard
    Definition telebot-types.h:862
    +
    int rows
    Definition telebot-types.h:865
    +
    This object represents an incoming inline query. When the user sends an empty query,...
    Definition telebot-types.h:3131
    +
    struct telebot_location * location
    Definition telebot-types.h:3148
    +
    struct telebot_user * from
    Definition telebot-types.h:3136
    +
    char * query
    Definition telebot-types.h:3139
    +
    char * chat_type
    Definition telebot-types.h:3145
    +
    char * offset
    Definition telebot-types.h:3142
    +
    char * id
    Definition telebot-types.h:3133
    +
    This object contains basic information about an invoice.
    Definition telebot-types.h:485
    +
    char * start_parameter
    Definition telebot-types.h:496
    +
    char * currency
    Definition telebot-types.h:499
    +
    char * description
    Definition telebot-types.h:490
    +
    char * title
    Definition telebot-types.h:487
    +
    int total_amount
    Definition telebot-types.h:505
    +
    This object represents type of a poll, which is allowed to be created and sent when the corresponding...
    Definition telebot-types.h:2623
    +
    char * type
    Definition telebot-types.h:2630
    +
    This object defines the criteria used to request a suitable chat.
    Definition telebot-types.h:2662
    +
    bool request_username
    Definition telebot-types.h:2691
    +
    bool chat_is_channel
    Definition telebot-types.h:2667
    +
    bool request_photo
    Definition telebot-types.h:2694
    +
    bool chat_is_forum
    Definition telebot-types.h:2670
    +
    bool bot_is_member
    Definition telebot-types.h:2685
    +
    int request_id
    Definition telebot-types.h:2664
    +
    struct telebot_chat_administrator_rights * user_administrator_rights
    Definition telebot-types.h:2679
    +
    bool chat_has_username
    Definition telebot-types.h:2673
    +
    bool request_title
    Definition telebot-types.h:2688
    +
    bool chat_is_created
    Definition telebot-types.h:2676
    +
    struct telebot_chat_administrator_rights * bot_administrator_rights
    Definition telebot-types.h:2682
    +
    This object defines the criteria used to request suitable users.
    Definition telebot-types.h:2636
    +
    bool request_photo
    Definition telebot-types.h:2656
    +
    bool user_is_premium
    Definition telebot-types.h:2644
    +
    int request_id
    Definition telebot-types.h:2638
    +
    bool request_username
    Definition telebot-types.h:2653
    +
    bool request_name
    Definition telebot-types.h:2650
    +
    int max_quantity
    Definition telebot-types.h:2647
    +
    bool user_is_bot
    Definition telebot-types.h:2641
    +
    This object represents one button of the reply keyboard. For simple text buttons String can be used i...
    Definition telebot-types.h:2711
    +
    bool request_contact
    Definition telebot-types.h:2736
    +
    char * text
    Definition telebot-types.h:2716
    +
    struct telebot_web_app_info * web_app
    Definition telebot-types.h:2754
    +
    struct telebot_keyboard_button_request_users * request_users
    Definition telebot-types.h:2723
    +
    struct telebot_keyboard_button_request_chat * request_chat
    Definition telebot-types.h:2730
    +
    telebot_keyboard_button_poll_type_t * request_poll
    Definition telebot-types.h:2747
    +
    bool request_location
    Definition telebot-types.h:2741
    + + + + + + +
    This object represents a point on the map.
    Definition telebot-types.h:2468
    +
    float longitude
    Definition telebot-types.h:2470
    +
    float latitude
    Definition telebot-types.h:2473
    +
    This object represents a parameter of the inline keyboard button used to automatically authorize a us...
    Definition telebot-types.h:742
    +
    char * bot_username
    Definition telebot-types.h:750
    +
    char * forward_text
    Definition telebot-types.h:747
    +
    bool request_write_access
    Definition telebot-types.h:753
    +
    char * url
    Definition telebot-types.h:744
    +
    This object describes the position on faces where a mask should be placed by default.
    Definition telebot-types.h:3226
    +
    char * point
    Definition telebot-types.h:3231
    +
    float y_shift
    Definition telebot-types.h:3245
    +
    float scale
    Definition telebot-types.h:3248
    +
    float x_shift
    Definition telebot-types.h:3238
    +
    This object represents a service message about a change in auto-delete timer settings.
    Definition telebot-types.h:3481
    +
    int message_auto_delete_time
    Definition telebot-types.h:3483
    +
    This object represents one special entity in a text message. For example, hashtags,...
    Definition telebot-types.h:2132
    +
    char * language
    Definition telebot-types.h:2157
    +
    int length
    Definition telebot-types.h:2145
    +
    telebot_user_t * user
    Definition telebot-types.h:2154
    +
    int offset
    Definition telebot-types.h:2142
    +
    char * url
    Definition telebot-types.h:2151
    +
    char * type
    Definition telebot-types.h:2139
    +
    This object describes the origin of a message.
    Definition telebot-types.h:1148
    +
    char * type
    Definition telebot-types.h:1150
    +
    char * author_signature
    Definition telebot-types.h:1165
    +
    struct telebot_chat * sender_chat
    Definition telebot-types.h:1162
    +
    int message_id
    Definition telebot-types.h:1168
    +
    long date
    Definition telebot-types.h:1153
    +
    char * sender_user_name
    Definition telebot-types.h:1159
    +
    struct telebot_user * sender_user
    Definition telebot-types.h:1156
    +
    This object represents reaction changes on a message with anonymous reactions.
    Definition telebot-types.h:1049
    +
    int message_id
    Definition telebot-types.h:1054
    +
    long date
    Definition telebot-types.h:1057
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1051
    +
    struct telebot_reaction_count * reactions
    Definition telebot-types.h:1060
    +
    This object represents a change of a reaction on a message performed by a user.
    Definition telebot-types.h:1020
    +
    struct telebot_chat * actor_chat
    Definition telebot-types.h:1031
    +
    struct telebot_reaction_type * new_reaction
    Definition telebot-types.h:1041
    +
    struct telebot_user * user
    Definition telebot-types.h:1028
    +
    long date
    Definition telebot-types.h:1034
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1022
    +
    int message_id
    Definition telebot-types.h:1025
    +
    struct telebot_reaction_type * old_reaction
    Definition telebot-types.h:1037
    +
    This object represents a message.
    Definition telebot-types.h:1777
    +
    bool group_chat_created
    Definition telebot-types.h:2001
    +
    struct telebot_voice * voice
    Definition telebot-types.h:1943
    +
    char * effect_id
    Definition telebot-types.h:1911
    +
    struct telebot_message * reply_to_message
    Definition telebot-types.h:1865
    +
    struct telebot_forum_topic_edited * forum_topic_edited
    Definition telebot-types.h:2065
    +
    struct telebot_video_chat_scheduled * video_chat_scheduled
    Definition telebot-types.h:2080
    +
    struct telebot_video * video
    Definition telebot-types.h:1937
    +
    struct telebot_invoice * invoice
    Definition telebot-types.h:2035
    +
    bool is_paid_post
    Definition telebot-types.h:1886
    +
    struct telebot_forum_topic_created * forum_topic_created
    Definition telebot-types.h:2062
    +
    char * business_connection_id
    Definition telebot-types.h:1807
    +
    struct telebot_audio * audio
    Definition telebot-types.h:1921
    +
    struct telebot_giveaway_created * giveaway_created
    Definition telebot-types.h:2113
    +
    struct telebot_poll * poll
    Definition telebot-types.h:1968
    +
    struct telebot_contact * contact
    Definition telebot-types.h:1959
    +
    char * forward_sender_name
    Definition telebot-types.h:1843
    +
    char * connected_website
    Definition telebot-types.h:2050
    +
    struct telebot_users_shared * users_shared
    Definition telebot-types.h:2095
    +
    struct telebot_user * forward_from
    Definition telebot-types.h:1819
    +
    struct telebot_game * game
    Definition telebot-types.h:1965
    +
    struct telebot_message_origin * forward_origin
    Definition telebot-types.h:1816
    +
    struct telebot_link_preview_options * link_preview_options
    Definition telebot-types.h:1908
    +
    struct telebot_message_auto_delete_timer_changed * message_auto_delete_timer_changed
    Definition telebot-types.h:2010
    +
    bool has_protected_content
    Definition telebot-types.h:1883
    +
    struct telebot_video_chat_ended * video_chat_ended
    Definition telebot-types.h:2086
    +
    struct telebot_chat_boost_added * boost_added
    Definition telebot-types.h:2107
    +
    long long int migrate_from_chat_id
    Definition telebot-types.h:2022
    +
    bool channel_chat_created
    Definition telebot-types.h:2007
    +
    struct telebot_video_note * video_note
    Definition telebot-types.h:1940
    +
    struct telebot_proximity_alert_triggered * proximity_alert_triggered
    Definition telebot-types.h:2059
    +
    struct telebot_photo * photos
    Definition telebot-types.h:1930
    +
    struct telebot_user * left_chat_members
    Definition telebot-types.h:1987
    +
    struct telebot_text_quote * quote
    Definition telebot-types.h:1871
    +
    char * caption
    Definition telebot-types.h:1946
    +
    struct telebot_passport_data * passport_data
    Definition telebot-types.h:2053
    +
    struct telebot_user * sender_business_bot
    Definition telebot-types.h:1804
    +
    struct telebot_message_entity * caption_entities
    Definition telebot-types.h:1952
    +
    struct telebot_refunded_payment * refunded_payment
    Definition telebot-types.h:2044
    +
    struct telebot_story * reply_to_story
    Definition telebot-types.h:1874
    +
    long edit_date
    Definition telebot-types.h:1880
    +
    struct telebot_successful_payment * successful_payment
    Definition telebot-types.h:2041
    +
    struct telebot_animation * animation
    Definition telebot-types.h:1918
    +
    struct telebot_paid_media_info * paid_media
    Definition telebot-types.h:1927
    +
    struct telebot_general_forum_topic_unhidden * general_forum_topic_unhidden
    Definition telebot-types.h:2077
    +
    struct telebot_chat * sender_chat
    Definition telebot-types.h:1798
    +
    char * media_group_id
    Definition telebot-types.h:1892
    +
    struct telebot_document * document
    Definition telebot-types.h:1924
    +
    bool show_caption_above_media
    Definition telebot-types.h:1956
    +
    bool is_automatic_forward
    Definition telebot-types.h:1858
    +
    struct telebot_user * new_chat_members
    Definition telebot-types.h:1980
    +
    char * author_signature
    Definition telebot-types.h:1895
    +
    struct telebot_general_forum_topic_hidden * general_forum_topic_hidden
    Definition telebot-types.h:2074
    +
    struct telebot_sticker * sticker
    Definition telebot-types.h:1934
    +
    struct telebot_dice * dice
    Definition telebot-types.h:1962
    +
    long forward_date
    Definition telebot-types.h:1849
    +
    int message_thread_id
    Definition telebot-types.h:1785
    +
    struct telebot_forum_topic_reopened * forum_topic_reopened
    Definition telebot-types.h:2071
    +
    bool delete_chat_photo
    Definition telebot-types.h:1998
    +
    struct telebot_photo * new_chat_photos
    Definition telebot-types.h:1994
    +
    struct telebot_user * from
    Definition telebot-types.h:1788
    +
    char * forward_signature
    Definition telebot-types.h:1837
    +
    struct telebot_message * pinned_message
    Definition telebot-types.h:2029
    +
    long date
    Definition telebot-types.h:1810
    +
    struct telebot_unique_gift_info * unique_gift
    Definition telebot-types.h:2104
    +
    bool has_media_spoiler
    Definition telebot-types.h:2119
    +
    struct telebot_web_app_data * web_app_data
    Definition telebot-types.h:2092
    +
    struct telebot_video_chat_participants_invited * video_chat_participants_invited
    Definition telebot-types.h:2089
    +
    struct telebot_inline_keyboard_markup * reply_markup
    Definition telebot-types.h:2125
    +
    struct telebot_external_reply_info * external_reply
    Definition telebot-types.h:1868
    +
    long long int migrate_to_chat_id
    Definition telebot-types.h:2016
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1813
    +
    struct telebot_location * location
    Definition telebot-types.h:1974
    +
    char * new_chat_title
    Definition telebot-types.h:1991
    +
    struct telebot_venue * venue
    Definition telebot-types.h:1971
    +
    struct telebot_giveaway_completed * giveaway_completed
    Definition telebot-types.h:2116
    +
    char * text
    Definition telebot-types.h:1898
    +
    int sender_boost_count
    Definition telebot-types.h:1801
    +
    int forward_from_message_id
    Definition telebot-types.h:1831
    +
    struct telebot_user * via_bot
    Definition telebot-types.h:1877
    +
    struct telebot_forum_topic_closed * forum_topic_closed
    Definition telebot-types.h:2068
    +
    struct telebot_video_chat_started * video_chat_started
    Definition telebot-types.h:2083
    +
    struct telebot_message_entity * entities
    Definition telebot-types.h:1904
    +
    bool is_topic_message
    Definition telebot-types.h:1852
    +
    struct telebot_chat * forward_from_chat
    Definition telebot-types.h:1825
    +
    int message_id
    Definition telebot-types.h:1779
    +
    struct telebot_gift_info * gift
    Definition telebot-types.h:2101
    +
    struct telebot_chat_background * chat_background_set
    Definition telebot-types.h:2110
    +
    struct telebot_write_access_allowed * write_access_allowed
    Definition telebot-types.h:2047
    +
    struct telebot_chat_shared * chat_shared
    Definition telebot-types.h:2098
    +
    bool supergroup_chat_created
    Definition telebot-types.h:2004
    +
    This object represents information about an order.
    Definition telebot-types.h:468
    +
    char * phone_number
    Definition telebot-types.h:473
    +
    char * email
    Definition telebot-types.h:476
    +
    struct telebot_shipping_address * shipping_address
    Definition telebot-types.h:479
    +
    char * name
    Definition telebot-types.h:470
    +
    Describes the paid media added to a message.
    Definition telebot-types.h:1327
    +
    struct telebot_paid_media * paid_media
    Definition telebot-types.h:1332
    +
    int star_count
    Definition telebot-types.h:1329
    +
    This object contains information about a paid media purchase.
    Definition telebot-types.h:1722
    +
    struct telebot_user * from
    Definition telebot-types.h:1724
    +
    char * paid_media_payload
    Definition telebot-types.h:1727
    +
    This object describes paid media.
    Definition telebot-types.h:1303
    +
    int duration
    Definition telebot-types.h:1314
    +
    char * type
    Definition telebot-types.h:1305
    +
    struct telebot_photo * photos
    Definition telebot-types.h:1317
    +
    int width
    Definition telebot-types.h:1308
    +
    int height
    Definition telebot-types.h:1311
    +
    struct telebot_video * video
    Definition telebot-types.h:1321
    +
    Contains information about Telegram Passport data which was shared with the bot by the user.
    Definition telebot-types.h:620
    +
    struct telebot_encrypted_credentials * credentials
    Definition telebot-types.h:629
    +
    struct telebot_encrypted_passport_element * data
    Definition telebot-types.h:625
    +
    This object represents an error in the Telegram Passport element.
    Definition telebot-types.h:1733
    +
    char * file_hash
    Definition telebot-types.h:1750
    +
    char * type
    Definition telebot-types.h:1738
    +
    char * field_name
    Definition telebot-types.h:1741
    +
    char * source
    Definition telebot-types.h:1735
    +
    char ** file_hashes
    Definition telebot-types.h:1753
    +
    char * data_hash
    Definition telebot-types.h:1744
    +
    char * element_hash
    Definition telebot-types.h:1757
    +
    char * message
    Definition telebot-types.h:1747
    +
    This object represents an internal identifier of a user in Telegram Passport.
    Definition telebot-types.h:540
    +
    char * file_unique_id
    Definition telebot-types.h:548
    +
    int file_size
    Definition telebot-types.h:551
    +
    char * file_id
    Definition telebot-types.h:542
    +
    long date
    Definition telebot-types.h:554
    +
    This object represents one size of a photo or a file / sticker thumbnail.
    Definition telebot-types.h:2165
    +
    char * file_unique_id
    Definition telebot-types.h:2173
    +
    int width
    Definition telebot-types.h:2176
    +
    int height
    Definition telebot-types.h:2179
    +
    int file_size
    Definition telebot-types.h:2182
    +
    char * file_id
    Definition telebot-types.h:2167
    +
    This object represents an answer of a user in a non-anonymous poll.
    Definition telebot-types.h:2515
    +
    struct telebot_user * user
    Definition telebot-types.h:2520
    +
    int * option_ids
    Definition telebot-types.h:2526
    +
    char * poll_id
    Definition telebot-types.h:2517
    +
    This object contains information about one answer option in a poll.
    Definition telebot-types.h:2504
    +
    char * text
    Definition telebot-types.h:2506
    +
    int voter_count
    Definition telebot-types.h:2509
    +
    This object contains information about a poll.
    Definition telebot-types.h:2535
    +
    bool is_anonymous
    Definition telebot-types.h:2555
    +
    int correct_option_id
    Definition telebot-types.h:2568
    +
    char * id
    Definition telebot-types.h:2537
    +
    char * question
    Definition telebot-types.h:2540
    +
    telebot_poll_option_t * options
    Definition telebot-types.h:2543
    +
    int total_voter_count
    Definition telebot-types.h:2549
    +
    bool allows_multiple_answers
    Definition telebot-types.h:2561
    +
    bool is_closed
    Definition telebot-types.h:2552
    +
    char * type
    Definition telebot-types.h:2558
    +
    This object contains information about an incoming pre-checkout query.
    Definition telebot-types.h:3196
    +
    struct telebot_user * from
    Definition telebot-types.h:3201
    +
    char * currency
    Definition telebot-types.h:3204
    +
    int total_amount
    Definition telebot-types.h:3210
    +
    char * id
    Definition telebot-types.h:3198
    +
    char * invoice_payload
    Definition telebot-types.h:3213
    +
    char * shipping_option_id
    Definition telebot-types.h:3216
    +
    struct telebot_order_info * order_info
    Definition telebot-types.h:3219
    +
    This object represents a prepared inline message.
    Definition telebot-types.h:3309
    +
    long expiration_date
    Definition telebot-types.h:3314
    +
    char * id
    Definition telebot-types.h:3311
    +
    This object represents a service message about a user in the chat triggered another user's proximity ...
    Definition telebot-types.h:636
    +
    struct telebot_user * traveler
    Definition telebot-types.h:638
    +
    int distance
    Definition telebot-types.h:644
    +
    struct telebot_user * watcher
    Definition telebot-types.h:641
    +
    This object represents a reaction count.
    Definition telebot-types.h:1081
    +
    int total_count
    Definition telebot-types.h:1086
    +
    struct telebot_reaction_type type
    Definition telebot-types.h:1083
    +
    This object represents a reaction type.
    Definition telebot-types.h:1067
    +
    char * custom_emoji_id
    Definition telebot-types.h:1075
    +
    char * type
    Definition telebot-types.h:1069
    +
    char * emoji
    Definition telebot-types.h:1072
    +
    This object represents a service message about a refunded payment.
    Definition telebot-types.h:1416
    +
    char * currency
    Definition telebot-types.h:1418
    +
    int total_amount
    Definition telebot-types.h:1421
    +
    char * provider_payment_charge_id
    Definition telebot-types.h:1430
    +
    char * telegram_payment_charge_id
    Definition telebot-types.h:1427
    +
    char * invoice_payload
    Definition telebot-types.h:1424
    +
    This object represents a custom keyboard with reply options.
    Definition telebot-types.h:2760
    +
    bool resize_keyboard
    Definition telebot-types.h:2785
    +
    bool is_persistent
    Definition telebot-types.h:2777
    +
    telebot_keyboard_button_t * keyboard
    Definition telebot-types.h:2765
    +
    bool selective
    Definition telebot-types.h:2802
    +
    bool one_time_keyboard
    Definition telebot-types.h:2794
    +
    Upon receiving a message with this object, Telegram clients will remove the current custom keyboard a...
    Definition telebot-types.h:2812
    +
    bool remove_keyboard
    Definition telebot-types.h:2818
    +
    bool selective
    Definition telebot-types.h:2826
    +
    Contains information about why a request was unsuccessful.
    Definition telebot-types.h:3110
    +
    int retry_after
    Definition telebot-types.h:3124
    +
    int migrate_to_chat_id
    Definition telebot-types.h:3118
    +
    This object describes the state of a revenue withdrawal operation.
    Definition telebot-types.h:1625
    +
    long date
    Definition telebot-types.h:1630
    +
    char * url
    Definition telebot-types.h:1633
    +
    char * type
    Definition telebot-types.h:1627
    +
    This object represents a message sent via a Web App.
    Definition telebot-types.h:3320
    +
    char * inline_message_id
    Definition telebot-types.h:3322
    +
    This object contains information about a user that was shared with the bot.
    Definition telebot-types.h:1450
    +
    char * username
    Definition telebot-types.h:1461
    +
    char * first_name
    Definition telebot-types.h:1455
    +
    struct telebot_photo * photo
    Definition telebot-types.h:1464
    +
    char * last_name
    Definition telebot-types.h:1458
    +
    long long int user_id
    Definition telebot-types.h:1452
    +
    This object represents a shipping address.
    Definition telebot-types.h:445
    +
    char * state
    Definition telebot-types.h:450
    +
    char * street_line1
    Definition telebot-types.h:456
    +
    char * street_line2
    Definition telebot-types.h:459
    +
    char * post_code
    Definition telebot-types.h:462
    +
    char * country_code
    Definition telebot-types.h:447
    +
    char * city
    Definition telebot-types.h:453
    +
    This object contains information about an incoming shipping query.
    Definition telebot-types.h:3179
    +
    char * invoice_payload
    Definition telebot-types.h:3187
    +
    struct telebot_shipping_address * shipping_address
    Definition telebot-types.h:3190
    +
    char * id
    Definition telebot-types.h:3181
    +
    struct telebot_user * from
    Definition telebot-types.h:3184
    +
    Describes an amount of Telegram Stars.
    Definition telebot-types.h:1594
    +
    int amount
    Definition telebot-types.h:1596
    +
    int nanostar_amount
    Definition telebot-types.h:1599
    +
    Describes a Telegram Star transaction.
    Definition telebot-types.h:1690
    +
    int amount
    Definition telebot-types.h:1695
    +
    struct telebot_transaction_partner * source
    Definition telebot-types.h:1704
    +
    struct telebot_transaction_partner * receiver
    Definition telebot-types.h:1707
    +
    long date
    Definition telebot-types.h:1701
    +
    char * id
    Definition telebot-types.h:1692
    +
    int nanostar_amount
    Definition telebot-types.h:1698
    +
    Contains a list of Telegram Star transactions.
    Definition telebot-types.h:1713
    +
    struct telebot_star_transaction * transactions
    Definition telebot-types.h:1715
    +
    This object represents a sticker.
    Definition telebot-types.h:3254
    +
    int width
    Definition telebot-types.h:3265
    +
    char * file_unique_id
    Definition telebot-types.h:3262
    +
    char * file_id
    Definition telebot-types.h:3256
    +
    struct telebot_mask_position * mask_position
    Definition telebot-types.h:3283
    +
    char * set_name
    Definition telebot-types.h:3280
    +
    char * emoji
    Definition telebot-types.h:3277
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:3274
    +
    int height
    Definition telebot-types.h:3268
    +
    bool is_animated
    Definition telebot-types.h:3271
    +
    int file_size
    Definition telebot-types.h:3286
    +
    This object contains information about a story.
    Definition telebot-types.h:1193
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1195
    +
    int id
    Definition telebot-types.h:1198
    +
    This object contains basic information about a successful payment.
    Definition telebot-types.h:511
    +
    int total_amount
    Definition telebot-types.h:519
    +
    char * shipping_option_id
    Definition telebot-types.h:525
    +
    char * telegram_payment_charge_id
    Definition telebot-types.h:531
    +
    char * invoice_payload
    Definition telebot-types.h:522
    +
    struct telebot_order_info * order_info
    Definition telebot-types.h:528
    +
    char * currency
    Definition telebot-types.h:513
    +
    char * provider_payment_charge_id
    Definition telebot-types.h:534
    +
    This object represents an inline button that switches the current user to inline mode in a chosen cha...
    Definition telebot-types.h:760
    +
    bool allow_bot_chats
    Definition telebot-types.h:768
    +
    char * query
    Definition telebot-types.h:762
    +
    bool allow_group_chats
    Definition telebot-types.h:771
    +
    bool allow_channel_chats
    Definition telebot-types.h:774
    +
    bool allow_user_chats
    Definition telebot-types.h:765
    +
    This object contains information about the quoted part of a message that is replied to by the given m...
    Definition telebot-types.h:1175
    +
    struct telebot_message_entity * entities
    Definition telebot-types.h:1180
    +
    int position
    Definition telebot-types.h:1184
    +
    bool is_manual
    Definition telebot-types.h:1187
    +
    char * text
    Definition telebot-types.h:1177
    +
    This object describes the source of a transaction.
    Definition telebot-types.h:1639
    +
    struct telebot_revenue_withdrawal_state * withdrawal_state
    Definition telebot-types.h:1675
    +
    int premium_subscription_duration
    Definition telebot-types.h:1672
    +
    struct telebot_affiliate_info * affiliate
    Definition telebot-types.h:1653
    +
    struct telebot_paid_media * paid_media
    Definition telebot-types.h:1662
    +
    struct telebot_gift * gift
    Definition telebot-types.h:1669
    +
    char * invoice_payload
    Definition telebot-types.h:1656
    +
    int subscription_period
    Definition telebot-types.h:1659
    +
    int commission_per_mille
    Definition telebot-types.h:1681
    +
    char * type
    Definition telebot-types.h:1641
    +
    struct telebot_chat * chat
    Definition telebot-types.h:1650
    +
    char * paid_media_payload
    Definition telebot-types.h:1666
    +
    int request_count
    Definition telebot-types.h:1684
    +
    char * transaction_type
    Definition telebot-types.h:1644
    +
    struct telebot_user * sponsor_user
    Definition telebot-types.h:1678
    +
    struct telebot_user * user
    Definition telebot-types.h:1647
    +
    Describes a unique gift that was sent or received.
    Definition telebot-types.h:1518
    +
    struct telebot_unique_gift * gift
    Definition telebot-types.h:1520
    +
    char * last_resale_currency
    Definition telebot-types.h:1526
    +
    long long int last_resale_amount
    Definition telebot-types.h:1529
    +
    char * origin
    Definition telebot-types.h:1523
    +
    This object describes a unique gift that was upgraded from a regular gift.
    Definition telebot-types.h:1535
    +
    char * gift_id
    Definition telebot-types.h:1537
    +
    int number
    Definition telebot-types.h:1543
    +
    struct telebot_sticker * sticker
    Definition telebot-types.h:1546
    +
    char * name
    Definition telebot-types.h:1540
    +
    This object represents an incoming update.
    Definition telebot-types.h:3328
    +
    telebot_message_t channel_post
    Definition telebot-types.h:3348
    +
    telebot_paid_media_purchased_t purchased_paid_media
    Definition telebot-types.h:3385
    +
    telebot_message_t business_message
    Definition telebot-types.h:3357
    +
    telebot_pre_checkout_query_t pre_checkout_query
    Definition telebot-types.h:3382
    +
    telebot_callback_query_t callback_query
    Definition telebot-types.h:3376
    +
    telebot_message_reaction_updated_t message_reaction
    Definition telebot-types.h:3409
    +
    telebot_message_t edited_message
    Definition telebot-types.h:3345
    +
    telebot_message_t edited_business_message
    Definition telebot-types.h:3360
    +
    telebot_business_connection_t business_connection
    Definition telebot-types.h:3354
    +
    telebot_chosen_inline_result_t chosen_inline_result
    Definition telebot-types.h:3373
    +
    telebot_business_messages_deleted_t deleted_business_messages
    Definition telebot-types.h:3363
    +
    telebot_chat_boost_removed_t chat_boost_removed
    Definition telebot-types.h:3418
    +
    telebot_update_type_e update_type
    Definition telebot-types.h:3338
    +
    telebot_chat_member_updated_t chat_member
    Definition telebot-types.h:3403
    +
    telebot_chat_member_updated_t my_chat_member
    Definition telebot-types.h:3400
    +
    telebot_message_t edited_channel_post
    Definition telebot-types.h:3351
    +
    telebot_poll_answer_t poll_answer
    Definition telebot-types.h:3397
    +
    telebot_message_reaction_count_updated_t message_reaction_count
    Definition telebot-types.h:3412
    +
    telebot_chat_boost_updated_t chat_boost
    Definition telebot-types.h:3415
    +
    telebot_chat_join_request_t chat_join_request
    Definition telebot-types.h:3406
    +
    telebot_poll_t poll
    Definition telebot-types.h:3391
    +
    int update_id
    Definition telebot-types.h:3333
    +
    telebot_message_t message
    Definition telebot-types.h:3342
    +
    telebot_shipping_query_t shipping_query
    Definition telebot-types.h:3379
    +
    telebot_inline_query_t inline_query
    Definition telebot-types.h:3366
    +
    This object represents a list of user chat boosts.
    Definition telebot-types.h:2290
    +
    telebot_chat_boost_t * boosts
    Definition telebot-types.h:2292
    +
    int count
    Definition telebot-types.h:2294
    +
    This object represents a gift received by a user.
    Definition telebot-types.h:2244
    +
    bool is_upgraded
    Definition telebot-types.h:2272
    +
    char * text
    Definition telebot-types.h:2252
    +
    long date
    Definition telebot-types.h:2263
    +
    telebot_gift_t * gift
    Definition telebot-types.h:2260
    +
    int upgrade_star_count
    Definition telebot-types.h:2269
    +
    struct telebot_user * sender_user
    Definition telebot-types.h:2249
    +
    int count_entities
    Definition telebot-types.h:2257
    +
    char * gift_id
    Definition telebot-types.h:2246
    +
    int message_id
    Definition telebot-types.h:2266
    +
    struct telebot_message_entity * entities
    Definition telebot-types.h:2255
    +
    This object represents a list of gifts received by a user.
    Definition telebot-types.h:2278
    +
    int count
    Definition telebot-types.h:2284
    +
    telebot_user_gift_t * gifts
    Definition telebot-types.h:2282
    +
    int total_count
    Definition telebot-types.h:2280
    +
    This object represents a list of user profile audios.
    Definition telebot-types.h:2232
    +
    int count
    Definition telebot-types.h:2238
    +
    telebot_audio_t * audios
    Definition telebot-types.h:2236
    +
    int total_count
    Definition telebot-types.h:2234
    +
    This object represent a user's profile pictures.
    Definition telebot-types.h:2582
    +
    struct telebot_photo * photos[4]
    Definition telebot-types.h:2590
    +
    int total_count
    Definition telebot-types.h:2584
    +
    int current_count
    Definition telebot-types.h:2587
    +
    This object contains information about the user whose identifier was shared with the bot using a Keyb...
    Definition telebot-types.h:915
    +
    long long int user_id
    Definition telebot-types.h:920
    +
    int request_id
    Definition telebot-types.h:917
    +
    This object represents a Telegram user or bot.
    Definition telebot-types.h:178
    +
    long long int id
    Definition telebot-types.h:180
    +
    bool allows_users_to_create_topics
    Definition telebot-types.h:222
    +
    bool has_main_web_app
    Definition telebot-types.h:216
    +
    bool can_connect_to_business
    Definition telebot-types.h:213
    +
    bool has_topics_enabled
    Definition telebot-types.h:219
    +
    char * last_name
    Definition telebot-types.h:189
    +
    bool can_join_groups
    Definition telebot-types.h:204
    +
    char * username
    Definition telebot-types.h:192
    +
    bool added_to_attachment_menu
    Definition telebot-types.h:201
    +
    bool is_premium
    Definition telebot-types.h:198
    +
    bool can_read_all_group_messages
    Definition telebot-types.h:207
    +
    char * language_code
    Definition telebot-types.h:195
    +
    bool supports_inline_queries
    Definition telebot-types.h:210
    +
    char * first_name
    Definition telebot-types.h:186
    +
    bool is_bot
    Definition telebot-types.h:183
    +
    This object contains information about the users whose identifiers were shared with the bot using a K...
    Definition telebot-types.h:1437
    +
    int request_id
    Definition telebot-types.h:1439
    +
    struct telebot_shared_user * users
    Definition telebot-types.h:1442
    +
    This object represents a venue.
    Definition telebot-types.h:2480
    +
    char * foursquare_id
    Definition telebot-types.h:2491
    +
    char * foursquare_type
    Definition telebot-types.h:2498
    +
    char * address
    Definition telebot-types.h:2488
    +
    char * title
    Definition telebot-types.h:2485
    +
    struct telebot_location * location
    Definition telebot-types.h:2482
    +
    This object represents a service message about a video chat ended in the chat.
    Definition telebot-types.h:702
    +
    int duration
    Definition telebot-types.h:704
    +
    This object represents a service message about new members invited to a video chat.
    Definition telebot-types.h:711
    +
    struct telebot_user * users
    Definition telebot-types.h:713
    +
    This object represents a service message about a video chat scheduled in the chat.
    Definition telebot-types.h:684
    +
    long start_date
    Definition telebot-types.h:686
    +
    This object represents a service message about a video chat started in the chat.
    Definition telebot-types.h:693
    +
    bool dummy
    Definition telebot-types.h:695
    +
    This object represents a video message (available in Telegram apps as of v.4.0).
    Definition telebot-types.h:2420
    +
    int length
    Definition telebot-types.h:2431
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:2437
    +
    char * file_id
    Definition telebot-types.h:2422
    +
    int file_size
    Definition telebot-types.h:2440
    +
    char * file_unique_id
    Definition telebot-types.h:2428
    +
    int duration
    Definition telebot-types.h:2434
    +
    This object represents a video file.
    Definition telebot-types.h:2328
    +
    char * mime_type
    Definition telebot-types.h:2351
    +
    char * file_unique_id
    Definition telebot-types.h:2336
    +
    char * file_id
    Definition telebot-types.h:2330
    +
    int width
    Definition telebot-types.h:2339
    +
    struct telebot_photo * thumb
    Definition telebot-types.h:2348
    +
    int file_size
    Definition telebot-types.h:2354
    +
    int duration
    Definition telebot-types.h:2345
    +
    int height
    Definition telebot-types.h:2342
    +
    This object represents a voice note.
    Definition telebot-types.h:2395
    +
    char * file_unique_id
    Definition telebot-types.h:2403
    +
    char * mime_type
    Definition telebot-types.h:2409
    +
    char * file_id
    Definition telebot-types.h:2397
    +
    int duration
    Definition telebot-types.h:2406
    +
    int file_size
    Definition telebot-types.h:2412
    +
    This object represents data sent by a Web App to the bot.
    Definition telebot-types.h:720
    +
    char * button_text
    Definition telebot-types.h:728
    +
    char * data
    Definition telebot-types.h:722
    +
    Describes a Web App.
    Definition telebot-types.h:2700
    +
    char * url
    Definition telebot-types.h:2702
    +
    Thi object represetns information about the current status of a webhook.
    Definition telebot-types.h:3425
    +
    char * last_error_message
    Definition telebot-types.h:3445
    +
    telebot_update_type_e allowed_updates[TELEBOT_UPDATE_TYPE_MAX]
    Definition telebot-types.h:3457
    +
    int max_connections
    Definition telebot-types.h:3451
    +
    char * url
    Definition telebot-types.h:3427
    +
    bool has_custom_certificate
    Definition telebot-types.h:3430
    +
    long last_error_date
    Definition telebot-types.h:3439
    +
    int allowed_updates_count
    Definition telebot-types.h:3462
    +
    int pending_update_count
    Definition telebot-types.h:3433
    +
    This object represents a service message about a user allowing a bot to write messages after adding t...
    Definition telebot-types.h:906
    +
    char * web_app_name
    Definition telebot-types.h:908
    diff --git a/docs/telebot_8h.html b/docs/telebot_8h.html new file mode 100644 index 0000000..a65fa77 --- /dev/null +++ b/docs/telebot_8h.html @@ -0,0 +1,104 @@ + + + + + + + +Telebot: include/telebot.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    Telebot 9.4 +
    +
    Library for Telegram bot API
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    telebot.h File Reference
    +
    +
    + +

    This file includes all the header files of the telegram bot library. +More...

    +
    #include "telebot-common.h"
    +#include "telebot-types.h"
    +#include "telebot-methods.h"
    +#include "telebot-stickers.h"
    +#include "telebot-inline.h"
    +#include "telebot-payments.h"
    +#include "telebot-passport.h"
    +#include "telebot-games.h"
    +#include "telebot-forums.h"
    +
    +

    Go to the source code of this file.

    +

    Detailed Description

    +

    This file includes all the header files of the telegram bot library.

    +
    Author
    Elmurod Talipov
    +
    Date
    2026-02-28
    +
    + + + + diff --git a/docs/telebot_8h_source.html b/docs/telebot_8h_source.html index 0382f2a..1fe4a1c 100644 --- a/docs/telebot_8h_source.html +++ b/docs/telebot_8h_source.html @@ -1,9 +1,9 @@ - - + + - - + + Telebot: include/telebot.h Source File @@ -19,10 +19,9 @@
    - - + @@ -31,19 +30,28 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - + +
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    telebot.h
    +
    telebot.h
    -
    1 /*
    2  * telebot
    3  *
    4  * Copyright (c) 2015 Elmurod Talipov.
    5  *
    6  * Licensed under the Apache License, Version 2.0 (the License);
    7  * you may not use this file except in compliance with the License.
    8  * You may obtain a copy of the License at
    9  *
    10  * http://www.apache.org/licenses/LICENSE-2.0
    11  *
    12  * Unless required by applicable law or agreed to in writing, software
    13  * distributed under the License is distributed on an "AS IS" BASIS,
    14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  * See the License for the specific language governing permissions and
    16  * limitations under the License.
    17  */
    18 
    19 #ifndef __TELEBOT_H__
    20 #define __TELEBOT_H__
    21 
    22 #include "telebot-common.h"
    23 #include "telebot-types.h"
    24 #include "telebot-methods.h"
    25 
    26 #endif /* __TELEBOT_H__ */
    27 
    This file contains telegram bot common defintions.
    -
    This file contains types used to create telegram bot.
    -
    This file contains methods used to create telegram bot.
    +Go to the documentation of this file.
    1/*
    +
    2 * telebot
    +
    3 *
    +
    4 * Copyright (c) 2015 Elmurod Talipov.
    +
    5 *
    +
    6 * Licensed under the Apache License, Version 2.0 (the License);
    +
    7 * you may not use this file except in compliance with the License.
    +
    8 * You may obtain a copy of the License at
    +
    9 *
    +
    10 * http://www.apache.org/licenses/LICENSE-2.0
    +
    11 *
    +
    12 * Unless required by applicable law or agreed to in writing, software
    +
    13 * distributed under the License is distributed on an "AS IS" BASIS,
    +
    14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +
    15 * See the License for the specific language governing permissions and
    +
    16 * limitations under the License.
    +
    17 */
    +
    18
    +
    19#ifndef __TELEBOT_H__
    +
    20#define __TELEBOT_H__
    +
    21
    +
    30#include "telebot-common.h"
    +
    31#include "telebot-types.h"
    +
    32#include "telebot-methods.h"
    +
    33#include "telebot-stickers.h"
    +
    34#include "telebot-inline.h"
    +
    35#include "telebot-payments.h"
    +
    36#include "telebot-passport.h"
    +
    37#include "telebot-games.h"
    +
    38#include "telebot-forums.h"
    +
    39
    +
    40#endif /* __TELEBOT_H__ */
    +
    41
    +
    This file contains telegram bot common defintions.
    +
    This file contains forums feature of telegram bot.
    +
    This file contains games feature of telegram bot.
    +
    This file contains inline mode feature of telegram bot.
    +
    This file contains methods used to create telegram bot.
    +
    This file contains Telegram Passport feature of telegram bot.
    +
    This file contains payments feature of telegram bot.
    +
    This file contains stickers feature of telegram bot.
    +
    This file contains types used to create telegram bot.
    diff --git a/docs/modules.html b/docs/topics.html similarity index 57% rename from docs/modules.html rename to docs/topics.html index 4395681..3a299ca 100644 --- a/docs/modules.html +++ b/docs/topics.html @@ -1,11 +1,11 @@ - - + + - - + + -Telebot: Modules +Telebot: Topics @@ -19,10 +19,9 @@
    - - + @@ -31,17 +30,21 @@
    -
    Telebot -  4.7.0 +
    +
    Telebot 9.4
    Library for Telegram bot API
    - +
    @@ -54,28 +57,32 @@
    - +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    -
    -
    Modules
    +
    Topics
    -
    Here is a list of all modules:
    +
    Here is a list of all topics with brief descriptions:
    - +
     Simple Telegram Bot APISimplified APIs to create telegram bot
     Core Telegram Bot APIThe APIs for the telegram bot interface, response is unparsed json sting
     Core Telegram Bot APIThe APIs for the telegram bot interface, response is unparsed json sting
    diff --git a/include/telebot-core.h b/include/telebot-core.h index 0938e87..077bbfa 100644 --- a/include/telebot-core.h +++ b/include/telebot-core.h @@ -21,18 +21,19 @@ #include #include +#include "telebot-common.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /** - * @file telebot-core-api.h + * @file telebot-core.h * @ingroup TELEBOT_CORE_API * @brief This file contains core API for the telegram bot interface * @author Elmurod Talipov - * @date 2020-04-19 - * @version 4.7.0 + * @date 2026-02-28 */ /** @@ -45,21 +46,36 @@ extern "C" { */ /** - * @brief This object represents a core telebot handler. + * @brief Telebot core handler opaque type. */ -typedef struct telebot_core_handler { - char *token; /**< Telegam bot token */ - char *proxy_addr; - char *proxy_auth; -} telebot_core_handler_t; +typedef struct telebot_core_handler *telebot_core_handler_t; /** - * @brief This object represents a telegram bot response. + * @brief Telebot core response opaque type. */ -typedef struct telebot_core_response { - size_t size; /**< Telegam bot response size */ - char *data; /**< Telegam bot response object */ -} telebot_core_response_t; +typedef struct telebot_core_response *telebot_core_response_t; + +/** + * @brief Get response error code. + * @param[in] response Response to get its error code. + * @return on For successful responses TELEBOT_ERROR_NONE is returned, + * otherwise a negative error value @see #telebot_error_e + */ +telebot_error_e telebot_core_get_response_code(telebot_core_response_t response); + +/** + * @brief Get response data. + * @param[in] response Response to get its data. + * @return on For successful responses null terminated string is returned, + * otherwise NULL. + */ +const char *telebot_core_get_response_data(telebot_core_response_t response); + +/** + * @brief Release response data obtained with telebot core methods. + * @param[in] response Response to release. + */ +void telebot_core_put_response(telebot_core_response_t response); /** * @brief Start function to use telebot core APIs. @@ -67,12 +83,12 @@ typedef struct telebot_core_response { * This function must be used first to call, and it creates handler that is used * as input to other functions in telebot core interface. This call MUST have * corresponding call to #telebot_core_destroy when operation is complete. - * @param core_h[in,out] A pointer to a handler, which will be allocated and created. + * @param core_h[out] A pointer to a handler, which will be allocated and created. * Obtained handler MUST be released with #telebot_core_destroy() * @param token[in] Telegram bot token to use. * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. */ -telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char *token); +telebot_error_e telebot_core_create(telebot_core_handler_t *core_h, const char *token); /** * @brief Final function to use telebot core APIs @@ -84,7 +100,7 @@ telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char * @param[in,out] core_h The A pointer to telebot core handler created with #telebot_core_create(). * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. */ -telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h); +telebot_error_e telebot_core_destroy(telebot_core_handler_t *core_h); /** * @brief Set proxy address to use telebot behind proxy @@ -94,7 +110,7 @@ telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h); * @param[in] auth Proxy authorization informatio. * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. */ -telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, const char *addr, +telebot_error_e telebot_core_set_proxy(telebot_core_handler_t core_h, const char *addr, const char *auth); /** @@ -104,7 +120,7 @@ telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, const cha * @param[out] addr Current proxy address or NULL, MUST be freed after use. * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. */ -telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **addr); +telebot_error_e telebot_core_get_proxy(telebot_core_handler_t core_h, char **addr); /** * @brief Receive incoming updates (long polling). It will not work if an outgoing @@ -122,12 +138,13 @@ telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **ad * short polling. * @param[in] allowed_updates List the types of update you want your bot to receive. * Specify an empty list to receive all updates regardless of type (default). - * @param[out] response Response data, MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains updates, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_updates(telebot_core_handler_t *core_h, int offset, - int limit, int timeout, const char *allowed_updates, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_updates(telebot_core_handler_t core_h, + int offset, int limit, int timeout, const char *allowed_updates); /** * @brief Specify a url and receive incoming updates via an outgoing webhook. @@ -145,39 +162,45 @@ telebot_error_e telebot_core_get_updates(telebot_core_handler_t *core_h, int off * @param[in] allowed_updates List the types of updates you want your bot to * receive. For example, specify ["message", "edited_channel_post", * "callback_query"] to only receive updates of these types. - * @param[out] response Response data, MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_webhook(telebot_core_handler_t *core_h, const char *url, - const char *certificate, int max_connections, const char *allowed_updates, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_webhook(telebot_core_handler_t core_h, + const char *url, const char *certificate, int max_connections, + const char *allowed_updates); /** * @brief Remove webhook integration if you decide to switch back to getUpdates. * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[out] response Response data, MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_delete_webhook(telebot_core_handler_t *core_h, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_delete_webhook(telebot_core_handler_t core_h); /** * @brief Get current webhook status. * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[out] response Response data, MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains webhook information, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_webhook_info(telebot_core_handler_t *core_h, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_webhook_info(telebot_core_handler_t core_h); /** * @brief Get basic information about the bot. * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[out] response Response data, MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains bot information, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_me(telebot_core_handler_t *core_h, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_me(telebot_core_handler_t core_h); /** * @brief Send text messages. @@ -193,14 +216,15 @@ telebot_error_e telebot_core_get_me(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom * reply keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_message(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_message(telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, - bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response); + bool disable_web_page_preview, bool disable_notification, + int reply_to_message_id, const char *reply_markup); /** * @brief Forward messages of any kind. @@ -212,13 +236,14 @@ telebot_error_e telebot_core_send_message(telebot_core_handler_t *core_h, * @param[in] disable_notification Sends the message silently. Users will receive a * notification with no sound. * @param[in] message_id Unique message identifier. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_forward_message(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_forward_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, - int message_id, telebot_core_response_t *response); + int message_id); /** * @brief Send photos. @@ -237,14 +262,15 @@ telebot_error_e telebot_core_forward_message(telebot_core_handler_t *core_h, * @param[in] reply_markup Additional interface options. An object for a custom * reply keyboard, instructions to hide keyboard or to force a reply from * the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_photo(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Send audio files. if you want Telegram clients to display them in the @@ -275,15 +301,16 @@ telebot_error_e telebot_core_send_photo(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_audio(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_audio(telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Send general files. @@ -305,15 +332,15 @@ telebot_error_e telebot_core_send_audio(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_document(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_document(telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + int reply_to_message_id, const char *reply_markup); /** * @brief Send video files, Telegram clients support mp4 videos (other formats @@ -340,16 +367,16 @@ telebot_error_e telebot_core_send_document(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_video(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_video(telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + int reply_to_message_id, const char *reply_markup); /** * @brief Send animation files (GIF or H.264/MPEG-4 AVC without sound). @@ -373,15 +400,16 @@ telebot_error_e telebot_core_send_video(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_animation(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_animation(telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Send audio files, if you want Telegram clients to display the file as @@ -401,15 +429,15 @@ telebot_error_e telebot_core_send_animation(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_voice(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_voice(telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + int reply_to_message_id, const char *reply_markup); /** * @brief Send video messages. As of v.4.0, Telegram clients support rounded square @@ -431,14 +459,15 @@ telebot_error_e telebot_core_send_voice(telebot_core_handler_t *core_h, * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_video_note(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_video_note(telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Send a group of photos as an album. @@ -449,17 +478,14 @@ telebot_error_e telebot_core_send_video_note(telebot_core_handler_t *core_h, * @param[in] count Number of photos in the array (2–10). * @param[in] disable_notification Sends the message silently. Users will receive a notification with no sound. * @param[in] reply_to_message_id If the message is a reply, ID of the original message. - * @param[out] response Response data that contains the sent messages on success. It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_media_group( - telebot_core_handler_t *core_h, - long long int chat_id, - char *media_paths[], - int count, - bool disable_notification, - int reply_to_message_id, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_send_media_group(telebot_core_handler_t core_h, + long long int chat_id, char *media_paths[], int count, bool disable_notification, + int reply_to_message_id); /** * @brief Send point on the map. @@ -475,14 +501,14 @@ telebot_error_e telebot_core_send_media_group( * @param[in] reply_to_message_id If the message is a reply, ID of the original message. * @param[in] reply_markup Additional interface options. An object for a custom reply * keyboard, instructions to hide keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_location(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_location(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, int live_period, - bool disable_notification, int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + bool disable_notification, int reply_to_message_id, const char *reply_markup); /** * @brief Edit live location messages sent by the bot or via the bot (for inline @@ -498,14 +524,14 @@ telebot_error_e telebot_core_send_location(telebot_core_handler_t *core_h, * @param[in] latitude Latitude of location. * @param[in] longitude Longitude of location. * @param[in] reply_markup A JSON-serialized object for a new inline keyboard. - * @param[out] response Response data that contains the sent message on success. - * Otherwise, True is returned. It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_edit_message_live_location(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_edit_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, - float latitude, float longitude, const char *reply_markup, - telebot_core_response_t *response); + float latitude, float longitude, const char *reply_markup); /** * @brief Stop updating a live location message sent by the bot or via the bot @@ -518,13 +544,14 @@ telebot_error_e telebot_core_edit_message_live_location(telebot_core_handler_t * * @param[in] inline_message_id Required if chat_id and message_id are not * specified. Identifier of the inline message. * @param[in] reply_markup A JSON-serialized object for a new inline keyboard. - * @param[out] response Response data that contains the sent message on success. - * Otherwise, True is returned. It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_stop_message_live_location(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_stop_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, char *inline_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Send information about a venue. @@ -543,15 +570,15 @@ telebot_error_e telebot_core_stop_message_live_location(telebot_core_handler_t * * @param[in] reply_markup Additional interface options. A JSON-serialized * object for an inline keyboard, custom reply keyboard, instructions to remove * reply keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains sent messageß, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_venue(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_venue(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, - bool disable_notification, int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + bool disable_notification, int reply_to_message_id, const char *reply_markup); /** * @brief Send phone contacts. @@ -568,15 +595,15 @@ telebot_error_e telebot_core_send_venue(telebot_core_handler_t *core_h, * @param[in] reply_markup Additional interface options. A JSON-serialized * object for an inline keyboard, custom reply keyboard, instructions to remove * reply keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_contact(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_contact(telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + int reply_to_message_id, const char *reply_markup); /** * @brief Send a native poll. @@ -600,16 +627,16 @@ telebot_error_e telebot_core_send_contact(telebot_core_handler_t *core_h, * @param[in] reply_markup Additional interface options. A JSON-serialized * object for an inline keyboard, custom reply keyboard, instructions to remove * reply keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_poll(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_poll(telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); + int reply_to_message_id, const char *reply_markup); /** * @brief Send a dice, which will have a random value from 1 to 6. @@ -622,153 +649,157 @@ telebot_error_e telebot_core_send_poll(telebot_core_handler_t *core_h, * @param[in] reply_markup Additional interface options. A JSON-serialized * object for an inline keyboard, custom reply keyboard, instructions to remove * reply keyboard or to force a reply from the user. - * @param[out] response Response data that contains the sent message on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains sent message, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_send_dice(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_send_dice(telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response); - -/** - * @brief Tell the user that something is happening on the bot's side. The status - * is set for 5 seconds or less (when a message arrives from your bot, Telegram - * clients clear its typing status). Example: The ImageBot needs some time to process - * a request and upload the image. Instead of sending a text message along the lines - * of "Retrieving image, please wait…", the bot may use #telebot_core_send_chat_action() - * with action = upload_photo. The user will see a "sending photo" status for the bot. - * It is only recommended to use when a response from the bot will take a noticeable - * amount of time to arrive. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] chat_id Unique identifier for the target chat or username of the - * target channel (in the format \@channelusername) - * @param[in] action Type of action to broadcast. Choose one, depending on what the - * user is about to receive: typing for text messages, upload_photo for photos, - * record_video or upload_video for videos, record_audio or upload_audio for - * audio files, upload_document for general files, find_location for location - * data. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_send_chat_action(telebot_core_handler_t *core_h, - long long int chat_id, const char *action, telebot_core_response_t *response); - -/** - * @brief Get user profile pictures object - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] user_id Unique identifier of the target user. - * @param[in] offset Sequential number of the first photo to be returned. By default, - * all photos are returned. - * @param[in] limit Limits the number of photos to be retrieved. Values between - * 1—100 are accepted. Defaults to 100. - * @param[out] response Response data that contains user's profile photos on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_get_user_profile_photos(telebot_core_handler_t *core_h, - int user_id, int offset, int limit, telebot_core_response_t *response); - -/** - * @brief Get basic info about a file and prepare it for - * downloading. For the moment, bots can download files of up to 20MB in size. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] file_id File identifier to get info about. - * @param[out] response Response data that contains file object on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_get_file(telebot_core_handler_t *core_h, const char *file_id, - telebot_core_response_t *response); - -/** - * @brief Download file using file_path obtained with - * telebot_core_get_file(). 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 telebot_core_get_file() again. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] file_path A file path take from the response of telebot_core_get_file() - * @param[in] out_file Full path to download and save file. - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative - * error value. No response, i.e., core_h->resp_data contains nothing. - */ -telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, + int reply_to_message_id, const char *reply_markup); + +/** +* @brief Tell the user that something is happening on the bot's side. The status +* is set for 5 seconds or less (when a message arrives from your bot, Telegram +* clients clear its typing status). Example: The ImageBot needs some time to process +* a request and upload the image. Instead of sending a text message along the lines +* of "Retrieving image, please wait…", the bot may use #telebot_core_send_chat_action() +* with action = upload_photo. The user will see a "sending photo" status for the bot. +* It is only recommended to use when a response from the bot will take a noticeable +* amount of time to arrive. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] chat_id Unique identifier for the target chat or username of the +* target channel (in the format \@channelusername) +* @param[in] action Type of action to broadcast. Choose one, depending on what the +* user is about to receive: typing for text messages, upload_photo for photos, +* record_video or upload_video for videos, record_audio or upload_audio for +* audio files, upload_document for general files, find_location for location +* data. +* @return #telebot_core_response_t response that contains sent message, +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_send_chat_action(telebot_core_handler_t core_h, + long long int chat_id, const char *action); + +/** +* @brief Get user profile pictures object +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] user_id Unique identifier of the target user. +* @param[in] offset Sequential number of the first photo to be returned. By default, +* all photos are returned. +* @param[in] limit Limits the number of photos to be retrieved. Values between +* 1—100 are accepted. Defaults to 100. +* @return #telebot_core_response_t response that contains user profile photos, +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_get_user_profile_photos(telebot_core_handler_t core_h, + int user_id, int offset, int limit); + +/** +* @brief Get basic info about a file and prepare it for +* downloading. For the moment, bots can download files of up to 20MB in size. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] file_id File identifier to get info about. +* @return #telebot_core_response_t response that contains file object, +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_get_file(telebot_core_handler_t core_h, const char *file_id); + +/** +* @brief Download file using file_path obtained with +* telebot_core_get_file(). 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 telebot_core_get_file() again. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] file_path A file path take from the response of telebot_core_get_file() +* @param[in] out_file Full path to download and save file. +* @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative +* error value. No response, i.e., core_h->resp_data contains nothing. +*/ +telebot_error_e telebot_core_download_file(telebot_core_handler_t core_h, const char *file_path, const char *out_file); /** - * @brief Kick a user from a group, a supergroup or a channel. In the case of - * supergroups and channels, the user will not be able to return to the group on - * their own using invite links, etc., unless unbanned first. The bot must be an - * administrator in the chat for this to work and must have the appropriate admin - * rights. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] chat_id Unique identifier for the target chat or username of the - * target channel (in the format \@channelusername) - * @param[in] user_id Unique identifier of the target user - * @param[in] until_date Date when the user will be unbanned, unix time. If user is - * banned for more than 366 days or less than 30 seconds from the current time - * they are considered to be banned forever. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_kick_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, long until_date, - telebot_core_response_t *response); - -/** - * @brief Unban a previously kicked user in a supergroup or channel. The user will - * not return to the group or channel automatically, but will be able to join via - * link, etc. The bot must be an administrator for this to work. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] chat_id Unique identifier for the target chat or username of the - * target channel (in the format \@channelusername) - * @param[in] user_id Unique identifier of the target user - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_unban_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, telebot_core_response_t *response); - -/** - * @brief Restrict a user in a supergroup. The bot must be an administrator in - * the supergroup for this to work and must have the appropriate admin rights. - * Pass true for all boolean parameters to lift restrictions from a user. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] chat_id Unique identifier for the target chat or username of the - * target channel (in the format \@channelusername) - * @param[in] user_id Unique identifier of the target user. - * @param[in] until_date Date when restrictions will be lifted for the user, unix - * time. If user is restricted for more than 366 days or less than 30 seconds - * from the current time, they are considered to be restricted forever. - * @param[in] can_send_messages Pass true, if the user is allowed to send text - * messages, contacts, locations and venues - * @param[in] can_send_media_messages Pass true, if the user is allowed to send - * audios, documents, photos, videos, video notes and voice notes, - * implies can_send_messages - * @param[in can_send_polls Pass true, if the user is allowed to send polls, - * implies can_send_messages - * @param[in] can_send_other_messages Pass true, if the user can send animations, - * games, stickers and use inline bots, implies can_send_media_messages - * @param[in] can_add_web_page_previews Pass true, if the user may add web page - * previews to their messages, implies can_send_media_messages. - * @param[in] can_change_info Pass true, if the user is allowed to change the - * chat title, photo and other settings. Ignored in public supergroups. - * @param[in] can_invite_users Pass true, if the user is allowed to invite - * new users to the chat. - * @param[in] can_pin_messages Pass true, if the user is allowed to pin messages. - * Ignored in public supergroups - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. - */ -telebot_error_e telebot_core_restrict_chat_member(telebot_core_handler_t *core_h, +* @brief Kick a user from a group, a supergroup or a channel. In the case of +* supergroups and channels, the user will not be able to return to the group on +* their own using invite links, etc., unless unbanned first. The bot must be an +* administrator in the chat for this to work and must have the appropriate admin +* rights. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] chat_id Unique identifier for the target chat or username of the +* target channel (in the format \@channelusername) +* @param[in] user_id Unique identifier of the target user +* @param[in] until_date Date when the user will be unbanned, unix time. If user is +* banned for more than 366 days or less than 30 seconds from the current time +* they are considered to be banned forever. +* @return #telebot_core_response_t response that contains the result (true/false), +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_kick_chat_member(telebot_core_handler_t core_h, + long long int chat_id, int user_id, long until_date); + +/** +* @brief Unban a previously kicked user in a supergroup or channel. The user will +* not return to the group or channel automatically, but will be able to join via +* link, etc. The bot must be an administrator for this to work. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] chat_id Unique identifier for the target chat or username of the +* target channel (in the format \@channelusername) +* @param[in] user_id Unique identifier of the target user +* @return #telebot_core_response_t response that contains the result (true/false), +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_unban_chat_member(telebot_core_handler_t core_h, + long long int chat_id, int user_id); + +/** +* @brief Restrict a user in a supergroup. The bot must be an administrator in +* the supergroup for this to work and must have the appropriate admin rights. +* Pass true for all boolean parameters to lift restrictions from a user. +* @param[in] core_h The telebot core handler created with #telebot_core_create(). +* @param[in] chat_id Unique identifier for the target chat or username of the +* target channel (in the format \@channelusername) +* @param[in] user_id Unique identifier of the target user. +* @param[in] until_date Date when restrictions will be lifted for the user, unix +* time. If user is restricted for more than 366 days or less than 30 seconds +* from the current time, they are considered to be restricted forever. +* @param[in] can_send_messages Pass true, if the user is allowed to send text +* messages, contacts, locations and venues +* @param[in] can_send_media_messages Pass true, if the user is allowed to send +* audios, documents, photos, videos, video notes and voice notes, +* implies can_send_messages +* @param[in can_send_polls Pass true, if the user is allowed to send polls, +* implies can_send_messages +* @param[in] can_send_other_messages Pass true, if the user can send animations, +* games, stickers and use inline bots, implies can_send_media_messages +* @param[in] can_add_web_page_previews Pass true, if the user may add web page +* previews to their messages, implies can_send_media_messages. +* @param[in] can_change_info Pass true, if the user is allowed to change the +* chat title, photo and other settings. Ignored in public supergroups. +* @param[in] can_invite_users Pass true, if the user is allowed to invite +* new users to the chat. +* @param[in] can_pin_messages Pass true, if the user is allowed to pin messages. +* Ignored in public supergroups +* @return #telebot_core_response_t response that contains the result (true/false), +* which MUST be released with #telebot_core_put_response(), or null if allocation fails. +* Response code should be checked with #teleobot_core_get_response_code(), +* before getting data with #telebot_core_get_response_data(). +*/ +telebot_core_response_t telebot_core_restrict_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, - bool can_pin_messages, telebot_core_response_t *response); + bool can_pin_messages); /** * @brief Promote or demote a user in a supergroup or a channel. The bot must be @@ -796,15 +827,15 @@ telebot_error_e telebot_core_restrict_chat_member(telebot_core_handler_t *core_h * administrators with a subset of his own privileges or demote administrators * that he has promoted, directly or indirectly (promoted by administrators * that were appointed by him). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_promote_chat_member(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_promote_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, - bool can_restrict_members, bool can_pin_messages, bool can_promote_members, - telebot_core_response_t *response); + bool can_restrict_members, bool can_pin_messages, bool can_promote_members); /** * @brief Export an invite link to a supergroup or a channel. The bot must be @@ -816,13 +847,13 @@ telebot_error_e telebot_core_promote_chat_member(telebot_core_handler_t *core_h, * @param[in] user_id Unique identifier of the target user. * @param[in] custom_title New custom title for the administrator; 0-16 characters, * emoji are not allowed. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_admin_custom_title(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, const char *custom_title, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_chat_admin_custom_title(telebot_core_handler_t core_h, + long long int chat_id, int user_id, const char *custom_title); /** * @brief Set default chat permissions for all members. The bot must be an administrator @@ -848,15 +879,15 @@ telebot_error_e telebot_core_set_chat_admin_custom_title(telebot_core_handler_t * new users to the chat. * @param[in] can_pin_messages Pass true, if the user is allowed to pin messages. * Ignored in public supergroups - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_permissions(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_set_chat_permissions(telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, - bool can_change_info, bool can_invite_users, bool can_pin_messages, - telebot_core_response_t *response); + bool can_change_info, bool can_invite_users, bool can_pin_messages); /** * @brief Generate a new invite link for a chat; any previously generated link is @@ -865,12 +896,13 @@ telebot_error_e telebot_core_set_chat_permissions(telebot_core_handler_t *core_h * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains the new invite link on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains new invite link, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_export_chat_invite_link(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_export_chat_invite_link(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Set a new profile photo for the chat. Photos can't be changed for private @@ -880,12 +912,13 @@ telebot_error_e telebot_core_export_chat_invite_link(telebot_core_handler_t *cor * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). * @param[in] photo New chat photo file path. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_photo(telebot_core_handler_t *core_h, - long long int chat_id, const char *photo, telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_chat_photo(telebot_core_handler_t core_h, + long long int chat_id, const char *photo); /** * @brief Delete a chat photo. Photos can't be changed for private chats. The bot @@ -894,12 +927,13 @@ telebot_error_e telebot_core_set_chat_photo(telebot_core_handler_t *core_h, * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_delete_chat_photo(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_delete_chat_photo(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Change the title of a chat. Titles can't be @@ -909,12 +943,13 @@ telebot_error_e telebot_core_delete_chat_photo(telebot_core_handler_t *core_h, * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). * @param[in] title New chat title, 1-255 characters. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_title(telebot_core_handler_t *core_h, - long long int chat_id, const char *title, telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_chat_title(telebot_core_handler_t core_h, + long long int chat_id, const char *title); /** * @brief Change the description of a supergroup or a channel. The bot must be @@ -924,13 +959,13 @@ telebot_error_e telebot_core_set_chat_title(telebot_core_handler_t *core_h, * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). * @param[in] description New chat description, 0-255 characters. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_description(telebot_core_handler_t *core_h, - long long int chat_id, const char *description, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_chat_description(telebot_core_handler_t core_h, + long long int chat_id, const char *description); /** * @brief Pin a message in a supergroup or a channel. The bot must be an administrator @@ -943,13 +978,13 @@ telebot_error_e telebot_core_set_chat_description(telebot_core_handler_t *core_h * @param[in] disable_notification Pass True, if it is not necessary to send * a notification to all chat members about the new pinned message. * Notifications are always disabled in channels. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_pin_chat_message(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, bool disable_notification, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_pin_chat_message(telebot_core_handler_t core_h, + long long int chat_id, int message_id, bool disable_notification); /** * @brief Unpin a message in a supergroup or a channel. The bot must be an administrator @@ -958,24 +993,25 @@ telebot_error_e telebot_core_pin_chat_message(telebot_core_handler_t *core_h, * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_unpin_chat_message(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_unpin_chat_message(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Leave a group, supergroup or channel. * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_leave_chat(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_leave_chat(telebot_core_handler_t core_h, long long int chat_id); /** * @brief Get up to date information about the chat (current name of the user for @@ -983,12 +1019,13 @@ telebot_error_e telebot_core_leave_chat(telebot_core_handler_t *core_h, * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains a Chat object on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains chat object, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_chat(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_chat(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Get a list of administrators in a chat. Response contains an array of @@ -998,24 +1035,26 @@ telebot_error_e telebot_core_get_chat(telebot_core_handler_t *core_h, * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains a array of chat members on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains an array of chat members, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_chat_admins(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_chat_admins(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Get the number of members in a chat. * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains number of chat members on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the number of chat members, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_chat_members_count(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_chat_members_count(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Get information about a member of a chat. @@ -1023,12 +1062,13 @@ telebot_error_e telebot_core_get_chat_members_count(telebot_core_handler_t *core * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). * @param[in] user_id Unique identifier of the target user. - * @param[out] response Response data that contains a chat member on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains a chat member, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_chat_member(telebot_core_handler_t core_h, + long long int chat_id, int user_id); /** * @brief Set a new group sticker set for a supergroup. The bot must be an administrator @@ -1040,13 +1080,13 @@ telebot_error_e telebot_core_get_chat_member(telebot_core_handler_t *core_h, * target channel (in the format \@channelusername). * @param[in] sticker_set_name Name of the sticker set to be set as the group * sticker set. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_chat_sticker_set(telebot_core_handler_t *core_h, - long long int chat_id, const char *sticker_set_name, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_chat_sticker_set(telebot_core_handler_t core_h, + long long int chat_id, const char *sticker_set_name); /** * @brief Delete a group sticker set from a supergroup. The bot must be an administrator @@ -1056,12 +1096,13 @@ telebot_error_e telebot_core_set_chat_sticker_set(telebot_core_handler_t *core_h * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] chat_id Unique identifier for the target chat or username of the * target channel (in the format \@channelusername). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_delete_chat_sticker_set(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_delete_chat_sticker_set(telebot_core_handler_t core_h, + long long int chat_id); /** * @brief Send answers to callback queries sent from inline keyboards. @@ -1080,35 +1121,37 @@ telebot_error_e telebot_core_delete_chat_sticker_set(telebot_core_handler_t *cor * @param[in] cache_time The maximum amount of time in seconds that the result of * the callback query may be cached client-side. Telegram apps will support * caching starting in version 3.14. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_answer_callback_query(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_answer_callback_query(telebot_core_handler_t core_h, const char *callback_query_id, const char *text, bool show_alert, - const char *url, int cache_time, telebot_core_response_t *response); + const char *url, int cache_time); /** * @brief Change the list of the bot's commands. * @param[in] core_h The telebot core handler created with #telebot_core_create(). * @param[in] commands A JSON-serialized list of bot commands to be set as the * list of the bot's commands. At most 100 commands can be specified. - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_set_my_commands(telebot_core_handler_t *core_h, - const char *commands, telebot_core_response_t *response); +telebot_core_response_t telebot_core_set_my_commands(telebot_core_handler_t core_h, + const char *commands); /** * @brief Get the current list of the bot's commands.. * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[out] response Response data that contains "True" on success. - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains an array of bot commands, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_get_my_commands(telebot_core_handler_t *core_h, - telebot_core_response_t *response); +telebot_core_response_t telebot_core_get_my_commands(telebot_core_handler_t core_h); /** * @brief Edit text and game messages sent by the bot or via the bot (for inline bots). @@ -1124,14 +1167,15 @@ telebot_error_e telebot_core_get_my_commands(telebot_core_handler_t *core_h, * bold, italic, fixed-width text or inline URLs in your bot's message. * @param[in] disable_web_page_priview Disables link previews for links in this message. * @param[in] reply_markup A JSON-serialized object for an inline keyboard. - * @param[out] response Response data that contains the message sent on succes, - * otherwise "True". It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the message edited, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_edit_message_text(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_edit_message_text(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, - const char *reply_markup, telebot_core_response_t *response); + const char *reply_markup); /** * @brief Edit captions of messages sent by the bot or via the bot (for inline bots). @@ -1144,14 +1188,14 @@ telebot_error_e telebot_core_edit_message_text(telebot_core_handler_t *core_h, * specified. Identifier of the inline message. * @param[in] caption New caption of the message. * @param[in] reply_markup A JSON-serialized object for an inline keyboard. - * @param[out] response Response data that contains the message sent on succes, - * otherwise "True". It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the message edited, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ -telebot_error_e telebot_core_edit_message_caption(telebot_core_handler_t *core_h, +telebot_core_response_t telebot_core_edit_message_caption(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, - const char *caption, const char *parse_mode, const char *reply_markup, - telebot_core_response_t *response); + const char *caption, const char *parse_mode, const char *reply_markup); /** * @brief Edit only the reply markup of messages sent by the bot or via the @@ -1164,14 +1208,30 @@ telebot_error_e telebot_core_edit_message_caption(telebot_core_handler_t *core_h * @param[in] inline_message_id Required if chat_id and message_id are not * specified. Identifier of the inline message. * @param[in] reply_markup A JSON-serialized object for an inline keyboard. - * @param[out] response Response data that contains the message sent on succes, - * otherwise "True". It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the message edited, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ +telebot_core_response_t telebot_core_edit_message_reply_markup(telebot_core_handler_t core_h, + long long int chat_id, int message_id, const char *inline_message_id, + const char *reply_markup); -telebot_error_e telebot_core_edit_message_reply_markup(telebot_core_handler_t *core_h, +/** + * @brief Use this method to edit animation, audio, document, photo, or video + * messages. If a message is part of a message album, then it can be edited + * only to an audio of the same type and with the same caption. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Required if inline_message_id is not specified. + * @param[in] message_id Required if inline_message_id is not specified. + * @param[in] inline_message_id Required if chat_id and message_id are not specified. + * @param[in] media A JSON-serialized object for a new media content of the message. + * @param[in] reply_markup A JSON-serialized object for a new inline keyboard. + * @return #telebot_core_response_t response that contains the edited message. + */ +telebot_core_response_t telebot_core_edit_message_media(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, - const char *reply_markup, telebot_core_response_t *response); + const char *media, const char *reply_markup); /** * @brief Stop a poll which was sent by the bot. @@ -1183,42 +1243,757 @@ telebot_error_e telebot_core_edit_message_reply_markup(telebot_core_handler_t *c * @param[in] inline_message_id Required if chat_id and message_id are not * specified. Identifier of the inline message. * @param[in] reply_markup A JSON-serialized object for an inline keyboard. - * @param[out] response Response data that contains the message sent on succes, - * otherwise "True". It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * @return #telebot_core_response_t response that contains the stopped poll, + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). */ - -telebot_error_e telebot_core_stop_poll(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *reply_markup, - telebot_core_response_t *response); - +telebot_core_response_t telebot_core_stop_poll(telebot_core_handler_t core_h, + long long int chat_id, int message_id, const char *reply_markup); /** * @brief Delete a message, including service messages, with the following limitations: - * - A message can only be deleted if it was sent less than 48 hours ago. - * - Bots can delete outgoing messages in groups and supergroups. - * - Bots granted can_post_messages permissions can delete outgoing messages - * in channels. - * - If the bot is an administrator of a group, it can delete any message there. - * - If the bot has can_delete_messages permission in a supergroup or a channel, - * it can delete any message there. - * @param[in] core_h The telebot core handler created with #telebot_core_create(). - * @param[in] chat_id Unique identifier for the target chat or username of the - * target message_id Message identifier to be deleted. - * @param[out] response Response data that contains "True" on succes, - * It MUST be freed with #telebot_core_put_response(). - * @return on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value. + * - A message can only be deleted if it was sent less than 48 hours ago. + * - Bots can delete outgoing messages in groups and supergroups. + * - Bots granted can_post_messages permissions can delete outgoing messages + * in channels. + * - If the bot is an administrator of a group, it can delete any message there. + * - If the bot has can_delete_messages permission in a supergroup or a channel, + * it can delete any message there. + * @param[in] core_h The telebot core handler created with #telebot_core_create(). + * @param[in] chat_id Unique identifier for the target chat or username of the + * target message_id Message identifier to be deleted. + * @return #telebot_core_response_t response that contains the result (true/false), + * which MUST be released with #telebot_core_put_response(), or null if allocation fails. + * Response code should be checked with #teleobot_core_get_response_code(), + * before getting data with #telebot_core_get_response_data(). + */ +telebot_core_response_t telebot_core_delete_message(telebot_core_handler_t core_h, + long long int chat_id, int message_id); + +/** + * @brief Use this method to log out from the cloud Bot API server before + * launching the bot locally. + * @param[in] core_h The telebot core handler. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_log_out(telebot_core_handler_t core_h); + +/** + * @brief Use this method to close the bot instance before moving it from one + * local server to another. + * @param[in] core_h The telebot core handler. + * @return #telebot_core_response_t response that contains the result (true/false). */ -telebot_error_e telebot_core_delete_message(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, telebot_core_response_t *response); +telebot_core_response_t telebot_core_close(telebot_core_handler_t core_h); +/** + * @brief Use this method to change the bot's name. + * @param[in] core_h The telebot core handler. + * @param[in] name New bot name; 0-64 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_my_name(telebot_core_handler_t core_h, + const char *name, const char *language_code); /** - * @brief Release response data obtained with telebot core methods. - * @param[in] response Pointer to response to release. + * @brief Use this method to get the current bot name for the given user language. + * @param[in] core_h The telebot core handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains BotName. + */ +telebot_core_response_t telebot_core_get_my_name(telebot_core_handler_t core_h, + const char *language_code); + +/** + * @brief Use this method to change the bot's description. + * @param[in] core_h The telebot core handler. + * @param[in] description New bot description; 0-512 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_my_description(telebot_core_handler_t core_h, + const char *description, const char *language_code); + +/** + * @brief Use this method to get the current bot description for the given user language. + * @param[in] core_h The telebot core handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains BotDescription. + */ +telebot_core_response_t telebot_core_get_my_description(telebot_core_handler_t core_h, + const char *language_code); + +/** + * @brief Use this method to change the bot's short description. + * @param[in] core_h The telebot core handler. + * @param[in] short_description New short description; 0-120 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_my_short_description(telebot_core_handler_t core_h, + const char *short_description, const char *language_code); + +/** + * @brief Use this method to get the current bot short description for the given user language. + * @param[in] core_h The telebot core handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains BotShortDescription. + */ +telebot_core_response_t telebot_core_get_my_short_description(telebot_core_handler_t core_h, + const char *language_code); + +/** + * @brief Use this method to change the bot's menu button in a private chat, or the default menu button. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target private chat. + * @param[in] menu_button A JSON-serialized object for the bot's new menu button. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_chat_menu_button(telebot_core_handler_t core_h, + long long int chat_id, const char *menu_button); + +/** + * @brief Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target private chat. + * @return #telebot_core_response_t response that contains MenuButton. + */ +telebot_core_response_t telebot_core_get_chat_menu_button(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. + * @param[in] core_h The telebot core handler. + * @param[in] rights A JSON-serialized object describing new default administrator rights. + * @param[in] for_channels Pass True to change the default administrator rights of the bot in channels. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_my_default_administrator_rights(telebot_core_handler_t core_h, + const char *rights, bool for_channels); + +/** + * @brief Use this method to get the current default administrator rights of the bot. + * @param[in] core_h The telebot core handler. + * @param[in] for_channels Pass True to get default administrator rights of the bot in channels. + * @return #telebot_core_response_t response that contains ChatAdministratorRights. + */ +telebot_core_response_t telebot_core_get_my_default_administrator_rights(telebot_core_handler_t core_h, + bool for_channels); + +/** + * @brief Use this method to delete the list of the bot's commands for the given scope and user language. + * @param[in] core_h The telebot core handler. + * @param[in] scope A JSON-serialized object, describing scope of users for which the commands are relevant. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_delete_my_commands(telebot_core_handler_t core_h, + const char *scope, const char *language_code); + +/** + * @brief Use this method to copy messages of any kind. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original message was sent. + * @param[in] message_id Message identifier in the chat specified by from_chat_id. + * @param[in] caption New caption for media, 0-1024 characters after entities parsing. + * @param[in] parse_mode Mode for parsing entities in the new caption. + * @param[in] caption_entities A JSON-serialized list of special entities that appear in the new caption. + * @param[in] disable_notification Sends the message silently. + * @param[in] protect_content Protects the contents of the sent message from forwarding and saving. + * @param[in] reply_to_message_id If the message is a reply, ID of the original message. + * @param[in] allow_sending_without_reply Pass True if the message should be sent even if the specified replied-to message is not found. + * @param[in] reply_markup Additional interface options. + * @return #telebot_core_response_t response that contains MessageId. + */ +telebot_core_response_t telebot_core_copy_message(telebot_core_handler_t core_h, + long long int chat_id, long long int from_chat_id, int message_id, + const char *caption, const char *parse_mode, const char *caption_entities, + bool disable_notification, bool protect_content, int reply_to_message_id, + bool allow_sending_without_reply, const char *reply_markup); + +/** + * @brief Use this method to copy messages of any kind. Service messages, + * giveaway messages, giveaway winners messages, and invoice messages can't + * be copied. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original messages were sent. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. + * @param[in] disable_notification Sends the messages silently. + * @param[in] protect_content Protects the contents of the sent messages from forwarding and saving. + * @param[in] remove_caption Pass True to copy the messages without their captions. + * @return #telebot_core_response_t response that contains an array of MessageId. + */ +telebot_core_response_t telebot_core_copy_messages(telebot_core_handler_t core_h, + long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content, bool remove_caption); + +/** + * @brief Use this method to forward multiple messages of any kind. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original messages were sent. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. + * @param[in] disable_notification Sends the messages silently. + * @param[in] protect_content Protects the contents of the sent messages from forwarding and saving. + * @return #telebot_core_response_t response that contains an array of MessageId. + */ +telebot_core_response_t telebot_core_forward_messages(telebot_core_handler_t core_h, + long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content); + +/** + * @brief Use this method to delete multiple messages in a chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages to delete. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_delete_messages(telebot_core_handler_t core_h, + long long int chat_id, const char *message_ids); + +/** + * @brief Use this method to ban a user in a group, a supergroup or a channel. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @param[in] until_date Date when the user will be unbanned, unix time. + * @param[in] revoke_messages Pass True to delete all messages from the chat for the user that is being banned. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_ban_chat_member(telebot_core_handler_t core_h, + long long int chat_id, int user_id, long until_date, bool revoke_messages); + +/** + * @brief Use this method to ban a channel chat in a supergroup or a channel. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] sender_chat_id Unique identifier of the target sender chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_ban_chat_sender_chat(telebot_core_handler_t core_h, + long long int chat_id, long long int sender_chat_id); + +/** + * @brief Use this method to unban a previously banned channel chat in a supergroup or a channel. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] sender_chat_id Unique identifier of the target sender chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_unban_chat_sender_chat(telebot_core_handler_t core_h, + long long int chat_id, long long int sender_chat_id); + +/** + * @brief Use this method to create an additional invite link for a chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name Invite link name; 0-32 characters. + * @param[in] expire_date Point in time (Unix timestamp) when the link will expire. + * @param[in] member_limit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. + * @param[in] creates_join_request True, if users joining the chat via the link need to be approved by chat administrators. + * @return #telebot_core_response_t response that contains ChatInviteLink. + */ +telebot_core_response_t telebot_core_create_chat_invite_link(telebot_core_handler_t core_h, + long long int chat_id, const char *name, long expire_date, int member_limit, + bool creates_join_request); + +/** + * @brief Use this method to edit a non-primary invite link created by the bot. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] invite_link The invite link to edit. + * @param[in] name Invite link name; 0-32 characters. + * @param[in] expire_date Point in time (Unix timestamp) when the link will expire. + * @param[in] member_limit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. + * @param[in] creates_join_request True, if users joining the chat via the link need to be approved by chat administrators. + * @return #telebot_core_response_t response that contains ChatInviteLink. + */ +telebot_core_response_t telebot_core_edit_chat_invite_link(telebot_core_handler_t core_h, + long long int chat_id, const char *invite_link, const char *name, + long expire_date, int member_limit, bool creates_join_request); + +/** + * @brief Use this method to revoke an invite link created by the bot. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] invite_link The invite link to revoke. + * @return #telebot_core_response_t response that contains ChatInviteLink. + */ +telebot_core_response_t telebot_core_revoke_chat_invite_link(telebot_core_handler_t core_h, + long long int chat_id, const char *invite_link); + +/** + * @brief Use this method to approve a chat join request. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_approve_chat_join_request(telebot_core_handler_t core_h, + long long int chat_id, int user_id); + +/** + * @brief Use this method to decline a chat join request. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_decline_chat_join_request(telebot_core_handler_t core_h, + long long int chat_id, int user_id); + +/** + * @brief Use this method to set a new message reaction. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_id Unique identifier of the target message. + * @param[in] reaction A JSON-serialized list of reaction types to set on the message. + * @param[in] is_big Pass True to set the reaction with a big animation. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_set_message_reaction(telebot_core_handler_t core_h, + long long int chat_id, int message_id, const char *reaction, bool is_big); + +/** + * @brief Use this method to create a topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name Topic name, 1-128 characters. + * @param[in] icon_color Color of the topic icon in RGB format. + * @param[in] icon_custom_emoji_id Unique identifier of the custom emoji used as the topic icon. + * @return #telebot_core_response_t response that contains ForumTopic. + */ +telebot_core_response_t telebot_core_create_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id); + +/** + * @brief Use this method to edit name and icon of a topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @param[in] name New topic name, 0-128 characters. + * @param[in] icon_custom_emoji_id New unique identifier of the custom emoji used as the topic icon. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_edit_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id); + +/** + * @brief Use this method to close an open topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_close_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to reopen a closed topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_reopen_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to delete a forum topic along with all its messages in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_delete_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to unpin all messages in a forum topic. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_unpin_all_forum_topic_messages(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. + * @param[in] core_h The telebot core handler. + * @return #telebot_core_response_t response that contains an array of Sticker objects. + */ +telebot_core_response_t telebot_core_get_forum_topic_icon_stickers(telebot_core_handler_t core_h); + +/** + * @brief Use this method to edit the name of the 'General' topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name New topic name, 1-128 characters. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_edit_general_forum_topic(telebot_core_handler_t core_h, + long long int chat_id, const char *name); + +/** + * @brief Use this method to close an open 'General' topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_close_general_forum_topic(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to reopen a closed 'General' topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_reopen_general_forum_topic(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to hide the 'General' topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_hide_general_forum_topic(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to unhide the 'General' topic in a forum supergroup chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_unhide_general_forum_topic(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to unpin all messages in a General forum topic. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return #telebot_core_response_t response that contains the result (true/false). + */ +telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages(telebot_core_handler_t core_h, + long long int chat_id); + +/** + * @brief Use this method to get information about custom emoji stickers by their identifiers. + * @param[in] core_h The telebot core handler. + * @param[in] custom_emoji_ids List of custom emoji identifiers. + * @return #telebot_core_response_t response that contains an array of Sticker objects. + */ +telebot_core_response_t telebot_core_get_custom_emoji_stickers(telebot_core_handler_t core_h, + const char *custom_emoji_ids); + +/** + * @brief Use this method to send answers to an inline query to a user from a Web App. + * @param[in] core_h The telebot core handler. + * @param[in] web_app_query_id Unique identifier for the query to be answered. + * @param[in] result A JSON-serialized object describing the message to be sent. + * @return #telebot_core_response_t response that contains SentWebAppMessage. + */ +telebot_core_response_t telebot_core_answer_web_app_query(telebot_core_handler_t core_h, + const char *web_app_query_id, const char *result); + +/** + * @brief Use this method to send paid media to a user. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] star_count The number of Telegram Stars that must be paid. + * @param[in] media A JSON-serialized array of InputPaidMedia objects. + * @param[in] caption Media caption. + * @param[in] parse_mode Mode for parsing entities in the caption. + * @param[in] caption_entities A JSON-serialized list of special entities. + * @param[in] show_caption_above_media Pass True, if the caption must be shown above the message media. + * @param[in] disable_notification Sends the message silently. + * @param[in] protect_content Protects the contents of the sent message. + * @param[in] reply_parameters Description of the message to reply to. + * @param[in] reply_markup Additional interface options. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_send_paid_media(telebot_core_handler_t core_h, + long long int chat_id, int star_count, const char *media, const char *caption, + const char *parse_mode, const char *caption_entities, bool show_caption_above_media, + bool disable_notification, bool protect_content, const char *reply_parameters, + const char *reply_markup); + +/** + * @brief Use this method to send answers to an inline query. + * @param[in] core_h The telebot core handler. + * @param[in] inline_query_id Unique identifier for the answered query. + * @param[in] results A JSON-serialized array of results for the inline query. + * @param[in] cache_time The maximum amount of time in seconds that the result + * of the inline query may be cached on the server. + * @param[in] is_personal Pass True, if results may be cached only for the user + * that sent the query. + * @param[in] next_offset Pass the offset that a client should send in the next + * query with the same text to receive more results. + * @param[in] button A JSON-serialized object describing a button to be shown + * above inline query results. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_answer_inline_query(telebot_core_handler_t core_h, + const char *inline_query_id, const char *results, int cache_time, + bool is_personal, const char *next_offset, const char *button); + +/** + * @brief Use this method to save a prepared inline message. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] result A JSON-serialized object describing the message to be sent. + * @param[in] allow_user_chats Pass True, if the message can be sent to user chats. + * @param[in] allow_bot_chats Pass True, if the message can be sent to bot chats. + * @param[in] allow_group_chats Pass True, if the message can be sent to group chats. + * @param[in] allow_channel_chats Pass True, if the message can be sent to channel chats. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_save_prepared_inline_message(telebot_core_handler_t core_h, + long long int user_id, const char *result, bool allow_user_chats, + bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats); + +/** + * @brief Use this method to send a gift. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] gift_id Identifier of the gift. + * @param[in] pay_for_upgrade Pass True to pay for the gift upgrade. + * @param[in] text Text that will be shown along with the gift. + * @param[in] text_parse_mode Mode for parsing entities in the text. + * @param[in] text_entities A JSON-serialized list of special entities. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_send_gift(telebot_core_handler_t core_h, + long long int user_id, long long int chat_id, const char *gift_id, + bool pay_for_upgrade, const char *text, const char *text_parse_mode, + const char *text_entities); + +/** + * @brief Use this method to gift a Telegram Premium subscription to a user. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] month_count Number of months the Telegram Premium subscription will be active. + * @param[in] star_count Number of Telegram Stars to pay. + * @param[in] text Text that will be shown along with the service message. + * @param[in] text_parse_mode Mode for parsing entities in the text. + * @param[in] text_entities A JSON-serialized list of special entities. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_gift_premium_subscription(telebot_core_handler_t core_h, + long long int user_id, int month_count, int star_count, const char *text, + const char *text_parse_mode, const char *text_entities); + +/** + * @brief Use this method to get the current Telegram Stars balance of the bot. + * @param[in] core_h The telebot core handler. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_my_star_balance(telebot_core_handler_t core_h); + +/** + * @brief Use this method to get the bot's Telegram Star transactions. + * @param[in] core_h The telebot core handler. + * @param[in] offset Number of transactions to skip. + * @param[in] limit Maximum number of transactions to be retrieved. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_star_transactions(telebot_core_handler_t core_h, + int offset, int limit); + +/** + * @brief Use this method to refund a successful payment in Telegram Stars. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Identifier of the user whose payment will be refunded. + * @param[in] telegram_payment_charge_id Telegram payment identifier. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_refund_star_payment(telebot_core_handler_t core_h, + long long int user_id, const char *telegram_payment_charge_id); + +/** + * @brief Use this method to get a list of gifts that can be sent by the bot to users. + * @param[in] core_h The telebot core handler. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_available_gifts(telebot_core_handler_t core_h); + +/** + * @brief Use this method to get a list of gifts received by a user. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] offset Number of gifts to skip. + * @param[in] limit Maximum number of gifts to be retrieved. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_user_gifts(telebot_core_handler_t core_h, + long long int user_id, int offset, int limit); + +/** + * @brief Use this method to get a list of gifts received by a chat. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier of the target chat. + * @param[in] offset Number of gifts to skip. + * @param[in] limit Maximum number of gifts to be retrieved. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_chat_gifts(telebot_core_handler_t core_h, + long long int chat_id, int offset, int limit); + +/** + * @brief Use this method to upgrade a gift. + * @param[in] core_h The telebot core handler. + * @param[in] gift_id Identifier of the gift. + * @param[in] pay_for_upgrade Pass True to pay for the gift upgrade. + * @param[in] text Text that will be shown along with the gift. + * @param[in] text_parse_mode Mode for parsing entities in the text. + * @param[in] text_entities A JSON-serialized list of special entities. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_upgrade_gift(telebot_core_handler_t core_h, + const char *gift_id, bool pay_for_upgrade, const char *text, + const char *text_parse_mode, const char *text_entities); + +/** + * @brief Use this method to transfer a gift. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] gift_id Identifier of the gift. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_transfer_gift(telebot_core_handler_t core_h, + long long int user_id, long long int chat_id, const char *gift_id); + +/** + * @brief Use this method to convert a gift to Telegram Stars. + * @param[in] core_h The telebot core handler. + * @param[in] gift_id Identifier of the gift. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_convert_gift_to_stars(telebot_core_handler_t core_h, + const char *gift_id); + +/** + * @brief Use this method to get user profile audios. + * @param[in] core_h The telebot core handler. + * @param[in] user_id Unique identifier of the target user. + * @param[in] offset Number of audios to skip. + * @param[in] limit Maximum number of audios to be retrieved. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_user_profile_audios(telebot_core_handler_t core_h, + long long int user_id, int offset, int limit); + +/** + * @brief Use this method to set the bot's profile photo. + * @param[in] core_h The telebot core handler. + * @param[in] photo Path to the new profile photo. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_set_my_profile_photo(telebot_core_handler_t core_h, + const char *photo); + +/** + * @brief Use this method to remove the bot's profile photo. + * @param[in] core_h The telebot core handler. + * @param[in] photo_id Identifier of the photo to remove. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_remove_my_profile_photo(telebot_core_handler_t core_h, + const char *photo_id); + +/** + * @brief Use this method to get information about the business connection. + * @param[in] core_h The telebot core handler. + * @param[in] business_connection_id Unique identifier of the business connection. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_business_connection(telebot_core_handler_t core_h, + const char *business_connection_id); + +/** + * @brief Use this method to get user chat boosts. + * @param[in] core_h The telebot core handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @return #telebot_core_response_t response. + */ +telebot_core_response_t telebot_core_get_user_chat_boosts(telebot_core_handler_t core_h, + long long int chat_id, long long int user_id); + +/** + * @brief Use this method to set the score of the specified user in a game. + */ +telebot_core_response_t telebot_core_set_game_score(telebot_core_handler_t core_h, + long long int user_id, int score, bool force, bool disable_edit_message, + long long int chat_id, int message_id, const char *inline_message_id); + +/** + * @brief Use this method to get data for high score tables. + */ +telebot_core_response_t telebot_core_get_game_high_scores(telebot_core_handler_t core_h, + long long int user_id, long long int chat_id, int message_id, const char *inline_message_id); + +/** + * @brief Use this method to send a game. + */ +telebot_core_response_t telebot_core_send_game(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id, const char *game_short_name, + bool disable_notification, bool protect_content, const char *reply_parameters, + const char *reply_markup); + +/** + * @brief Use this method to set passport data errors. + */ +telebot_core_response_t telebot_core_set_passport_data_errors(telebot_core_handler_t core_h, + long long int user_id, const char *errors); + +/** + * @brief Use this method to send an invoice. + */ +telebot_core_response_t telebot_core_send_invoice(telebot_core_handler_t core_h, + long long int chat_id, int message_thread_id, const char *title, + const char *description, const char *payload, const char *provider_token, + const char *currency, const char *prices, int max_tip_amount, + const char *suggested_tip_amounts, const char *start_parameter, + const char *provider_data, const char *photo_url, int photo_size, + int photo_width, int photo_height, bool need_name, bool need_phone_number, + bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, + bool send_email_to_provider, bool is_flexible, bool disable_notification, + bool protect_content, const char *reply_parameters, const char *reply_markup); + +/** + * @brief Use this method to create a link for an invoice. + */ +telebot_core_response_t telebot_core_create_invoice_link(telebot_core_handler_t core_h, + const char *title, const char *description, const char *payload, + const char *provider_token, const char *currency, const char *prices, + int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, + const char *photo_url, int photo_size, int photo_width, int photo_height, + bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, + bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible); + +/** + * @brief Use this method to reply to shipping queries. + */ +telebot_core_response_t telebot_core_answer_shipping_query(telebot_core_handler_t core_h, + const char *shipping_query_id, bool ok, const char *shipping_options, + const char *error_message); + +/** + * @brief Use this method to respond to pre-checkout queries. */ -void telebot_core_put_response(telebot_core_response_t *response); +telebot_core_response_t telebot_core_answer_pre_checkout_query(telebot_core_handler_t core_h, + const char *pre_checkout_query_id, bool ok, const char *error_message); /** * @} // end of APIs diff --git a/include/telebot-forums.h b/include/telebot-forums.h new file mode 100644 index 0000000..6e5d066 --- /dev/null +++ b/include/telebot-forums.h @@ -0,0 +1,201 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TELEBOT_FORUMS_H__ +#define __TELEBOT_FORUMS_H__ + +#include +#include "telebot-types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file telebot-forums.h + * @ingroup TELEBOT_API + * @brief This file contains forums feature of telegram bot + * @author Elmurod Talipov + * @date 2026-02-27 + */ + +/** + * @addtogroup TELEBOT_API + * @{ + */ + +/** + * @brief Use this method to create a topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name Topic name, 1-128 characters. + * @param[in] icon_color Color of the topic icon in RGB format. + * @param[in] icon_custom_emoji_id Unique identifier of the custom emoji used as the topic icon. + * @param[out] topic Pointer to get ForumTopic, MUST be released with #telebot_put_forum_topic. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_create_forum_topic(telebot_handler_t handle, + long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id, + telebot_forum_topic_t *topic); + +/** + * @brief Release forum topic obtained with #telebot_create_forum_topic. + * @param[in] topic Pointer to forum topic to be released. + * @return on Success, #TELEBOT_ERROR_NONE is returned. + */ +telebot_error_e telebot_put_forum_topic(telebot_forum_topic_t *topic); + +/** + * @brief Use this method to edit name and icon of a topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @param[in] name New topic name, 0-128 characters. + * @param[in] icon_custom_emoji_id New unique identifier of the custom emoji used as the topic icon. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_edit_forum_topic(telebot_handler_t handle, + long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id); + +/** + * @brief Use this method to close an open topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_close_forum_topic(telebot_handler_t handle, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to reopen a closed topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_reopen_forum_topic(telebot_handler_t handle, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to delete a forum topic along with all its messages in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_delete_forum_topic(telebot_handler_t handle, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to unpin all messages in a forum topic. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_thread_id Unique identifier for the target message thread of the forum topic. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_unpin_all_forum_topic_messages(telebot_handler_t handle, + long long int chat_id, int message_thread_id); + +/** + * @brief Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. + * @param[in] handle The telebot handler. + * @param[out] stickers Pointer to stickers to be obtained, MUST be released with #telebot_put_stickers. + * @param[out] count Pointer to get the number of stickers. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_forum_topic_icon_stickers(telebot_handler_t handle, + telebot_sticker_t **stickers, int *count); + +/** + * @brief Use this method to edit the name of the 'General' topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name New topic name, 1-128 characters. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_edit_general_forum_topic(telebot_handler_t handle, + long long int chat_id, const char *name); + +/** + * @brief Use this method to close an open 'General' topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_close_general_forum_topic(telebot_handler_t handle, + long long int chat_id); + +/** + * @brief Use this method to reopen a closed 'General' topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_reopen_general_forum_topic(telebot_handler_t handle, + long long int chat_id); + +/** + * @brief Use this method to hide the 'General' topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_hide_general_forum_topic(telebot_handler_t handle, + long long int chat_id); + +/** + * @brief Use this method to unhide the 'General' topic in a forum supergroup chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_unhide_general_forum_topic(telebot_handler_t handle, + long long int chat_id); + +/** + * @brief Use this method to unpin all messages in a General forum topic. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_unpin_all_general_forum_topic_messages(telebot_handler_t handle, + long long int chat_id); + +/** + * @} // end of APIs + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TELEBOT_FORUMS_H__ */ diff --git a/include/telebot-games.h b/include/telebot-games.h new file mode 100644 index 0000000..8254243 --- /dev/null +++ b/include/telebot-games.h @@ -0,0 +1,78 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TELEBOT_GAMES_H__ +#define __TELEBOT_GAMES_H__ + +#include +#include "telebot-types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file telebot-games.h + * @ingroup TELEBOT_API + * @brief This file contains games feature of telegram bot + * @author Elmurod Talipov + * @date 2026-02-27 + */ + +/** + * @addtogroup TELEBOT_API + * @{ + */ + +/** + * @brief Use this method to send a game. + */ +telebot_error_e telebot_send_game(telebot_handler_t handle, + long long int chat_id, int message_thread_id, const char *game_short_name, + bool disable_notification, bool protect_content, const char *reply_parameters, + const char *reply_markup, telebot_message_t *message); + +/** + * @brief Use this method to set the score of the specified user in a game. + */ +telebot_error_e telebot_set_game_score(telebot_handler_t handle, + long long int user_id, int score, bool force, bool disable_edit_message, + long long int chat_id, int message_id, const char *inline_message_id, + telebot_message_t *message); + +/** + * @brief Use this method to get data for high score tables. + */ +telebot_error_e telebot_get_game_high_scores(telebot_handler_t handle, + long long int user_id, long long int chat_id, int message_id, const char *inline_message_id, + telebot_game_high_score_t **high_scores, int *count); + +/** + * @brief Release game high scores obtained with #telebot_get_game_high_scores. + */ +telebot_error_e telebot_put_game_high_scores(telebot_game_high_score_t *high_scores, int count); + +/** + * @} // end of APIs + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TELEBOT_GAMES_H__ */ diff --git a/include/telebot-inline.h b/include/telebot-inline.h new file mode 100644 index 0000000..fbb161b --- /dev/null +++ b/include/telebot-inline.h @@ -0,0 +1,76 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TELEBOT_INLINE_H__ +#define __TELEBOT_INLINE_H__ + +#include +#include "telebot-types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file telebot-inline.h + * @ingroup TELEBOT_API + * @brief This file contains inline mode feature of telegram bot + * @author Elmurod Talipov + * @date 2026-02-27 + */ + +/** + * @addtogroup TELEBOT_API + * @{ + */ + +/** + * @brief Use this method to send answers to an inline query. + */ +telebot_error_e telebot_answer_inline_query(telebot_handler_t handle, + const char *inline_query_id, const char *results, int cache_time, + bool is_personal, const char *next_offset, const char *button); + +/** + * @brief Use this method to save a prepared inline message. + */ +telebot_error_e telebot_save_prepared_inline_message(telebot_handler_t handle, + long long int user_id, const char *result, bool allow_user_chats, + bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats, + telebot_prepared_inline_message_t *prepared_message); + +/** + * @brief Release prepared inline message. + */ +telebot_error_e telebot_put_prepared_inline_message(telebot_prepared_inline_message_t *prepared_message); + +/** + * @brief Use this method to send answers to an inline query to a user from a Web App. + */ +telebot_error_e telebot_answer_web_app_query(telebot_handler_t handle, + const char *web_app_query_id, const char *result, char **inline_message_id); + +/** + * @} // end of APIs + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TELEBOT_INLINE_H__ */ diff --git a/include/telebot-methods.h b/include/telebot-methods.h index 1a5730d..0908da8 100644 --- a/include/telebot-methods.h +++ b/include/telebot-methods.h @@ -20,6 +20,9 @@ #define __TELEBOT_METHODS_H__ #include +#include "telebot-common.h" +#include "telebot-types.h" +#include "telebot-core.h" #ifdef __cplusplus extern "C" { @@ -200,6 +203,14 @@ telebot_error_e telebot_get_me(telebot_handler_t handle, telebot_user_t *me); */ telebot_error_e telebot_put_me(telebot_user_t *me); +/** + * @brief This function is used to release memory used for user object. + * + * @param[in] user Pointer to telegram user object. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + */ +telebot_error_e telebot_put_user(telebot_user_t *user); + /** * @brief Send text messages. * @param[in] handle The telebot handler created with #telebot_create(). @@ -670,6 +681,51 @@ telebot_error_e telebot_get_user_profile_photos(telebot_handler_t handle, */ telebot_error_e telebot_put_user_profile_photos(telebot_user_profile_photos_t *photos); +/** + * @brief Use this method to get user profile audios. + */ +telebot_error_e telebot_get_user_profile_audios(telebot_handler_t handle, + long long int user_id, int offset, int limit, telebot_user_profile_audios_t *audios); + +/** + * @brief Release user profile audios obtained with #telebot_get_user_profile_audios. + */ +telebot_error_e telebot_put_user_profile_audios(telebot_user_profile_audios_t *audios); + +/** + * @brief Use this method to set the bot's profile photo. + */ +telebot_error_e telebot_set_my_profile_photo(telebot_handler_t handle, + const char *photo); + +/** + * @brief Use this method to remove the bot's profile photo. + */ +telebot_error_e telebot_remove_my_profile_photo(telebot_handler_t handle, + const char *photo_id); + +/** + * @brief Use this method to get information about the business connection. + */ +telebot_error_e telebot_get_business_connection(telebot_handler_t handle, + const char *business_connection_id, telebot_business_connection_t *connection); + +/** + * @brief Release business connection obtained with #telebot_get_business_connection. + */ +telebot_error_e telebot_put_business_connection(telebot_business_connection_t *connection); + +/** + * @brief Use this method to get user chat boosts. + */ +telebot_error_e telebot_get_user_chat_boosts(telebot_handler_t handle, + long long int chat_id, long long int user_id, telebot_user_chat_boosts_t *boosts); + +/** + * @brief Release user chat boosts obtained with #telebot_get_user_chat_boosts. + */ +telebot_error_e telebot_put_user_chat_boosts(telebot_user_chat_boosts_t *boosts); + /** * @brief This function is used to download file. * @param[in] file_id File identifier to get info about. @@ -1199,6 +1255,354 @@ telebot_error_e telebot_stop_poll(telebot_handler_t handle, long long int chat_i telebot_error_e telebot_delete_message(telebot_handler_t handle, long long int chat_id, int message_id); +/** + * @brief Use this method to log out from the cloud Bot API server before + * launching the bot locally. + * @param[in] handle The telebot handler. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_log_out(telebot_handler_t handle); + +/** + * @brief Use this method to close the bot instance before moving it from one + * local server to another. + * @param[in] handle The telebot handler. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_close(telebot_handler_t handle); + +/** + * @brief Use this method to change the bot's name. + * @param[in] handle The telebot handler. + * @param[in] name New bot name; 0-64 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_my_name(telebot_handler_t handle, + const char *name, const char *language_code); + +/** + * @brief Use this method to get the current bot name for the given user language. + * @param[in] handle The telebot handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @param[out] name Pointer to get bot name, MUST be freed after use. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_my_name(telebot_handler_t handle, + const char *language_code, char **name); + +/** + * @brief Use this method to change the bot's description. + * @param[in] handle The telebot handler. + * @param[in] description New bot description; 0-512 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_my_description(telebot_handler_t handle, + const char *description, const char *language_code); + +/** + * @brief Use this method to get the current bot description for the given user language. + * @param[in] handle The telebot handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @param[out] description Pointer to get bot description, MUST be freed after use. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_my_description(telebot_handler_t handle, + const char *language_code, char **description); + +/** + * @brief Use this method to change the bot's short description. + * @param[in] handle The telebot handler. + * @param[in] short_description New short description; 0-120 characters. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_my_short_description(telebot_handler_t handle, + const char *short_description, const char *language_code); + +/** + * @brief Use this method to get the current bot short description for the given user language. + * @param[in] handle The telebot handler. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @param[out] short_description Pointer to get bot short description, MUST be freed after use. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_my_short_description(telebot_handler_t handle, + const char *language_code, char **short_description); + +/** + * @brief Use this method to change the bot's menu button in a private chat, or the default menu button. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target private chat. + * @param[in] menu_button A JSON-serialized object for the bot's new menu button. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_chat_menu_button(telebot_handler_t handle, + long long int chat_id, const char *menu_button); + +/** + * @brief Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target private chat. + * @param[out] menu_button Pointer to get menu button, MUST be freed after use. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_chat_menu_button(telebot_handler_t handle, + long long int chat_id, char **menu_button); + +/** + * @brief Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. + * @param[in] handle The telebot handler. + * @param[in] rights A JSON-serialized object describing new default administrator rights. + * @param[in] for_channels Pass True to change the default administrator rights of the bot in channels. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_my_default_administrator_rights(telebot_handler_t handle, + const char *rights, bool for_channels); + +/** + * @brief Use this method to get the current default administrator rights of the bot. + * @param[in] handle The telebot handler. + * @param[in] for_channels Pass True to get default administrator rights of the bot in channels. + * @param[out] rights Pointer to get admin rights, MUST be freed after use. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_get_my_default_administrator_rights(telebot_handler_t handle, + bool for_channels, char **rights); + +/** + * @brief Use this method to delete the list of the bot's commands for the given scope and user language. + * @param[in] handle The telebot handler. + * @param[in] scope A JSON-serialized object, describing scope of users for which the commands are relevant. + * @param[in] language_code A two-letter ISO 639-1 language code. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_delete_my_commands(telebot_handler_t handle, + const char *scope, const char *language_code); + +/** + * @brief Use this method to copy messages of any kind. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original message was sent. + * @param[in] message_id Message identifier in the chat specified by from_chat_id. + * @param[in] caption New caption for media, 0-1024 characters after entities parsing. + * @param[in] parse_mode Mode for parsing entities in the new caption. + * @param[in] caption_entities A JSON-serialized list of special entities that appear in the new caption. + * @param[in] disable_notification Sends the message silently. + * @param[in] protect_content Protects the contents of the sent message from forwarding and saving. + * @param[in] reply_to_message_id If the message is a reply, ID of the original message. + * @param[in] allow_sending_without_reply Pass True if the message should be sent even if the specified replied-to message is not found. + * @param[in] reply_markup Additional interface options. + * @param[out] message_id_out Pointer to get the message identifier of the sent message. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_copy_message(telebot_handler_t handle, + long long int chat_id, long long int from_chat_id, int message_id, + const char *caption, const char *parse_mode, const char *caption_entities, + bool disable_notification, bool protect_content, int reply_to_message_id, + bool allow_sending_without_reply, const char *reply_markup, int *message_id_out); + +/** + * @brief Use this method to copy multiple messages of any kind. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original messages were sent. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. + * @param[in] disable_notification Sends the messages silently. + * @param[in] protect_content Protects the contents of the sent messages from forwarding and saving. + * @param[in] remove_caption Pass True to copy the messages without their captions. + * @param[out] message_ids_out Pointer to get the message identifiers of the sent messages, MUST be freed after use. + * @param[out] count Pointer to get the number of messages sent. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_copy_messages(telebot_handler_t handle, + long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content, bool remove_caption, + int **message_ids_out, int *count); + +/** + * @brief Use this method to forward multiple messages of any kind. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] from_chat_id Unique identifier for the chat where the original messages were sent. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. + * @param[in] disable_notification Sends the messages silently. + * @param[in] protect_content Protects the contents of the sent messages from forwarding and saving. + * @param[out] message_ids_out Pointer to get the message identifiers of the sent messages, MUST be freed after use. + * @param[out] count Pointer to get the number of messages sent. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_forward_messages(telebot_handler_t handle, + long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content, int **message_ids_out, int *count); + +/** + * @brief Use this method to delete multiple messages in a chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_ids A JSON-serialized list of 1-100 identifiers of messages to delete. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_delete_messages(telebot_handler_t handle, + long long int chat_id, const char *message_ids); + +/** + * @brief Use this method to ban a user in a group, a supergroup or a channel. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @param[in] until_date Date when the user will be unbanned, unix time. + * @param[in] revoke_messages Pass True to delete all messages from the chat for the user that is being banned. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_ban_chat_member(telebot_handler_t handle, + long long int chat_id, int user_id, long until_date, bool revoke_messages); + +/** + * @brief Use this method to ban a channel chat in a supergroup or a channel. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] sender_chat_id Unique identifier of the target sender chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_ban_chat_sender_chat(telebot_handler_t handle, + long long int chat_id, long long int sender_chat_id); + +/** + * @brief Use this method to unban a previously banned channel chat in a supergroup or a channel. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] sender_chat_id Unique identifier of the target sender chat. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_unban_chat_sender_chat(telebot_handler_t handle, + long long int chat_id, long long int sender_chat_id); + +/** + * @brief Use this method to create an additional invite link for a chat. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] name Invite link name; 0-32 characters. + * @param[in] expire_date Point in time (Unix timestamp) when the link will expire. + * @param[in] member_limit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. + * @param[in] creates_join_request True, if users joining the chat via the link need to be approved by chat administrators. + * @param[out] invite_link Pointer to get ChatInviteLink, MUST be released with #telebot_put_chat_invite_link. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_create_chat_invite_link(telebot_handler_t handle, + long long int chat_id, const char *name, long expire_date, int member_limit, + bool creates_join_request, telebot_chat_invite_link_t *invite_link); + +/** + * @brief Use this method to edit a non-primary invite link created by the bot. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] invite_link_str The invite link to edit. + * @param[in] name Invite link name; 0-32 characters. + * @param[in] expire_date Point in time (Unix timestamp) when the link will expire. + * @param[in] member_limit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999. + * @param[in] creates_join_request True, if users joining the chat via the link need to be approved by chat administrators. + * @param[out] invite_link Pointer to get ChatInviteLink, MUST be released with #telebot_put_chat_invite_link. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_edit_chat_invite_link(telebot_handler_t handle, + long long int chat_id, const char *invite_link_str, const char *name, + long expire_date, int member_limit, bool creates_join_request, + telebot_chat_invite_link_t *invite_link); + +/** + * @brief Use this method to revoke an invite link created by the bot. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] invite_link_str The invite link to revoke. + * @param[out] invite_link Pointer to get ChatInviteLink, MUST be released with #telebot_put_chat_invite_link. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_revoke_chat_invite_link(telebot_handler_t handle, + long long int chat_id, const char *invite_link_str, telebot_chat_invite_link_t *invite_link); + +/** + * @brief Release chat invite link obtained with #telebot_create_chat_invite_link etc. + * @param[in] invite_link Pointer to chat invite link to be released. + * @return on Success, #TELEBOT_ERROR_NONE is returned. + */ +telebot_error_e telebot_put_chat_invite_link(telebot_chat_invite_link_t *invite_link); + +/** + * @brief Use this method to approve a chat join request. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_approve_chat_join_request(telebot_handler_t handle, + long long int chat_id, int user_id); + +/** + * @brief Use this method to decline a chat join request. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] user_id Unique identifier of the target user. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_decline_chat_join_request(telebot_handler_t handle, + long long int chat_id, int user_id); + +/** + * @brief Use this method to set a new message reaction. + * @param[in] handle The telebot handler. + * @param[in] chat_id Unique identifier for the target chat. + * @param[in] message_id Unique identifier of the target message. + * @param[in] reaction A JSON-serialized list of reaction types to set on the message. + * @param[in] is_big Pass True to set the reaction with a big animation. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_set_message_reaction(telebot_handler_t handle, + long long int chat_id, int message_id, const char *reaction, bool is_big); + +/** + * @brief Use this method to edit animation, audio, document, photo, or video messages. + * @param[in] handle The telebot handler. + * @param[in] chat_id Required if inline_message_id is not specified. + * @param[in] message_id Required if inline_message_id is not specified. + * @param[in] inline_message_id Required if chat_id and message_id are not specified. + * @param[in] media A JSON-serialized object for a new media content of the message. + * @param[in] reply_markup A JSON-serialized object for a new inline keyboard. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_edit_message_media(telebot_handler_t handle, + long long int chat_id, int message_id, const char *inline_message_id, + const char *media, const char *reply_markup); + /** * @} // end of APIs */ diff --git a/include/telebot-parser.h b/include/telebot-parser.h index 52bedcc..660363c 100644 --- a/include/telebot-parser.h +++ b/include/telebot-parser.h @@ -19,7 +19,10 @@ #ifndef __TELEBOT_PARSER_H__ #define __TELEBOT_PARSER_H__ -struct json_object *telebot_parser_str_to_obj(char *data); +#include "telebot-types.h" +#include "telebot-methods.h" + +struct json_object *telebot_parser_str_to_obj(const char *data); /** Get update from Json Object */ telebot_error_e telebot_parser_get_updates(struct json_object *obj, telebot_update_t **updates, int *count); @@ -103,7 +106,7 @@ telebot_error_e telebot_parser_get_file(struct json_object *obj, telebot_file_t telebot_error_e telebot_parser_get_callback_query(struct json_object *obj, telebot_callback_query_t *cb_query); /** Prase chat photo object */ -telebot_error_e telebot_parser_get_chat_photo(struct json_object *obj, telebot_chat_photo_t *photo); +telebot_error_e telebot_parser_get_chat_photo(struct json_object *obj, telebot_chat_photo_t *photo); /** Prase bot command object */ telebot_error_e telebot_parser_get_bot_command(struct json_object *obj, telebot_bot_command_t *command); @@ -114,4 +117,142 @@ telebot_error_e telebot_parser_get_array_bot_command(struct json_object *obj, te /** Prase response paramters object */ telebot_error_e telebot_parser_get_response_parameters(struct json_object *obj, telebot_response_paramters_t *resp_param); +/** Prase chat location object object */ +telebot_error_e telebot_parser_get_chat_location(struct json_object *obj, telebot_chat_location_t *chat_location); + +/** Parse chat message auto-delete timer changed object object */ +telebot_error_e telebot_parser_get_message_auto_delete_timer_changed(struct json_object *obj, telebot_message_auto_delete_timer_changed_t *timer_changed); + +/** Parse invoice object */ +telebot_error_e telebot_parser_get_invoice(struct json_object *obj, telebot_invoice_t *invoice); + +/** Parse shipping address object */ +telebot_error_e telebot_parser_get_shipping_address(struct json_object *obj, telebot_shipping_address_t *address); + +/** Parse order info object */ +telebot_error_e telebot_parser_get_order_info(struct json_object *obj, telebot_order_info_t *info); + +/** Parse successful payment object */ +telebot_error_e telebot_parser_get_successful_payment(struct json_object *obj, telebot_successful_payment_t *payment); + +/** Parse passport file object */ +telebot_error_e telebot_parser_get_passport_file(struct json_object *obj, telebot_passport_file_t *file); + +/** Parse encrypted passport element object */ +telebot_error_e telebot_parser_get_encrypted_passport_element(struct json_object *obj, telebot_encrypted_passport_element_t *element); + +/** Parse encrypted credentials object */ +telebot_error_e telebot_parser_get_encrypted_credentials(struct json_object *obj, telebot_encrypted_credentials_t *credentials); + +/** Parse passport data object */ +telebot_error_e telebot_parser_get_passport_data(struct json_object *obj, telebot_passport_data_t *passport_data); + +/** Parse proximity alert triggered object */ +telebot_error_e telebot_parser_get_proximity_alert_triggered(struct json_object *obj, telebot_proximity_alert_triggered_t *alert); + +/** Parse forum topic created object */ +telebot_error_e telebot_parser_get_forum_topic_created(struct json_object *obj, telebot_forum_topic_created_t *topic); + +/** Parse forum topic edited object */ +telebot_error_e telebot_parser_get_forum_topic_edited(struct json_object *obj, telebot_forum_topic_edited_t *topic); + +/** Parse video chat scheduled object */ +telebot_error_e telebot_parser_get_video_chat_scheduled(struct json_object *obj, telebot_video_chat_scheduled_t *scheduled); + +/** Parse video chat ended object */ +telebot_error_e telebot_parser_get_video_chat_ended(struct json_object *obj, telebot_video_chat_ended_t *ended); + +/** Parse video chat participants invited object */ +telebot_error_e telebot_parser_get_video_chat_participants_invited(struct json_object *obj, telebot_video_chat_participants_invited_t *invited); + +/** Parse web app data object */ +telebot_error_e telebot_parser_get_web_app_data(struct json_object *obj, telebot_web_app_data_t *data); + +/** Parse inline keyboard button object */ +telebot_error_e telebot_parser_get_inline_keyboard_button(struct json_object *obj, telebot_inline_keyboard_button_t *button); + +/** Parse inline keyboard markup object */ +telebot_error_e telebot_parser_get_inline_keyboard_markup(struct json_object *obj, telebot_inline_keyboard_markup_t *markup); + +/** Parse chat invite link object */ +telebot_error_e telebot_parser_get_chat_invite_link(struct json_object *obj, telebot_chat_invite_link_t *invite_link); + +/** Parse chat member updated object */ +telebot_error_e telebot_parser_get_chat_member_updated(struct json_object *obj, telebot_chat_member_updated_t *updated); + +/** Parse chat join request object */ +telebot_error_e telebot_parser_get_chat_join_request(struct json_object *obj, telebot_chat_join_request_t *request); + +/** Parse reaction type object */ +telebot_error_e telebot_parser_get_reaction_type(struct json_object *obj, telebot_reaction_type_t *reaction); + +/** Parse message reaction updated object */ +telebot_error_e telebot_parser_get_message_reaction_updated(struct json_object *obj, telebot_message_reaction_updated_t *updated); + +/** Parse reaction count object */ +telebot_error_e telebot_parser_get_reaction_count(struct json_object *obj, telebot_reaction_count_t *count); + +/** Parse message reaction count updated object */ +telebot_error_e telebot_parser_get_message_reaction_count_updated(struct json_object *obj, telebot_message_reaction_count_updated_t *updated); + +/** Parse chat boost source object */ +telebot_error_e telebot_parser_get_chat_boost_source(struct json_object *obj, telebot_chat_boost_source_t *source); + +/** Parse chat boost object */ +telebot_error_e telebot_parser_get_chat_boost(struct json_object *obj, telebot_chat_boost_t *boost); + +/** Parse chat boost updated object */ +telebot_error_e telebot_parser_get_chat_boost_updated(struct json_object *obj, telebot_chat_boost_updated_t *updated); + +/** Parse chat boost removed object */ +telebot_error_e telebot_parser_get_chat_boost_removed(struct json_object *obj, telebot_chat_boost_removed_t *removed); + +/** Parse forum topic object */ +telebot_error_e telebot_parser_get_forum_topic(struct json_object *obj, telebot_forum_topic_t *topic); + +/** Parse inline query object */ +telebot_error_e telebot_parser_get_inline_query(struct json_object *obj, telebot_inline_query_t *query); + +/** Parse chosen inline result object */ +telebot_error_e telebot_parser_get_chosen_inline_result(struct json_object *obj, telebot_chosen_inline_result_t *result); + +/** Parse shipping query object */ +telebot_error_e telebot_parser_get_shipping_query(struct json_object *obj, telebot_shipping_query_t *query); + +/** Parse pre-checkout query object */ +telebot_error_e telebot_parser_get_pre_checkout_query(struct json_object *obj, telebot_pre_checkout_query_t *query); + +/** Parse stickers array */ +telebot_error_e telebot_parser_get_stickers(struct json_object *obj, telebot_sticker_t **stickers, int *count); + +/** Parse star transactions */ +telebot_error_e telebot_parser_get_star_transactions(struct json_object *obj, telebot_star_transactions_t *transactions); + +/** Parse prepared inline message */ +telebot_error_e telebot_parser_get_prepared_inline_message(struct json_object *obj, telebot_prepared_inline_message_t *prepared_message); + +/** Parse game high score */ +telebot_error_e telebot_parser_get_game_high_score(struct json_object *obj, telebot_game_high_score_t *high_score); + +/** Parse gifts */ +telebot_error_e telebot_parser_get_gifts(struct json_object *obj, telebot_gifts_t *gifts); + +/** Parse user gift */ +telebot_error_e telebot_parser_get_user_gift(struct json_object *obj, telebot_user_gift_t *gift); + +/** Parse user gifts */ +telebot_error_e telebot_parser_get_user_gifts(struct json_object *obj, telebot_user_gifts_t *gifts); + +/** Parse user profile audios */ +telebot_error_e telebot_parser_get_user_profile_audios(struct json_object *obj, telebot_user_profile_audios_t *audios); + +/** Parse business connection */ +telebot_error_e telebot_parser_get_business_connection(struct json_object *obj, telebot_business_connection_t *connection); + +/** Parse user chat boosts */ +telebot_error_e telebot_parser_get_user_chat_boosts(struct json_object *obj, telebot_user_chat_boosts_t *boosts); + +/** Parse paid media purchased */ +telebot_error_e telebot_parser_get_paid_media_purchased(struct json_object *obj, telebot_paid_media_purchased_t *purchased); + #endif /* __TELEBOT_PARSER_H__ */ diff --git a/include/telebot-passport.h b/include/telebot-passport.h new file mode 100644 index 0000000..a5de214 --- /dev/null +++ b/include/telebot-passport.h @@ -0,0 +1,56 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TELEBOT_PASSPORT_H__ +#define __TELEBOT_PASSPORT_H__ + +#include +#include "telebot-types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file telebot-passport.h + * @ingroup TELEBOT_API + * @brief This file contains Telegram Passport feature of telegram bot + * @author Elmurod Talipov + * @date 2026-02-27 + */ + +/** + * @addtogroup TELEBOT_API + * @{ + */ + +/** + * @brief Use this method to set passport data errors. + */ +telebot_error_e telebot_set_passport_data_errors(telebot_handler_t handle, + long long int user_id, const char *errors); + +/** + * @} // end of APIs + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TELEBOT_PASSPORT_H__ */ diff --git a/include/telebot-payments.h b/include/telebot-payments.h new file mode 100644 index 0000000..a6dd4e1 --- /dev/null +++ b/include/telebot-payments.h @@ -0,0 +1,189 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TELEBOT_PAYMENTS_H__ +#define __TELEBOT_PAYMENTS_H__ + +#include +#include "telebot-types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file telebot-payments.h + * @ingroup TELEBOT_API + * @brief This file contains payments feature of telegram bot + * @author Elmurod Talipov + * @date 2026-02-27 + */ + +/** + * @addtogroup TELEBOT_API + * @{ + */ + +/** + * @brief Use this method to send an invoice. + */ +telebot_error_e telebot_send_invoice(telebot_handler_t handle, + long long int chat_id, int message_thread_id, const char *title, + const char *description, const char *payload, const char *provider_token, + const char *currency, const char *prices, int max_tip_amount, + const char *suggested_tip_amounts, const char *start_parameter, + const char *provider_data, const char *photo_url, int photo_size, + int photo_width, int photo_height, bool need_name, bool need_phone_number, + bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, + bool send_email_to_provider, bool is_flexible, bool disable_notification, + bool protect_content, const char *reply_parameters, const char *reply_markup, + telebot_message_t *message); + +/** + * @brief Use this method to create a link for an invoice. + */ +telebot_error_e telebot_create_invoice_link(telebot_handler_t handle, + const char *title, const char *description, const char *payload, + const char *provider_token, const char *currency, const char *prices, + int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, + const char *photo_url, int photo_size, int photo_width, int photo_height, + bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, + bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, + char **invoice_link); + +/** + * @brief Use this method to reply to shipping queries. + */ +telebot_error_e telebot_answer_shipping_query(telebot_handler_t handle, + const char *shipping_query_id, bool ok, const char *shipping_options, + const char *error_message); + +/** + * @brief Use this method to respond to pre-checkout queries. + */ +telebot_error_e telebot_answer_pre_checkout_query(telebot_handler_t handle, + const char *pre_checkout_query_id, bool ok, const char *error_message); + +/** + * @brief Use this method to get the current Telegram Stars balance of the bot. + */ +telebot_error_e telebot_get_my_star_balance(telebot_handler_t handle, long long int *balance); + +/** + * @brief Use this method to get the bot's Telegram Star transactions. + */ +telebot_error_e telebot_get_star_transactions(telebot_handler_t handle, + int offset, int limit, telebot_star_transactions_t *transactions); + +/** + * @brief Release star transactions obtained with #telebot_get_star_transactions. + */ +telebot_error_e telebot_put_star_transactions(telebot_star_transactions_t *transactions); + +/** + * @brief Use this method to refund a successful payment in Telegram Stars. + */ +telebot_error_e telebot_refund_star_payment(telebot_handler_t handle, + long long int user_id, const char *telegram_payment_charge_id); + +/** + * @brief Use this method to get a list of gifts that can be sent by the bot to users. + */ +telebot_error_e telebot_get_available_gifts(telebot_handler_t handle, + telebot_gifts_t *gifts); + +/** + * @brief Release available gifts obtained with #telebot_get_available_gifts. + */ +telebot_error_e telebot_put_available_gifts(telebot_gifts_t *gifts); + +/** + * @brief Release a gift object. + */ +telebot_error_e telebot_put_gift(telebot_gift_t *gift); + +/** + * @brief Use this method to get a list of gifts received by a user. + */ +telebot_error_e telebot_get_user_gifts(telebot_handler_t handle, + long long int user_id, int offset, int limit, telebot_user_gifts_t *gifts); + +/** + * @brief Release user gifts obtained with #telebot_get_user_gifts. + */ +telebot_error_e telebot_put_user_gifts(telebot_user_gifts_t *gifts); + +/** + * @brief Release a user gift object. + */ +telebot_error_e telebot_put_user_gift(telebot_user_gift_t *gift); + +/** + * @brief Use this method to get a list of gifts received by a chat. + */ +telebot_error_e telebot_get_chat_gifts(telebot_handler_t handle, + long long int chat_id, int offset, int limit, telebot_user_gifts_t *gifts); + +/** + * @brief Release chat gifts obtained with #telebot_get_chat_gifts. + */ +telebot_error_e telebot_put_chat_gifts(telebot_user_gifts_t *gifts); + +/** + * @brief Use this method to upgrade a gift. + */ +telebot_error_e telebot_upgrade_gift(telebot_handler_t handle, + const char *gift_id, bool pay_for_upgrade, const char *text, + const char *text_parse_mode, const char *text_entities); + +/** + * @brief Use this method to transfer a gift. + */ +telebot_error_e telebot_transfer_gift(telebot_handler_t handle, + long long int user_id, long long int chat_id, const char *gift_id); + +/** + * @brief Use this method to convert a gift to Telegram Stars. + */ +telebot_error_e telebot_convert_gift_to_stars(telebot_handler_t handle, + const char *gift_id); + +/** + * @brief Use this method to send a gift. + */ +telebot_error_e telebot_send_gift(telebot_handler_t handle, + long long int user_id, long long int chat_id, const char *gift_id, + bool pay_for_upgrade, const char *text, const char *text_parse_mode, + const char *text_entities); + +/** + * @brief Use this method to gift a Telegram Premium subscription to a user. + */ +telebot_error_e telebot_gift_premium_subscription(telebot_handler_t handle, + long long int user_id, int month_count, int star_count, const char *text, + const char *text_parse_mode, const char *text_entities); + +/** + * @} // end of APIs + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TELEBOT_PAYMENTS_H__ */ diff --git a/include/telebot-private.h b/include/telebot-private.h index b3748e0..03492b9 100644 --- a/include/telebot-private.h +++ b/include/telebot-private.h @@ -19,6 +19,13 @@ #ifndef __TELEBOT_PRIVATE_H__ #define __TELEBOT_PRIVATE_H__ +#include +#include +#include +#include "telebot-common.h" +#include "telebot-types.h" +#include "telebot-core.h" + #define TELEBOT_API_URL "https://api.telegram.org" #define TELEBOT_URL_SIZE 1024 #define TELEBOT_BUFFER_SECTOR 512 @@ -30,78 +37,258 @@ #define TELEBOT_SAFE_FZCNT(addr, count) { TELEBOT_SAFE_FREE(addr); count = 0; } #define TELEBOT_SAFE_STRDUP(str) (str) ? strdup(str) : NULL; -#define TELEBOT_METHOD_GET_UPDATES "getUpdates" -#define TELEBOT_METHOD_SET_WEBHOOK "setWebhook" -#define TELEBOT_METHOD_DELETE_WEBHOOK "deleteWebhook" -#define TELEBOT_METHOD_GET_WEBHOOK_INFO "getWebhookInfo" -#define TELEBOT_METHOD_GET_ME "getMe" -#define TELEBOT_METHOD_SEND_MESSAGE "sendMessage" -#define TELEBOT_METHOD_FORWARD_MESSAGE "forwardMessage" -#define TELEBOT_METHOD_SEND_PHOTO "sendPhoto" -#define TELEBOT_METHOD_SEND_AUDIO "sendAudio" -#define TELEBOT_METHOD_SEND_DOCUMENT "sendDocument" -#define TELEBOT_METHOD_SEND_VIDEO "sendVideo" -#define TELEBOT_METHOD_SEND_ANIMATION "sendAnimation" -#define TELEBOT_METHOD_SEND_VOICE "sendVoice" -#define TELEBOT_METHOD_SEND_VIDEO_NOTE "sendVideoNote" -#define TELEBOT_METHOD_SEND_MEDIA_GROUP "sendMediaGroup" -#define TELEBOT_METHOD_SEND_LOCATION "sendLocation" -#define TELEBOT_METHOD_EDIT_MESSAGE_LIVE_LOCATION "editMessageLiveLocation" -#define TELEBOT_METHOD_STOP_MESSAGE_LIVE_LOCATION "stopMessageLiveLocation" -#define TELEBOT_METHOD_SEND_VENUE "sendVenue" -#define TELEBOT_METHOD_SEND_CONTACT "sendContact" -#define TELEBOT_METHOD_SEND_POLL "sendPoll" -#define TELEBOT_METHOD_SEND_DICE "sendDice" -#define TELEBOT_METHOD_SEND_CHAT_ACTION "sendChatAction" -#define TELEBOT_METHOD_GET_USER_PHOTOS "getUserProfilePhotos" -#define TELEBOT_METHOD_GET_FILE "getFile" -#define TELEBOT_METHOD_KICK_CHAT_MEMBER "kickChatMember" -#define TELEBOT_METHOD_UNBAN_CHAT_MEMBER "unbanChatMember" -#define TELEBOT_METHOD_RESTRICT_CHAT_MEMBER "restrictChatMember" -#define TELEBOT_METHOD_PROMOTE_CHAT_MEMBER "promoteChatMember" -#define TELEBOT_METHOD_SET_CHAT_ADMIN_TITLE "setChatAdministratorCustomTitle" -#define TELEBOT_METHOD_SET_CHAT_PERMISSIONS "setChatPermissions" -#define TELEBOT_METHOD_EXPORT_CHAT_INVITE_LINK "exportChatInviteLink" -#define TELEBOT_METHOD_SET_CHAT_PHOTO "setChatPhoto" -#define TELEBOT_METHOD_DELETE_CHAT_PHOTO "deleteChatPhoto" -#define TELEBOT_METHOD_SET_CHAT_TITLE "setChatTitle" -#define TELEBOT_METHOD_SET_CHAT_DESCRIPTION "setChatDescription" -#define TELEBOT_METHOD_PIN_CHAT_MESSAGE "pinChatMessage" -#define TELEBOT_METHOD_UNPIN_CHAT_MESSAGE "unpinChatMessage" -#define TELEBOT_METHOD_LEAVE_CHAT "leaveChat" -#define TELEBOT_METHOD_GET_CHAT "getChat" -#define TELEBOT_METHOD_GET_CHAT_ADMINS "getChatAdministrators" -#define TELEBOT_METHOD_GET_CHAT_MEMBERS_COUNT "getChatMembersCount" -#define TELEBOT_METHOD_GET_CHAT_MEMBER "getChatMember" -#define TELEBOT_METHOD_SET_CHAT_STICKER_SET "setChatStickerSet" -#define TELEBOT_METHOD_DEL_CHAT_STICKER_SET "deleteChatStickerSet" -#define TELEBOT_METHOD_ANSWER_CALLBACK_QUERY "answerCallbackQuery" -#define TELEBOT_METHOD_SET_MY_COMMANDS "setMyCommands" -#define TELEBOT_METHOD_GET_MY_COMMANDS "getMyCommands" -#define TELEBOT_METHOD_EDIT_MESSAGE_TEXT "editMessageText" -#define TELEBOT_METHOD_EDIT_MESSAGE_CAPTION "editMessageCaption" -#define TELEBOT_METHOD_EDIT_MESSAGE_MEDIA "editMessageMedia" -#define TELEBOT_METHOD_EDIT_MESSAGE_REPLY_MARKUP "editMessageReplyMarkup" -#define TELEBOT_METHOD_STOP_POLL "stopPoll" -#define TELEBOT_METHOD_DELETE_MESSAGE "deleteMessage" +#define TELEBOT_METHOD_GET_UPDATES "getUpdates" +#define TELEBOT_METHOD_SET_WEBHOOK "setWebhook" +#define TELEBOT_METHOD_DELETE_WEBHOOK "deleteWebhook" +#define TELEBOT_METHOD_GET_WEBHOOK_INFO "getWebhookInfo" +#define TELEBOT_METHOD_GET_ME "getMe" +#define TELEBOT_METHOD_LOG_OUT "logOut" +#define TELEBOT_METHOD_CLOSE "close" +#define TELEBOT_METHOD_SET_MY_NAME "setMyName" +#define TELEBOT_METHOD_GET_MY_NAME "getMyName" +#define TELEBOT_METHOD_SET_MY_DESCRIPTION "setMyDescription" +#define TELEBOT_METHOD_GET_MY_DESCRIPTION "getMyDescription" +#define TELEBOT_METHOD_SET_MY_SHORT_DESCRIPTION "setMyShortDescription" +#define TELEBOT_METHOD_GET_MY_SHORT_DESCRIPTION "getMyShortDescription" +#define TELEBOT_METHOD_SET_MY_PROFILE_PHOTO "setMyProfilePhoto" +#define TELEBOT_METHOD_REMOVE_MY_PROFILE_PHOTO "removeMyProfilePhoto" +#define TELEBOT_METHOD_SET_CHAT_MENU_BUTTON "setChatMenuButton" +#define TELEBOT_METHOD_GET_CHAT_MENU_BUTTON "getChatMenuButton" +#define TELEBOT_METHOD_SET_MY_DEFAULT_ADMIN_RIGHTS "setMyDefaultAdministratorRights" +#define TELEBOT_METHOD_GET_MY_DEFAULT_ADMIN_RIGHTS "getMyDefaultAdministratorRights" +#define TELEBOT_METHOD_SEND_MESSAGE "sendMessage" +#define TELEBOT_METHOD_FORWARD_MESSAGE "forwardMessage" +#define TELEBOT_METHOD_FORWARD_MESSAGES "forwardMessages" +#define TELEBOT_METHOD_COPY_MESSAGE "copyMessage" +#define TELEBOT_METHOD_COPY_MESSAGES "copyMessages" +#define TELEBOT_METHOD_SEND_PHOTO "sendPhoto" +#define TELEBOT_METHOD_SEND_AUDIO "sendAudio" +#define TELEBOT_METHOD_SEND_DOCUMENT "sendDocument" +#define TELEBOT_METHOD_SEND_VIDEO "sendVideo" +#define TELEBOT_METHOD_SEND_ANIMATION "sendAnimation" +#define TELEBOT_METHOD_SEND_VOICE "sendVoice" +#define TELEBOT_METHOD_SEND_VIDEO_NOTE "sendVideoNote" +#define TELEBOT_METHOD_SEND_PAID_MEDIA "sendPaidMedia" +#define TELEBOT_METHOD_SEND_MEDIA_GROUP "sendMediaGroup" +#define TELEBOT_METHOD_SEND_LOCATION "sendLocation" +#define TELEBOT_METHOD_EDIT_MESSAGE_LIVE_LOCATION "editMessageLiveLocation" +#define TELEBOT_METHOD_STOP_MESSAGE_LIVE_LOCATION "stopMessageLiveLocation" +#define TELEBOT_METHOD_SEND_VENUE "sendVenue" +#define TELEBOT_METHOD_SEND_CONTACT "sendContact" +#define TELEBOT_METHOD_SEND_POLL "sendPoll" +#define TELEBOT_METHOD_SEND_CHECKLIST "sendChecklist" +#define TELEBOT_METHOD_SEND_DICE "sendDice" +#define TELEBOT_METHOD_SEND_CHAT_ACTION "sendChatAction" +#define TELEBOT_METHOD_SEND_MESSAGE_DRAFT "sendMessageDraft" +#define TELEBOT_METHOD_GET_USER_PHOTOS "getUserProfilePhotos" +#define TELEBOT_METHOD_GET_USER_AUDIOS "getUserProfileAudios" +#define TELEBOT_METHOD_SET_USER_EMOJI_STATUS "setUserEmojiStatus" +#define TELEBOT_METHOD_GET_FILE "getFile" +#define TELEBOT_METHOD_BAN_CHAT_MEMBER "banChatMember" +#define TELEBOT_METHOD_KICK_CHAT_MEMBER "kickChatMember" +#define TELEBOT_METHOD_UNBAN_CHAT_MEMBER "unbanChatMember" +#define TELEBOT_METHOD_RESTRICT_CHAT_MEMBER "restrictChatMember" +#define TELEBOT_METHOD_PROMOTE_CHAT_MEMBER "promoteChatMember" +#define TELEBOT_METHOD_SET_CHAT_ADMIN_TITLE "setChatAdministratorCustomTitle" +#define TELEBOT_METHOD_BAN_CHAT_SENDER_CHAT "banChatSenderChat" +#define TELEBOT_METHOD_UNBAN_CHAT_SENDER_CHAT "unbanChatSenderChat" +#define TELEBOT_METHOD_SET_CHAT_PERMISSIONS "setChatPermissions" +#define TELEBOT_METHOD_EXPORT_CHAT_INVITE_LINK "exportChatInviteLink" +#define TELEBOT_METHOD_CREATE_CHAT_INVITE_LINK "createChatInviteLink" +#define TELEBOT_METHOD_EDIT_CHAT_INVITE_LINK "editChatInviteLink" +#define TELEBOT_METHOD_CREATE_CHAT_SUBSCRIPTION_INVITE_LINK "createChatSubscriptionInviteLink" +#define TELEBOT_METHOD_EDIT_CHAT_SUBSCRIPTION_INVITE_LINK "editChatSubscriptionInviteLink" +#define TELEBOT_METHOD_REVOKE_CHAT_INVITE_LINK "revokeChatInviteLink" +#define TELEBOT_METHOD_APPROVE_CHAT_JOIN_REQUEST "approveChatJoinRequest" +#define TELEBOT_METHOD_DECLINE_CHAT_JOIN_REQUEST "declineChatJoinRequest" +#define TELEBOT_METHOD_SET_CHAT_PHOTO "setChatPhoto" +#define TELEBOT_METHOD_DELETE_CHAT_PHOTO "deleteChatPhoto" +#define TELEBOT_METHOD_SET_CHAT_TITLE "setChatTitle" +#define TELEBOT_METHOD_SET_CHAT_DESCRIPTION "setChatDescription" +#define TELEBOT_METHOD_PIN_CHAT_MESSAGE "pinChatMessage" +#define TELEBOT_METHOD_UNPIN_CHAT_MESSAGE "unpinChatMessage" +#define TELEBOT_METHOD_UNPIN_ALL_CHAT_MESSAGES "unpinAllChatMessages" +#define TELEBOT_METHOD_LEAVE_CHAT "leaveChat" +#define TELEBOT_METHOD_GET_CHAT "getChat" +#define TELEBOT_METHOD_GET_CHAT_ADMINS "getChatAdministrators" +#define TELEBOT_METHOD_GET_CHAT_MEMBERS_COUNT "getChatMembersCount" +#define TELEBOT_METHOD_GET_CHAT_MEMBER "getChatMember" +#define TELEBOT_METHOD_SET_CHAT_STICKER_SET "setChatStickerSet" +#define TELEBOT_METHOD_DEL_CHAT_STICKER_SET "deleteChatStickerSet" +#define TELEBOT_METHOD_GET_FORUM_TOPIC_ICON_STICKERS "getForumTopicIconStickers" +#define TELEBOT_METHOD_CREATE_FORUM_TOPIC "createForumTopic" +#define TELEBOT_METHOD_EDIT_FORUM_TOPIC "editForumTopic" +#define TELEBOT_METHOD_CLOSE_FORUM_TOPIC "closeForumTopic" +#define TELEBOT_METHOD_REOPEN_FORUM_TOPIC "reopenForumTopic" +#define TELEBOT_METHOD_DELETE_FORUM_TOPIC "deleteForumTopic" +#define TELEBOT_METHOD_UNPIN_ALL_FORUM_TOPIC_MESSAGES "unpinAllForumTopicMessages" +#define TELEBOT_METHOD_EDIT_GENERAL_FORUM_TOPIC "editGeneralForumTopic" +#define TELEBOT_METHOD_CLOSE_GENERAL_FORUM_TOPIC "closeGeneralForumTopic" +#define TELEBOT_METHOD_REOPEN_GENERAL_FORUM_TOPIC "reopenGeneralForumTopic" +#define TELEBOT_METHOD_HIDE_GENERAL_FORUM_TOPIC "hideGeneralForumTopic" +#define TELEBOT_METHOD_UNHIDE_GENERAL_FORUM_TOPIC "unhideGeneralForumTopic" +#define TELEBOT_METHOD_UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES "unpinAllGeneralForumTopicMessages" +#define TELEBOT_METHOD_ANSWER_CALLBACK_QUERY "answerCallbackQuery" +#define TELEBOT_METHOD_GET_USER_CHAT_BOOSTS "getUserChatBoosts" +#define TELEBOT_METHOD_GET_BUSINESS_CONNECTION "getBusinessConnection" +#define TELEBOT_METHOD_SET_MY_COMMANDS "setMyCommands" +#define TELEBOT_METHOD_DELETE_MY_COMMANDS "deleteMyCommands" +#define TELEBOT_METHOD_GET_MY_COMMANDS "getMyCommands" +#define TELEBOT_METHOD_SET_MESSAGE_REACTION "setMessageReaction" +#define TELEBOT_METHOD_EDIT_MESSAGE_TEXT "editMessageText" +#define TELEBOT_METHOD_EDIT_MESSAGE_CAPTION "editMessageCaption" +#define TELEBOT_METHOD_EDIT_MESSAGE_MEDIA "editMessageMedia" +#define TELEBOT_METHOD_EDIT_MESSAGE_REPLY_MARKUP "editMessageReplyMarkup" +#define TELEBOT_METHOD_EDIT_MESSAGE_CHECKLIST "editMessageChecklist" +#define TELEBOT_METHOD_STOP_POLL "stopPoll" +#define TELEBOT_METHOD_APPROVE_SUGGESTED_POST "approveSuggestedPost" +#define TELEBOT_METHOD_DECLINE_SUGGESTED_POST "declineSuggestedPost" +#define TELEBOT_METHOD_DELETE_MESSAGE "deleteMessage" +#define TELEBOT_METHOD_DELETE_MESSAGES "deleteMessages" +#define TELEBOT_METHOD_GET_STICKER_SET "getStickerSet" +#define TELEBOT_METHOD_GET_CUSTOM_EMOJI_STICKERS "getCustomEmojiStickers" +#define TELEBOT_METHOD_UPLOAD_STICKER_FILE "uploadStickerFile" +#define TELEBOT_METHOD_CREATE_NEW_STICKER_SET "createNewStickerSet" +#define TELEBOT_METHOD_ADD_STICKER_TO_SET "addStickerToSet" +#define TELEBOT_METHOD_SET_STICKER_POSITION_IN_SET "setStickerPositionInSet" +#define TELEBOT_METHOD_DELETE_STICKER_FROM_SET "deleteStickerFromSet" +#define TELEBOT_METHOD_REPLACE_STICKER_IN_SET "replaceStickerInSet" +#define TELEBOT_METHOD_SET_STICKER_EMOJI_LIST "setStickerEmojiList" +#define TELEBOT_METHOD_SET_STICKER_KEYWORDS "setStickerKeywords" +#define TELEBOT_METHOD_SET_STICKER_MASK_POSITION "setStickerMaskPosition" +#define TELEBOT_METHOD_SET_STICKER_SET_TITLE "setStickerSetTitle" +#define TELEBOT_METHOD_SET_STICKER_SET_THUMBNAIL "setStickerSetThumbnail" +#define TELEBOT_METHOD_SET_CUSTOM_EMOJI_STICKER_SET_THUMBNAIL "setCustomEmojiStickerSetThumbnail" +#define TELEBOT_METHOD_DELETE_STICKER_SET "deleteStickerSet" +#define TELEBOT_METHOD_ANSWER_INLINE_QUERY "answerInlineQuery" +#define TELEBOT_METHOD_ANSWER_WEB_APP_QUERY "answerWebAppQuery" +#define TELEBOT_METHOD_SAVE_PREPARED_INLINE_MESSAGE "savePreparedInlineMessage" +#define TELEBOT_METHOD_SEND_INVOICE "sendInvoice" +#define TELEBOT_METHOD_CREATE_INVOICE_LINK "createInvoiceLink" +#define TELEBOT_METHOD_ANSWER_SHIPPING_QUERY "answerShippingQuery" +#define TELEBOT_METHOD_ANSWER_PRE_CHECKOUT_QUERY "answerPreCheckoutQuery" +#define TELEBOT_METHOD_GET_MY_STAR_BALANCE "getMyStarBalance" +#define TELEBOT_METHOD_GET_STAR_TRANSACTIONS "getStarTransactions" +#define TELEBOT_METHOD_REFUND_STAR_PAYMENT "refundStarPayment" +#define TELEBOT_METHOD_EDIT_USER_STAR_SUBSCRIPTION "editUserStarSubscription" +#define TELEBOT_METHOD_SET_PASSPORT_DATA_ERRORS "setPassportDataErrors" +#define TELEBOT_METHOD_SEND_GAME "sendGame" +#define TELEBOT_METHOD_SET_GAME_SCORE "setGameScore" +#define TELEBOT_METHOD_GET_GAME_HIGH_SCORES "getGameHighScores" +#define TELEBOT_METHOD_GET_AVAILABLE_GIFTS "getAvailableGifts" +#define TELEBOT_METHOD_SEND_GIFT "sendGift" +#define TELEBOT_METHOD_GIFT_PREMIUM_SUBSCRIPTION "giftPremiumSubscription" +#define TELEBOT_METHOD_VERIFY_USER "verifyUser" +#define TELEBOT_METHOD_VERIFY_CHAT "verifyChat" +#define TELEBOT_METHOD_REMOVE_USER_VERIFICATION "removeUserVerification" +#define TELEBOT_METHOD_REMOVE_CHAT_VERIFICATION "removeChatVerification" +#define TELEBOT_METHOD_READ_BUSINESS_MESSAGE "readBusinessMessage" +#define TELEBOT_METHOD_DELETE_BUSINESS_MESSAGES "deleteBusinessMessages" +#define TELEBOT_METHOD_SET_BUSINESS_ACCOUNT_NAME "setBusinessAccountName" +#define TELEBOT_METHOD_SET_BUSINESS_ACCOUNT_USERNAME "setBusinessAccountUsername" +#define TELEBOT_METHOD_SET_BUSINESS_ACCOUNT_BIO "setBusinessAccountBio" +#define TELEBOT_METHOD_SET_BUSINESS_ACCOUNT_PROFILE_PHOTO "setBusinessAccountProfilePhoto" +#define TELEBOT_METHOD_REMOVE_BUSINESS_ACCOUNT_PROFILE_PHOTO "removeBusinessAccountProfilePhoto" +#define TELEBOT_METHOD_SET_BUSINESS_ACCOUNT_GIFT_SETTINGS "setBusinessAccountGiftSettings" +#define TELEBOT_METHOD_GET_BUSINESS_ACCOUNT_STAR_BALANCE "getBusinessAccountStarBalance" +#define TELEBOT_METHOD_TRANSFER_BUSINESS_ACCOUNT_STARS "transferBusinessAccountStars" +#define TELEBOT_METHOD_GET_BUSINESS_ACCOUNT_GIFTS "getBusinessAccountGifts" +#define TELEBOT_METHOD_GET_USER_GIFTS "getUserGifts" +#define TELEBOT_METHOD_GET_CHAT_GIFTS "getChatGifts" +#define TELEBOT_METHOD_CONVERT_GIFT_TO_STARS "convertGiftToStars" +#define TELEBOT_METHOD_UPGRADE_GIFT "upgradeGift" +#define TELEBOT_METHOD_TRANSFER_GIFT "transferGift" +#define TELEBOT_METHOD_POST_STORY "postStory" +#define TELEBOT_METHOD_REPOST_STORY "repostStory" +#define TELEBOT_METHOD_EDIT_STORY "editStory" +#define TELEBOT_METHOD_DELETE_STORY "deleteStory" +#define ERR(fmt, args...) fprintf(stderr, "[ERROR][%s:%d]" fmt "\n", __func__, __LINE__, ##args) #ifdef DEBUG - #define ERR(fmt, args...) fprintf(stderr, "[ERROR][%s:%d]" fmt "\n", __func__, __LINE__, ##args) - #define DBG(fmt, args...) fprintf(stdout, "[DEBUG][%s:%d]" fmt "\n", __func__, __LINE__, ##args) +#define DBG(fmt, args...) fprintf(stdout, "[DEBUG][%s:%d]" fmt "\n", __func__, __LINE__, ##args) #else - #define ERR(x, ...) - #define DBG(x, ...) +#define DBG(x, ...) #endif -typedef enum { - TELEBOT_MIME_TYPE_DATA = 0, +#define CHECK_ARG_NULL(PARAM) \ + if (PARAM == NULL) \ + { \ + ERR("Argument '%s' is null)", #PARAM); \ + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); \ + } + +#define CHECK_ARG_CONDITION(CONDITION, MESSAGE) \ + if (CONDITION) \ + { \ + ERR(MESSAGE); \ + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); \ + } + +typedef enum +{ + TELEBOT_MIME_TYPE_CHAR, + TELEBOT_MIME_TYPE_INT, + TELEBOT_MIME_TYPE_U_INT, + TELEBOT_MIME_TYPE_LONG_INT, + TELEBOT_MIME_TYPE_U_LONG_INT, + TELEBOT_MIME_TYPE_LONG_LONG_INT, + TELEBOT_MIME_TYPE_U_LONG_LONG_INT, + TELEBOT_MIME_TYPE_FLOAT, + TELEBOT_MIME_TYPE_DOUBLE, + TELEBOT_MIME_TYPE_LONG_DOUBLE, + TELEBOT_MIME_TYPE_STRING, TELEBOT_MIME_TYPE_FILE, TELEBOT_MIME_TYPE_MAX, } telebot_core_mime_e; -typedef struct { + +typedef struct telebot_core_mime_s +{ telebot_core_mime_e type; const char *name; - char data[TELEBOT_BUFFER_PAGE]; + union + { + char c; + int d; + unsigned int u; + long int ld; + unsigned long int lu; + long long lld; + unsigned long long llu; + float f; + double lf; + long double llf; + const char *s; + } data; + } telebot_core_mime_t; +/** + * @brief This object represents core handler. + */ +struct telebot_core_handler +{ + char *token; /**< Telegam bot token */ + char *proxy_addr; /**< Proxy address (optional) */ + char *proxy_auth; /**< Proxy authentication (optional) */ +}; + +/** + * @brief This object represents handler. + */ +struct telebot_handler +{ + telebot_core_handler_t core_h; /**< Core handler */ + int offset; /**< Offset value to get updates */ +}; + +/** + * @brief This object represents a telegram bot response. + */ +struct telebot_core_response +{ + telebot_error_e ret; /**< Telegram bot response code */ + size_t size; /**< Telegam bot response size */ + char *data; /**< Telegam bot response object */ +}; + #endif /* __TELEBOT_PRIVATE_H__ */ diff --git a/include/telebot-stickers.h b/include/telebot-stickers.h index 2e417f8..e172477 100644 --- a/include/telebot-stickers.h +++ b/include/telebot-stickers.h @@ -39,75 +39,6 @@ extern "C" { * @{ */ -/** - * @brief This object describes the position on faces where a mask should be - * placed by default. - */ -typedef struct telebot_mask_position { - /** - * The part of the face relative to which the mask should be placed. - * One of "forehead", "eyes", "mouth", or "chin". - */ - char *point; - - /** - * 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. - */ - float x_shift; - - /** - * 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. - */ - float y_shift; - - /** Mask scaling coefficient. For example, 2.0 means double size. */ - float scale; -} telebot_mask_position_t; - - -/** - * @brief This object represents a sticker. - */ -typedef struct telebot_sticker { - /** Identifier for this file, which can be used to download or reuse the file */ - char *file_id; - - /** - * 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. - */ - char *file_unique_id; - - /** Sticker width */ - int width; - - /** Sticker height */ - int height; - - /** True, if the sticker is animated */ - bool is_animated; - - /** Optional. Sticker thumbnail in .webp or .jpg format */ - struct telebot_photo *thumb; - - /** Optional. Emoji associated with the sticker. */ - char *emoji; - - /** Optional. Name of the sticker set to which the sticker belongs */ - char *set_name; - - /** Optional. For mask stickers, the position where the mask should be placed. */ - struct telebot_mask_position *mask_position; - - /** Optional. File size */ - int file_size; -} telebot_sticker_t; - - /** * @brief This object represents a sticker set. */ @@ -171,13 +102,21 @@ telebot_error_e telebot_get_sticker_set(telebot_handler_t handle, const char *na /** * @brief Release sticker set obtained with #telebot_get_sticker_set() * - * @param[in] handle The telebot handler created with #telebot_create(). * @param[in] stickers Pointer to sticker set to be released. * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative * error value. */ telebot_error_e telebot_put_sticker_set(telebot_sticker_set_t *stickers); +/** + * @brief Release a sticker object. + * + * @param[in] sticker Pointer to sticker to be released. + * @return on Success, #TELEBOT_ERROR_NONE is returned, otherwise a negative + * error value. + */ +telebot_error_e telebot_put_sticker(telebot_sticker_t *sticker); + /** * @} // end of APIs */ diff --git a/include/telebot-types.h b/include/telebot-types.h index 1f06e81..fd889c7 100644 --- a/include/telebot-types.h +++ b/include/telebot-types.h @@ -46,22 +46,138 @@ typedef enum telebot_update_type { TELEBOT_UPDATE_TYPE_EDITED_MESSAGE, /**< Edited message */ TELEBOT_UPDATE_TYPE_CHANNEL_POST, /**< Channel post */ TELEBOT_UPDATE_TYPE_EDITED_CHANNEL_POST, /**< Edited channel post */ + TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION, /**< Business connection */ + TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE, /**< Business message */ + TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE, /**< Edited business message */ + TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES, /**< Deleted business messages */ + TELEBOT_UPDATE_TYPE_MESSAGE_REACTION, /**< Message reaction updated */ + TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT, /**< Message reaction count updated */ TELEBOT_UPDATE_TYPE_INLINE_QUERY, /**< Inline query */ TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT, /**< Chosen inline result */ TELEBOT_UPDATE_TYPE_CALLBACK_QUERY, /**< Callback query */ TELEBOT_UPDATE_TYPE_SHIPPING_QUERY, /**< Shipping query */ TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY, /**< Pre-checkout query */ + TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA, /**< User purchased paid media */ TELEBOT_UPDATE_TYPE_POLL, /**< Poll */ TELEBOT_UPDATE_TYPE_POLL_ANSWER, /**< Poll answer */ + TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER, /**< My chat member updated */ + TELEBOT_UPDATE_TYPE_CHAT_MEMBER, /**< Chat member updated */ + TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST, /**< Chat join request */ + TELEBOT_UPDATE_TYPE_CHAT_BOOST, /**< Chat boost updated */ + TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST, /**< Chat boost removed */ TELEBOT_UPDATE_TYPE_MAX /**< Number of update types */ } telebot_update_type_e; +/** + * @brief Describes the birthdate of a user. + */ +typedef struct telebot_birthdate { + /** Day of the user's birth; 1-31 */ + int day; + + /** Month of the user's birth; 1-12 */ + int month; + + /** Optional. Year of the user's birth */ + int year; +} telebot_birthdate_t; + +/** + * @brief Contains information about the start page settings of a Telegram Business account. + */ +typedef struct telebot_business_intro { + /** Optional. Title text of the business intro */ + char *title; + + /** Optional. Message text of the business intro */ + char *message; + + /** Optional. Sticker of the business intro */ + struct telebot_sticker *sticker; +} telebot_business_intro_t; + +/** + * @brief Contains information about the location of a Telegram Business account. + */ +typedef struct telebot_business_location { + /** Address of the business */ + char *address; + + /** Optional. Location of the business */ + struct telebot_location *location; +} telebot_business_location_t; + +/** + * @brief Describes an interval of time during which a business is open. + */ +typedef struct telebot_business_opening_hours_interval { + /** The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60 */ + int opening_minute; + + /** The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60 */ + int closing_minute; +} telebot_business_opening_hours_interval_t; + +/** + * @brief Describes the opening hours of a business. + */ +typedef struct telebot_business_opening_hours { + /** Unique name of the time zone for which the opening hours are defined */ + char *time_zone_name; + + /** List of time intervals describing business opening hours */ + struct telebot_business_opening_hours_interval *opening_hours; + int count_opening_hours; +} telebot_business_opening_hours_t; + +/** + * @brief Represents the rights of a business bot. + */ +typedef struct telebot_business_bot_rights { + bool can_reply; + bool can_read_messages; + bool can_delete_sent_messages; + bool can_delete_all_messages; + bool can_edit_name; + bool can_edit_bio; + bool can_edit_profile_photo; + bool can_edit_username; + bool can_change_gift_settings; + bool can_view_gifts_and_stars; + bool can_convert_gifts_to_stars; + bool can_transfer_and_upgrade_gifts; + bool can_transfer_stars; + bool can_manage_stories; +} telebot_business_bot_rights_t; + +/** + * @brief Describes the connection of the bot with a business account. + */ +typedef struct telebot_business_connection { + char *id; + struct telebot_user *user; + long long int user_chat_id; + long date; + bool can_reply; + bool is_enabled; +} telebot_business_connection_t; + +/** + * @brief This object is received when messages are deleted from a connected business account. + */ +typedef struct telebot_business_messages_deleted { + char *business_connection_id; + struct telebot_chat *chat; + int *message_ids; + int count_message_ids; +} telebot_business_messages_deleted_t; + /** * @brief This object represents a Telegram user or bot. */ typedef struct telebot_user { /** Unique identifier for this user or bot. */ - int id; + long long int id; /** True, if this user is bot. */ bool is_bot; @@ -78,6 +194,12 @@ typedef struct telebot_user { /** Optional. IETF language tag of the user's language. */ char *language_code; + /** Optional. True, if this user is a Telegram Premium user. */ + bool is_premium; + + /** Optional. True, if this user added the bot to the attachment menu. */ + bool added_to_attachment_menu; + /** Optional. Optional. True, if the bot can be invited to groups. Returned only in getMe. */ bool can_join_groups; @@ -87,6 +209,18 @@ typedef struct telebot_user { /** Optional. True, if the bot supports inline queries. Returned only in getMe. */ bool supports_inline_queries; + /** Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. */ + bool can_connect_to_business; + + /** Optional. True, if the bot has a main Web App. Returned only in getMe. */ + bool has_main_web_app; + + /** Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. */ + bool has_topics_enabled; + + /** Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. */ + bool allows_users_to_create_topics; + } telebot_user_t; /** @@ -111,34 +245,136 @@ typedef struct telebot_chat { /** Optional. Last name of the other party in a private chat. */ char *last_name; + /** Optional. True, if the supergroup chat is a forum (has topics enabled). */ + bool is_forum; + + /** Optional. True, if the chat is the direct messages chat of a channel. */ + bool is_direct_messages; + + /** Optional. Identifier of the accent color for the chat name and backgrounds. */ + int accent_color_id; + + /** Optional. The maximum number of reactions that can be set on a message in the chat. */ + int max_reaction_count; + /** Optional. Chat photo. Returned only in getChat. */ struct telebot_chat_photo *photo; + /** Optional. If non-empty, the list of all active chat usernames; + * for private chats, supergroups and channels. Returned only in getChat. + */ + char **active_usernames; + int count_active_usernames; + + /** Optional. For private chats, the date of birth of the user. */ + struct telebot_birthdate *birthdate; + + /** Optional. For private chats with business accounts, the intro of the business. */ + struct telebot_business_intro *business_intro; + + /** Optional. For private chats with business accounts, the location of the business. */ + struct telebot_business_location *business_location; + + /** Optional. For private chats with business accounts, the opening hours of the business. */ + struct telebot_business_opening_hours *business_opening_hours; + + /** Optional. For private chats, the personal channel of the user. */ + struct telebot_chat *personal_chat; + + /** Optional. Information about the corresponding channel chat; for direct messages chats only. */ + struct telebot_chat *parent_chat; + + /** + * Optional. Custom emoji identifier of emoji status of the other party in + * a private chat. Returned only in getChat. + */ + char *emoji_status_custom_emoji_id; + + /** Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. */ + long emoji_status_expiration_date; + + /** Optional. Bio of the other party in a private chat. Returned only in getChat. */ + char *bio; + /** - * Optional. Desription, for supergroups and channel chats. + * Optional. True, if privacy settings of the other party in the private + * chat allows to use tg://user?id= links only in chats with the user. + * Returned only in getChat. + */ + bool has_private_forwards; + + /** + * Optional. True, if the privacy settings of the other party restrict + * sending voice and video note messages in the private chat. + * Returned only in getChat. + */ + bool has_restricted_voice_and_video_messages; + + /** + * Optional. True, if users need to join the supergroup before they can + * send messages. Returned only in getChat. + */ + bool join_to_send_messages; + + /** + * Optional. True, if all users directly joining the supergroup need + * to be approved by supergroup administrators. Returned only in getChat. + */ + bool join_by_request; + + /** + * Optional. Description, for supergroups and channel chats. * Returned only in getChat. */ char *description; /** - * Optional. Chat invite link, for supergroups and channel chats. + * Optional. Primary invite link, for groups, supergroups and channel chats. * Returned only in getChat. */ char *invite_link; - /** Optional. Pinned message, for supergroups. Returned only in getChat. */ + /** Optional. The most recent pinned message (by sending date). + * Returned only in getChat. + */ struct telebot_message *pinned_message; - /** Optional. Default chat member permissions, for groups and supergroups. + /** + * Optional. Default chat member permissions, for groups and supergroups. * Returned only in getChat. */ struct telebot_chat_permissions *permissions; - /** Optional. For supergroups, the minimum allowed delay between consecutive + /** + * Optional. For supergroups, the minimum allowed delay between consecutive * messages sent by each unpriviledged user. Returned only in getChat. */ int slow_mode_delay; + /** Optional. For supergroups, the minimum number of boosts that a non-administrator user needs. */ + int unrestrict_boost_count; + + /** + * Optional. The time after which all messages sent to the chat will be + * automatically deleted; in seconds. Returned only in getChat. + */ + int message_auto_delete_time; + + /** Optional. True, if aggressive anti-spam checks are enabled in the supergroup. */ + bool has_aggressive_anti_spam_enabled; + + /** Optional. True, if non-administrators can only get the list of bots and administrators in the chat. */ + bool has_hidden_members; + + /** + * Optional. True, if messages from the chat can't be forwarded to other chats. + * Returned only in getChat. + */ + bool has_protected_content; + + /** Optional. True, if new chat members will have access to old messages. */ + bool has_visible_history; + /** * Optional. For supergroups, name of group sticker set. * Returned only in getChat. @@ -151,57 +387,1475 @@ typedef struct telebot_chat { */ bool can_set_sticker_set; + /** Optional. For supergroups, the name of the group's custom emoji sticker set. */ + char *custom_emoji_sticker_set_name; + + /** + * Optional. Unique identifier for the linked chat, i.e. the discussion + * group identifier for a channel and vice versa; for supergroups and + * channel chats. Returned only in getChat. + */ + long long int linked_chat_id; + + /** + * Optional. For supergroups, the location to which the supergroup is connected. + * Returned only in getChat. + */ + struct telebot_chat_location *location; } telebot_chat_t; +/** + * @brief This object represents a game. + */ +typedef struct telebot_game { + /** Title of the game */ + char *title; + + /** Description of the game */ + char *description; + + /** Photo that will be displayed in the game message in chats. */ + struct telebot_photo *photo; + + /** Number of photos */ + int count_photo; + + /** + * Optional. Brief description of the game or high scores included in the + * game message. + */ + char *text; + + /** + * Optional. Special entities that appear in text, such as usernames, URLs, + * bot commands, etc. + */ + struct telebot_message_entity *text_entities; + int count_text_entities; + + /** + * Optional. Animation that will be displayed in the game message in chats. + */ + struct telebot_animation *animation; +} telebot_game_t; /** - * @brief This object represents a message. + * @brief This object represents a shipping address. */ -typedef struct telebot_message { - /** Unique message identifier */ - int message_id; +typedef struct telebot_shipping_address { + /** ISO 3166-1 alpha-2 country code */ + char *country_code; - /** Optional. Sender, can be empty for messages sent to channels */ - struct telebot_user *from; + /** State, if applicable */ + char *state; - /** Date the message was sent in Unix time */ - long date; + /** City */ + char *city; - /** Conversation the message belongs to */ - struct telebot_chat *chat; + /** First line for the address */ + char *street_line1; - /** Optional. For forwarded messages, sender of the original message */ - struct telebot_user *forward_from; + /** Second line for the address */ + char *street_line2; + + /** Address post code */ + char *post_code; +} telebot_shipping_address_t; + +/** + * @brief This object represents information about an order. + */ +typedef struct telebot_order_info { + /** Optional. User name */ + char *name; + + /** Optional. User's phone number */ + char *phone_number; + + /** Optional. User's email address */ + char *email; + + /** Optional. User's shipping address */ + struct telebot_shipping_address *shipping_address; +} telebot_order_info_t; + +/** + * @brief This object contains basic information about an invoice. + */ +typedef struct telebot_invoice { + /** Product name */ + char *title; + + /** Product description */ + char *description; /** - * Optional. For messages forwarded from channels, information about the - * original channel + * Unique bot deep-linking parameter that can be used to generate this + * invoice */ - struct telebot_chat *forward_from_chat; + char *start_parameter; + + /** Three-letter ISO 4217 currency code */ + char *currency; /** - * Optional. For messages forwarded from channels, identifier of the original - * message in the channel + * Total amount in the smallest units of the currency (integer, not + * float/double). */ - int forward_from_message_id; + int total_amount; +} telebot_invoice_t; + +/** + * @brief This object contains basic information about a successful payment. + */ +typedef struct telebot_successful_payment { + /** Three-letter ISO 4217 currency code */ + char *currency; /** - * Optional. For messages forwarded from channels, signature of the post - * author if present + * Total amount in the smallest units of the currency (integer, not + * float/double). */ - char *forward_signature; + int total_amount; + + /** Bot specified invoice payload */ + char *invoice_payload; + + /** Optional. Identifier of the shipping option chosen by the user */ + char *shipping_option_id; + + /** Optional. Order info provided by the user */ + struct telebot_order_info *order_info; + + /** Telegram payment identifier */ + char *telegram_payment_charge_id; + + /** Provider payment identifier */ + char *provider_payment_charge_id; +} telebot_successful_payment_t; + +/** + * @brief This object represents an internal identifier of a user in Telegram Passport. + */ +typedef struct telebot_passport_file { + /** Identifier for this file, which can be used to download or reuse the file */ + char *file_id; /** - * Optional. Sender's name for messages forwarded from users who disallow - * adding a link to their account in forwarded messages + * 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. */ - char *forward_sender_name; + char *file_unique_id; + + /** File size */ + int file_size; + + /** Unix time when the file was uploaded */ + long date; +} telebot_passport_file_t; +/** + * @brief This object represents one element of the Telegram Passport data. + */ +typedef struct telebot_encrypted_passport_element { /** - * Optional. For forwarded messages, date the original message was sent - * in Unix time + * Element type. One of "personal_details", "passport", "internal_passport", + * "driver_license", "id_card", "internal_passport", "address", + * "utility_bill", "bank_statement", "rental_agreement", + * "passport_registration", "temporary_registration", "phone_number", "email". + */ + char *type; + + /** + * Optional. Base64-encoded encrypted Telegram Passport element data + * provided by the user. + */ + char *data; + + /** Optional. User's verified phone number. */ + char *phone_number; + + /** Optional. User's verified email address. */ + char *email; + + /** Optional. Array of encrypted files with documents provided by the user. */ + struct telebot_passport_file *files; + int count_files; + + /** Optional. Encrypted file with the front side of the document. */ + struct telebot_passport_file *front_side; + + /** Optional. Encrypted file with the reverse side of the document. */ + struct telebot_passport_file *reverse_side; + + /** Optional. Encrypted file with the selfie of the user holding a document. */ + struct telebot_passport_file *selfie; + + /** Optional. Array of encrypted files with translated versions of documents. */ + struct telebot_passport_file *translation; + int count_translation; + + /** Base64-encoded element hash for using in PassportElementErrorUnspecified */ + char *hash; +} telebot_encrypted_passport_element_t; + +/** + * @brief This object represents credentials required to decrypt the data. + */ +typedef struct telebot_encrypted_credentials { + /** Base64-encoded encrypted JSON-serialized data with unique user's payload */ + char *data; + + /** Base64-encoded data hash */ + char *hash; + + /** Base64-encoded secret used for data decryption */ + char *secret; +} telebot_encrypted_credentials_t; + +/** + * @brief Contains information about Telegram Passport data which was shared + * with the bot by the user. + */ +typedef struct telebot_passport_data { + /** + * Array with information about documents and other Telegram Passport + * elements that were shared with the bot + */ + struct telebot_encrypted_passport_element *data; + int count_data; + + /** Encrypted credentials required to decrypt the data */ + struct telebot_encrypted_credentials *credentials; +} telebot_passport_data_t; + +/** + * @brief This object represents a service message about a user in the chat + * triggered another user's proximity alert while sharing Live Location. + */ +typedef struct telebot_proximity_alert_triggered { + /** User that triggered the alert */ + struct telebot_user *traveler; + + /** User that set the alert */ + struct telebot_user *watcher; + + /** The distance between the users */ + int distance; +} telebot_proximity_alert_triggered_t; + +/** + * @brief This object represents a service message about a new forum topic + * created in the chat. + */ +typedef struct telebot_forum_topic_created { + /** Name of the topic */ + char *name; + + /** Color of the topic icon in RGB format */ + int icon_color; + + /** Optional. Unique identifier of the custom emoji used as the topic icon */ + char *icon_custom_emoji_id; +} telebot_forum_topic_created_t; + +/** + * @brief This object represents a service message about a forum topic closed + * in the chat. + */ +typedef struct telebot_forum_topic_closed { + /** Empty struct as per Telegram API */ + bool dummy; +} telebot_forum_topic_closed_t; + +/** + * @brief This object represents a service message about a forum topic reopened + * in the chat. + */ +typedef struct telebot_forum_topic_reopened { + /** Empty struct as per Telegram API */ + bool dummy; +} telebot_forum_topic_reopened_t; + +/** + * @brief This object represents a service message about a video chat scheduled + * in the chat. + */ +typedef struct telebot_video_chat_scheduled { + /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */ + long start_date; +} telebot_video_chat_scheduled_t; + +/** + * @brief This object represents a service message about a video chat started + * in the chat. + */ +typedef struct telebot_video_chat_started { + /** Empty struct as per Telegram API */ + bool dummy; +} telebot_video_chat_started_t; + +/** + * @brief This object represents a service message about a video chat ended + * in the chat. + */ +typedef struct telebot_video_chat_ended { + /** Video chat duration in seconds */ + int duration; +} telebot_video_chat_ended_t; + +/** + * @brief This object represents a service message about new members invited to + * a video chat. + */ +typedef struct telebot_video_chat_participants_invited { + /** New members that were invited to the video chat */ + struct telebot_user *users; + int count_users; +} telebot_video_chat_participants_invited_t; + +/** + * @brief This object represents data sent by a Web App to the bot. + */ +typedef struct telebot_web_app_data { + /** The data. Be aware that a bad client can send arbitrary data in this field. */ + char *data; + + /** + * 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. + */ + char *button_text; +} telebot_web_app_data_t; + +/** + * @brief A placeholder, currently holds no information. Use BotFather to set up your game. + */ +typedef struct telebot_callback_game { + bool dummy; +} telebot_callback_game_t; + +/** + * @brief This object represents a parameter of the inline keyboard button used + * to automatically authorize a user. + */ +typedef struct telebot_login_url { + /** An HTTPS URL used to automatically authorize the user. */ + char *url; + + /** Optional. New text of the button in forwarded messages. */ + char *forward_text; + + /** Optional. Username of a bot, which will be used for user authorization. */ + char *bot_username; + + /** Optional. Pass True to request the permission for your bot to send messages to the user. */ + bool request_write_access; +} telebot_login_url_t; + +/** + * @brief This object represents an inline button that switches the current + * user to inline mode in a chosen chat. + */ +typedef struct telebot_switch_inline_query_chosen_chat { + /** Optional. The default inline query to be inserted in the input field. */ + char *query; + + /** Optional. True, if private chats with users can be chosen */ + bool allow_user_chats; + + /** Optional. True, if private chats with bots can be chosen */ + bool allow_bot_chats; + + /** Optional. True, if group and supergroup chats can be chosen */ + bool allow_group_chats; + + /** Optional. True, if channel chats can be chosen */ + bool allow_channel_chats; +} telebot_switch_inline_query_chosen_chat_t; + +/** + * @brief This object represents an inline keyboard button that copies + * specified text to the clipboard. + */ +typedef struct telebot_copy_text_button { + /** The text to be copied to the clipboard; 1-256 characters */ + char *text; +} telebot_copy_text_button_t; + +/** + * @brief This object represents one button of an inline keyboard. You must use + * exactly one of the optional fields. + */ +typedef struct telebot_inline_keyboard_button { + /** Label text on the button */ + char *text; + + /** Optional. HTTP or tg:// url to be opened when button is pressed */ + char *url; + + /** + * Optional. Data to be sent in a callback query to the bot when button is + * pressed, 1-64 bytes + */ + char *callback_data; + + /** + * Optional. Description of the Web App that will be launched when the user + * presses the button. + */ + struct telebot_web_app_info *web_app; + + /** + * Optional. An HTTPS URL used to automatically authorize the user. + */ + struct telebot_login_url *login_url; + + /** + * Optional. If set, pressing the button will prompt the user to select one + * of their chats, open that chat and insert the bot's username and the + * specified inline query in the input field. Can be empty, in which case + * just the bot's username will be inserted. + */ + char *switch_inline_query; + + /** + * Optional. If set, pressing the button will insert the bot's username and + * the specified inline query in the current chat's input field. Can be + * empty, in which case just the bot's username will be inserted. + */ + char *switch_inline_query_current_chat; + + /** + * Optional. If set, pressing the button will prompt the user to select one + * of their chats of the specified type. + */ + struct telebot_switch_inline_query_chosen_chat *switch_inline_query_chosen_chat; + + /** + * Optional. Description of the button that copies the specified text to the clipboard. + */ + struct telebot_copy_text_button *copy_text; + + /** + * Optional. Description of the game that will be launched when the user + * presses the button. + */ + struct telebot_callback_game *callback_game; + + /** + * Optional. Specify True, to send a Pay button. + * NOTE: This type of button must always be the first button in the first row. + */ + bool pay; +} telebot_inline_keyboard_button_t; + +/** + * @brief This object represents an inline keyboard that appears right next to + * the message it belongs to. + */ +typedef struct telebot_inline_keyboard_markup { + /** + * Array of button rows, each represented by an Array of + * InlineKeyboardButton objects + */ + telebot_inline_keyboard_button_t *inline_keyboard; + + /** Number of rows */ + int rows; + + /** Number of columns */ + int cols; +} telebot_inline_keyboard_markup_t; + +/** + * @brief This object represents a service message about a forum topic edited + * in the chat. + */ +typedef struct telebot_forum_topic_edited { + /** Optional. New name of the topic, if it was edited */ + char *name; + + /** Optional. New identifier of the custom emoji used as the topic icon, if it was edited */ + char *icon_custom_emoji_id; +} telebot_forum_topic_edited_t; + +/** + * @brief This object represents a service message about a general forum topic + * hidden in the chat. + */ +typedef struct telebot_general_forum_topic_hidden { + /** Empty struct as per Telegram API */ + bool dummy; +} telebot_general_forum_topic_hidden_t; + +/** + * @brief This object represents a service message about a general forum topic + * unhidden in the chat. + */ +typedef struct telebot_general_forum_topic_unhidden { + /** Empty struct as per Telegram API */ + bool dummy; +} telebot_general_forum_topic_unhidden_t; + +/** + * @brief This object represents a service message about a user allowing a bot + * to write messages after adding the bot to the attachment menu or launching + * a Web App from a link. + */ +typedef struct telebot_write_access_allowed { + /** Optional. Name of the Web App which was launched from a link */ + char *web_app_name; +} telebot_write_access_allowed_t; + +/** + * @brief This object contains information about the user whose identifier was + * shared with the bot using a KeyboardButtonRequestUser button. + */ +typedef struct telebot_user_shared { + /** Identifier of the request */ + int request_id; + + /** Identifier of the shared user. */ + long long int user_id; +} telebot_user_shared_t; + +/** + * @brief This object contains information about the chat whose identifier was + * shared with the bot using a KeyboardButtonRequestChat button. + */ +typedef struct telebot_chat_shared { + /** Identifier of the request */ + int request_id; + + /** Identifier of the shared chat. */ + long long int chat_id; +} telebot_chat_shared_t; + +/** + * @brief This object represents a chat invite link. + */ +typedef struct telebot_chat_invite_link { + /** The invite link. */ + char *invite_link; + + /** Creator of the link */ + struct telebot_user *creator; + + /** True, if users joining the chat via the link need to be approved by chat administrators */ + bool creates_join_request; + + /** True, if the link is primary */ + bool is_primary; + + /** True, if the link is revoked */ + bool is_revoked; + + /** Optional. Invite link name */ + char *name; + + /** Optional. Point in time (Unix timestamp) when the link will expire or has expired */ + long expire_date; + + /** Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ + int member_limit; + + /** Optional. Number of pending join requests created using this link */ + int pending_join_request_count; +} telebot_chat_invite_link_t; + +/** + * @brief This object represents changes in the status of a chat member. + */ +typedef struct telebot_chat_member_updated { + /** Chat the user belongs to */ + struct telebot_chat *chat; + + /** Performer of the action, which resulted in the change */ + struct telebot_user *from; + + /** Date the change was effected in Unix time */ + long date; + + /** Previous information about the chat member */ + struct telebot_chat_member *old_chat_member; + + /** New information about the chat member */ + struct telebot_chat_member *new_chat_member; + + /** Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */ + struct telebot_chat_invite_link *invite_link; + + /** Optional. True, if the user joined the chat via a chat folder invite link */ + bool via_chat_folder_invite_link; +} telebot_chat_member_updated_t; + +/** + * @brief This object represents a join request sent to a chat. + */ +typedef struct telebot_chat_join_request { + /** Chat to which the request was sent */ + struct telebot_chat *chat; + + /** User that sent the join request */ + struct telebot_user *from; + + /** Identifier of a private chat with the user who sent the join request. */ + long long int user_chat_id; + + /** Date the request was sent in Unix time */ + long date; + + /** Optional. Bio of the user. */ + char *bio; + + /** Optional. Chat invite link that was used by the user to send the join request */ + struct telebot_chat_invite_link *invite_link; +} telebot_chat_join_request_t; + +/** + * @brief This object represents a change of a reaction on a message performed + * by a user. + */ +typedef struct telebot_message_reaction_updated { + /** The chat where the reaction was changed */ + struct telebot_chat *chat; + + /** Unique identifier of the message inside the chat */ + int message_id; + + /** Optional. The user that changed the reaction, if the reaction was changed on behalf of a user */ + struct telebot_user *user; + + /** Optional. The chat on behalf of which the reaction was changed, if the reaction was changed on behalf of a chat */ + struct telebot_chat *actor_chat; + + /** Date of the change in Unix time */ + long date; + + /** List of reaction types that were set by the user */ + struct telebot_reaction_type *old_reaction; + int count_old_reaction; + + /** List of reaction types that are set by the user */ + struct telebot_reaction_type *new_reaction; + int count_new_reaction; +} telebot_message_reaction_updated_t; + +/** + * @brief This object represents reaction changes on a message with anonymous + * reactions. + */ +typedef struct telebot_message_reaction_count_updated { + /** The chat where the reactions were changed */ + struct telebot_chat *chat; + + /** Unique identifier of the message inside the chat */ + int message_id; + + /** Date of the change in Unix time */ + long date; + + /** List of reactions that are present on the message */ + struct telebot_reaction_count *reactions; + int count_reactions; +} telebot_message_reaction_count_updated_t; + +/** + * @brief This object represents a reaction type. + */ +typedef struct telebot_reaction_type { + /** Type of the reaction, currently can be "emoji" or "custom_emoji" */ + char *type; + + /** Optional. Reaction emoji. */ + char *emoji; + + /** Optional. Custom emoji identifier. */ + char *custom_emoji_id; +} telebot_reaction_type_t; + +/** + * @brief This object represents a reaction count. + */ +typedef struct telebot_reaction_count { + /** Type of the reaction */ + struct telebot_reaction_type type; + + /** Number of times the reaction was added */ + int total_count; +} telebot_reaction_count_t; + +/** + * @brief This object represents a boost added to a chat. + */ +typedef struct telebot_chat_boost_updated { + /** Chat which was boosted */ + struct telebot_chat *chat; + + /** Information about the boost */ + struct telebot_chat_boost *boost; +} telebot_chat_boost_updated_t; + +/** + * @brief This object contains information about a chat boost. + */ +typedef struct telebot_chat_boost { + /** Unique identifier of the boost */ + char *boost_id; + + /** Point in time (Unix timestamp) when the chat was boosted */ + long add_date; + + /** Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */ + long expiration_date; + + /** Source of the added boost */ + struct telebot_chat_boost_source *source; +} telebot_chat_boost_t; + +/** + * @brief This object represents the source of a chat boost. + */ +typedef struct telebot_chat_boost_source { + /** Source of the boost, one of "premium", "gift_code", "giveaway" */ + char *source; + + /** Optional. User that boosted the chat */ + struct telebot_user *user; +} telebot_chat_boost_source_t; + +/** + * @brief This object represents a boost removed from a chat. + */ +typedef struct telebot_chat_boost_removed { + /** Chat from which the boost was removed */ + struct telebot_chat *chat; + + /** Unique identifier of the boost */ + char *boost_id; + + /** Point in time (Unix timestamp) when the boost was removed */ + long remove_date; + + /** Source of the removed boost */ + struct telebot_chat_boost_source *source; +} telebot_chat_boost_removed_t; + +/** + * @brief This object describes the origin of a message. + */ +typedef struct telebot_message_origin { + /** Type of the message origin, can be "user", "hidden_user", "chat", "channel" */ + char *type; + + /** Date the message was sent originally in Unix time */ + long date; + + /** Optional. User that sent the message originally */ + struct telebot_user *sender_user; + + /** Optional. Name of the user that sent the message originally */ + char *sender_user_name; + + /** Optional. Chat that sent the message originally */ + struct telebot_chat *sender_chat; + + /** Optional. For messages originally sent by an anonymous chat administrator, original message author signature */ + char *author_signature; + + /** Optional. Unique message identifier inside the chat */ + int message_id; +} telebot_message_origin_t; + +/** + * @brief This object contains information about the quoted part of a message + * that is replied to by the given message. + */ +typedef struct telebot_text_quote { + /** Text of the quoted part of a message */ + char *text; + + /** Optional. Special entities that appear in the quote. */ + struct telebot_message_entity *entities; + int count_entities; + + /** Approximate quote position in the original message */ + int position; + + /** Optional. True, if the quote was chosen manually by the message sender. */ + bool is_manual; +} telebot_text_quote_t; + +/** + * @brief This object contains information about a story. + */ +typedef struct telebot_story { + /** Chat that posted the story */ + struct telebot_chat *chat; + + /** Unique identifier for the story in the chat */ + int id; +} telebot_story_t; + +/** + * @brief This object contains information about the message that is being + * replied to, which may come from another chat or forum topic. + */ +typedef struct telebot_external_reply_info { + /** Origin of the message replied to by the given message */ + struct telebot_message_origin origin; + + /** Optional. Chat the original message belongs to. */ + struct telebot_chat *chat; + + /** Optional. Unique message identifier inside the original chat. */ + int message_id; + + /** Optional. Options used for link preview generation for the original message */ + struct telebot_link_preview_options *link_preview_options; + + /** Optional. Message is an animation, information about the animation */ + struct telebot_animation *animation; + + /** Optional. Message is an audio file, information about the file */ + struct telebot_audio *audio; + + /** Optional. Message is a general file, information about the file */ + struct telebot_document *document; + + /** Optional. Message contains paid media; information about the paid media */ + struct telebot_paid_media_info *paid_media; + + /** Optional. Message is a photo, available sizes of the photo */ + struct telebot_photo *photos; + int count_photos; + + /** Optional. Message is a sticker, information about the sticker */ + struct telebot_sticker *sticker; + + /** Optional. Message is a forwarded story */ + struct telebot_story *story; + + /** Optional. Message is a video, information about the video */ + struct telebot_video *video; + + /** Optional. Message is a video note, information about the video message */ + struct telebot_video_note *video_note; + + /** Optional. Message is a voice message, information about the file */ + struct telebot_voice *voice; + + /** Optional. True, if the message media is covered by a spoiler animation */ + bool has_media_spoiler; + + /** Optional. Message is a shared contact, information about the contact */ + struct telebot_contact *contact; + + /** Optional. Message is a dice with random value */ + struct telebot_dice *dice; + + /** Optional. Message is a game, information about the game. */ + struct telebot_game *game; + + /** Optional. Message is a giveaway, information about the giveaway */ + struct telebot_giveaway *giveaway; + + /** Optional. A giveaway with public winners was completed */ + struct telebot_giveaway_winners *giveaway_winners; + + /** Optional. Message is an invoice for a payment, information about the invoice. */ + struct telebot_invoice *invoice; + + /** Optional. Message is a shared location, information about the location */ + struct telebot_location *location; + + /** Optional. Message is a native poll, information about the poll */ + struct telebot_poll *poll; + + /** Optional. Message is a venue, information about the venue */ + struct telebot_venue *venue; +} telebot_external_reply_info_t; + +/** + * @brief Describes the options used for link preview generation. + */ +typedef struct telebot_link_preview_options { + /** Optional. True, if the link preview is disabled */ + bool is_disabled; + + /** Optional. URL to use for the link preview. */ + char *url; + + /** Optional. True, if the media in the link preview is supposed to be shrunk */ + bool prefer_small_media; + + /** Optional. True, if the media in the link preview is supposed to be enlarged */ + bool prefer_large_media; + + /** Optional. True, if the link preview must be shown above the message text */ + bool show_above_text; +} telebot_link_preview_options_t; + +/** + * @brief This object describes paid media. + */ +typedef struct telebot_paid_media { + /** Type of the paid media, can be "preview", "photo", "video" */ + char *type; + + /** Optional. Media width as defined by the sender */ + int width; + + /** Optional. Media height as defined by the sender */ + int height; + + /** Optional. Duration of the media in seconds as defined by the sender */ + int duration; + + /** Optional. The photo */ + struct telebot_photo *photos; + int count_photos; + + /** Optional. The video */ + struct telebot_video *video; +} telebot_paid_media_t; + +/** + * @brief Describes the paid media added to a message. + */ +typedef struct telebot_paid_media_info { + /** The number of Telegram Stars that must be paid to buy access to the media */ + int star_count; + + /** Information about the paid media */ + struct telebot_paid_media *paid_media; + int count_paid_media; +} telebot_paid_media_info_t; + +/** + * @brief This object represents a message about a scheduled giveaway. + */ +typedef struct telebot_giveaway { + /** The list of chats which the user must join to participate in the giveaway */ + struct telebot_chat *chats; + int count_chats; + + /** Point in time (Unix timestamp) when winners of the giveaway will be selected */ + long winners_selection_date; + + /** The number of users which are supposed to be selected as winners of the giveaway */ + int winner_count; + + /** Optional. True, if only users who join the chats after the giveaway started should be eligible to win */ + bool only_new_members; + + /** Optional. True, if the list of giveaway winners will be visible to everyone */ + bool has_public_winners; + + /** Optional. Description of additional giveaway prize */ + char *prize_description; + + /** Optional. A list of two-letter ISO 3166-1 alpha-2 country codes */ + char **country_codes; + int count_country_codes; + + /** Optional. The number of Telegram Stars to be split between giveaway winners */ + int prize_star_count; + + /** Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for */ + int premium_subscription_month_count; +} telebot_giveaway_t; + +/** + * @brief This object represents a message about the completion of a giveaway + * with public winners. + */ +typedef struct telebot_giveaway_winners { + /** The chat that created the giveaway */ + struct telebot_chat *chat; + + /** Identifier of the message with the giveaway in the chat */ + int giveaway_message_id; + + /** Point in time (Unix timestamp) when winners of the giveaway were selected */ + long winners_selection_date; + + /** Total number of winners in the giveaway */ + int winner_count; + + /** List of winners of the giveaway */ + struct telebot_user *winners; + int count_winners; + + /** Optional. The number of other chats the user had to join in order to be eligible for the giveaway */ + int additional_chat_count; + + /** Optional. The number of Telegram Stars that were split between giveaway winners */ + int prize_star_count; + + /** Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for */ + int premium_subscription_month_count; + + /** Optional. Number of undistributed prizes */ + int unclaimed_prize_count; + + /** Optional. True, if only users who had joined the chats after the giveaway started were eligible to win */ + bool only_new_members; + + /** Optional. True, if the giveaway was canceled because the payment for it was refunded */ + bool was_refunded; + + /** Optional. Description of additional giveaway prize */ + char *prize_description; +} telebot_giveaway_winners_t; + +/** + * @brief This object represents a service message about a refunded payment. + */ +typedef struct telebot_refunded_payment { + /** Three-letter ISO 4217 currency code */ + char *currency; + + /** Total amount in the smallest units of the currency */ + int total_amount; + + /** Bot specified invoice payload */ + char *invoice_payload; + + /** Telegram payment identifier */ + char *telegram_payment_charge_id; + + /** Optional. Provider payment identifier */ + char *provider_payment_charge_id; +} telebot_refunded_payment_t; + +/** + * @brief This object contains information about the users whose identifiers + * were shared with the bot using a KeyboardButtonRequestUsers button. + */ +typedef struct telebot_users_shared { + /** Identifier of the request */ + int request_id; + + /** Information about users shared with the bot. */ + struct telebot_shared_user *users; + int count_users; +} telebot_users_shared_t; + +/** + * @brief This object contains information about a user that was shared with + * the bot. + */ +typedef struct telebot_shared_user { + /** Identifier of the shared user. */ + long long int user_id; + + /** Optional. First name of the user */ + char *first_name; + + /** Optional. Last name of the user */ + char *last_name; + + /** Optional. Username of the user */ + char *username; + + /** Optional. Available sizes of the chat photo */ + struct telebot_photo *photo; + int count_photo; +} telebot_shared_user_t; + +/** + * @brief This object represents a gift that can be sent by the bot. + */ +typedef struct telebot_gift { + /** Unique identifier of the gift */ + char *id; + + /** The sticker that represents the gift */ + struct telebot_sticker *sticker; + + /** The number of Telegram Stars that must be paid to send the sticker */ + int star_count; + + /** Optional. The number of Telegram Stars that must be paid to upgrade the gift */ + int upgrade_star_count; + + /** Optional. True, if the gift can only be purchased by Telegram Premium subscribers */ + bool is_premium; + + /** Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance */ + bool has_colors; + + /** Optional. The total number of gifts of this type that can be sent */ + int total_count; + + /** Optional. The number of remaining gifts */ + int remaining_count; +} telebot_gift_t; + +/** + * @brief Describes a regular gift that was sent or received. + */ +typedef struct telebot_gift_info { + /** Information about the gift */ + struct telebot_gift gift; + + /** Optional. Message text added to the gift */ + char *text; + + /** Optional. Special entities that appear in the text */ + struct telebot_message_entity *entities; + int count_entities; + + /** Optional. True, if the sender and gift text are shown only to the receiver */ + bool is_private; +} telebot_gift_info_t; + +/** + * @brief Describes a unique gift that was sent or received. + */ +typedef struct telebot_unique_gift_info { + /** Information about the gift */ + struct telebot_unique_gift *gift; + + /** Origin of the gift */ + char *origin; + + /** Optional. Currency in which the payment for the gift was done */ + char *last_resale_currency; + + /** Optional. Price paid for the gift */ + long long int last_resale_amount; +} telebot_unique_gift_info_t; + +/** + * @brief This object describes a unique gift that was upgraded from a regular gift. + */ +typedef struct telebot_unique_gift { + /** Identifier of the regular gift */ + char *gift_id; + + /** Unique name of the gift */ + char *name; + + /** Unique number of the upgraded gift */ + int number; + + /** Optional. Model of the gift */ + struct telebot_sticker *sticker; +} telebot_unique_gift_t; + +/** + * @brief This object represents a service message about a user boosting a chat. + */ +typedef struct telebot_chat_boost_added { + /** Number of boosts added by the user */ + int boost_count; +} telebot_chat_boost_added_t; + +/** + * @brief This object represents a chat background. + */ +typedef struct telebot_chat_background { + /** Type of the background */ + char *type; +} telebot_chat_background_t; + +/** + * @brief This object represents a service message about the creation of a scheduled giveaway. + */ +typedef struct telebot_giveaway_created { + /** Optional. The number of Telegram Stars to be split between giveaway winners */ + int prize_star_count; +} telebot_giveaway_created_t; + +/** + * @brief This object represents a service message about the completion of a giveaway + * without public winners. + */ +typedef struct telebot_giveaway_completed { + /** Number of winners in the giveaway */ + int winner_count; + + /** Optional. Number of undistributed prizes */ + int unclaimed_prize_count; + + /** Optional. Message with the giveaway that was completed */ + struct telebot_message *giveaway_message; + + /** Optional. True, if the giveaway is a Telegram Star giveaway */ + bool is_star_giveaway; +} telebot_giveaway_completed_t; + +/** + * @brief Describes an amount of Telegram Stars. + */ +typedef struct telebot_star_amount { + /** Integer amount of Telegram Stars, rounded to 0; can be negative */ + int amount; + + /** Optional. The number of 1/1000000000 shares of Telegram Stars */ + int nanostar_amount; +} telebot_star_amount_t; + +/** + * @brief Contains information about the affiliate that received a commission. + */ +typedef struct telebot_affiliate_info { + /** Optional. The bot or the user that received an affiliate commission */ + struct telebot_user *affiliate_user; + + /** Optional. The chat that received an affiliate commission */ + struct telebot_chat *affiliate_chat; + + /** The number of Telegram Stars received by the affiliate for each 1000 Stars */ + int commission_per_mille; + + /** Integer amount of Telegram Stars received by the affiliate */ + int amount; + + /** Optional. The number of 1/1000000000 shares of Telegram Stars */ + int nanostar_amount; +} telebot_affiliate_info_t; + +/** + * @brief This object describes the state of a revenue withdrawal operation. + */ +typedef struct telebot_revenue_withdrawal_state { + /** Type of the state, currently one of "pending", "succeeded", "failed" */ + char *type; + + /** Optional. Date the withdrawal was completed in Unix time */ + long date; + + /** Optional. An HTTPS URL that can be used to see transaction details */ + char *url; +} telebot_revenue_withdrawal_state_t; + +/** + * @brief This object describes the source of a transaction. + */ +typedef struct telebot_transaction_partner { + /** Type of the transaction partner */ + char *type; + + /** Optional. Type of the transaction */ + char *transaction_type; + + /** Optional. Information about the user */ + struct telebot_user *user; + + /** Optional. Information about the chat */ + struct telebot_chat *chat; + + /** Optional. Information about the affiliate */ + struct telebot_affiliate_info *affiliate; + + /** Optional. Bot-specified invoice payload */ + char *invoice_payload; + + /** Optional. The duration of the paid subscription */ + int subscription_period; + + /** Optional. Information about the paid media bought by the user */ + struct telebot_paid_media *paid_media; + int count_paid_media; + + /** Optional. Bot-specified paid media payload */ + char *paid_media_payload; + + /** Optional. The gift sent to the user by the bot */ + struct telebot_gift *gift; + + /** Optional. Number of months the gifted Telegram Premium subscription will be active for */ + int premium_subscription_duration; + + /** Optional. State of the transaction if the transaction is outgoing */ + struct telebot_revenue_withdrawal_state *withdrawal_state; + + /** Optional. Information about the bot that sponsored the affiliate program */ + struct telebot_user *sponsor_user; + + /** Optional. The number of Telegram Stars received by the bot for each 1000 Stars */ + int commission_per_mille; + + /** Optional. The number of successful requests that exceeded regular limits */ + int request_count; +} telebot_transaction_partner_t; + +/** + * @brief Describes a Telegram Star transaction. + */ +typedef struct telebot_star_transaction { + /** Unique identifier of the transaction. */ + char *id; + + /** Integer amount of Telegram Stars transferred by the transaction */ + int amount; + + /** Optional. The number of 1/1000000000 shares of Telegram Stars */ + int nanostar_amount; + + /** Date the transaction was created in Unix time */ + long date; + + /** Optional. Source of an incoming transaction */ + struct telebot_transaction_partner *source; + + /** Optional. Receiver of an outgoing transaction */ + struct telebot_transaction_partner *receiver; +} telebot_star_transaction_t; + +/** + * @brief Contains a list of Telegram Star transactions. + */ +typedef struct telebot_star_transactions { + /** The list of transactions */ + struct telebot_star_transaction *transactions; + int count_transactions; +} telebot_star_transactions_t; + +/** + * @brief This object contains information about a paid media purchase. + */ +typedef struct telebot_paid_media_purchased { + /** User who purchased the media */ + struct telebot_user *from; + + /** Bot-specified paid media payload */ + char *paid_media_payload; +} telebot_paid_media_purchased_t; + +/** + * @brief This object represents an error in the Telegram Passport element. + */ +typedef struct telebot_passport_element_error { + /** Error source */ + char *source; + + /** The section of the user's Telegram Passport which has the error */ + char *type; + + /** Name of the data field which has the error */ + char *field_name; + + /** Base64-encoded data hash */ + char *data_hash; + + /** Error message */ + char *message; + + /** Base64-encoded file hash */ + char *file_hash; + + /** List of base64-encoded file hashes */ + char **file_hashes; + int count_file_hashes; + + /** Base64-encoded element hash */ + char *element_hash; +} telebot_passport_element_error_t; + +/** + * @brief This object represents a game high score row. + */ +typedef struct telebot_game_high_score { + /** Position in high score table for the game */ + int position; + + /** User */ + struct telebot_user *user; + + /** Score */ + int score; +} telebot_game_high_score_t; + +/** + * @brief This object represents a message. + */ +typedef struct telebot_message { + /** Unique message identifier */ + int message_id; + + /** + * Unique identifier of a message thread to which the message belongs; + * for supergroups only + */ + int message_thread_id; + + /** Optional. Sender, can be empty for messages sent to channels */ + struct telebot_user *from; + + /** + * Optional. Sender of the message, sent on behalf of a chat. For example, + * the channel itself for channel posts, the supergroup itself for messages + * from anonymous group administrators, the linked channel for messages + * automatically forwarded to the discussion group. For backward compatibility, + * the field from contains a fake sender user in non-channel chats, + * if the message was sent on behalf of a chat. + */ + struct telebot_chat *sender_chat; + + /** Optional. If the sender of the message boosted the chat, the number of boosts */ + int sender_boost_count; + + /** Optional. The bot that actually sent the message on behalf of the business account. */ + struct telebot_user *sender_business_bot; + + /** Optional. Unique identifier of the business connection */ + char *business_connection_id; + + /** Date the message was sent in Unix time */ + long date; + + /** Conversation the message belongs to */ + struct telebot_chat *chat; + + /** Optional. Information about the original message for forwarded messages */ + struct telebot_message_origin *forward_origin; + + /** Optional. For forwarded messages, sender of the original message */ + struct telebot_user *forward_from; + + /** + * Optional. For messages forwarded from channels, information about the + * original channel + */ + struct telebot_chat *forward_from_chat; + + /** + * Optional. For messages forwarded from channels, identifier of the original + * message in the channel + */ + int forward_from_message_id; + + /** + * Optional. For messages forwarded from channels, signature of the post + * author if present + */ + char *forward_signature; + + /** + * Optional. Sender's name for messages forwarded from users who disallow + * adding a link to their account in forwarded messages + */ + char *forward_sender_name; + + /** + * Optional. For forwarded messages, date the original message was sent + * in Unix time + */ + long forward_date; + + /** Optional. True, if the message is sent to a forum topic */ + bool is_topic_message; + + /** + * Optional. True, if the message is a channel post that was automatically + * forwarded to the connected discussion group */ - long forward_date; + bool is_automatic_forward; /** * For replies, the original message. Note that the Message object in this @@ -210,9 +1864,27 @@ typedef struct telebot_message { */ struct telebot_message *reply_to_message; + /** Optional. Information about the message that is being replied to */ + struct telebot_external_reply_info *external_reply; + + /** Optional. For replies that quote part of the original message, the quoted part */ + struct telebot_text_quote *quote; + + /** Optional. For replies to a story, the original story */ + struct telebot_story *reply_to_story; + + /** Optional. Bot through which the message was sent */ + struct telebot_user *via_bot; + /** Optional. Date the message was last edited in Unix time */ long edit_date; + /** Optional. True, if the message can't be forwarded */ + bool has_protected_content; + + /** Optional. True, if the message is a paid post */ + bool is_paid_post; + /** * Optional. The unique identifier of a media message group this message * belongs to @@ -232,12 +1904,18 @@ typedef struct telebot_message { struct telebot_message_entity *entities; int count_entities; + /** Optional. Options used for link preview generation for the message */ + struct telebot_link_preview_options *link_preview_options; + + /** Optional. Unique identifier of the message effect added to the message */ + char *effect_id; + /** - * Optional. For messages with a caption, special entities like usernames, - * URLs, bot commands, etc. that appear in the caption. + * Optional. Message is an animation, information about the animation. + * For backward compatibility, when this field is set, the document field + * will also be set */ - struct telebot_message_entity *caption_entities; - int count_caption_entities; + struct telebot_animation *animation; /** Optional. Message is an audio file, information about the file */ struct telebot_audio *audio; @@ -245,11 +1923,8 @@ typedef struct telebot_message { /** Optional. Message is a general file, information about the file */ struct telebot_document *document; - /** Optional. Message is a animation, information about the animation */ - struct telebot_animation *animation; - - /** Optional. Message is a game, information about the game. */ - struct telebot_game *game; //TODO:define type + /** Optional. Message contains paid media; information about the paid media */ + struct telebot_paid_media_info *paid_media; /** Optional. Message is a photo, available sizes of the photo */ struct telebot_photo *photos; @@ -261,29 +1936,42 @@ typedef struct telebot_message { /** Optional. Message is a video, information about the video */ struct telebot_video *video; - /** Optional. Message is a voice message, information about the file */ - struct telebot_voice *voice; - /** Optional. Message is a video note, information about the video message */ struct telebot_video_note *video_note; + /** Optional. Message is a voice message, information about the file */ + struct telebot_voice *voice; + /** Optional. Caption for the photo or video */ char *caption; + /** + * Optional. For messages with a caption, special entities like usernames, + * URLs, bot commands, etc. that appear in the caption. + */ + struct telebot_message_entity *caption_entities; + int count_caption_entities; + + /** Optional. True, if the caption must be shown above the message media */ + bool show_caption_above_media; + /** Optional. Message is a shared contact, information about the contact */ struct telebot_contact *contact; - /** Optional. Message is a shared location, information about the location */ - struct telebot_location *location; + /** Optional. Message is a dice with random value from 1 to 6 */ + struct telebot_dice *dice; - /** Optional. Message is a venue, information about the venue */ - struct telebot_venue *venue; + /** Optional. Message is a game, information about the game. */ + struct telebot_game *game; /** Optional. Message is a native poll, information about the poll */ struct telebot_poll *poll; - /** Optional. Message is a dice with random value from 1 to 6 */ - struct telebot_dice *dice; + /** Optional. Message is a venue, information about the venue */ + struct telebot_venue *venue; + + /** Optional. Message is a shared location, information about the location */ + struct telebot_location *location; /** * Optional. New members that were added to the group or supergroup and @@ -318,6 +2006,9 @@ typedef struct telebot_message { /** Optional. Service message: the channel has been created */ bool channel_chat_created; + /** Optional. Service message: auto-delete timer settings changed in the chat */ + struct telebot_message_auto_delete_timer_changed *message_auto_delete_timer_changed; + /** * Optional. The group has been migrated to a supergroup with the specified * identifier, not exceeding 1e13 by absolute value @@ -341,25 +2032,97 @@ typedef struct telebot_message { * Optional. Message is an invoice for a payment, information about the * invoice. */ - struct telebot_invoice *invoice; //TODO:define type + struct telebot_invoice *invoice; /** * Optional. Message is a service message about a successful payment, * information about the payment. */ - struct telebot_successful_payment *successful_payment; //TODO:define type + struct telebot_successful_payment *successful_payment; + + /** Optional. Message is a service message about a refunded payment */ + struct telebot_refunded_payment *refunded_payment; + + /** Optional. Service message: the user allowed the bot to write messages */ + struct telebot_write_access_allowed *write_access_allowed; /** Optional. The domain name of the website on which the user has logged in.*/ char *connected_website; /** Telegram Passport data */ - struct telebot_passport_data *passport_data; //TODO:define type + struct telebot_passport_data *passport_data; + + /** + * Optional. Service message. A user in the chat triggered another user's + * proximity alert while sharing Live Location. + */ + struct telebot_proximity_alert_triggered *proximity_alert_triggered; + + /** Optional. Service message: forum topic created. */ + struct telebot_forum_topic_created *forum_topic_created; + + /** Optional. Service message: forum topic edited. */ + struct telebot_forum_topic_edited *forum_topic_edited; + + /** Optional. Service message: forum topic closed. */ + struct telebot_forum_topic_closed *forum_topic_closed; + + /** Optional. Service message: forum topic reopened. */ + struct telebot_forum_topic_reopened *forum_topic_reopened; + + /** Optional. Service message: general forum topic hidden. */ + struct telebot_general_forum_topic_hidden *general_forum_topic_hidden; + + /** Optional. Service message: general forum topic unhidden. */ + struct telebot_general_forum_topic_unhidden *general_forum_topic_unhidden; + + /** Optional. Service message: video chat scheduled. */ + struct telebot_video_chat_scheduled *video_chat_scheduled; + + /** Optional. Service message: video chat started. */ + struct telebot_video_chat_started *video_chat_started; + + /** Optional. Service message: video chat ended. */ + struct telebot_video_chat_ended *video_chat_ended; + + /** Optional. Service message: new participants invited to a video chat. */ + struct telebot_video_chat_participants_invited *video_chat_participants_invited; + + /** Optional. Service message: data sent by a Web App. */ + struct telebot_web_app_data *web_app_data; + + /** Optional. Service message: users were shared with the bot */ + struct telebot_users_shared *users_shared; + + /** Optional. Service message: a chat was shared with the bot */ + struct telebot_chat_shared *chat_shared; + + /** Optional. Service message: a regular gift was sent or received */ + struct telebot_gift_info *gift; + + /** Optional. Service message: a unique gift was sent or received */ + struct telebot_unique_gift_info *unique_gift; + + /** Optional. Service message: user boosted the chat */ + struct telebot_chat_boost_added *boost_added; + + /** Optional. Service message: chat background set */ + struct telebot_chat_background *chat_background_set; + + /** Optional. Service message: giveaway created */ + struct telebot_giveaway_created *giveaway_created; + + /** Optional. Service message: giveaway completed */ + struct telebot_giveaway_completed *giveaway_completed; + + /** Optional. True, if the message media is covered by a spoiler animation */ + bool has_media_spoiler; /** * Inline keyboard attached to the message. login_url buttons are * represented as ordinary url buttons. */ - struct inline_keyboard_markup *reply_markup; //TODO:define type + struct telebot_inline_keyboard_markup *reply_markup; } telebot_message_t; /** @@ -453,6 +2216,83 @@ typedef struct telebot_audio { struct telebot_photo *thumb; } telebot_audio_t; +/** + * @brief This object represent a list of gifts. + */ +typedef struct telebot_gifts { + /** The list of gifts */ + telebot_gift_t *gifts; + /** Number of gifts */ + int count; +} telebot_gifts_t; + +/** + * @brief This object represents a list of user profile audios. + */ +typedef struct telebot_user_profile_audios { + /** Total number of audios in the list */ + int total_count; + /** The list of audios */ + telebot_audio_t *audios; + /** Number of audios in the list */ + int count; +} telebot_user_profile_audios_t; + +/** + * @brief This object represents a gift received by a user. + */ +typedef struct telebot_user_gift { + /** Unique identifier of the gift */ + char *gift_id; + + /** Optional. The user that sent the gift */ + struct telebot_user *sender_user; + + /** Optional. Message text added to the gift */ + char *text; + + /** Optional. Special entities that appear in the text */ + struct telebot_message_entity *entities; + /** Number of entities */ + int count_entities; + + /** Information about the gift */ + telebot_gift_t *gift; + + /** Date the gift was sent */ + long date; + + /** Optional. Message identifier of the message with the gift */ + int message_id; + + /** Optional. The number of Telegram Stars that must be paid to upgrade the gift */ + int upgrade_star_count; + + /** Optional. True, if the gift is upgraded */ + bool is_upgraded; +} telebot_user_gift_t; + +/** + * @brief This object represents a list of gifts received by a user. + */ +typedef struct telebot_user_gifts { + /** Total number of gifts in the list */ + int total_count; + /** The list of gifts */ + telebot_user_gift_t *gifts; + /** Number of gifts in the list */ + int count; +} telebot_user_gifts_t; + +/** + * @brief This object represents a list of user chat boosts. + */ +typedef struct telebot_user_chat_boosts { + /** The list of boosts */ + telebot_chat_boost_t *boosts; + /** Number of boosts */ + int count; +} telebot_user_chat_boosts_t; /** * @brief This object represents a general file (as opposed to photos, voice @@ -790,6 +2630,78 @@ typedef struct telebot_keyboard_button_poll_type { char *type; } telebot_keyboard_button_poll_type_t; +/** + * @brief This object defines the criteria used to request suitable users. + */ +typedef struct telebot_keyboard_button_request_users { + /** Identifier of the request */ + int request_id; + + /** Optional. Pass True to request bots, pass False to request regular users. */ + bool user_is_bot; + + /** Optional. Pass True to request premium users, pass False to request non-premium users. */ + bool user_is_premium; + + /** Optional. The maximum number of users to be selected; 1-10. */ + int max_quantity; + + /** Optional. Pass True to request the users' first and last names */ + bool request_name; + + /** Optional. Pass True to request the users' usernames */ + bool request_username; + + /** Optional. Pass True to request the users' photos */ + bool request_photo; +} telebot_keyboard_button_request_users_t; + +/** + * @brief This object defines the criteria used to request a suitable chat. + */ +typedef struct telebot_keyboard_button_request_chat { + /** Identifier of the request */ + int request_id; + + /** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */ + bool chat_is_channel; + + /** Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. */ + bool chat_is_forum; + + /** Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. */ + bool chat_has_username; + + /** Optional. Pass True to request a chat owned by the user. */ + bool chat_is_created; + + /** Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. */ + struct telebot_chat_administrator_rights *user_administrator_rights; + + /** Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. */ + struct telebot_chat_administrator_rights *bot_administrator_rights; + + /** Optional. Pass True to request a chat with the bot as a member. */ + bool bot_is_member; + + /** Optional. Pass True to request the chat's title */ + bool request_title; + + /** Optional. Pass True to request the chat's username */ + bool request_username; + + /** Optional. Pass True to request the chat's photo */ + bool request_photo; +} telebot_keyboard_button_request_chat_t; + +/** + * @brief Describes a Web App. + */ +typedef struct telebot_web_app_info { + /** An HTTPS URL of a Web App to be opened */ + char *url; +} telebot_web_app_info_t; + /** * @brief This object represents one button of the reply keyboard. For simple * text buttons String can be used instead of this object to specify text of @@ -803,6 +2715,20 @@ typedef struct telebot_keyboard_button { */ char *text; + /** + * Optional. If specified, pressing the button will open a list of suitable + * users. Identifiers of selected users will be sent to the bot in a + * "users_shared" service message. Available in private chats only. + */ + struct telebot_keyboard_button_request_users *request_users; + + /** + * Optional. If specified, pressing the button will open a list of suitable + * chats. Tapping on a chat will send its identifier to the bot in a + * "chat_shared" service message. Available in private chats only. + */ + struct telebot_keyboard_button_request_chat *request_chat; + /** * Optional. If True, the user's phone number will be sent as a contact * when the button is pressed. Available in private chats only. @@ -819,6 +2745,13 @@ typedef struct telebot_keyboard_button { * it to the bot when the button is pressed. Available in private chats only */ telebot_keyboard_button_poll_type_t *request_poll; + + /** + * Optional. If specified, the described Web App will be launched when the + * button is pressed. The Web App will be able to send a "web_app_data" + * service message. Available in private chats only. + */ + struct telebot_web_app_info *web_app; } telebot_keyboard_button_t; /** @@ -837,6 +2770,12 @@ typedef struct telebot_reply_keyboard_markup { /* Number of keyboard columns */ int keyboard_cols; + /** + * Optional. Requests clients to always show the keyboard when the regular + * keyboard is hidden. Defaults to false. + */ + bool is_persistent; + /** * Optional. Requests clients to resize the keyboard vertically for optimal * fit (e.g., make the keyboard smaller if there are just two rows of buttons). @@ -1185,6 +3124,204 @@ typedef struct telebot_response_paramters { int retry_after; } telebot_response_paramters_t; +/** + * @brief This object represents an incoming inline query. When the user sends + * an empty query, your bot could return some default or trending results. + */ +typedef struct telebot_inline_query { + /** Unique identifier for this query */ + char *id; + + /** Sender */ + struct telebot_user *from; + + /** Text of the query (up to 256 characters) */ + char *query; + + /** Offset of the results to be returned, can be controlled by the bot */ + char *offset; + + /** Optional. Type of the chat from which the inline query was sent */ + char *chat_type; + + /** Optional. Sender location, only for bots that request user location */ + struct telebot_location *location; +} telebot_inline_query_t; + +/** + * @brief Represents a result of an inline query that was chosen by the user + * and sent to their chat partner. + */ +typedef struct telebot_chosen_inline_result { + /** The unique identifier for the result that was chosen */ + char *result_id; + + /** The user who chose the result */ + struct telebot_user *from; + + /** Optional. Sender location, only for bots that request user location */ + struct telebot_location *location; + + /** + * 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. + */ + char *inline_message_id; + + /** The query that was used to obtain the result */ + char *query; +} telebot_chosen_inline_result_t; + +/** + * @brief This object contains information about an incoming shipping query. + */ +typedef struct telebot_shipping_query { + /** Unique query identifier */ + char *id; + + /** User who sent the query */ + struct telebot_user *from; + + /** Bot specified invoice payload */ + char *invoice_payload; + + /** User specified shipping address */ + struct telebot_shipping_address *shipping_address; +} telebot_shipping_query_t; + +/** + * @brief This object contains information about an incoming pre-checkout query. + */ +typedef struct telebot_pre_checkout_query { + /** Unique query identifier */ + char *id; + + /** User who sent the query */ + struct telebot_user *from; + + /** Three-letter ISO 4217 currency code */ + char *currency; + + /** + * Total amount in the smallest units of the currency (integer, not + * float/double). + */ + int total_amount; + + /** Bot specified invoice payload */ + char *invoice_payload; + + /** Optional. Identifier of the shipping option chosen by the user */ + char *shipping_option_id; + + /** Optional. Order info provided by the user */ + struct telebot_order_info *order_info; +} telebot_pre_checkout_query_t; + +/** + * @brief This object describes the position on faces where a mask should be + * placed by default. + */ +typedef struct telebot_mask_position { + /** + * The part of the face relative to which the mask should be placed. + * One of "forehead", "eyes", "mouth", or "chin". + */ + char *point; + + /** + * 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. + */ + float x_shift; + + /** + * 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. + */ + float y_shift; + + /** Mask scaling coefficient. For example, 2.0 means double size. */ + float scale; +} telebot_mask_position_t; + +/** + * @brief This object represents a sticker. + */ +typedef struct telebot_sticker { + /** Identifier for this file, which can be used to download or reuse the file */ + char *file_id; + + /** + * 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. + */ + char *file_unique_id; + + /** Sticker width */ + int width; + + /** Sticker height */ + int height; + + /** True, if the sticker is animated */ + bool is_animated; + + /** Optional. Sticker thumbnail in .webp or .jpg format */ + struct telebot_photo *thumb; + + /** Optional. Emoji associated with the sticker. */ + char *emoji; + + /** Optional. Name of the sticker set to which the sticker belongs */ + char *set_name; + + /** Optional. For mask stickers, the position where the mask should be placed. */ + struct telebot_mask_position *mask_position; + + /** Optional. File size */ + int file_size; +} telebot_sticker_t; + +/** + * @brief This object represents a forum topic. + */ +typedef struct telebot_forum_topic { + /** Unique identifier of the forum topic */ + int message_thread_id; + + /** Name of the topic */ + char *name; + + /** Color of the topic icon in RGB format */ + int icon_color; + + /** Optional. Unique identifier of the custom emoji used as the topic icon */ + char *icon_custom_emoji_id; +} telebot_forum_topic_t; + +/** + * @brief This object represents a prepared inline message. + */ +typedef struct telebot_prepared_inline_message { + /** Unique identifier of the prepared message */ + char *id; + + /** Expiration date of the prepared message */ + long expiration_date; +} telebot_prepared_inline_message_t; + +/** + * @brief This object represents a message sent via a Web App. + */ +typedef struct telebot_sent_web_app_message { + /** Optional. Identifier of the sent inline message. */ + char *inline_message_id; +} telebot_sent_web_app_message_t; + /** * @brief This object represents an incoming update. */ @@ -1213,24 +3350,39 @@ typedef struct telebot_update { /** New version of a channel post that is known to the bot and was edited */ telebot_message_t edited_channel_post; + /** The bot was connected to or disconnected from a business account */ + telebot_business_connection_t business_connection; + + /** New message from a connected business account */ + telebot_message_t business_message; + + /** New version of a message from a connected business account */ + telebot_message_t edited_business_message; + + /** Messages were deleted from a connected business account */ + telebot_business_messages_deleted_t deleted_business_messages; + /** New incoming inline query */ - //TODO: telebot_inline_query_t inline_query; + telebot_inline_query_t inline_query; /** * The result of an inline query that was chosen by a user and sent to * their chat partner. Please see our documentation on the feedback collecting * for details on how to enable these updates for your bot. */ - //TODO: telebot_inline_query_result_t chosen_inline_result; + telebot_chosen_inline_result_t chosen_inline_result; /** New incoming callback query */ telebot_callback_query_t callback_query; /** New incoming shipping query. Only for invoices with flexible price */ - //TODO: telebot_shipping_query_t shipping_query; + telebot_shipping_query_t shipping_query; /** New incoming pre-checkout query. Contains full information about checkout */ - //TODO: telebot_pre_checkout_query_t pre_checkout_query; + telebot_pre_checkout_query_t pre_checkout_query; + + /** A user purchased paid media */ + telebot_paid_media_purchased_t purchased_paid_media; /** * New poll state. Bots receive only updates about stopped polls and @@ -1243,6 +3395,27 @@ typedef struct telebot_update { * new votes only in polls that were sent by the bot itself. */ telebot_poll_answer_t poll_answer; + + /** The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. */ + telebot_chat_member_updated_t my_chat_member; + + /** A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates. */ + telebot_chat_member_updated_t chat_member; + + /** A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */ + telebot_chat_join_request_t chat_join_request; + + /** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. */ + telebot_message_reaction_updated_t message_reaction; + + /** Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. */ + telebot_message_reaction_count_updated_t message_reaction_count; + + /** A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. */ + telebot_chat_boost_updated_t chat_boost; + + /** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */ + telebot_chat_boost_removed_t chat_boost_removed; }; } telebot_update_t; @@ -1290,10 +3463,30 @@ typedef struct telebot_webhook_info { } telebot_webhook_info_t; +/** + * @brief Thi object represetns information about the current status of a webhook. + */ +typedef struct telebot_chat_location { + /** The location to which the supergroup is connected. Can't be a live location.*/ + struct telebot_location *location; + + /** Location address; 1-64 characters, as defined by the chat owner */ + char *address; +} telebot_chat_location_t; + +/** + * @brief This object represents a service message about a change in + * auto-delete timer settings. + */ +typedef struct telebot_message_auto_delete_timer_changed { + /** New auto-delete time for messages in the chat; in seconds */ + int message_auto_delete_time; +} telebot_message_auto_delete_timer_changed_t; + /** * @brief This is opaque object to represent a telebot handler. */ -typedef struct telebot_handler_s *telebot_handler_t; +typedef struct telebot_handler *telebot_handler_t; /** * @} // end of APIs diff --git a/include/telebot.h b/include/telebot.h index cc211d2..653c8b7 100644 --- a/include/telebot.h +++ b/include/telebot.h @@ -19,9 +19,23 @@ #ifndef __TELEBOT_H__ #define __TELEBOT_H__ +/** + * @file telebot.h + * @ingroup TELEBOT_API + * @brief This file includes all the header files of the telegram bot library + * @author Elmurod Talipov + * @date 2026-02-28 + */ + #include "telebot-common.h" #include "telebot-types.h" #include "telebot-methods.h" +#include "telebot-stickers.h" +#include "telebot-inline.h" +#include "telebot-payments.h" +#include "telebot-passport.h" +#include "telebot-games.h" +#include "telebot-forums.h" #endif /* __TELEBOT_H__ */ diff --git a/src/telebot-core.c b/src/telebot-core.c index e6ddd64..29d7eac 100644 --- a/src/telebot-core.c +++ b/src/telebot-core.c @@ -18,169 +18,62 @@ * limitations under the License. */ -#include +#include +#include #include +#include #include -#include -#include #include -#include -#include -#include +#include #include #include +#include +#include -void telebot_core_put_response(telebot_core_response_t *response) +telebot_error_e telebot_core_get_response_code(telebot_core_response_t response) { if (response) - { - TELEBOT_SAFE_FZCNT(response->data, response->size); - } + return response->ret; + else + // response is NULL, probably could not allocate memory + return TELEBOT_ERROR_OUT_OF_MEMORY; } -static size_t write_data_cb(void *contents, size_t size, size_t nmemb, void *userp) +const char *telebot_core_get_response_data(telebot_core_response_t response) { - telebot_core_response_t *resp = (telebot_core_response_t *)userp; - size_t r_size = size * nmemb; - - char *data = (char *)realloc(resp->data, resp->size + r_size + 1); - if (data == NULL) - { - ERR("Failed to allocate memory, size:%u", (unsigned int)r_size); - TELEBOT_SAFE_FZCNT(resp->data, resp->size); - return 0; - } - memcpy((data + resp->size), contents, r_size); - resp->data = data; - resp->size += r_size; - resp->data[resp->size] = 0; - - return r_size; + if (response) + return response->data; + else + return NULL; } -static telebot_error_e telebot_core_curl_perform(telebot_core_handler_t *core_h, - const char *method, telebot_core_mime_t mimes[], size_t size, - telebot_core_response_t *resp) +void telebot_core_put_response(telebot_core_response_t response) { - CURLcode res; - CURL *curl_h = NULL; - curl_mime *mime = NULL; - long resp_code = 0L; - int ret = TELEBOT_ERROR_NONE; - - if (resp == NULL) - { - return TELEBOT_ERROR_INVALID_PARAMETER; - } - resp->data = (char *)malloc(1); - resp->size = 0; - - curl_h = curl_easy_init(); - if (curl_h == NULL) - { - ERR("Failed to init curl"); - ret = TELEBOT_ERROR_OUT_OF_MEMORY; - goto finish; - } - - char URL[TELEBOT_URL_SIZE]; - snprintf(URL, TELEBOT_URL_SIZE, "%s/bot%s/%s", TELEBOT_API_URL, core_h->token, method); - curl_easy_setopt(curl_h, CURLOPT_URL, URL); - curl_easy_setopt(curl_h, CURLOPT_WRITEFUNCTION, write_data_cb); - curl_easy_setopt(curl_h, CURLOPT_WRITEDATA, resp); - - if (core_h->proxy_addr != NULL) - { - curl_easy_setopt(curl_h, CURLOPT_PROXY, core_h->proxy_addr); - if (core_h->proxy_auth != NULL) - { - curl_easy_setopt(curl_h, CURLOPT_PROXYAUTH, CURLAUTH_ANY); - curl_easy_setopt(curl_h, CURLOPT_PROXYUSERPWD, core_h->proxy_auth); - } - } - - if (size > 0) - { - mime = curl_mime_init(curl_h); - if (mime == NULL) - { - ERR("Failed to create mime"); - ret = TELEBOT_ERROR_OUT_OF_MEMORY; - goto finish; - } - for (int index = 0; index < size; index++) - { - curl_mimepart *part = curl_mime_addpart(mime); - if (part == NULL) - { - ERR("Failed to create mime part"); - ret = TELEBOT_ERROR_OUT_OF_MEMORY; - goto finish; - } - curl_mime_name(part, mimes[index].name); - if (mimes[index].type == TELEBOT_MIME_TYPE_FILE) - curl_mime_filedata(part, mimes[index].data); - else - curl_mime_data(part, mimes[index].data, CURL_ZERO_TERMINATED); - } - - curl_easy_setopt(curl_h, CURLOPT_MIMEPOST, mime); - } - - res = curl_easy_perform(curl_h); - if (res != CURLE_OK) - { - ERR("Failed to curl_easy_perform\nError: %s (%d)", curl_easy_strerror(res), res); - ret = TELEBOT_ERROR_OPERATION_FAILED; - goto finish; - } - - curl_easy_getinfo(curl_h, CURLINFO_RESPONSE_CODE, &resp_code); - if (resp_code != 200L) + if (response) { - ret = TELEBOT_ERROR_OPERATION_FAILED; - - struct json_object *obj = json_tokener_parse(resp->data); - if (obj == NULL) { - ERR("HTTP error: %ld", resp_code); - ERR("Response: %s", resp->data); - } else { - ERR("HTTP error: %d - \"%s\"", - json_object_get_int(json_object_object_get(obj, "error_code")), - json_object_get_string(json_object_object_get(obj, "description"))); - } - - goto finish; + TELEBOT_SAFE_FZCNT(response->data, response->size); + TELEBOT_SAFE_FREE(response); } - - DBG("Response: %s", resp->data); - -finish: - if (ret != TELEBOT_ERROR_NONE) - TELEBOT_SAFE_FZCNT(resp->data, resp->size); - if (mime) - curl_mime_free(mime); - if (curl_h) - curl_easy_cleanup(curl_h); - - return ret; } -telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char *token) +telebot_error_e +telebot_core_create(telebot_core_handler_t *core_h, const char *token) { - if ((token == NULL) || (core_h == NULL)) + if ((core_h == NULL) || (token == NULL)) { - ERR("Token(0x%p) or core_h(0x%p) is NULL", token, core_h); + ERR("Either pointer for core handler (%p) or token (%p) is null", core_h, token); return TELEBOT_ERROR_INVALID_PARAMETER; } + *core_h = NULL; - telebot_core_handler_t *_core_h = calloc(1, sizeof(telebot_core_handler_t)); + telebot_core_handler_t _core_h = malloc(sizeof(struct telebot_core_handler)); if (_core_h == NULL) { ERR("Failed to allocate memory"); return TELEBOT_ERROR_OUT_OF_MEMORY; } + _core_h->token = strdup(token); if (_core_h->token == NULL) { @@ -198,13 +91,14 @@ telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h) +telebot_error_e +telebot_core_destroy(telebot_core_handler_t *core_h) { curl_global_cleanup(); if ((core_h == NULL) || (*core_h == NULL)) { - ERR("Handler is NULL"); + ERR("Core handler is null"); return TELEBOT_ERROR_INVALID_PARAMETER; } @@ -230,8 +124,8 @@ telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h) return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, - const char *addr, const char *auth) +telebot_error_e +telebot_core_set_proxy(telebot_core_handler_t core_h, const char *addr, const char *auth) { if ((addr == NULL) || (core_h == NULL)) { @@ -259,7 +153,8 @@ telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **addr) +telebot_error_e +telebot_core_get_proxy(telebot_core_handler_t core_h, char **addr) { if ((addr == NULL) || (core_h == NULL)) { @@ -274,814 +169,985 @@ telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **ad return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_core_get_updates(telebot_core_handler_t *core_h, - int offset, int limit, int timeout, const char *allowed_updates, - telebot_core_response_t *response) +static size_t write_data_cb(void *contents, size_t size, size_t nmemb, void *userp) { - if ((core_h == NULL) || (core_h->token == NULL)) + telebot_core_response_t resp = (telebot_core_response_t)userp; + size_t r_size = size * nmemb; + + char *data = (char *)realloc(resp->data, resp->size + r_size + 1); + if (data == NULL) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + ERR("Failed to allocate memory, size:%u", (unsigned int)r_size); + TELEBOT_SAFE_FZCNT(resp->data, resp->size); + return 0; } + memcpy((data + resp->size), contents, r_size); + resp->data = data; + resp->size += r_size; + resp->data[resp->size] = 0; - if (limit > TELEBOT_UPDATE_COUNT_MAX_LIMIT) - limit = TELEBOT_UPDATE_COUNT_MAX_LIMIT; + return r_size; +} - int index = 0; - telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "offset"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", offset); - ++index; +static void telebot_core_copy_mime_data_to_part(telebot_core_mime_t *mime, curl_mimepart *part) +{ + curl_mime_name(part, mime->name); + + char buffer[TELEBOT_BUFFER_PAGE]; + switch (mime->type) + { + case TELEBOT_MIME_TYPE_CHAR: + snprintf(buffer, sizeof(buffer), "%c", mime->data.c); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_INT: + snprintf(buffer, sizeof(buffer), "%d", mime->data.d); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_U_INT: + snprintf(buffer, sizeof(buffer), "%u", mime->data.u); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_LONG_INT: + snprintf(buffer, sizeof(buffer), "%ld", mime->data.ld); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_U_LONG_INT: + snprintf(buffer, sizeof(buffer), "%lu", mime->data.lu); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_LONG_LONG_INT: + snprintf(buffer, sizeof(buffer), "%lld", mime->data.lld); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_U_LONG_LONG_INT: + snprintf(buffer, sizeof(buffer), "%llu", mime->data.llu); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_FLOAT: + snprintf(buffer, sizeof(buffer), "%f", mime->data.f); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_DOUBLE: + snprintf(buffer, sizeof(buffer), "%lf", mime->data.lf); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_LONG_DOUBLE: + snprintf(buffer, sizeof(buffer), "%Lf", mime->data.llf); + curl_mime_data(part, buffer, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_STRING: + curl_mime_data(part, mime->data.s, CURL_ZERO_TERMINATED); + break; + case TELEBOT_MIME_TYPE_FILE: + curl_mime_filedata(part, mime->data.s); + break; + case TELEBOT_MIME_TYPE_MAX: + default: + ERR("Invalid type: %d", mime->type); + break; + } +} + +static telebot_core_response_t +telebot_core_curl_perform(telebot_core_handler_t core_h, const char *method, telebot_core_mime_t mimes[], size_t size) +{ + CURLcode res; + CURL *curl_h = NULL; + curl_mime *mime = NULL; + long resp_code = 0L; - mimes[index].name = "limit"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", limit); - ++index; + telebot_core_response_t resp = calloc(1, sizeof(struct telebot_core_response)); + if (resp == NULL) + { + ERR("Failed to allocate memory for response"); + return NULL; + } - mimes[index].name = "timeout"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", timeout); - ++index; + if (core_h == NULL) + { + ERR("Core handler is NULL"); + resp->ret = TELEBOT_ERROR_INVALID_PARAMETER; + return resp; + } - if (allowed_updates) + if (core_h->token == NULL) { - mimes[index].name = "allowed_updates"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", allowed_updates); - ++index; + ERR("Token is NULL, this should not happen"); + resp->ret = TELEBOT_ERROR_OPERATION_FAILED; + return resp; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_UPDATES, mimes, index, response); -} + resp->data = (char *)malloc(1); + resp->size = 0; + resp->ret = TELEBOT_ERROR_NONE; -telebot_error_e telebot_core_set_webhook(telebot_core_handler_t *core_h, const char *url, - const char *certificate, int max_connections, const char *allowed_updates, - telebot_core_response_t *response) -{ - if ((core_h == NULL) || (core_h->token == NULL) || (url == NULL)) + curl_h = curl_easy_init(); + if (curl_h == NULL) { - ERR("Handler, token, or url is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + ERR("Failed to init curl"); + resp->ret = TELEBOT_ERROR_OUT_OF_MEMORY; + goto finish; } - int index = 0; - telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "url"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", url); - ++index; + char URL[TELEBOT_URL_SIZE]; + snprintf(URL, TELEBOT_URL_SIZE, "%s/bot%s/%s", TELEBOT_API_URL, core_h->token, method); + curl_easy_setopt(curl_h, CURLOPT_URL, URL); + curl_easy_setopt(curl_h, CURLOPT_WRITEFUNCTION, write_data_cb); + curl_easy_setopt(curl_h, CURLOPT_WRITEDATA, resp); - if (certificate != NULL) + if (core_h->proxy_addr != NULL) + { + curl_easy_setopt(curl_h, CURLOPT_PROXY, core_h->proxy_addr); + if (core_h->proxy_auth != NULL) + { + curl_easy_setopt(curl_h, CURLOPT_PROXYAUTH, CURLAUTH_ANY); + curl_easy_setopt(curl_h, CURLOPT_PROXYUSERPWD, core_h->proxy_auth); + } + } + + if (size > 0) { - mimes[index].name = "certificate"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", certificate); - ++index; + mime = curl_mime_init(curl_h); + if (mime == NULL) + { + ERR("Failed to create mime"); + resp->ret = TELEBOT_ERROR_OUT_OF_MEMORY; + goto finish; + } + for (size_t index = 0; index < size; index++) + { + curl_mimepart *part = curl_mime_addpart(mime); + if (part == NULL) + { + ERR("Failed to create mime part"); + resp->ret = TELEBOT_ERROR_OUT_OF_MEMORY; + goto finish; + } + telebot_core_copy_mime_data_to_part(&mimes[index], part); + } + + curl_easy_setopt(curl_h, CURLOPT_MIMEPOST, mime); } - mimes[index].name = "max_connections"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", max_connections); + res = curl_easy_perform(curl_h); + if (res != CURLE_OK) + { + ERR("Failed to curl_easy_perform\nError: %s (%d)", curl_easy_strerror(res), res); + resp->ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } - if (allowed_updates != NULL) + curl_easy_getinfo(curl_h, CURLINFO_RESPONSE_CODE, &resp_code); + if (resp_code != 200L) { - mimes[index].name = "allowed_updates"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", allowed_updates); - ++index; + ERR("Wrong HTTP response received, response: %ld", resp_code); + resp->ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_WEBHOOK, mimes, index, response); + DBG("Response: %s", resp->data); + +finish: + if (resp->ret != TELEBOT_ERROR_NONE) + TELEBOT_SAFE_FZCNT(resp->data, resp->size); + if (mime) + curl_mime_free(mime); + if (curl_h) + curl_easy_cleanup(curl_h); + + return resp; } -telebot_error_e telebot_core_delete_webhook(telebot_core_handler_t *core_h, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_updates(telebot_core_handler_t core_h, int offset, int limit, int timeout, const char *allowed_updates) { - if ((core_h == NULL) || (core_h->token == NULL)) + if (limit > TELEBOT_UPDATE_COUNT_MAX_LIMIT) + limit = TELEBOT_UPDATE_COUNT_MAX_LIMIT; + + size_t count = 0; + telebot_core_mime_t mimes[4]; // number of arguments + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; + + mimes[count].name = "timeout"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = timeout; + count++; + + if (allowed_updates) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "allowed_updates"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = allowed_updates; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_WEBHOOK, NULL, 0, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_UPDATES, mimes, count); } -telebot_error_e telebot_core_get_webhook_info(telebot_core_handler_t *core_h, - telebot_core_response_t *response) +static telebot_core_response_t telebot_core_get_error_response(telebot_error_e ret) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + telebot_core_response_t resp = calloc(1, sizeof(struct telebot_core_response)); + if (resp) + resp->ret = ret; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_WEBHOOK_INFO, NULL, 0, response); + return resp; } -telebot_error_e telebot_core_get_me(telebot_core_handler_t *core_h, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_webhook(telebot_core_handler_t core_h, const char *url, const char *certificate, int max_connections, + const char *allowed_updates) { - if ((core_h == NULL) || (core_h->token == NULL)) + CHECK_ARG_NULL(url); + + size_t count = 0; + telebot_core_mime_t mimes[4]; // number of arguments + mimes[count].name = "url"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = url; + ++count; + + if (certificate != NULL) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "certificate"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = certificate; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_ME, NULL, 0, response); -} + mimes[count].name = "max_connections"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = max_connections; -telebot_error_e telebot_core_send_message(telebot_core_handler_t *core_h, - long long int chat_id, const char *text, const char *parse_mode, - bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) -{ - if ((core_h == NULL) || (core_h->token == NULL) || (text == NULL)) + if (allowed_updates != NULL) { - ERR("Handler, token or text is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "allowed_updates"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = allowed_updates; + count++; } - int index = 0; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_WEBHOOK, mimes, count); +} + +telebot_core_response_t +telebot_core_delete_webhook(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_WEBHOOK, NULL, 0); +} + +telebot_core_response_t +telebot_core_get_webhook_info(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_WEBHOOK_INFO, NULL, 0); +} + +telebot_core_response_t +telebot_core_get_me(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_ME, NULL, 0); +} + +telebot_core_response_t +telebot_core_send_message(telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, + bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, + const char *reply_markup) +{ + CHECK_ARG_NULL(text); + + int count = 0; telebot_core_mime_t mimes[7]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "text"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", text); - ++index; + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; - mimes[index].name = "disable_web_page_preview"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_web_page_preview ? "true" : "false")); - ++index; + mimes[count].name = "disable_web_page_preview"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_web_page_preview ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_MESSAGE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_MESSAGE, mimes, count); } -telebot_error_e telebot_core_forward_message(telebot_core_handler_t *core_h, - long long int chat_id, long long int from_chat_id, bool disable_notification, - int message_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_forward_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, + bool disable_notification, int message_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL."); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - if (message_id <= 0) { ERR("Valid message_id is required."); - return TELEBOT_ERROR_INVALID_PARAMETER; + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } - int index = 0; + int count = 0; telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "from_chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", from_chat_id); - ++index; - - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; - - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_FORWARD_MESSAGE, mimes, index, response); + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "from_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = from_chat_id; + count++; + + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_FORWARD_MESSAGE, mimes, count); } -telebot_error_e telebot_core_send_photo(telebot_core_handler_t *core_h, - long long int chat_id, const char *photo, bool is_file, const char *caption, - const char *parse_mode, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, + const char *caption, const char *parse_mode, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (photo == NULL)) - { - ERR("Handler, token or photo is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(photo); - int index = 0; + int count = 0; telebot_core_mime_t mimes[7]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "photo"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", photo); - ++index; + mimes[count].name = "photo"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = photo; + count++; if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_PHOTO, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_PHOTO, mimes, count); } -telebot_error_e telebot_core_send_audio(telebot_core_handler_t *core_h, - long long int chat_id, const char *audio, bool is_file, const char *caption, - const char *parse_mode, int duration, const char *performer, const char *title, - const char *thumb, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_audio(telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, + const char *caption, const char *parse_mode, int duration, const char *performer, + const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, + const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (audio == NULL)) - { - ERR("Handler, token or audio is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(audio); - int index = 0; + int count = 0; telebot_core_mime_t mimes[11]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "audio"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", audio); - ++index; + mimes[count].name = "audio"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = audio; + count++; if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } if (duration > 0) { - mimes[index].name = "duration"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", duration); - ++index; + mimes[count].name = "duration"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = duration; + count++; } if (performer != NULL) { - mimes[index].name = "performer"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", performer); - ++index; + mimes[count].name = "performer"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = performer; + count++; } if (title != NULL) { - mimes[index].name = "title"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", title); - ++index; + mimes[count].name = "title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = title; + count++; } - if (thumb != NULL) + if (thumb != NULL && thumb[0] != '\0') { - mimes[index].name = "thumb"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", thumb); - ++index; + mimes[count].name = "thumb"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = thumb; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_AUDIO, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_AUDIO, mimes, count); } -telebot_error_e telebot_core_send_document(telebot_core_handler_t *core_h, - long long int chat_id, const char *document, bool is_file, const char *thumb, - const char *caption, const char *parse_mode, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) - +telebot_core_response_t +telebot_core_send_document(telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, + const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (document == NULL)) - { - ERR("Handler, token or document is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(document); - int index = 0; + int count = 0; telebot_core_mime_t mimes[8]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "document"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", document); - ++index; + mimes[count].name = "document"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = document; + count++; - if (thumb != NULL) + if (thumb != NULL && thumb[0] != '\0') { - mimes[index].name = "thumb"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", thumb); - ++index; + mimes[count].name = "thumb"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = thumb; + count++; } if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_DOCUMENT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_DOCUMENT, mimes, count); } -telebot_error_e telebot_core_send_video(telebot_core_handler_t *core_h, - long long int chat_id, const char *video, bool is_file, int duration, - int width, int height, const char *thumb, const char *caption, - const char *parse_mode, bool supports_streaming, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_video(telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, + int duration, int width, int height, const char *thumb, const char *caption, + const char *parse_mode, bool supports_streaming, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (video == NULL)) - { - ERR("Handler, token or video is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(video); - int index = 0; + int count = 0; telebot_core_mime_t mimes[12]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "video"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", video); - ++index; + mimes[count].name = "video"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = video; + count++; if (duration > 0) { - mimes[index].name = "duration"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", duration); - ++index; + mimes[count].name = "duration"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = duration; + count++; } if (width > 0) { - mimes[index].name = "width"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", width); - ++index; + mimes[count].name = "width"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = width; + count++; } if (height > 0) { - mimes[index].name = "height"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", height); - ++index; + mimes[count].name = "height"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = height; + count++; } - if (thumb != NULL) + if (thumb != NULL && thumb[0] != '\0') { - mimes[index].name = "thumb"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", thumb); - ++index; + mimes[count].name = "thumb"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = thumb; + count++; } if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } - mimes[index].name = "supports_streaming"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (supports_streaming ? "true" : "false")); - ++index; + mimes[count].name = "supports_streaming"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = supports_streaming ? "true" : "false"; + count++; - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VIDEO, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VIDEO, mimes, count); } -telebot_error_e telebot_core_send_animation(telebot_core_handler_t *core_h, - long long int chat_id, const char *animation, bool is_file, int duration, - int width, int height, const char *thumb, const char *caption, - const char *parse_mode, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_animation(telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, + int duration, int width, int height, const char *thumb, const char *caption, + const char *parse_mode, bool disable_notification, int reply_to_message_id, + const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (animation == NULL)) - { - ERR("Handler, token or animation is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(animation); - int index = 0; + int count = 0; telebot_core_mime_t mimes[11]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "animation"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", animation); - ++index; + mimes[count].name = "animation"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = animation; + count++; if (duration > 0) { - mimes[index].name = "duration"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", duration); - ++index; + mimes[count].name = "duration"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = duration; + count++; } if (width > 0) { - mimes[index].name = "width"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", width); - ++index; + mimes[count].name = "width"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = width; + count++; } if (height > 0) { - mimes[index].name = "height"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", height); - ++index; + mimes[count].name = "height"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = height; + count++; } - if (thumb != NULL) + if (thumb != NULL && thumb[0] != '0') { - mimes[index].name = "thumb"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", thumb); - ++index; + mimes[count].name = "thumb"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = thumb; + count++; } if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_ANIMATION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_ANIMATION, mimes, count); } -telebot_error_e telebot_core_send_voice(telebot_core_handler_t *core_h, - long long int chat_id, const char *voice, bool is_file, const char *caption, - const char *parse_mode, int duration, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_voice(telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, + const char *caption, const char *parse_mode, int duration, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (voice == NULL)) - { - ERR("Handler, token or voice is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(voice); - int index = 0; + int count = 0; telebot_core_mime_t mimes[8]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "voice"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", voice); - ++index; + mimes[count].name = "voice"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = voice; + count++; if (duration > 0) { - mimes[index].name = "duration"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", duration); - ++index; + mimes[count].name = "duration"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = duration; + count++; } if (caption != NULL) { - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VOICE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VOICE, mimes, count); } -telebot_error_e telebot_core_send_video_note(telebot_core_handler_t *core_h, - long long int chat_id, char *video_note, bool is_file, int duration, int length, - const char *thumb, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_video_note(telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, + int duration, int length, const char *thumb, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (video_note == NULL)) - { - ERR("Handler, token or video_note is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(video_note); - int index = 0; + int count = 0; telebot_core_mime_t mimes[8]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "video_note"; - mimes[index].type = (is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_DATA); - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", video_note); - ++index; + mimes[count] + .name = "video_note"; + mimes[count].type = is_file ? TELEBOT_MIME_TYPE_FILE : TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = video_note; + count++; if (duration > 0) { - mimes[index].name = "duration"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", duration); - ++index; + mimes[count].name = "duration"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = duration; + count++; } if (length > 0) { - mimes[index].name = "length"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", length); - ++index; + mimes[count].name = "length"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = length; + count++; } - if (thumb != NULL) + if (thumb != NULL && thumb[0] != '\0') { - mimes[index].name = "thumb"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", thumb); - ++index; + mimes[count].name = "thumb"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = thumb; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VIDEO_NOTE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VIDEO_NOTE, mimes, count); } -telebot_error_e telebot_core_send_media_group( - telebot_core_handler_t *core_h, - long long int chat_id, - char *media_paths[], - int count, - bool disable_notification, - int reply_to_message_id, - telebot_core_response_t *response) +// Helper function to determine media type based on file extension +static const char *telebot_core_get_media_type(const char *filename) { - if ((core_h == NULL) || (core_h->token == NULL) || - (media_paths == NULL) || (count < 2) || (count > 10)) + const char *ext = strrchr(filename, '.'); + if (ext == NULL) + return "document"; // No extension, treat as document + + ext++; // Skip the dot + + // Convert to lowercase for comparison + char ext_lower[10]; + int i = 0; + while (ext[i] != '\0' && i < 9) { - ERR("Invalid parameters: core_h, token, media_paths, or count (%d)", count); - return TELEBOT_ERROR_INVALID_PARAMETER; + ext_lower[i] = (ext[i] >= 'A' && ext[i] <= 'Z') ? ext[i] - 'A' + 'a' : ext[i]; + i++; + } + ext_lower[i] = '\0'; + + // Check for photo extensions + if (strcmp(ext_lower, "jpg") == 0 || strcmp(ext_lower, "jpeg") == 0 || + strcmp(ext_lower, "png") == 0 || strcmp(ext_lower, "bmp") == 0 || + strcmp(ext_lower, "tiff") == 0 || strcmp(ext_lower, "webp") == 0) + { + return "photo"; } + // Check for video extensions + else if (strcmp(ext_lower, "mp4") == 0 || strcmp(ext_lower, "mpeg") == 0 || + strcmp(ext_lower, "avi") == 0 || strcmp(ext_lower, "mov") == 0 || + strcmp(ext_lower, "mkv") == 0 || strcmp(ext_lower, "wmv") == 0 || + strcmp(ext_lower, "flv") == 0 || strcmp(ext_lower, "webm") == 0 || + strcmp(ext_lower, "3gp") == 0 || strcmp(ext_lower, "m4v") == 0) + { + return "video"; + } + // Check for audio extensions + else if (strcmp(ext_lower, "mp3") == 0 || strcmp(ext_lower, "m4a") == 0 || + strcmp(ext_lower, "flac") == 0 || strcmp(ext_lower, "ogg") == 0 || + strcmp(ext_lower, "oga") == 0 || strcmp(ext_lower, "wav") == 0 || + strcmp(ext_lower, "aac") == 0 || strcmp(ext_lower, "opus") == 0) + { + return "audio"; + } + // Everything else is treated as document (including gif) + else + { + return "document"; + } +} + +telebot_core_response_t +telebot_core_send_media_group(telebot_core_handler_t core_h, long long int chat_id, char *media_paths[], int path_count, + bool disable_notification, int reply_to_message_id) +{ + CHECK_ARG_NULL(media_paths); + CHECK_ARG_CONDITION(path_count <= 0, "Invalid media path count, should be greater than 0"); + CHECK_ARG_CONDITION(path_count > 10, "Invalid media path count, should be less than or equal to 10") // Validate all media paths are non-NULL - for (int i = 0; i < count; ++i) + for (int i = 0; i < path_count; ++i) { if (media_paths[i] == NULL) { - ERR("Media path at index %d is NULL", i); - return TELEBOT_ERROR_INVALID_PARAMETER; + ERR("Invalid media path at index %d is null", i); + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } } @@ -1090,75 +1156,34 @@ telebot_error_e telebot_core_send_media_group( if (media_array == NULL) { ERR("Failed to create JSON media array"); - return TELEBOT_ERROR_OUT_OF_MEMORY; + return telebot_core_get_error_response(TELEBOT_ERROR_OUT_OF_MEMORY); } // Allocate memory for filenames - char **filenames = calloc(count, sizeof(char*)); + char **filenames = calloc(path_count, sizeof(char *)); if (filenames == NULL) { json_object_put(media_array); ERR("Failed to allocate memory for filenames"); - return TELEBOT_ERROR_OUT_OF_MEMORY; - } - - // Helper function to determine media type based on file extension - const char* get_media_type(const char* filename) { - const char* ext = strrchr(filename, '.'); - if (ext == NULL) return "document"; // No extension, treat as document - - ext++; // Skip the dot - - // Convert to lowercase for comparison - char ext_lower[10]; - int i = 0; - while (ext[i] != '\0' && i < 9) { - ext_lower[i] = (ext[i] >= 'A' && ext[i] <= 'Z') ? ext[i] - 'A' + 'a' : ext[i]; - i++; - } - ext_lower[i] = '\0'; - - // Check for photo extensions - if (strcmp(ext_lower, "jpg") == 0 || strcmp(ext_lower, "jpeg") == 0 || - strcmp(ext_lower, "png") == 0 || strcmp(ext_lower, "bmp") == 0 || - strcmp(ext_lower, "tiff") == 0 || strcmp(ext_lower, "webp") == 0) { - return "photo"; - } - // Check for video extensions - else if (strcmp(ext_lower, "mp4") == 0 || strcmp(ext_lower, "mpeg") == 0 || - strcmp(ext_lower, "avi") == 0 || strcmp(ext_lower, "mov") == 0 || - strcmp(ext_lower, "mkv") == 0 || strcmp(ext_lower, "wmv") == 0 || - strcmp(ext_lower, "flv") == 0 || strcmp(ext_lower, "webm") == 0 || - strcmp(ext_lower, "3gp") == 0 || strcmp(ext_lower, "m4v") == 0) { - return "video"; - } - // Check for audio extensions - else if (strcmp(ext_lower, "mp3") == 0 || strcmp(ext_lower, "m4a") == 0 || - strcmp(ext_lower, "flac") == 0 || strcmp(ext_lower, "ogg") == 0 || - strcmp(ext_lower, "oga") == 0 || strcmp(ext_lower, "wav") == 0 || - strcmp(ext_lower, "aac") == 0 || strcmp(ext_lower, "opus") == 0) { - return "audio"; - } - // Everything else is treated as document (including gif) - else { - return "document"; - } + return telebot_core_get_error_response(TELEBOT_ERROR_OUT_OF_MEMORY); } // Determine media types for validation - const char **media_types = calloc(count, sizeof(char*)); + const char **media_types = calloc(path_count, sizeof(char *)); if (media_types == NULL) { - for (int i = 0; i < count; i++) { + for (int i = 0; i < path_count; i++) + { free(filenames[i]); } free(filenames); json_object_put(media_array); ERR("Failed to allocate memory for media types"); - return TELEBOT_ERROR_OUT_OF_MEMORY; + return telebot_core_get_error_response(TELEBOT_ERROR_OUT_OF_MEMORY); + ; } - for (int i = 0; i < count; ++i) + for (int i = 0; i < path_count; ++i) { // Extract filename from path using basename const char *filename = basename(media_paths[i]); @@ -1176,21 +1201,27 @@ telebot_error_e telebot_core_send_media_group( free(media_types); json_object_put(media_array); ERR("Failed to duplicate filename"); - return TELEBOT_ERROR_OUT_OF_MEMORY; + return telebot_core_get_error_response(TELEBOT_ERROR_OUT_OF_MEMORY); + ; } // Determine media type - media_types[i] = get_media_type(filename); + media_types[i] = telebot_core_get_media_type(filename); } // Validate media group composition // Count unique types in the group int photo_count = 0, video_count = 0, audio_count = 0, document_count = 0; - for (int i = 0; i < count; i++) { - if (strcmp(media_types[i], "photo") == 0) photo_count++; - else if (strcmp(media_types[i], "video") == 0) video_count++; - else if (strcmp(media_types[i], "audio") == 0) audio_count++; - else if (strcmp(media_types[i], "document") == 0) document_count++; + for (int i = 0; i < path_count; i++) + { + if (strcmp(media_types[i], "photo") == 0) + photo_count++; + else if (strcmp(media_types[i], "video") == 0) + video_count++; + else if (strcmp(media_types[i], "audio") == 0) + audio_count++; + else if (strcmp(media_types[i], "document") == 0) + document_count++; } // Check valid combinations: @@ -1198,28 +1229,33 @@ telebot_error_e telebot_core_send_media_group( // 2. Mixed photo and video only bool valid_combination = false; - if (photo_count == count || video_count == count || audio_count == count || document_count == count) { + if (photo_count == path_count || video_count == path_count || audio_count == path_count || document_count == path_count) + { // All same type - valid valid_combination = true; - } else if (photo_count > 0 && video_count > 0 && audio_count == 0 && document_count == 0) { + } + else if (photo_count > 0 && video_count > 0 && audio_count == 0 && document_count == 0) + { // Mixed photo and video only - valid valid_combination = true; } - if (!valid_combination) { + if (!valid_combination) + { // Free allocated resources - for (int i = 0; i < count; i++) { + for (int i = 0; i < path_count; i++) + { free(filenames[i]); } free(filenames); free(media_types); json_object_put(media_array); ERR("Invalid media group composition: only homogeneous groups or mixed photo/video groups are allowed"); - return TELEBOT_ERROR_INVALID_PARAMETER; + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } // Create JSON objects for media array - for (int i = 0; i < count; ++i) + for (int i = 0; i < path_count; ++i) { struct json_object *item = json_object_new_object(); json_object_object_add(item, "type", json_object_new_string(media_types[i])); @@ -1238,599 +1274,540 @@ telebot_error_e telebot_core_send_media_group( if (media_json_str == NULL) { // Free allocated filenames - for (int i = 0; i < count; i++) + for (int i = 0; i < path_count; i++) { free(filenames[i]); } free(filenames); json_object_put(media_array); ERR("Failed to serialize media JSON"); - return TELEBOT_ERROR_OPERATION_FAILED; + return telebot_core_get_error_response(TELEBOT_ERROR_OPERATION_FAILED); } // Prepare MIME parts telebot_core_mime_t mimes[20]; // max: chat_id + media + disable_notif + reply_id + 10 files - int index = 0; + int count = 0; // chat_id - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; // media (JSON string) - mimes[index].name = "media"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", media_json_str); - ++index; + mimes[count].name = "media"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = media_json_str; + count++; // disable_notification - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", - (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; // reply_to_message_id (optional) if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } // Attach actual photo files using the correct names - for (int i = 0; i < count; ++i) + for (int i = 0; i < path_count; ++i) { - mimes[index].name = filenames[i]; // Use actual filename instead of generated name - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", media_paths[i]); - ++index; + mimes[count].name = filenames[i]; // Use actual filename instead of generated name + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = media_paths[i]; + count++; } // Perform request - telebot_error_e ret = telebot_core_curl_perform( - core_h, TELEBOT_METHOD_SEND_MEDIA_GROUP, mimes, index, response); + telebot_core_response_t response = telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_MEDIA_GROUP, mimes, count); // Clean up allocated filenames - for (int i = 0; i < count; i++) + for (int i = 0; i < path_count; i++) { free(filenames[i]); } free(filenames); - + // Clean up JSON object json_object_put(media_array); - return ret; + return response; } -telebot_error_e telebot_core_send_location(telebot_core_handler_t *core_h, - long long int chat_id, float latitude, float longitude, int live_period, - bool disable_notification, int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_location(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, + int live_period, bool disable_notification, int reply_to_message_id, + const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[7]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "latitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", latitude); - ++index; + mimes[count].name = "latitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = latitude; + count++; - mimes[index].name = "longitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", longitude); - ++index; + mimes[count].name = "longitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = longitude; + count++; if (live_period > 0) { - mimes[index].name = "live_period"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", live_period); - ++index; + mimes[count].name = "live_period"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = live_period; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_LOCATION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_LOCATION, mimes, count); } -telebot_error_e telebot_core_edit_message_live_location(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *inline_message_id, - float latitude, float longitude, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_edit_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *inline_message_id, float latitude, float longitude, + const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[6]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "latitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", latitude); - ++index; + mimes[count].name = "latitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = latitude; + count++; - mimes[index].name = "longitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", longitude); - ++index; + mimes[count].name = "longitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = longitude; + count++; if (message_id > 0) { - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } if (inline_message_id != NULL) { - mimes[index].name = "inline_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", inline_message_id); - ++index; + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_LIVE_LOCATION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_LIVE_LOCATION, mimes, count); } -telebot_error_e telebot_core_stop_message_live_location(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, char *inline_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_stop_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, + char *inline_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; if (message_id > 0) { - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } if (inline_message_id != NULL) { - mimes[index].name = "inline_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", inline_message_id); - ++index; + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_STOP_MESSAGE_LIVE_LOCATION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_STOP_MESSAGE_LIVE_LOCATION, mimes, count); } -telebot_error_e telebot_core_send_venue(telebot_core_handler_t *core_h, - long long int chat_id, float latitude, float longitude, const char *title, - const char *address, const char *foursquare_id, const char *foursquare_type, - bool disable_notification, int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_venue(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, + const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, + bool disable_notification, int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (title == NULL) || - (address == NULL)) - { - ERR("Handler, token, title, or address is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(title); + CHECK_ARG_NULL(address); - int index = 0; + int count = 0; telebot_core_mime_t mimes[10]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "latitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", latitude); - ++index; - - mimes[index].name = "longitude"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%f", longitude); - ++index; - - mimes[index].name = "title"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", title); - ++index; - - mimes[index].name = "address"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", address); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "latitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = latitude; + count++; + + mimes[count].name = "longitude"; + mimes[count].type = TELEBOT_MIME_TYPE_FLOAT; + mimes[count].data.f = longitude; + count++; + + mimes[count].name = "title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = title; + count++; + + mimes[count].name = "address"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = address; + count++; if (foursquare_id != NULL) { - mimes[index].name = "foursquare_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", foursquare_id); - ++index; + mimes[count].name = "foursquare_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = foursquare_id; + count++; } if (foursquare_type != NULL) { - mimes[index].name = "foursquare_type"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", foursquare_type); - ++index; + mimes[count].name = "foursquare_type"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = foursquare_type; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VENUE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_VENUE, mimes, count); } -telebot_error_e telebot_core_send_contact(telebot_core_handler_t *core_h, - long long int chat_id, const char *phone_number, const char *first_name, - const char *last_name, const char *vcard, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_contact(telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, + const char *first_name, const char *last_name, const char *vcard, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (phone_number == NULL) || (first_name == NULL)) - { - ERR("Handler, token, phone_number, or first_name is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(phone_number); + CHECK_ARG_NULL(first_name); - int index = 0; + int count = 0; telebot_core_mime_t mimes[8]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "phone_number"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", phone_number); - ++index; + mimes[count].name = "phone_number"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = phone_number; + count++; - mimes[index].name = "first_name"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", first_name); - ++index; + mimes[count].name = "first_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = first_name; + count++; if (last_name != NULL) { - mimes[index].name = "last_name"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", last_name); - ++index; + mimes[count].name = "last_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = last_name; + count++; } if (vcard != NULL) { - mimes[index].name = "vcard"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", vcard); - ++index; + mimes[count].name = "vcard"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = vcard; + count++; } - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_CONTACT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_CONTACT, mimes, count); } -telebot_error_e telebot_core_send_poll(telebot_core_handler_t *core_h, - long long int chat_id, const char *question, const char *options, - bool is_anonymous, const char *type, bool allows_multiple_answers, - int correct_option_id, bool is_closed, bool disable_notification, - int reply_to_message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_poll(telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, + bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, + bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (question == NULL) || (options == NULL)) - { - ERR("Handler, token, phone_number, or first_name is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(question); + CHECK_ARG_NULL(options); - int index = 0; + int count = 0; telebot_core_mime_t mimes[11]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "question"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", question); - ++index; - - mimes[index].name = "options"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", options); - ++index; - - mimes[index].name = "is_anonymous"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (is_anonymous ? "true" : "false")); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "question"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = question; + count++; + + mimes[count].name = "options"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = options; + count++; + + mimes[count].name = "is_anonymous"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = is_anonymous ? "true" : "false"; + count++; if (type != NULL) { - mimes[index].name = "type"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", type); - ++index; + mimes[count].name = "type"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = type; + count++; } - mimes[index].name = "allows_multiple_answers"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (allows_multiple_answers ? "true" : "false")); - ++index; + mimes[count].name = "allows_multiple_answers"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = allows_multiple_answers ? "true" : "false"; + count++; if (correct_option_id >= 0) { - mimes[index].name = "correct_option_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", correct_option_id); - ++index; + mimes[count].name = "correct_option_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = correct_option_id; + count++; } - mimes[index].name = "is_closed"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (is_closed ? "true" : "false")); - ++index; + mimes[count].name = "is_closed"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = is_closed ? "true" : "false"; + count++; - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_POLL, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_POLL, mimes, count); } -telebot_error_e telebot_core_send_dice(telebot_core_handler_t *core_h, - long long int chat_id, bool disable_notification, int reply_to_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_dice(telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, token, phone_number, or first_name is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; if (reply_to_message_id > 0) { - mimes[index].name = "reply_to_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", reply_to_message_id); - ++index; + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; } if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_DICE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_DICE, mimes, count); } -telebot_error_e telebot_core_send_chat_action(telebot_core_handler_t *core_h, - long long int chat_id, const char *action, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_chat_action(telebot_core_handler_t core_h, long long int chat_id, const char *action) { - if ((core_h == NULL) || (core_h->token == NULL) || (action == NULL)) - { - ERR("Handler, token or action is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(action); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "action"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", action); - ++index; + mimes[count].name = "action"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = action; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_CHAT_ACTION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_CHAT_ACTION, mimes, count); } -telebot_error_e telebot_core_get_user_profile_photos(telebot_core_handler_t *core_h, - int user_id, int offset, int limit, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_user_profile_photos(telebot_core_handler_t core_h, int user_id, int offset, int limit) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Invalid value of user_id"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((user_id <= 0), "Invalid value of user_id"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[3]; // number of arguments - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; - - mimes[index].name = "offset"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", offset); - ++index; - - mimes[index].name = "limit"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", limit); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_USER_PHOTOS, mimes, index, response); + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_USER_PHOTOS, mimes, count); } -telebot_error_e telebot_core_get_file(telebot_core_handler_t *core_h, const char *file_id, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_file(telebot_core_handler_t core_h, const char *file_id) { - if ((core_h == NULL) || (core_h->token == NULL) || (file_id == NULL)) - { - ERR("Handler, token or file_id is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(file_id); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "file_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", file_id); - ++index; + mimes[count].name = "file_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = file_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_FILE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_FILE, mimes, count); } -static size_t write_file_cb(void *contents, size_t size, size_t nmemb, - void *userp) +static size_t +write_file_cb(void *contents, size_t size, size_t nmemb, void *userp) { size_t written = fwrite(contents, size, nmemb, (FILE *)userp); return written; } -telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, - const char *file_path, const char *out_file) +telebot_error_e +telebot_core_download_file(telebot_core_handler_t core_h, const char *file_path, const char *out_file) { int ret = TELEBOT_ERROR_NONE; - if ((core_h == NULL) || (core_h->token == NULL) || (file_path == NULL) || - (out_file == NULL)) + if ((core_h == NULL) || (core_h->token == NULL) || (file_path == NULL) || (out_file == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; CURL *curl_h = NULL; @@ -1840,7 +1817,7 @@ telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, FILE *fp = fopen(out_file, "w"); if (fp == NULL) { - ret = TELEBOT_ERROR_INVALID_PARAMETER; + ret = TELEBOT_ERROR_OPERATION_FAILED; goto finish; } @@ -1887,994 +1864,2647 @@ telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, return ret; } -telebot_error_e telebot_core_kick_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, long until_date, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_kick_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[3]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; if (until_date > 0) { - mimes[index].name = "until_date"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%ld", until_date); - ++index; + mimes[count].name = "until_date"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_INT; + mimes[count].data.ld = until_date; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_KICK_CHAT_MEMBER, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_KICK_CHAT_MEMBER, mimes, count); } -telebot_error_e telebot_core_unban_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_unban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNBAN_CHAT_MEMBER, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNBAN_CHAT_MEMBER, mimes, count); } -telebot_error_e telebot_core_restrict_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, long until_date, bool can_send_messages, - bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, - bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, - bool can_pin_messages, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_restrict_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, + bool can_send_messages, bool can_send_media_messages, bool can_send_polls, + bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, + bool can_invite_users, bool can_pin_messages) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[11]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; if (until_date > 0) { - mimes[index].name = "until_date"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%ld", until_date); - ++index; - } - - mimes[index].name = "can_send_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_media_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_media_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_polls"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_polls ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_other_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_other_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_add_web_page_previews"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_add_web_page_previews ? "true" : "false")); - ++index; - - mimes[index].name = "can_change_info"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_change_info ? "true" : "false")); - ++index; - - mimes[index].name = "can_invite_users"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_invite_users ? "true" : "false")); - ++index; - - mimes[index].name = "can_pin_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_pin_messages ? "true" : "false")); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_RESTRICT_CHAT_MEMBER, mimes, index, response); + mimes[count].name = "until_date"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_INT; + mimes[count].data.ld = until_date; + count++; + } + + mimes[count].name = "can_send_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_send_media_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_media_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_send_polls"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_polls ? "true" : "false"; + count++; + + mimes[count].name = "can_send_other_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_other_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_add_web_page_previews"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_add_web_page_previews ? "true" : "false"; + count++; + + mimes[count].name = "can_change_info"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_change_info ? "true" : "false"; + count++; + + mimes[count].name = "can_invite_users"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_invite_users ? "true" : "false"; + count++; + + mimes[count].name = "can_pin_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_invite_users ? "true" : "false"; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_RESTRICT_CHAT_MEMBER, mimes, count); } -telebot_error_e telebot_core_promote_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, - bool can_edit_messages, bool can_delete_messages, bool can_invite_users, - bool can_restrict_members, bool can_pin_messages, bool can_promote_members, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_promote_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, + bool can_post_messages, bool can_edit_messages, bool can_delete_messages, + bool can_invite_users, bool can_restrict_members, bool can_pin_messages, + bool can_promote_members) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[10]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; - - mimes[index].name = "can_change_info"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_change_info ? "true" : "false")); - ++index; - - mimes[index].name = "can_post_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_post_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_edit_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_edit_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_delete_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_delete_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_invite_users"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_invite_users ? "true" : "false")); - ++index; - - mimes[index].name = "can_restrict_members"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_restrict_members ? "true" : "false")); - ++index; - - mimes[index].name = "can_pin_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_pin_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_promote_members"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_promote_members ? "true" : "false")); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_PROMOTE_CHAT_MEMBER, mimes, index, response); -} - -telebot_error_e telebot_core_set_chat_admin_custom_title(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, const char *custom_title, - telebot_core_response_t *response) -{ - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + + mimes[count].name = "can_change_info"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_change_info ? "true" : "false"; + count++; + + mimes[count].name = "can_post_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_post_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_edit_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_edit_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_delete_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_delete_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_invite_users"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_invite_users ? "true" : "false"; + count++; + + mimes[count].name = "can_restrict_members"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_restrict_members ? "true" : "false"; + count++; + + mimes[count].name = "can_pin_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_pin_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_promote_members"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_promote_members ? "true" : "false"; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_PROMOTE_CHAT_MEMBER, mimes, count); +} - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } +telebot_core_response_t +telebot_core_set_chat_admin_custom_title(telebot_core_handler_t core_h, long long int chat_id, int user_id, + const char *custom_title) +{ + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[3]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; - - mimes[index].name = "custom_title"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", custom_title); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_ADMIN_TITLE, mimes, index, response); + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + + mimes[count].name = "custom_title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = custom_title; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_ADMIN_TITLE, mimes, count); } -telebot_error_e telebot_core_set_chat_permissions(telebot_core_handler_t *core_h, - long long int chat_id, bool can_send_messages, bool can_send_media_messages, - bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, - bool can_change_info, bool can_invite_users, bool can_pin_messages, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_chat_permissions(telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, + bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, + bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, + bool can_pin_messages) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[9]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "can_send_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_media_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_media_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_polls"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_polls ? "true" : "false")); - ++index; - - mimes[index].name = "can_send_other_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_send_other_messages ? "true" : "false")); - ++index; - - mimes[index].name = "can_add_web_page_previews"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_add_web_page_previews ? "true" : "false")); - ++index; - - mimes[index].name = "can_change_info"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_change_info ? "true" : "false")); - ++index; - - mimes[index].name = "can_invite_users"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_invite_users ? "true" : "false")); - ++index; - - mimes[index].name = "can_pin_messages"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (can_pin_messages ? "true" : "false")); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_PERMISSIONS, mimes, index, response); + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "can_send_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_send_media_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_media_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_send_polls"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_polls ? "true" : "false"; + count++; + + mimes[count].name = "can_send_other_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_send_other_messages ? "true" : "false"; + count++; + + mimes[count].name = "can_add_web_page_previews"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_add_web_page_previews ? "true" : "false"; + count++; + + mimes[count].name = "can_change_info"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_change_info ? "true" : "false"; + count++; + + mimes[count].name = "can_invite_users"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_invite_users ? "true" : "false"; + count++; + + mimes[count].name = "can_pin_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = can_invite_users ? "true" : "false"; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_PERMISSIONS, mimes, count); } -telebot_error_e telebot_core_export_chat_invite_link(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_export_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EXPORT_CHAT_INVITE_LINK, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EXPORT_CHAT_INVITE_LINK, mimes, count); } -telebot_error_e telebot_core_set_chat_photo(telebot_core_handler_t *core_h, - long long int chat_id, const char *photo, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_chat_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(photo); - if (photo == NULL) - { - ERR("Valid photo is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "photo"; - mimes[index].type = TELEBOT_MIME_TYPE_FILE; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", photo); - ++index; + mimes[count].name = "photo"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = photo; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_PHOTO, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_PHOTO, mimes, count); } -telebot_error_e telebot_core_delete_chat_photo(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_delete_chat_photo(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Invalid chat id"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_CHAT_PHOTO, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_CHAT_PHOTO, mimes, count); } -telebot_error_e telebot_core_set_chat_title(telebot_core_handler_t *core_h, - long long int chat_id, const char *title, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_chat_title(telebot_core_handler_t core_h, long long int chat_id, const char *title) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if ((title == NULL) || (strlen(title) > 255)) - { - ERR("Valid title is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); + CHECK_ARG_CONDITION((title == NULL) || (strlen(title) > 255), "Valid title is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "title"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", title); - ++index; + mimes[count].name = "title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = title; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_TITLE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_TITLE, mimes, count); } -telebot_error_e telebot_core_set_chat_description(telebot_core_handler_t *core_h, - long long int chat_id, const char *description, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_chat_description(telebot_core_handler_t core_h, long long int chat_id, const char *description) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if ((description == NULL) || (strlen(description) > 255)) - { - ERR("Valid title is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); + CHECK_ARG_CONDITION((description == NULL) || (strlen(description) > 255), + "Valid description is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "description"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", description); - ++index; + mimes[count].name = "description"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = description; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_DESCRIPTION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_DESCRIPTION, mimes, count); } -telebot_error_e telebot_core_pin_chat_message(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, bool disable_notification, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_pin_chat_message(telebot_core_handler_t core_h, long long int chat_id, int message_id, + bool disable_notification) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); + CHECK_ARG_CONDITION((message_id <= 0), "Valid message_id is required"); - if (message_id <= 0) - { - ERR("Valid message_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - int index = 0; + int count = 0; telebot_core_mime_t mimes[3]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; - - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; - - mimes[index].name = "disable_notification"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_notification ? "true" : "false")); - ++index; - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_PIN_CHAT_MESSAGE, mimes, index, response); + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_PIN_CHAT_MESSAGE, mimes, count); } -telebot_error_e telebot_core_unpin_chat_message(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_unpin_chat_message(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNPIN_CHAT_MESSAGE, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNPIN_CHAT_MESSAGE, mimes, count); } -telebot_error_e telebot_core_leave_chat(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_leave_chat(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_LEAVE_CHAT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_LEAVE_CHAT, mimes, count); } -telebot_error_e telebot_core_get_chat(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_chat(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT, mimes, count); } -telebot_error_e telebot_core_get_chat_admins(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_chat_admins(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_ADMINS, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_ADMINS, mimes, count); } -telebot_error_e telebot_core_get_chat_members_count(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_chat_members_count(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_MEMBERS_COUNT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_MEMBERS_COUNT, mimes, count); } -telebot_error_e telebot_core_get_chat_member(telebot_core_handler_t *core_h, - long long int chat_id, int user_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (user_id <= 0) - { - ERR("Valid user_id is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); + CHECK_ARG_CONDITION((user_id <= 0), "Valid user_id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "user_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", user_id); - ++index; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_MEMBER, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_MEMBER, mimes, count); } -telebot_error_e telebot_core_set_chat_sticker_set(telebot_core_handler_t *core_h, - long long int chat_id, const char *sticker_set_name, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id, const char *sticker_set_name) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - if (sticker_set_name == NULL) - { - ERR("Valid sticker_set_name is required"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); + CHECK_ARG_NULL(sticker_set_name); - int index = 0; + int count = 0; telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - mimes[index].name = "sticker_set_name"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", sticker_set_name); - ++index; + mimes[count].name = "sticker_set_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = sticker_set_name; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_STICKER_SET, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_STICKER_SET, mimes, count); } -telebot_error_e telebot_core_delete_chat_sticker_set(telebot_core_handler_t *core_h, - long long int chat_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_delete_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_CONDITION((chat_id <= 0), "Valid chat id is required"); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DEL_CHAT_STICKER_SET, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DEL_CHAT_STICKER_SET, mimes, count); } -telebot_error_e telebot_core_answer_callback_query(telebot_core_handler_t *core_h, - const char *callback_query_id, const char *text, bool show_alert, - const char *url, int cache_time, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_answer_callback_query(telebot_core_handler_t core_h, const char *callback_query_id, const char *text, + bool show_alert, const char *url, int cache_time) { - if ((core_h == NULL) || (core_h->token == NULL) || - (callback_query_id == NULL)) - { - ERR("Handler, token or callback_query_id is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(callback_query_id); - int index = 0; + int count = 0; telebot_core_mime_t mimes[5]; // number of arguments - mimes[index].name = "callback_query_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", callback_query_id); - ++index; + mimes[count].name = "callback_query_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = callback_query_id; + count++; if (text != NULL) { - mimes[index].name = "text"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", text); - ++index; + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; } - mimes[index].name = "show_alert"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (show_alert ? "true" : "false")); - ++index; + mimes[count].name = "show_alert"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = show_alert ? "true" : "false"; + count++; if (url != NULL) { - mimes[index].name = "url"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", url); - ++index; + mimes[count].name = "url"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = url; + count++; } if (cache_time > 0) { - mimes[index].name = "cache_time"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", cache_time); - ++index; + mimes[count].name = "cache_time"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = cache_time; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_CALLBACK_QUERY, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_CALLBACK_QUERY, mimes, count); } -telebot_error_e telebot_core_set_my_commands(telebot_core_handler_t *core_h, - const char *commands, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_set_my_commands(telebot_core_handler_t core_h, const char *commands) { - if ((core_h == NULL) || (core_h->token == NULL) || (commands == NULL)) - { - ERR("Handler, token, or commands is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } + CHECK_ARG_NULL(commands); - int index = 0; + int count = 0; telebot_core_mime_t mimes[1]; // number of arguments - mimes[index].name = "commands"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", commands); - ++index; + mimes[count].name = "commands"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = commands; + count++; - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_COMMANDS, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_COMMANDS, mimes, count); } -telebot_error_e telebot_core_get_my_commands(telebot_core_handler_t *core_h, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_my_commands(telebot_core_handler_t core_h) { - if ((core_h == NULL) || (core_h->token == NULL)) - { - ERR("Handler, or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_COMMANDS, NULL, 0, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_COMMANDS, NULL, 0); } -telebot_error_e telebot_core_edit_message_text(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *inline_message_id, - const char *text, const char *parse_mode, bool disable_web_page_preview, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_edit_message_text(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *inline_message_id, const char *text, const char *parse_mode, + bool disable_web_page_preview, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL) || (text == NULL)) - { - ERR("Handler, token, or text is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; - } - if (((chat_id == 0) || (message_id <= 0)) && (inline_message_id == NULL)) { ERR("Either valid chat_id & message_id or inline_message_id required"); - return TELEBOT_ERROR_INVALID_PARAMETER; + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } - int index = 0; + int count = 0; telebot_core_mime_t mimes[7]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; if (message_id > 0) { - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } if (inline_message_id != NULL) { - mimes[index].name = "inline_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", inline_message_id); - ++index; + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } - mimes[index].name = "text"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", text); - ++index; + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; if (parse_mode != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; } - mimes[index].name = "disable_web_page_preview"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", (disable_web_page_preview ? "true" : "false")); - ++index; + mimes[count].name = "disable_web_page_preview"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_web_page_preview ? "true" : "false"; + count++; if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_TEXT, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_TEXT, mimes, count); } -telebot_error_e telebot_core_edit_message_caption(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *inline_message_id, - const char *caption, const char *parse_mode, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_edit_message_caption(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *inline_message_id, const char *caption, const char *parse_mode, + const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) + if (((chat_id == 0) || (message_id <= 0)) && (inline_message_id == NULL)) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + ERR("Either valid chat_id & message_id or inline_message_id required"); + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); + } + + int count = 0; + telebot_core_mime_t mimes[6]; // number of arguments + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + if (message_id > 0) + { + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } + if (inline_message_id != NULL) + { + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; + } + + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; + + if (parse_mode != NULL) + { + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; + } + + if (reply_markup != NULL) + { + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; + } + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_CAPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_edit_message_reply_markup(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *inline_message_id, const char *reply_markup) +{ if (((chat_id == 0) || (message_id <= 0)) && (inline_message_id == NULL)) { ERR("Either valid chat_id & message_id or inline_message_id required"); - return TELEBOT_ERROR_INVALID_PARAMETER; + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } - int index = 0; - telebot_core_mime_t mimes[6]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + int count = 0; + telebot_core_mime_t mimes[4]; // number of arguments + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; if (message_id > 0) { - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } if (inline_message_id != NULL) { - mimes[index].name = "inline_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", inline_message_id); - ++index; + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } - mimes[index].name = "caption"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", caption); - ++index; - - if (parse_mode != NULL) + if (reply_markup != NULL) { - mimes[index].name = "parse_mode"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", parse_mode); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_REPLY_MARKUP, mimes, count); +} + +telebot_core_response_t +telebot_core_stop_poll(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reply_markup) +{ + CHECK_ARG_CONDITION((chat_id <= 0) || (message_id <= 0), + "Valid chat_id and message_id required"); + + int count = 0; + telebot_core_mime_t mimes[3]; // number of arguments + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_CAPTION, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_STOP_POLL, mimes, count); } -telebot_error_e telebot_core_edit_message_reply_markup(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *inline_message_id, - const char *reply_markup, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_delete_message(telebot_core_handler_t core_h, long long int chat_id, int message_id) { - if ((core_h == NULL) || (core_h->token == NULL)) + CHECK_ARG_CONDITION((chat_id <= 0) || (message_id <= 0), + "Valid chat_id and message_id required"); + + int count = 0; + telebot_core_mime_t mimes[2]; // number of arguments + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_MESSAGE, mimes, count); +} + +telebot_core_response_t +telebot_core_log_out(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_LOG_OUT, NULL, 0); +} + +telebot_core_response_t +telebot_core_close(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CLOSE, NULL, 0); +} + +telebot_core_response_t +telebot_core_set_my_name(telebot_core_handler_t core_h, const char *name, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (name) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; } + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_NAME, mimes, count); +} + +telebot_core_response_t +telebot_core_get_my_name(telebot_core_handler_t core_h, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_NAME, mimes, count); +} + +telebot_core_response_t +telebot_core_set_my_description(telebot_core_handler_t core_h, const char *description, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (description) + { + mimes[count].name = "description"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = description; + count++; + } + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_DESCRIPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_get_my_description(telebot_core_handler_t core_h, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_DESCRIPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_set_my_short_description(telebot_core_handler_t core_h, const char *short_description, + const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (short_description) + { + mimes[count].name = "short_description"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = short_description; + count++; + } + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_SHORT_DESCRIPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_get_my_short_description(telebot_core_handler_t core_h, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_SHORT_DESCRIPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_set_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id, const char *menu_button) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (chat_id != 0) + { + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + } + if (menu_button) + { + mimes[count].name = "menu_button"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = menu_button; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_CHAT_MENU_BUTTON, mimes, count); +} + +telebot_core_response_t +telebot_core_get_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + if (chat_id != 0) + { + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_MENU_BUTTON, mimes, count); +} + +telebot_core_response_t +telebot_core_set_my_default_administrator_rights(telebot_core_handler_t core_h, const char *rights, bool for_channels) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (rights) + { + mimes[count].name = "rights"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = rights; + count++; + } + mimes[count].name = "for_channels"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = for_channels ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_DEFAULT_ADMIN_RIGHTS, mimes, count); +} + +telebot_core_response_t +telebot_core_get_my_default_administrator_rights(telebot_core_handler_t core_h, bool for_channels) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "for_channels"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = for_channels ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_DEFAULT_ADMIN_RIGHTS, mimes, count); +} + +telebot_core_response_t +telebot_core_delete_my_commands(telebot_core_handler_t core_h, const char *scope, const char *language_code) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (scope) + { + mimes[count].name = "scope"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = scope; + count++; + } + if (language_code) + { + mimes[count].name = "language_code"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = language_code; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_MY_COMMANDS, mimes, count); +} + +telebot_core_response_t +telebot_core_copy_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, int message_id, + const char *caption, const char *parse_mode, const char *caption_entities, + bool disable_notification, bool protect_content, int reply_to_message_id, + bool allow_sending_without_reply, const char *reply_markup) +{ + int count = 0; + telebot_core_mime_t mimes[12]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "from_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = from_chat_id; + count++; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + if (caption) + { + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; + } + if (parse_mode) + { + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; + } + if (caption_entities) + { + mimes[count].name = "caption_entities"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption_entities; + count++; + } + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + if (reply_to_message_id > 0) + { + mimes[count].name = "reply_to_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = reply_to_message_id; + count++; + } + mimes[count].name = "allow_sending_without_reply"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = allow_sending_without_reply ? "true" : "false"; + count++; + if (reply_markup) + { + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_COPY_MESSAGE, mimes, count); +} + +telebot_core_response_t +telebot_core_ban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, + long until_date, bool revoke_messages) +{ + int count = 0; + telebot_core_mime_t mimes[4]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + if (until_date > 0) + { + mimes[count].name = "until_date"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_INT; + mimes[count].data.ld = until_date; + count++; + } + mimes[count].name = "revoke_messages"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = revoke_messages ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_BAN_CHAT_MEMBER, mimes, count); +} + +telebot_core_response_t +telebot_core_ban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "sender_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = sender_chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_BAN_CHAT_SENDER_CHAT, mimes, count); +} + +telebot_core_response_t +telebot_core_unban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "sender_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = sender_chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNBAN_CHAT_SENDER_CHAT, mimes, count); +} + +telebot_core_response_t +telebot_core_create_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *name, + long expire_date, int member_limit, bool creates_join_request) +{ + int count = 0; + telebot_core_mime_t mimes[6]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + if (name) + { + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; + } + if (expire_date > 0) + { + mimes[count].name = "expire_date"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_INT; + mimes[count].data.ld = expire_date; + count++; + } + if (member_limit > 0) + { + mimes[count].name = "member_limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = member_limit; + count++; + } + mimes[count].name = "creates_join_request"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = creates_join_request ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CREATE_CHAT_INVITE_LINK, mimes, count); +} + +telebot_core_response_t +telebot_core_edit_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link, + const char *name, long expire_date, int member_limit, bool creates_join_request) +{ + int count = 0; + telebot_core_mime_t mimes[7]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "invite_link"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = invite_link; + count++; + if (name) + { + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; + } + if (expire_date > 0) + { + mimes[count].name = "expire_date"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_INT; + mimes[count].data.ld = expire_date; + count++; + } + if (member_limit > 0) + { + mimes[count].name = "member_limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = member_limit; + count++; + } + mimes[count].name = "creates_join_request"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = creates_join_request ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_CHAT_INVITE_LINK, mimes, count); +} + +telebot_core_response_t +telebot_core_revoke_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "invite_link"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = invite_link; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_REVOKE_CHAT_INVITE_LINK, mimes, count); +} + +telebot_core_response_t +telebot_core_approve_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_APPROVE_CHAT_JOIN_REQUEST, mimes, count); +} + +telebot_core_response_t +telebot_core_decline_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = user_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DECLINE_CHAT_JOIN_REQUEST, mimes, count); +} + +telebot_core_response_t +telebot_core_set_message_reaction(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *reaction, bool is_big) +{ + int count = 0; + telebot_core_mime_t mimes[4]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + if (reaction) + { + mimes[count].name = "reaction"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reaction; + count++; + } + mimes[count].name = "is_big"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = is_big ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MESSAGE_REACTION, mimes, count); +} + +telebot_core_response_t +telebot_core_create_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name, + int icon_color, const char *icon_custom_emoji_id) +{ + int count = 0; + telebot_core_mime_t mimes[5]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; + if (icon_color > 0) + { + mimes[count].name = "icon_color"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = icon_color; + count++; + } + if (icon_custom_emoji_id) + { + mimes[count].name = "icon_custom_emoji_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = icon_custom_emoji_id; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CREATE_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_edit_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, + const char *name, const char *icon_custom_emoji_id) +{ + int count = 0; + telebot_core_mime_t mimes[4]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + if (name) + { + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; + } + if (icon_custom_emoji_id) + { + mimes[count].name = "icon_custom_emoji_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = icon_custom_emoji_id; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_close_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CLOSE_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_reopen_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_REOPEN_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_delete_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_unpin_all_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNPIN_ALL_FORUM_TOPIC_MESSAGES, mimes, count); +} + +telebot_core_response_t +telebot_core_get_forum_topic_icon_stickers(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_FORUM_TOPIC_ICON_STICKERS, NULL, 0); +} + +telebot_core_response_t +telebot_core_edit_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = name; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_GENERAL_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_close_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CLOSE_GENERAL_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_reopen_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_REOPEN_GENERAL_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_hide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_HIDE_GENERAL_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_unhide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNHIDE_GENERAL_FORUM_TOPIC, mimes, count); +} + +telebot_core_response_t +telebot_core_unpin_all_general_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES, mimes, count); +} + +telebot_core_response_t +telebot_core_get_custom_emoji_stickers(telebot_core_handler_t core_h, const char *custom_emoji_ids) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "custom_emoji_ids"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = custom_emoji_ids; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CUSTOM_EMOJI_STICKERS, mimes, count); +} + +telebot_core_response_t +telebot_core_answer_web_app_query(telebot_core_handler_t core_h, const char *web_app_query_id, const char *result) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "web_app_query_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = web_app_query_id; + count++; + mimes[count].name = "result"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = result; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_WEB_APP_QUERY, mimes, count); +} + +telebot_core_response_t +telebot_core_copy_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, + const char *message_ids, bool disable_notification, bool protect_content, + bool remove_caption) +{ + int count = 0; + telebot_core_mime_t mimes[6]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "from_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = from_chat_id; + count++; + mimes[count].name = "message_ids"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = message_ids; + count++; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + mimes[count].name = "remove_caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = remove_caption ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_COPY_MESSAGES, mimes, count); +} +telebot_core_response_t +telebot_core_forward_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, + const char *message_ids, bool disable_notification, bool protect_content) +{ + int count = 0; + telebot_core_mime_t mimes[5]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "from_chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = from_chat_id; + count++; + mimes[count].name = "message_ids"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = message_ids; + count++; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_FORWARD_MESSAGES, mimes, count); +} + +telebot_core_response_t +telebot_core_delete_messages(telebot_core_handler_t core_h, long long int chat_id, const char *message_ids) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "message_ids"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = message_ids; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_MESSAGES, mimes, count); +} + +telebot_core_response_t +telebot_core_edit_message_media(telebot_core_handler_t core_h, long long int chat_id, int message_id, + const char *inline_message_id, const char *media, const char *reply_markup) +{ if (((chat_id == 0) || (message_id <= 0)) && (inline_message_id == NULL)) { ERR("Either valid chat_id & message_id or inline_message_id required"); - return TELEBOT_ERROR_INVALID_PARAMETER; + return telebot_core_get_error_response(TELEBOT_ERROR_INVALID_PARAMETER); } - int index = 0; - telebot_core_mime_t mimes[4]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; + int count = 0; + telebot_core_mime_t mimes[5]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; if (message_id > 0) { - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } if (inline_message_id != NULL) { - mimes[index].name = "inline_message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", inline_message_id); - ++index; + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } + mimes[count].name = "media"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = media; + count++; + if (reply_markup != NULL) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; } - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_REPLY_MARKUP, mimes, index, response); + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_EDIT_MESSAGE_MEDIA, mimes, count); } -telebot_error_e telebot_core_stop_poll(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, const char *reply_markup, - telebot_core_response_t *response) +telebot_core_response_t +telebot_core_send_paid_media(telebot_core_handler_t core_h, long long int chat_id, int star_count, const char *media, + const char *caption, const char *parse_mode, const char *caption_entities, + bool show_caption_above_media, bool disable_notification, bool protect_content, + const char *reply_parameters, const char *reply_markup) { - if ((core_h == NULL) || (core_h->token == NULL)) + int count = 0; + telebot_core_mime_t mimes[12]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "star_count"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = star_count; + count++; + mimes[count].name = "media"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = media; + count++; + if (caption) + { + mimes[count].name = "caption"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption; + count++; + } + if (parse_mode) + { + mimes[count].name = "parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = parse_mode; + count++; + } + if (caption_entities) + { + mimes[count].name = "caption_entities"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = caption_entities; + count++; + } + mimes[count].name = "show_caption_above_media"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = show_caption_above_media ? "true" : "false"; + count++; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + if (reply_parameters) + { + mimes[count].name = "reply_parameters"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_parameters; + count++; + } + if (reply_markup) + { + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_PAID_MEDIA, mimes, count); +} + +telebot_core_response_t +telebot_core_answer_inline_query(telebot_core_handler_t core_h, const char *inline_query_id, const char *results, + int cache_time, bool is_personal, const char *next_offset, const char *button) +{ + int count = 0; + telebot_core_mime_t mimes[6]; + mimes[count].name = "inline_query_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_query_id; + count++; + mimes[count].name = "results"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = results; + count++; + if (cache_time > 0) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "cache_time"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = cache_time; + count++; } - - if ((chat_id == 0) || (message_id <= 0)) + if (is_personal) { - ERR("Valid chat_id and message_id required"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "is_personal"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = "true"; + count++; + } + if (next_offset) + { + mimes[count].name = "next_offset"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = next_offset; + count++; + } + if (button) + { + mimes[count].name = "button"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = button; + count++; } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_INLINE_QUERY, mimes, count); +} - int index = 0; - telebot_core_mime_t mimes[3]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; +telebot_core_response_t +telebot_core_save_prepared_inline_message(telebot_core_handler_t core_h, long long int user_id, const char *result, + bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, + bool allow_channel_chats) +{ + int count = 0; + telebot_core_mime_t mimes[6]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "result"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = result; + count++; + if (allow_user_chats) + { + mimes[count].name = "allow_user_chats"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = "true"; + count++; + } + if (allow_bot_chats) + { + mimes[count].name = "allow_bot_chats"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = "true"; + count++; + } + if (allow_group_chats) + { + mimes[count].name = "allow_group_chats"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = "true"; + count++; + } + if (allow_channel_chats) + { + mimes[count].name = "allow_channel_chats"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = "true"; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SAVE_PREPARED_INLINE_MESSAGE, mimes, count); +} - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; +telebot_core_response_t +telebot_core_send_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id, + bool pay_for_upgrade, const char *text, const char *text_parse_mode, + const char *text_entities) +{ + int count = 0; + telebot_core_mime_t mimes[7]; + if (user_id > 0) + { + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + } + if (chat_id != 0) + { + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + } + mimes[count].name = "gift_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = gift_id; + count++; + mimes[count].name = "pay_for_upgrade"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = pay_for_upgrade ? "true" : "false"; + count++; + if (text) + { + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; + } + if (text_parse_mode) + { + mimes[count].name = "text_parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_parse_mode; + count++; + } + if (text_entities) + { + mimes[count].name = "text_entities"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_entities; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_GIFT, mimes, count); +} - if (reply_markup != NULL) +telebot_core_response_t +telebot_core_gift_premium_subscription(telebot_core_handler_t core_h, long long int user_id, int month_count, + int star_count, const char *text, const char *text_parse_mode, + const char *text_entities) +{ + int count = 0; + telebot_core_mime_t mimes[7]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "month_count"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = month_count; + count++; + mimes[count].name = "star_count"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = star_count; + count++; + if (text) + { + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; + } + if (text_parse_mode) + { + mimes[count].name = "text_parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_parse_mode; + count++; + } + if (text_entities) + { + mimes[count].name = "text_entities"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_entities; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GIFT_PREMIUM_SUBSCRIPTION, mimes, count); +} + +telebot_core_response_t +telebot_core_get_my_star_balance(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_MY_STAR_BALANCE, NULL, 0); +} + +telebot_core_response_t +telebot_core_get_star_transactions(telebot_core_handler_t core_h, int offset, int limit) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + if (offset > 0) + { + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + } + if (limit > 0) { - mimes[index].name = "reply_markup"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%s", reply_markup); - ++index; + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_STAR_TRANSACTIONS, mimes, count); +} - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_STOP_POLL, mimes, index, response); +telebot_core_response_t +telebot_core_refund_star_payment(telebot_core_handler_t core_h, long long int user_id, + const char *telegram_payment_charge_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "telegram_payment_charge_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = telegram_payment_charge_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_REFUND_STAR_PAYMENT, mimes, count); +} + +telebot_core_response_t +telebot_core_get_available_gifts(telebot_core_handler_t core_h) +{ + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_AVAILABLE_GIFTS, NULL, 0); } -telebot_error_e telebot_core_delete_message(telebot_core_handler_t *core_h, - long long int chat_id, int message_id, telebot_core_response_t *response) +telebot_core_response_t +telebot_core_get_user_gifts(telebot_core_handler_t core_h, long long int user_id, int offset, int limit) { - if ((core_h == NULL) || (core_h->token == NULL)) + int count = 0; + telebot_core_mime_t mimes[3]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + if (offset > 0) + { + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + } + if (limit > 0) + { + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_USER_GIFTS, mimes, count); +} + +telebot_core_response_t +telebot_core_get_chat_gifts(telebot_core_handler_t core_h, long long int chat_id, int offset, int limit) +{ + int count = 0; + telebot_core_mime_t mimes[3]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + if (offset > 0) + { + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + } + if (limit > 0) + { + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_CHAT_GIFTS, mimes, count); +} + +telebot_core_response_t +telebot_core_upgrade_gift(telebot_core_handler_t core_h, const char *gift_id, bool pay_for_upgrade, const char *text, + const char *text_parse_mode, const char *text_entities) +{ + int count = 0; + telebot_core_mime_t mimes[5]; + mimes[count].name = "gift_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = gift_id; + count++; + mimes[count].name = "pay_for_upgrade"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = pay_for_upgrade ? "true" : "false"; + count++; + if (text) + { + mimes[count].name = "text"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text; + count++; + } + if (text_parse_mode) + { + mimes[count].name = "text_parse_mode"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_parse_mode; + count++; + } + if (text_entities) + { + mimes[count].name = "text_entities"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = text_entities; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_UPGRADE_GIFT, mimes, count); +} + +telebot_core_response_t +telebot_core_transfer_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, + const char *gift_id) +{ + int count = 0; + telebot_core_mime_t mimes[3]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "gift_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = gift_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_TRANSFER_GIFT, mimes, count); +} + +telebot_core_response_t +telebot_core_convert_gift_to_stars(telebot_core_handler_t core_h, const char *gift_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "gift_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = gift_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CONVERT_GIFT_TO_STARS, mimes, count); +} + +telebot_core_response_t +telebot_core_get_user_profile_audios(telebot_core_handler_t core_h, long long int user_id, int offset, int limit) +{ + int count = 0; + telebot_core_mime_t mimes[3]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + if (offset > 0) + { + mimes[count].name = "offset"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = offset; + count++; + } + if (limit > 0) + { + mimes[count].name = "limit"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = limit; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_USER_AUDIOS, mimes, count); +} + +telebot_core_response_t +telebot_core_set_my_profile_photo(telebot_core_handler_t core_h, const char *photo) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "photo"; + mimes[count].type = TELEBOT_MIME_TYPE_FILE; + mimes[count].data.s = photo; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_MY_PROFILE_PHOTO, mimes, count); +} + +telebot_core_response_t +telebot_core_remove_my_profile_photo(telebot_core_handler_t core_h, const char *photo_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "photo_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = photo_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_REMOVE_MY_PROFILE_PHOTO, mimes, count); +} + +telebot_core_response_t +telebot_core_get_business_connection(telebot_core_handler_t core_h, const char *business_connection_id) +{ + int count = 0; + telebot_core_mime_t mimes[1]; + mimes[count].name = "business_connection_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = business_connection_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_BUSINESS_CONNECTION, mimes, count); +} + +telebot_core_response_t +telebot_core_get_user_chat_boosts(telebot_core_handler_t core_h, long long int chat_id, long long int user_id) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_USER_CHAT_BOOSTS, mimes, count); +} + +telebot_core_response_t +telebot_core_send_game(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, + const char *game_short_name, bool disable_notification, bool protect_content, + const char *reply_parameters, const char *reply_markup) +{ + int count = 0; + telebot_core_mime_t mimes[8]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + if (message_thread_id > 0) + { + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + } + mimes[count].name = "game_short_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = game_short_name; + count++; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + if (reply_parameters) + { + mimes[count].name = "reply_parameters"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_parameters; + count++; + } + if (reply_markup) + { + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_GAME, mimes, count); +} + +telebot_core_response_t +telebot_core_set_game_score(telebot_core_handler_t core_h, long long int user_id, int score, bool force, + bool disable_edit_message, long long int chat_id, int message_id, + const char *inline_message_id) +{ + int count = 0; + telebot_core_mime_t mimes[7]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "score"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = score; + count++; + mimes[count].name = "force"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = force ? "true" : "false"; + count++; + mimes[count].name = "disable_edit_message"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_edit_message ? "true" : "false"; + count++; + if (chat_id != 0) + { + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + } + if (message_id > 0) { - ERR("Handler or token is NULL"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; } + if (inline_message_id) + { + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_GAME_SCORE, mimes, count); +} - if ((message_id) <= 0) +telebot_core_response_t +telebot_core_get_game_high_scores(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, + int message_id, const char *inline_message_id) +{ + int count = 0; + telebot_core_mime_t mimes[4]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + if (chat_id != 0) + { + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + } + if (message_id > 0) { - ERR("message_id is invalid"); - return TELEBOT_ERROR_INVALID_PARAMETER; + mimes[count].name = "message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_id; + count++; + } + if (inline_message_id) + { + mimes[count].name = "inline_message_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = inline_message_id; + count++; } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_GET_GAME_HIGH_SCORES, mimes, count); +} - int index = 0; - telebot_core_mime_t mimes[2]; // number of arguments - mimes[index].name = "chat_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%lld", chat_id); - ++index; +telebot_core_response_t +telebot_core_set_passport_data_errors(telebot_core_handler_t core_h, long long int user_id, const char *errors) +{ + int count = 0; + telebot_core_mime_t mimes[2]; + mimes[count].name = "user_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = user_id; + count++; + mimes[count].name = "errors"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = errors; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SET_PASSPORT_DATA_ERRORS, mimes, count); +} - mimes[index].name = "message_id"; - mimes[index].type = TELEBOT_MIME_TYPE_DATA; - snprintf(mimes[index].data, sizeof(mimes[index].data), "%d", message_id); - ++index; +telebot_core_response_t +telebot_core_send_invoice(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, + const char *title, const char *description, const char *payload, const char *provider_token, + const char *currency, const char *prices, int max_tip_amount, + const char *suggested_tip_amounts, const char *start_parameter, + const char *provider_data, const char *photo_url, int photo_size, + int photo_width, int photo_height, bool need_name, bool need_phone_number, + bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, + bool send_email_to_provider, bool is_flexible, bool disable_notification, + bool protect_content, const char *reply_parameters, const char *reply_markup) +{ + int count = 0; + telebot_core_mime_t mimes[28]; + mimes[count].name = "chat_id"; + mimes[count].type = TELEBOT_MIME_TYPE_LONG_LONG_INT; + mimes[count].data.lld = chat_id; + count++; + if (message_thread_id > 0) + { + mimes[count].name = "message_thread_id"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = message_thread_id; + count++; + } + mimes[count].name = "title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = title; + count++; + mimes[count].name = "description"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = description; + count++; + mimes[count].name = "payload"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = payload; + count++; + if (provider_token) + { + mimes[count].name = "provider_token"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = provider_token; + count++; + } + mimes[count].name = "currency"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = currency; + count++; + mimes[count].name = "prices"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = prices; + count++; + if (max_tip_amount > 0) + { + mimes[count].name = "max_tip_amount"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = max_tip_amount; + count++; + } + if (suggested_tip_amounts) + { + mimes[count].name = "suggested_tip_amounts"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = suggested_tip_amounts; + count++; + } + if (start_parameter) + { + mimes[count].name = "start_parameter"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = start_parameter; + count++; + } + if (provider_data) + { + mimes[count].name = "provider_data"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = provider_data; + count++; + } + if (photo_url) + { + mimes[count].name = "photo_url"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = photo_url; + count++; + } + if (photo_size > 0) + { + mimes[count].name = "photo_size"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_size; + count++; + } + if (photo_width > 0) + { + mimes[count].name = "photo_width"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_width; + count++; + } + if (photo_height > 0) + { + mimes[count].name = "photo_height"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_height; + count++; + } + mimes[count].name = "need_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_name ? "true" : "false"; + count++; + mimes[count].name = "need_phone_number"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_phone_number ? "true" : "false"; + count++; + mimes[count].name = "need_email"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_email ? "true" : "false"; + count++; + mimes[count].name = "need_shipping_address"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_shipping_address ? "true" : "false"; + count++; + mimes[count].name = "send_phone_number_to_provider"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = send_phone_number_to_provider ? "true" : "false"; + count++; + mimes[count].name = "send_email_to_provider"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = send_email_to_provider ? "true" : "false"; + count++; + mimes[count].name = "is_flexible"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = is_flexible ? "true" : "false"; + count++; + mimes[count].name = "disable_notification"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = disable_notification ? "true" : "false"; + count++; + mimes[count].name = "protect_content"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = protect_content ? "true" : "false"; + count++; + if (reply_parameters) + { + mimes[count].name = "reply_parameters"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_parameters; + count++; + } + if (reply_markup) + { + mimes[count].name = "reply_markup"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = reply_markup; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_INVOICE, mimes, count); +} + +telebot_core_response_t +telebot_core_create_invoice_link(telebot_core_handler_t core_h, const char *title, const char *description, + const char *payload, const char *provider_token, const char *currency, + const char *prices, int max_tip_amount, const char *suggested_tip_amounts, + const char *provider_data, const char *photo_url, int photo_size, int photo_width, + int photo_height, bool need_name, bool need_phone_number, bool need_email, + bool need_shipping_address, bool send_phone_number_to_provider, + bool send_email_to_provider, bool is_flexible) +{ + int count = 0; + telebot_core_mime_t mimes[21]; + mimes[count].name = "title"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = title; + count++; + mimes[count].name = "description"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = description; + count++; + mimes[count].name = "payload"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = payload; + count++; + if (provider_token) + { + mimes[count].name = "provider_token"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = provider_token; + count++; + } + mimes[count].name = "currency"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = currency; + count++; + mimes[count].name = "prices"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = prices; + count++; + if (max_tip_amount > 0) + { + mimes[count].name = "max_tip_amount"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = max_tip_amount; + count++; + } + if (suggested_tip_amounts) + { + mimes[count].name = "suggested_tip_amounts"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = suggested_tip_amounts; + count++; + } + if (provider_data) + { + mimes[count].name = "provider_data"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = provider_data; + count++; + } + if (photo_url) + { + mimes[count].name = "photo_url"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = photo_url; + count++; + } + if (photo_size > 0) + { + mimes[count].name = "photo_size"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_size; + count++; + } + if (photo_width > 0) + { + mimes[count].name = "photo_width"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_width; + count++; + } + if (photo_height > 0) + { + mimes[count].name = "photo_height"; + mimes[count].type = TELEBOT_MIME_TYPE_INT; + mimes[count].data.d = photo_height; + count++; + } + mimes[count].name = "need_name"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_name ? "true" : "false"; + count++; + mimes[count].name = "need_phone_number"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_phone_number ? "true" : "false"; + count++; + mimes[count].name = "need_email"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_email ? "true" : "false"; + count++; + mimes[count].name = "need_shipping_address"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = need_shipping_address ? "true" : "false"; + count++; + mimes[count].name = "send_phone_number_to_provider"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = send_phone_number_to_provider ? "true" : "false"; + count++; + mimes[count].name = "send_email_to_provider"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = send_email_to_provider ? "true" : "false"; + count++; + mimes[count].name = "is_flexible"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = is_flexible ? "true" : "false"; + count++; + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_CREATE_INVOICE_LINK, mimes, count); +} - return telebot_core_curl_perform(core_h, TELEBOT_METHOD_DELETE_MESSAGE, mimes, index, response); +telebot_core_response_t +telebot_core_answer_shipping_query(telebot_core_handler_t core_h, const char *shipping_query_id, bool ok, + const char *shipping_options, const char *error_message) +{ + int count = 0; + telebot_core_mime_t mimes[4]; + mimes[count].name = "shipping_query_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = shipping_query_id; + count++; + mimes[count].name = "ok"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = ok ? "true" : "false"; + count++; + if (shipping_options) + { + mimes[count].name = "shipping_options"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = shipping_options; + count++; + } + if (error_message) + { + mimes[count].name = "error_message"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = error_message; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_SHIPPING_QUERY, mimes, count); +} + +telebot_core_response_t +telebot_core_answer_pre_checkout_query(telebot_core_handler_t core_h, const char *pre_checkout_query_id, bool ok, + const char *error_message) +{ + int count = 0; + telebot_core_mime_t mimes[3]; + mimes[count].name = "pre_checkout_query_id"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = pre_checkout_query_id; + count++; + mimes[count].name = "ok"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = ok ? "true" : "false"; + count++; + if (error_message) + { + mimes[count].name = "error_message"; + mimes[count].type = TELEBOT_MIME_TYPE_STRING; + mimes[count].data.s = error_message; + count++; + } + return telebot_core_curl_perform(core_h, TELEBOT_METHOD_ANSWER_PRE_CHECKOUT_QUERY, mimes, count); } diff --git a/src/telebot-forums.c b/src/telebot-forums.c new file mode 100644 index 0000000..c2661ff --- /dev/null +++ b/src/telebot-forums.c @@ -0,0 +1,249 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +telebot_error_e telebot_create_forum_topic(telebot_handler_t handle, long long int chat_id, + const char *name, int icon_color, const char *icon_custom_emoji_id, + telebot_forum_topic_t *topic) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (topic == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_create_forum_topic(handle->core_h, chat_id, name, icon_color, icon_custom_emoji_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_forum_topic(result, topic); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_forum_topic(telebot_forum_topic_t *topic) +{ + if (topic == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + TELEBOT_SAFE_FREE(topic->name); + TELEBOT_SAFE_FREE(topic->icon_custom_emoji_id); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_edit_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id, + const char *name, const char *icon_custom_emoji_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_edit_forum_topic(handle->core_h, chat_id, message_thread_id, name, icon_custom_emoji_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_close_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_close_forum_topic(handle->core_h, chat_id, message_thread_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_reopen_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_reopen_forum_topic(handle->core_h, chat_id, message_thread_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_delete_forum_topic(telebot_handler_t handle, long long int chat_id, int message_thread_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_delete_forum_topic(handle->core_h, chat_id, message_thread_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_unpin_all_forum_topic_messages(telebot_handler_t handle, long long int chat_id, int message_thread_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_unpin_all_forum_topic_messages(handle->core_h, chat_id, message_thread_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_forum_topic_icon_stickers(telebot_handler_t handle, telebot_sticker_t **stickers, int *count) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if ((stickers == NULL) || (count == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_forum_topic_icon_stickers(handle->core_h); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_stickers(result, stickers, count); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_edit_general_forum_topic(telebot_handler_t handle, long long int chat_id, const char *name) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_edit_general_forum_topic(handle->core_h, chat_id, name); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_close_general_forum_topic(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_close_general_forum_topic(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_reopen_general_forum_topic(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_reopen_general_forum_topic(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_hide_general_forum_topic(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_hide_general_forum_topic(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_unhide_general_forum_topic(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_unhide_general_forum_topic(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_unpin_all_general_forum_topic_messages(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_unpin_all_general_forum_topic_messages(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} diff --git a/src/telebot-games.c b/src/telebot-games.c new file mode 100644 index 0000000..c2bd696 --- /dev/null +++ b/src/telebot-games.c @@ -0,0 +1,199 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +telebot_error_e telebot_send_game(telebot_handler_t handle, + long long int chat_id, int message_thread_id, const char *game_short_name, + bool disable_notification, bool protect_content, const char *reply_parameters, + const char *reply_markup, telebot_message_t *message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (message == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_send_game(handle->core_h, chat_id, message_thread_id, + game_short_name, disable_notification, protect_content, + reply_parameters, reply_markup); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_message(result, message); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_game_score(telebot_handler_t handle, + long long int user_id, int score, bool force, bool disable_edit_message, + long long int chat_id, int message_id, const char *inline_message_id, + telebot_message_t *message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_set_game_score(handle->core_h, user_id, score, force, + disable_edit_message, chat_id, message_id, inline_message_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (message) + { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + if (json_object_get_type(result) == json_type_object) + ret = telebot_parser_get_message(result, message); + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_game_high_scores(telebot_handler_t handle, + long long int user_id, long long int chat_id, int message_id, const char *inline_message_id, + telebot_game_high_score_t **high_scores, int *count) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if ((high_scores == NULL) || (count == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_game_high_scores(handle->core_h, user_id, chat_id, message_id, inline_message_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + int array_len = json_object_array_length(result); + if (array_len <= 0) + { + *count = 0; + *high_scores = NULL; + goto finish; + } + + *high_scores = calloc(array_len, sizeof(telebot_game_high_score_t)); + if (*high_scores == NULL) + { + ret = TELEBOT_ERROR_OUT_OF_MEMORY; + goto finish; + } + *count = array_len; + + for (int i = 0; i < array_len; i++) + { + telebot_parser_get_game_high_score(json_object_array_get_idx(result, i), &((*high_scores)[i])); + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_game_high_scores(telebot_game_high_score_t *high_scores, int count) +{ + if (high_scores == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + for (int i = 0; i < count; i++) + { + telebot_put_user(high_scores[i].user); + TELEBOT_SAFE_FREE(high_scores[i].user); + } + free(high_scores); + + return TELEBOT_ERROR_NONE; +} diff --git a/src/telebot-inline.c b/src/telebot-inline.c new file mode 100644 index 0000000..2f0be21 --- /dev/null +++ b/src/telebot-inline.c @@ -0,0 +1,124 @@ +#include +#include +#include +#include +#include + +telebot_error_e telebot_answer_inline_query(telebot_handler_t handle, + const char *inline_query_id, const char *results, int cache_time, + bool is_personal, const char *next_offset, const char *button) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_answer_inline_query(handle->core_h, inline_query_id, + results, cache_time, is_personal, + next_offset, button); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_save_prepared_inline_message(telebot_handler_t handle, + long long int user_id, const char *result, bool allow_user_chats, + bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats, + telebot_prepared_inline_message_t *prepared_message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (prepared_message == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_save_prepared_inline_message(handle->core_h, user_id, result, + allow_user_chats, allow_bot_chats, + allow_group_chats, allow_channel_chats); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *res_obj = NULL; + if (!json_object_object_get_ex(obj, "result", &res_obj)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_prepared_inline_message(res_obj, prepared_message); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_prepared_inline_message(telebot_prepared_inline_message_t *prepared_message) +{ + if (prepared_message == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + TELEBOT_SAFE_FREE(prepared_message->id); + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_answer_web_app_query(telebot_handler_t handle, const char *web_app_query_id, const char *result, char **inline_message_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_answer_web_app_query(handle->core_h, web_app_query_id, result); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (inline_message_id) + { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result_obj = NULL; + if (json_object_object_get_ex(obj, "result", &result_obj)) + { + struct json_object *imid_obj = NULL; + if (json_object_object_get_ex(result_obj, "inline_message_id", &imid_obj)) + { + *inline_message_id = TELEBOT_SAFE_STRDUP(json_object_get_string(imid_obj)); + } + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} diff --git a/src/telebot-parser.c b/src/telebot-parser.c index 49cbb86..d6065c4 100644 --- a/src/telebot-parser.c +++ b/src/telebot-parser.c @@ -21,26 +21,58 @@ #include #include #include -#include -#include -#include #include -#include #include +#include static const char *telebot_update_type_str[TELEBOT_UPDATE_TYPE_MAX] = { "message", "edited_message", "channel_post", - "edited_channel_post", "inline_query", + "edited_channel_post", "business_connection", + "business_message", "edited_business_message", + "deleted_business_messages", "message_reaction", + "message_reaction_count", "inline_query", "chosen_inline_result", "callback_query", "shipping_query", "pre_checkout_query", - "poll", "poll_answer"}; + "purchased_paid_media", + "poll", "poll_answer", "my_chat_member", + "chat_member", "chat_join_request", + "chat_boost", "removed_chat_boost"}; static telebot_error_e telebot_parser_get_photos(struct json_object *obj, telebot_photo_t **photos, int *count); static telebot_error_e telebot_parser_get_users(struct json_object *obj, telebot_user_t **users, int *count); - -struct json_object *telebot_parser_str_to_obj(char *data) +static telebot_error_e telebot_parser_get_business_messages_deleted(struct json_object *obj, telebot_business_messages_deleted_t *deleted); +static telebot_error_e telebot_parser_get_message_origin(struct json_object *obj, telebot_message_origin_t *origin); +static telebot_error_e telebot_parser_get_text_quote(struct json_object *obj, telebot_text_quote_t *quote); +static telebot_error_e telebot_parser_get_story(struct json_object *obj, telebot_story_t *story); +static telebot_error_e telebot_parser_get_external_reply_info(struct json_object *obj, telebot_external_reply_info_t *info); +static telebot_error_e telebot_parser_get_link_preview_options(struct json_object *obj, telebot_link_preview_options_t *options); +static telebot_error_e telebot_parser_get_paid_media_info(struct json_object *obj, telebot_paid_media_info_t *info); +static telebot_error_e telebot_parser_get_refunded_payment(struct json_object *obj, telebot_refunded_payment_t *payment); +static telebot_error_e telebot_parser_get_write_access_allowed(struct json_object *obj, telebot_write_access_allowed_t *allowed); +static telebot_error_e telebot_parser_get_users_shared(struct json_object *obj, telebot_users_shared_t *shared); +static telebot_error_e telebot_parser_get_chat_shared(struct json_object *obj, telebot_chat_shared_t *shared); +static telebot_error_e telebot_parser_get_gift_info(struct json_object *obj, telebot_gift_info_t *gift); +static telebot_error_e telebot_parser_get_unique_gift_info(struct json_object *obj, telebot_unique_gift_info_t *gift); +static telebot_error_e telebot_parser_get_chat_boost_added(struct json_object *obj, telebot_chat_boost_added_t *boost); +static telebot_error_e telebot_parser_get_chat_background(struct json_object *obj, telebot_chat_background_t *background); +static telebot_error_e telebot_parser_get_giveaway_created(struct json_object *obj, telebot_giveaway_created_t *giveaway); +static telebot_error_e telebot_parser_get_giveaway_completed(struct json_object *obj, telebot_giveaway_completed_t *giveaway); +static telebot_error_e telebot_parser_get_birthdate(struct json_object *obj, telebot_birthdate_t *birthdate); +static telebot_error_e telebot_parser_get_business_intro(struct json_object *obj, telebot_business_intro_t *intro); +static telebot_error_e telebot_parser_get_business_location(struct json_object *obj, telebot_business_location_t *location); +static telebot_error_e telebot_parser_get_business_opening_hours(struct json_object *obj, telebot_business_opening_hours_t *hours); +static telebot_error_e telebot_parser_get_business_bot_rights(struct json_object *obj, telebot_business_bot_rights_t *rights); +static telebot_error_e telebot_parser_get_paid_media(struct json_object *obj, telebot_paid_media_t *media); +static telebot_error_e telebot_parser_get_gift(struct json_object *obj, telebot_gift_t *gift); +static telebot_error_e telebot_parser_get_unique_gift(struct json_object *obj, telebot_unique_gift_t *gift); +static telebot_error_e telebot_parser_get_shared_user(struct json_object *obj, telebot_shared_user_t *user); + +struct json_object *telebot_parser_str_to_obj(const char *data) { - return json_tokener_parse(data); + if (data) + return json_tokener_parse(data); + else + return NULL; } telebot_error_e telebot_parser_get_updates(struct json_object *obj, telebot_update_t **updates, int *count) @@ -106,6 +138,42 @@ telebot_error_e telebot_parser_get_updates(struct json_object *obj, telebot_upda continue; } + struct json_object *business_connection = NULL; + if (json_object_object_get_ex(item, "business_connection", &business_connection)) + { + if (telebot_parser_get_business_connection(business_connection, &(result[index].business_connection)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse business_connection of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_BUSINESS_CONNECTION; + continue; + } + + struct json_object *business_message = NULL; + if (json_object_object_get_ex(item, "business_message", &business_message)) + { + if (telebot_parser_get_message(business_message, &(result[index].business_message)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse business_message of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_BUSINESS_MESSAGE; + continue; + } + + struct json_object *edited_business_message = NULL; + if (json_object_object_get_ex(item, "edited_business_message", &edited_business_message)) + { + if (telebot_parser_get_message(edited_business_message, &(result[index].edited_business_message)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse edited_business_message of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_EDITED_BUSINESS_MESSAGE; + continue; + } + + struct json_object *deleted_business_messages = NULL; + if (json_object_object_get_ex(item, "deleted_business_messages", &deleted_business_messages)) + { + if (telebot_parser_get_business_messages_deleted(deleted_business_messages, &(result[index].deleted_business_messages)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse deleted_business_messages of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_DELETED_BUSINESS_MESSAGES; + continue; + } + struct json_object *callback_query = NULL; if (json_object_object_get_ex(item, "callback_query", &callback_query)) { @@ -133,6 +201,114 @@ telebot_error_e telebot_parser_get_updates(struct json_object *obj, telebot_upda continue; } + struct json_object *my_chat_member = NULL; + if (json_object_object_get_ex(item, "my_chat_member", &my_chat_member)) + { + if (telebot_parser_get_chat_member_updated(my_chat_member, &(result[index].my_chat_member)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse my_chat_member of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER; + continue; + } + + struct json_object *chat_member = NULL; + if (json_object_object_get_ex(item, "chat_member", &chat_member)) + { + if (telebot_parser_get_chat_member_updated(chat_member, &(result[index].chat_member)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse chat_member of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_CHAT_MEMBER; + continue; + } + + struct json_object *chat_join_request = NULL; + if (json_object_object_get_ex(item, "chat_join_request", &chat_join_request)) + { + if (telebot_parser_get_chat_join_request(chat_join_request, &(result[index].chat_join_request)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse chat_join_request of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST; + continue; + } + + struct json_object *message_reaction = NULL; + if (json_object_object_get_ex(item, "message_reaction", &message_reaction)) + { + if (telebot_parser_get_message_reaction_updated(message_reaction, &(result[index].message_reaction)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse message_reaction of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_MESSAGE_REACTION; + continue; + } + + struct json_object *message_reaction_count = NULL; + if (json_object_object_get_ex(item, "message_reaction_count", &message_reaction_count)) + { + if (telebot_parser_get_message_reaction_count_updated(message_reaction_count, &(result[index].message_reaction_count)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse message_reaction_count of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT; + continue; + } + + struct json_object *chat_boost = NULL; + if (json_object_object_get_ex(item, "chat_boost", &chat_boost)) + { + if (telebot_parser_get_chat_boost_updated(chat_boost, &(result[index].chat_boost)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse chat_boost of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_CHAT_BOOST; + continue; + } + + struct json_object *chat_boost_removed = NULL; + if (json_object_object_get_ex(item, "removed_chat_boost", &chat_boost_removed)) + { + if (telebot_parser_get_chat_boost_removed(chat_boost_removed, &(result[index].chat_boost_removed)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse chat_boost_removed of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST; + continue; + } + + struct json_object *inline_query = NULL; + if (json_object_object_get_ex(item, "inline_query", &inline_query)) + { + if (telebot_parser_get_inline_query(inline_query, &(result[index].inline_query)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse inline_query of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_INLINE_QUERY; + continue; + } + + struct json_object *chosen_inline_result = NULL; + if (json_object_object_get_ex(item, "chosen_inline_result", &chosen_inline_result)) + { + if (telebot_parser_get_chosen_inline_result(chosen_inline_result, &(result[index].chosen_inline_result)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse chosen_inline_result of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT; + continue; + } + + struct json_object *shipping_query = NULL; + if (json_object_object_get_ex(item, "shipping_query", &shipping_query)) + { + if (telebot_parser_get_shipping_query(shipping_query, &(result[index].shipping_query)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse shipping_query of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_SHIPPING_QUERY; + continue; + } + + struct json_object *pre_checkout_query = NULL; + if (json_object_object_get_ex(item, "pre_checkout_query", &pre_checkout_query)) + { + if (telebot_parser_get_pre_checkout_query(pre_checkout_query, &(result[index].pre_checkout_query)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse pre_checkout_query of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY; + continue; + } + + struct json_object *purchased_paid_media = NULL; + if (json_object_object_get_ex(item, "purchased_paid_media", &purchased_paid_media)) + { + if (telebot_parser_get_paid_media_purchased(purchased_paid_media, &(result[index].purchased_paid_media)) != TELEBOT_ERROR_NONE) + ERR("Failed to parse purchased_paid_media of bot update"); + result[index].update_type = TELEBOT_UPDATE_TYPE_PURCHASED_PAID_MEDIA; + continue; + } + } /* for index */ return TELEBOT_ERROR_NONE; @@ -219,7 +395,7 @@ telebot_error_e telebot_parser_get_user(struct json_object *obj, telebot_user_t ERR("Object is not json user type, id not found"); return TELEBOT_ERROR_OPERATION_FAILED; } - user->id = json_object_get_int(id); + user->id = json_object_get_int64(id); struct json_object *is_bot = NULL; if (!json_object_object_get_ex(obj, "is_bot", &is_bot)) @@ -249,6 +425,14 @@ telebot_error_e telebot_parser_get_user(struct json_object *obj, telebot_user_t if (json_object_object_get_ex(obj, "language_code", &language_code)) user->language_code = TELEBOT_SAFE_STRDUP(json_object_get_string(language_code)); + struct json_object *is_premium = NULL; + if (json_object_object_get_ex(obj, "is_premium", &is_premium)) + user->is_premium = json_object_get_boolean(is_premium); + + struct json_object *added_to_attachment_menu = NULL; + if (json_object_object_get_ex(obj, "added_to_attachment_menu", &added_to_attachment_menu)) + user->added_to_attachment_menu = json_object_get_boolean(added_to_attachment_menu); + struct json_object *can_join_groups = NULL; if (json_object_object_get_ex(obj, "can_join_groups", &can_join_groups)) user->can_join_groups = json_object_get_boolean(can_join_groups); @@ -261,6 +445,22 @@ telebot_error_e telebot_parser_get_user(struct json_object *obj, telebot_user_t if (json_object_object_get_ex(obj, "supports_inline_queries", &supports_inline_queries)) user->supports_inline_queries = json_object_get_boolean(supports_inline_queries); + struct json_object *can_connect_to_business = NULL; + if (json_object_object_get_ex(obj, "can_connect_to_business", &can_connect_to_business)) + user->can_connect_to_business = json_object_get_boolean(can_connect_to_business); + + struct json_object *has_main_web_app = NULL; + if (json_object_object_get_ex(obj, "has_main_web_app", &has_main_web_app)) + user->has_main_web_app = json_object_get_boolean(has_main_web_app); + + struct json_object *has_topics_enabled = NULL; + if (json_object_object_get_ex(obj, "has_topics_enabled", &has_topics_enabled)) + user->has_topics_enabled = json_object_get_boolean(has_topics_enabled); + + struct json_object *allows_users_to_create_topics = NULL; + if (json_object_object_get_ex(obj, "allows_users_to_create_topics", &allows_users_to_create_topics)) + user->allows_users_to_create_topics = json_object_get_boolean(allows_users_to_create_topics); + return TELEBOT_ERROR_NONE; } @@ -328,6 +528,22 @@ telebot_error_e telebot_parser_get_chat(struct json_object *obj, telebot_chat_t if (json_object_object_get_ex(obj, "last_name", &last_name)) chat->last_name = TELEBOT_SAFE_STRDUP(json_object_get_string(last_name)); + struct json_object *is_forum = NULL; + if (json_object_object_get_ex(obj, "is_forum", &is_forum)) + chat->is_forum = json_object_get_boolean(is_forum); + + struct json_object *is_direct_messages = NULL; + if (json_object_object_get_ex(obj, "is_direct_messages", &is_direct_messages)) + chat->is_direct_messages = json_object_get_boolean(is_direct_messages); + + struct json_object *accent_color_id = NULL; + if (json_object_object_get_ex(obj, "accent_color_id", &accent_color_id)) + chat->accent_color_id = json_object_get_int(accent_color_id); + + struct json_object *max_reaction_count = NULL; + if (json_object_object_get_ex(obj, "max_reaction_count", &max_reaction_count)) + chat->max_reaction_count = json_object_get_int(max_reaction_count); + struct json_object *chat_photo = NULL; if (json_object_object_get_ex(obj, "photo", &chat_photo)) { @@ -339,6 +555,92 @@ telebot_error_e telebot_parser_get_chat(struct json_object *obj, telebot_chat_t } } + struct json_object *array_active_usernames = NULL; + if (json_object_object_get_ex(obj, "active_usernames", &array_active_usernames)) + { + int count_active_usernames = json_object_array_length(array_active_usernames); + if ((chat->count_active_usernames > 0) && + (chat->active_usernames = calloc(count_active_usernames, sizeof(char *)))) + { + chat->count_active_usernames = count_active_usernames; + for (int index = 0; index < count_active_usernames; index++) + { + struct json_object *item = json_object_array_get_idx(array_active_usernames, index); + chat->active_usernames[index] = TELEBOT_SAFE_STRDUP(json_object_get_string(item)); + } + } + } + + struct json_object *birthdate = NULL; + if (json_object_object_get_ex(obj, "birthdate", &birthdate)) + { + chat->birthdate = calloc(1, sizeof(telebot_birthdate_t)); + telebot_parser_get_birthdate(birthdate, chat->birthdate); + } + + struct json_object *business_intro = NULL; + if (json_object_object_get_ex(obj, "business_intro", &business_intro)) + { + chat->business_intro = calloc(1, sizeof(telebot_business_intro_t)); + telebot_parser_get_business_intro(business_intro, chat->business_intro); + } + + struct json_object *business_location = NULL; + if (json_object_object_get_ex(obj, "business_location", &business_location)) + { + chat->business_location = calloc(1, sizeof(telebot_business_location_t)); + telebot_parser_get_business_location(business_location, chat->business_location); + } + + struct json_object *business_opening_hours = NULL; + if (json_object_object_get_ex(obj, "business_opening_hours", &business_opening_hours)) + { + chat->business_opening_hours = calloc(1, sizeof(telebot_business_opening_hours_t)); + telebot_parser_get_business_opening_hours(business_opening_hours, chat->business_opening_hours); + } + + struct json_object *personal_chat = NULL; + if (json_object_object_get_ex(obj, "personal_chat", &personal_chat)) + { + chat->personal_chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(personal_chat, chat->personal_chat); + } + + struct json_object *parent_chat = NULL; + if (json_object_object_get_ex(obj, "parent_chat", &parent_chat)) + { + chat->parent_chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(parent_chat, chat->parent_chat); + } + + struct json_object *emoji_status_custom_emoji_id = NULL; + if (json_object_object_get_ex(obj, "emoji_status_custom_emoji_id", &emoji_status_custom_emoji_id)) + chat->emoji_status_custom_emoji_id = TELEBOT_SAFE_STRDUP(json_object_get_string(emoji_status_custom_emoji_id)); + + struct json_object *emoji_status_expiration_date = NULL; + if (json_object_object_get_ex(obj, "emoji_status_expiration_date", &emoji_status_expiration_date)) + chat->emoji_status_expiration_date = json_object_get_int(emoji_status_expiration_date); + + struct json_object *bio = NULL; + if (json_object_object_get_ex(obj, "bio", &bio)) + chat->bio = TELEBOT_SAFE_STRDUP(json_object_get_string(bio)); + + struct json_object *has_private_forwards = NULL; + if (json_object_object_get_ex(obj, "has_private_forwards", &has_private_forwards)) + chat->has_private_forwards = json_object_get_boolean(has_private_forwards); + + struct json_object *has_restricted_voice_and_video_messages = NULL; + if (json_object_object_get_ex(obj, "has_restricted_voice_and_video_messages", &has_restricted_voice_and_video_messages)) + chat->has_restricted_voice_and_video_messages = json_object_get_boolean(has_restricted_voice_and_video_messages); + + struct json_object *join_to_send_messages = NULL; + if (json_object_object_get_ex(obj, "join_to_send_messages", &join_to_send_messages)) + chat->join_to_send_messages = json_object_get_boolean(join_to_send_messages); + + struct json_object *join_by_request = NULL; + if (json_object_object_get_ex(obj, "join_by_request", &join_by_request)) + chat->join_by_request = json_object_get_boolean(join_by_request); + struct json_object *description = NULL; if (json_object_object_get_ex(obj, "description", &description)) chat->description = TELEBOT_SAFE_STRDUP(json_object_get_string(description)); @@ -347,16 +649,6 @@ telebot_error_e telebot_parser_get_chat(struct json_object *obj, telebot_chat_t if (json_object_object_get_ex(obj, "invite_link", &invite_link)) chat->invite_link = TELEBOT_SAFE_STRDUP(json_object_get_string(invite_link)); - struct json_object *pinned_message = NULL; - if (json_object_object_get_ex(obj, "pinned_message", &pinned_message)) - { - chat->pinned_message = calloc(1, sizeof(telebot_message_t)); - if (telebot_parser_get_message(pinned_message, chat->pinned_message) != TELEBOT_ERROR_NONE) - { - ERR("Failed to get from chat object"); - TELEBOT_SAFE_FREE(chat->pinned_message); - } - } struct json_object *permissions = NULL; if (json_object_object_get_ex(obj, "permissions", &permissions)) @@ -371,9 +663,27 @@ telebot_error_e telebot_parser_get_chat(struct json_object *obj, telebot_chat_t struct json_object *slow_mode_delay = NULL; if (json_object_object_get_ex(obj, "slow_mode_delay", &slow_mode_delay)) - { chat->slow_mode_delay = json_object_get_int(slow_mode_delay); - } + + struct json_object *unrestrict_boost_count = NULL; + if (json_object_object_get_ex(obj, "unrestrict_boost_count", &unrestrict_boost_count)) + chat->unrestrict_boost_count = json_object_get_int(unrestrict_boost_count); + + struct json_object *has_aggressive_anti_spam_enabled = NULL; + if (json_object_object_get_ex(obj, "has_aggressive_anti_spam_enabled", &has_aggressive_anti_spam_enabled)) + chat->has_aggressive_anti_spam_enabled = json_object_get_boolean(has_aggressive_anti_spam_enabled); + + struct json_object *has_hidden_members = NULL; + if (json_object_object_get_ex(obj, "has_hidden_members", &has_hidden_members)) + chat->has_hidden_members = json_object_get_boolean(has_hidden_members); + + struct json_object *has_protected_content = NULL; + if (json_object_object_get_ex(obj, "has_protected_content", &has_protected_content)) + chat->has_protected_content = json_object_get_boolean(has_protected_content); + + struct json_object *message_auto_delete_time = NULL; + if (json_object_object_get_ex(obj, "message_auto_delete_time", &message_auto_delete_time)) + chat->message_auto_delete_time = json_object_get_int(message_auto_delete_time); struct json_object *sticker_set_name = NULL; if (json_object_object_get_ex(obj, "sticker_set_name", &sticker_set_name)) @@ -383,6 +693,25 @@ telebot_error_e telebot_parser_get_chat(struct json_object *obj, telebot_chat_t if (json_object_object_get_ex(obj, "can_set_sticker_set", &can_set_sticker_set)) chat->can_set_sticker_set = json_object_get_boolean(can_set_sticker_set); + struct json_object *custom_emoji_sticker_set_name = NULL; + if (json_object_object_get_ex(obj, "custom_emoji_sticker_set_name", &custom_emoji_sticker_set_name)) + chat->custom_emoji_sticker_set_name = TELEBOT_SAFE_STRDUP(json_object_get_string(custom_emoji_sticker_set_name)); + + struct json_object *linked_chat_id = NULL; + if (json_object_object_get_ex(obj, "linked_chat_id", &linked_chat_id)) + chat->linked_chat_id = json_object_get_int64(linked_chat_id); + + struct json_object *location = NULL; + if (json_object_object_get_ex(obj, "location", &location)) + { + chat->location = calloc(1, sizeof(telebot_chat_location_t)); + if (telebot_parser_get_chat_location(location, chat->location) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get chat location from chat object"); + TELEBOT_SAFE_FREE(chat->location); + } + } + return TELEBOT_ERROR_NONE; } @@ -459,7 +788,22 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess return TELEBOT_ERROR_OPERATION_FAILED; } + struct json_object *forward_origin = NULL; + if (json_object_object_get_ex(obj, "forward_origin", &forward_origin)) + { + msg->forward_origin = calloc(1, sizeof(telebot_message_origin_t)); + if (telebot_parser_get_message_origin(forward_origin, msg->forward_origin) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->forward_origin); + } + } + /* Optional Fields */ + struct json_object *message_thread_id = NULL; + if (json_object_object_get_ex(obj, "message_thread_id", &message_thread_id)) + msg->message_thread_id = json_object_get_int(message_thread_id); + struct json_object *from = NULL; if (json_object_object_get_ex(obj, "from", &from)) { @@ -471,6 +815,36 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } + struct json_object *sender_chat = NULL; + if (json_object_object_get_ex(obj, "sender_chat", &sender_chat)) + { + msg->sender_chat = malloc(sizeof(telebot_chat_t)); + if (telebot_parser_get_chat(sender_chat, msg->sender_chat) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->sender_chat); + } + } + + struct json_object *sender_boost_count = NULL; + if (json_object_object_get_ex(obj, "sender_boost_count", &sender_boost_count)) + msg->sender_boost_count = json_object_get_int(sender_boost_count); + + struct json_object *sender_business_bot = NULL; + if (json_object_object_get_ex(obj, "sender_business_bot", &sender_business_bot)) + { + msg->sender_business_bot = calloc(1, sizeof(telebot_user_t)); + if (telebot_parser_get_user(sender_business_bot, msg->sender_business_bot) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->sender_business_bot); + } + } + + struct json_object *business_connection_id = NULL; + if (json_object_object_get_ex(obj, "business_connection_id", &business_connection_id)) + msg->business_connection_id = TELEBOT_SAFE_STRDUP(json_object_get_string(business_connection_id)); + struct json_object *forward_from = NULL; if (json_object_object_get_ex(obj, "forward_from", &forward_from)) { @@ -509,6 +883,14 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess if (json_object_object_get_ex(obj, "forward_date", &forward_date)) msg->forward_date = json_object_get_int(forward_date); + struct json_object *is_topic_message = NULL; + if (json_object_object_get_ex(obj, "is_topic_message", &is_topic_message)) + msg->is_topic_message = json_object_get_boolean(is_topic_message); + + struct json_object *is_automatic_forward = NULL; + if (json_object_object_get_ex(obj, "is_automatic_forward", &is_automatic_forward)) + msg->is_automatic_forward = json_object_get_boolean(is_automatic_forward); + struct json_object *reply_to_message = NULL; if (json_object_object_get_ex(obj, "reply_to_message", &reply_to_message)) { @@ -520,10 +902,62 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } + struct json_object *external_reply = NULL; + if (json_object_object_get_ex(obj, "external_reply", &external_reply)) + { + msg->external_reply = calloc(1, sizeof(telebot_external_reply_info_t)); + if (telebot_parser_get_external_reply_info(external_reply, msg->external_reply) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->external_reply); + } + } + + struct json_object *quote = NULL; + if (json_object_object_get_ex(obj, "quote", "e)) + { + msg->quote = calloc(1, sizeof(telebot_text_quote_t)); + if (telebot_parser_get_text_quote(quote, msg->quote) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->quote); + } + } + + struct json_object *reply_to_story = NULL; + if (json_object_object_get_ex(obj, "reply_to_story", &reply_to_story)) + { + msg->reply_to_story = calloc(1, sizeof(telebot_story_t)); + if (telebot_parser_get_story(reply_to_story, msg->reply_to_story) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->reply_to_story); + } + } + + struct json_object *via_bot = NULL; + if (json_object_object_get_ex(obj, "via_bot", &via_bot)) + { + msg->via_bot = malloc(sizeof(telebot_user_t)); + if (telebot_parser_get_user(via_bot, msg->via_bot) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->via_bot); + } + } + struct json_object *edit_date = NULL; if (json_object_object_get_ex(obj, "edit_date", &edit_date)) msg->edit_date = json_object_get_int(edit_date); + struct json_object *has_protected_content = NULL; + if (json_object_object_get_ex(obj, "has_protected_content", &has_protected_content)) + msg->has_protected_content = json_object_get_boolean(has_protected_content); + + struct json_object *is_paid_post = NULL; + if (json_object_object_get_ex(obj, "is_paid_post", &is_paid_post)) + msg->is_paid_post = json_object_get_boolean(is_paid_post); + struct json_object *media_group_id = NULL; if (json_object_object_get_ex(obj, "media_group_id", &media_group_id)) msg->media_group_id = TELEBOT_SAFE_STRDUP(json_object_get_string(media_group_id)); @@ -544,12 +978,30 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess ERR("Failed to get from message object"); } - struct json_object *caption_entities = NULL; - if (json_object_object_get_ex(obj, "caption_entities", &caption_entities)) + struct json_object *link_preview_options = NULL; + if (json_object_object_get_ex(obj, "link_preview_options", &link_preview_options)) { - if (telebot_parser_get_message_entities(caption_entities, &(msg->caption_entities), - &(msg->count_caption_entities)) != TELEBOT_ERROR_NONE) - ERR("Failed to get from message object"); + msg->link_preview_options = calloc(1, sizeof(telebot_link_preview_options_t)); + if (telebot_parser_get_link_preview_options(link_preview_options, msg->link_preview_options) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->link_preview_options); + } + } + + struct json_object *effect_id = NULL; + if (json_object_object_get_ex(obj, "effect_id", &effect_id)) + msg->effect_id = TELEBOT_SAFE_STRDUP(json_object_get_string(effect_id)); + + struct json_object *animation = NULL; + if (json_object_object_get_ex(obj, "animation", &animation)) + { + msg->animation = malloc(sizeof(telebot_animation_t)); + if (telebot_parser_get_animation(animation, msg->animation) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->animation); + } } struct json_object *audio = NULL; @@ -574,7 +1026,16 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } - //TODO: implement game parsing + struct json_object *paid_media = NULL; + if (json_object_object_get_ex(obj, "paid_media", &paid_media)) + { + msg->paid_media = calloc(1, sizeof(telebot_paid_media_info_t)); + if (telebot_parser_get_paid_media_info(paid_media, msg->paid_media) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->paid_media); + } + } struct json_object *photo = NULL; if (json_object_object_get_ex(obj, "photo", &photo)) @@ -583,7 +1044,8 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess ERR("Failed to get from message object"); } - //TODO: implement sticker parsing + // TODO: implement sticker parsing + struct json_object *video = NULL; if (json_object_object_get_ex(obj, "video", &video)) { @@ -595,17 +1057,6 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } - struct json_object *voice = NULL; - if (json_object_object_get_ex(obj, "voice", &voice)) - { - msg->voice = calloc(1, sizeof(telebot_voice_t)); - if (telebot_parser_get_voice(voice, msg->voice) != TELEBOT_ERROR_NONE) - { - ERR("Failed to get from message object"); - TELEBOT_SAFE_FREE(msg->voice); - } - } - struct json_object *video_note = NULL; if (json_object_object_get_ex(obj, "video_note", &video_note)) { @@ -617,10 +1068,37 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } + struct json_object *voice = NULL; + if (json_object_object_get_ex(obj, "voice", &voice)) + { + msg->voice = malloc(sizeof(telebot_voice_t)); + if (telebot_parser_get_voice(voice, msg->voice) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->voice); + } + } + struct json_object *caption = NULL; if (json_object_object_get_ex(obj, "caption", &caption)) msg->caption = TELEBOT_SAFE_STRDUP(json_object_get_string(caption)); + struct json_object *caption_entities = NULL; + if (json_object_object_get_ex(obj, "caption_entities", &caption_entities)) + { + if (telebot_parser_get_message_entities(caption_entities, &(msg->caption_entities), + &(msg->count_caption_entities)) != TELEBOT_ERROR_NONE) + ERR("Failed to get from message object"); + } + + struct json_object *show_caption_above_media = NULL; + if (json_object_object_get_ex(obj, "show_caption_above_media", &show_caption_above_media)) + msg->show_caption_above_media = json_object_get_boolean(show_caption_above_media); + + struct json_object *has_media_spoiler = NULL; + if (json_object_object_get_ex(obj, "has_media_spoiler", &has_media_spoiler)) + msg->has_media_spoiler = json_object_get_boolean(has_media_spoiler); + struct json_object *contact = NULL; if (json_object_object_get_ex(obj, "contact", &contact)) { @@ -632,32 +1110,23 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } - struct json_object *location = NULL; - if (json_object_object_get_ex(obj, "location", &location)) + struct json_object *dice = NULL; + if (json_object_object_get_ex(obj, "dice", &dice)) { - msg->location = calloc(1, sizeof(telebot_location_t)); - if (telebot_parser_get_location(location, msg->location) != TELEBOT_ERROR_NONE) + msg->dice = calloc(1, sizeof(telebot_dice_t)); + if (telebot_parser_get_dice(dice, msg->dice) != TELEBOT_ERROR_NONE) { - ERR("Failed to get from message object"); - TELEBOT_SAFE_FREE(msg->location); + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->dice); } } - struct json_object *venue = NULL; - if (json_object_object_get_ex(obj, "venue", &venue)) - { - msg->venue = calloc(1, sizeof(telebot_venue_t)); - if (telebot_parser_get_venue(venue, msg->venue) != TELEBOT_ERROR_NONE) - { - ERR("Failed to get from message object"); - TELEBOT_SAFE_FREE(msg->venue); - } - } + // TODO: implement game parsing struct json_object *poll = NULL; if (json_object_object_get_ex(obj, "poll", &poll)) { - msg->poll = calloc(1, sizeof(telebot_poll_t)); + msg->poll = malloc(sizeof(telebot_poll_t)); if (telebot_parser_get_poll(poll, msg->poll) != TELEBOT_ERROR_NONE) { ERR("Failed to get from message object"); @@ -665,35 +1134,47 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess } } - struct json_object *dice = NULL; - if (json_object_object_get_ex(obj, "dice", &dice)) + struct json_object *venue = NULL; + if (json_object_object_get_ex(obj, "venue", &venue)) { - msg->dice = calloc(1, sizeof(telebot_dice_t)); - if (telebot_parser_get_dice(dice, msg->dice) != TELEBOT_ERROR_NONE) + msg->venue = malloc(sizeof(telebot_venue_t)); + if (telebot_parser_get_venue(venue, msg->venue) != TELEBOT_ERROR_NONE) { - ERR("Failed to get from message object"); - TELEBOT_SAFE_FREE(msg->dice); + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->venue); } } - struct json_object *ncm = NULL; - if (json_object_object_get_ex(obj, "new_chat_members", &ncm)) + struct json_object *location = NULL; + if (json_object_object_get_ex(obj, "location", &location)) { - if (telebot_parser_get_users(ncm, &(msg->new_chat_members), &(msg->count_new_chat_members)) != TELEBOT_ERROR_NONE) - ERR("Failed to get from message object"); - } - - struct json_object *lcm = NULL; - if (json_object_object_get_ex(obj, "left_chat_members", &lcm)) + msg->location = malloc(sizeof(telebot_location_t)); + if (telebot_parser_get_location(location, msg->location) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->location); + } + } + + struct json_object *new_chat_members = NULL; + if (json_object_object_get_ex(obj, "new_chat_members", &new_chat_members)) { - if (telebot_parser_get_users(lcm, &(msg->left_chat_members), &(msg->count_left_chat_members)) != - TELEBOT_ERROR_NONE) + int ret = telebot_parser_get_users(new_chat_members, &(msg->new_chat_members), &(msg->count_new_chat_members)); + if (ret != TELEBOT_ERROR_NONE) + ERR("Failed to get from message object"); + } + + struct json_object *left_chat_members = NULL; + if (json_object_object_get_ex(obj, "left_chat_members", &left_chat_members)) + { + int ret = telebot_parser_get_users(left_chat_members, &(msg->left_chat_members), &(msg->count_left_chat_members)); + if (ret != TELEBOT_ERROR_NONE) ERR("Failed to get from message object"); } - struct json_object *nct = NULL; - if (json_object_object_get_ex(obj, "new_chat_title", &nct)) - msg->new_chat_title = TELEBOT_SAFE_STRDUP(json_object_get_string(nct)); + struct json_object *new_chat_title = NULL; + if (json_object_object_get_ex(obj, "new_chat_title", &new_chat_title)) + msg->new_chat_title = TELEBOT_SAFE_STRDUP(json_object_get_string(new_chat_title)); struct json_object *new_chat_photo = NULL; if (json_object_object_get_ex(obj, "new_chat_photo", &new_chat_photo)) @@ -707,25 +1188,38 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess if (json_object_object_get_ex(obj, "delete_chat_photo", &del_chat_photo)) msg->delete_chat_photo = json_object_get_boolean(del_chat_photo); - struct json_object *gcc = NULL; - if (json_object_object_get_ex(obj, "group_chat_created", &gcc)) - msg->group_chat_created = json_object_get_boolean(gcc); + struct json_object *group_chat_created = NULL; + if (json_object_object_get_ex(obj, "group_chat_created", &group_chat_created)) + msg->group_chat_created = json_object_get_boolean(group_chat_created); - struct json_object *sgcc = NULL; - if (json_object_object_get_ex(obj, "supergroup_chat_created", &sgcc)) - msg->supergroup_chat_created = json_object_get_boolean(sgcc); + struct json_object *supergroup_chat_created = NULL; + if (json_object_object_get_ex(obj, "supergroup_chat_created", &supergroup_chat_created)) + msg->supergroup_chat_created = json_object_get_boolean(supergroup_chat_created); - struct json_object *cacc = NULL; - if (json_object_object_get_ex(obj, "channel_chat_created", &cacc)) - msg->channel_chat_created = json_object_get_boolean(cacc); + struct json_object *channel_chat_created = NULL; + if (json_object_object_get_ex(obj, "channel_chat_created", &channel_chat_created)) + msg->channel_chat_created = json_object_get_boolean(channel_chat_created); + + struct json_object *message_auto_delete_timer_changed = NULL; + if (json_object_object_get_ex(obj, "message_auto_delete_timer_changed", &message_auto_delete_timer_changed)) + { + msg->message_auto_delete_timer_changed = malloc(sizeof(telebot_message_auto_delete_timer_changed_t)); + int ret = telebot_parser_get_message_auto_delete_timer_changed(message_auto_delete_timer_changed, + msg->message_auto_delete_timer_changed); + if (ret != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->message_auto_delete_timer_changed); + } + } - struct json_object *mtci = NULL; - if (json_object_object_get_ex(obj, "migrate_to_chat_id", &mtci)) - msg->migrate_to_chat_id = json_object_get_int64(mtci); + struct json_object *migrate_to_chat_id = NULL; + if (json_object_object_get_ex(obj, "migrate_to_chat_id", &migrate_to_chat_id)) + msg->migrate_to_chat_id = json_object_get_int64(migrate_to_chat_id); - struct json_object *mftci = NULL; - if (json_object_object_get_ex(obj, "migrate_from_chat_id", &mftci)) - msg->migrate_from_chat_id = json_object_get_int64(mftci); + struct json_object *migrate_from_chat_id = NULL; + if (json_object_object_get_ex(obj, "migrate_from_chat_id", &migrate_from_chat_id)) + msg->migrate_from_chat_id = json_object_get_int64(migrate_from_chat_id); struct json_object *pinned_message = NULL; if (json_object_object_get_ex(obj, "pinned_message", &pinned_message)) @@ -742,7 +1236,257 @@ telebot_error_e telebot_parser_get_message(struct json_object *obj, telebot_mess if (json_object_object_get_ex(obj, "connected_website", &connected_website)) msg->connected_website = TELEBOT_SAFE_STRDUP(json_object_get_string(connected_website)); - //TODO: implement invoce, successful_payment, passport_data, reply_markup + struct json_object *invoice = NULL; + if (json_object_object_get_ex(obj, "invoice", &invoice)) + { + msg->invoice = calloc(1, sizeof(telebot_invoice_t)); + if (telebot_parser_get_invoice(invoice, msg->invoice) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->invoice); + } + } + + struct json_object *successful_payment = NULL; + if (json_object_object_get_ex(obj, "successful_payment", &successful_payment)) + { + msg->successful_payment = calloc(1, sizeof(telebot_successful_payment_t)); + if (telebot_parser_get_successful_payment(successful_payment, msg->successful_payment) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->successful_payment); + } + } + + struct json_object *refunded_payment = NULL; + if (json_object_object_get_ex(obj, "refunded_payment", &refunded_payment)) + { + msg->refunded_payment = calloc(1, sizeof(telebot_refunded_payment_t)); + if (telebot_parser_get_refunded_payment(refunded_payment, msg->refunded_payment) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->refunded_payment); + } + } + + struct json_object *write_access_allowed = NULL; + if (json_object_object_get_ex(obj, "write_access_allowed", &write_access_allowed)) + { + msg->write_access_allowed = calloc(1, sizeof(telebot_write_access_allowed_t)); + if (telebot_parser_get_write_access_allowed(write_access_allowed, msg->write_access_allowed) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->write_access_allowed); + } + } + + struct json_object *passport_data = NULL; + if (json_object_object_get_ex(obj, "passport_data", &passport_data)) + { + msg->passport_data = calloc(1, sizeof(telebot_passport_data_t)); + if (telebot_parser_get_passport_data(passport_data, msg->passport_data) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->passport_data); + } + } + + struct json_object *proximity_alert_triggered = NULL; + if (json_object_object_get_ex(obj, "proximity_alert_triggered", &proximity_alert_triggered)) + { + msg->proximity_alert_triggered = calloc(1, sizeof(telebot_proximity_alert_triggered_t)); + if (telebot_parser_get_proximity_alert_triggered(proximity_alert_triggered, msg->proximity_alert_triggered) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->proximity_alert_triggered); + } + } + + struct json_object *forum_topic_created = NULL; + if (json_object_object_get_ex(obj, "forum_topic_created", &forum_topic_created)) + { + msg->forum_topic_created = calloc(1, sizeof(telebot_forum_topic_created_t)); + if (telebot_parser_get_forum_topic_created(forum_topic_created, msg->forum_topic_created) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->forum_topic_created); + } + } + + struct json_object *forum_topic_edited = NULL; + if (json_object_object_get_ex(obj, "forum_topic_edited", &forum_topic_edited)) + { + msg->forum_topic_edited = calloc(1, sizeof(telebot_forum_topic_edited_t)); + if (telebot_parser_get_forum_topic_edited(forum_topic_edited, msg->forum_topic_edited) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->forum_topic_edited); + } + } + + struct json_object *forum_topic_closed = NULL; + if (json_object_object_get_ex(obj, "forum_topic_closed", &forum_topic_closed)) + { + msg->forum_topic_closed = calloc(1, sizeof(telebot_forum_topic_closed_t)); + msg->forum_topic_closed->dummy = true; + } + + struct json_object *forum_topic_reopened = NULL; + if (json_object_object_get_ex(obj, "forum_topic_reopened", &forum_topic_reopened)) + { + msg->forum_topic_reopened = calloc(1, sizeof(telebot_forum_topic_reopened_t)); + msg->forum_topic_reopened->dummy = true; + } + + struct json_object *video_chat_scheduled = NULL; + if (json_object_object_get_ex(obj, "video_chat_scheduled", &video_chat_scheduled)) + { + msg->video_chat_scheduled = calloc(1, sizeof(telebot_video_chat_scheduled_t)); + if (telebot_parser_get_video_chat_scheduled(video_chat_scheduled, msg->video_chat_scheduled) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->video_chat_scheduled); + } + } + + struct json_object *video_chat_started = NULL; + if (json_object_object_get_ex(obj, "video_chat_started", &video_chat_started)) + { + msg->video_chat_started = calloc(1, sizeof(telebot_video_chat_started_t)); + msg->video_chat_started->dummy = true; + } + + struct json_object *video_chat_ended = NULL; + if (json_object_object_get_ex(obj, "video_chat_ended", &video_chat_ended)) + { + msg->video_chat_ended = calloc(1, sizeof(telebot_video_chat_ended_t)); + if (telebot_parser_get_video_chat_ended(video_chat_ended, msg->video_chat_ended) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->video_chat_ended); + } + } + + struct json_object *video_chat_participants_invited = NULL; + if (json_object_object_get_ex(obj, "video_chat_participants_invited", &video_chat_participants_invited)) + { + msg->video_chat_participants_invited = calloc(1, sizeof(telebot_video_chat_participants_invited_t)); + if (telebot_parser_get_video_chat_participants_invited(video_chat_participants_invited, msg->video_chat_participants_invited) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->video_chat_participants_invited); + } + } + + struct json_object *web_app_data = NULL; + if (json_object_object_get_ex(obj, "web_app_data", &web_app_data)) + { + msg->web_app_data = calloc(1, sizeof(telebot_web_app_data_t)); + if (telebot_parser_get_web_app_data(web_app_data, msg->web_app_data) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->web_app_data); + } + } + + struct json_object *users_shared = NULL; + if (json_object_object_get_ex(obj, "users_shared", &users_shared)) + { + msg->users_shared = calloc(1, sizeof(telebot_users_shared_t)); + if (telebot_parser_get_users_shared(users_shared, msg->users_shared) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->users_shared); + } + } + + struct json_object *chat_shared = NULL; + if (json_object_object_get_ex(obj, "chat_shared", &chat_shared)) + { + msg->chat_shared = calloc(1, sizeof(telebot_chat_shared_t)); + if (telebot_parser_get_chat_shared(chat_shared, msg->chat_shared) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->chat_shared); + } + } + + struct json_object *gift = NULL; + if (json_object_object_get_ex(obj, "gift", &gift)) + { + msg->gift = calloc(1, sizeof(telebot_gift_info_t)); + if (telebot_parser_get_gift_info(gift, msg->gift) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->gift); + } + } + + struct json_object *unique_gift = NULL; + if (json_object_object_get_ex(obj, "unique_gift", &unique_gift)) + { + msg->unique_gift = calloc(1, sizeof(telebot_unique_gift_info_t)); + if (telebot_parser_get_unique_gift_info(unique_gift, msg->unique_gift) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->unique_gift); + } + } + + struct json_object *boost_added = NULL; + if (json_object_object_get_ex(obj, "boost_added", &boost_added)) + { + msg->boost_added = calloc(1, sizeof(telebot_chat_boost_added_t)); + if (telebot_parser_get_chat_boost_added(boost_added, msg->boost_added) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->boost_added); + } + } + + struct json_object *chat_background_set = NULL; + if (json_object_object_get_ex(obj, "chat_background_set", &chat_background_set)) + { + msg->chat_background_set = calloc(1, sizeof(telebot_chat_background_t)); + if (telebot_parser_get_chat_background(chat_background_set, msg->chat_background_set) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->chat_background_set); + } + } + + struct json_object *giveaway_created = NULL; + if (json_object_object_get_ex(obj, "giveaway_created", &giveaway_created)) + { + msg->giveaway_created = calloc(1, sizeof(telebot_giveaway_created_t)); + if (telebot_parser_get_giveaway_created(giveaway_created, msg->giveaway_created) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->giveaway_created); + } + } + + struct json_object *giveaway_completed = NULL; + if (json_object_object_get_ex(obj, "giveaway_completed", &giveaway_completed)) + { + msg->giveaway_completed = calloc(1, sizeof(telebot_giveaway_completed_t)); + if (telebot_parser_get_giveaway_completed(giveaway_completed, msg->giveaway_completed) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->giveaway_completed); + } + } + + struct json_object *reply_markup = NULL; + if (json_object_object_get_ex(obj, "reply_markup", &reply_markup)) + { + msg->reply_markup = calloc(1, sizeof(telebot_inline_keyboard_markup_t)); + if (telebot_parser_get_inline_keyboard_markup(reply_markup, msg->reply_markup) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from message object"); + TELEBOT_SAFE_FREE(msg->reply_markup); + } + } return TELEBOT_ERROR_NONE; } @@ -2013,7 +2757,7 @@ telebot_error_e telebot_parser_get_response_parameters(struct json_object *obj, memset(resp_param, 0, sizeof(telebot_response_paramters_t)); struct json_object *migrate_to_chat_id = NULL; if (json_object_object_get_ex(obj, "migrate_to_chat_id", &migrate_to_chat_id)) - resp_param->migrate_to_chat_id = json_object_get_int(migrate_to_chat_id); + resp_param->migrate_to_chat_id = json_object_get_int64(migrate_to_chat_id); struct json_object *retry_after = NULL; if (json_object_object_get_ex(obj, "retry_after", &retry_after)) @@ -2021,3 +2765,1979 @@ telebot_error_e telebot_parser_get_response_parameters(struct json_object *obj, return TELEBOT_ERROR_NONE; } + +telebot_error_e telebot_parser_get_chat_location(struct json_object *obj, telebot_chat_location_t *chat_location) +{ + if ((obj == NULL) || (chat_location == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *address = NULL; + if (!json_object_object_get_ex(obj, "address", &address)) + { + ERR("Object is not chat type, address not found"); + return TELEBOT_ERROR_OPERATION_FAILED; + } + chat_location->address = TELEBOT_SAFE_STRDUP(json_object_get_string(address)); + + struct json_object *location = NULL; + if (json_object_object_get_ex(obj, "location", &location)) + { + chat_location->location = malloc(sizeof(telebot_location_t)); + if (telebot_parser_get_location(location, chat_location->location) != TELEBOT_ERROR_NONE) + { + ERR("Failed to get from chat object"); + TELEBOT_SAFE_FREE(chat_location->location); + TELEBOT_SAFE_FREE(chat_location->address); + return TELEBOT_ERROR_OPERATION_FAILED; + } + } + else + { + ERR("Object is not chat location type, location not found"); + TELEBOT_SAFE_FREE(chat_location->address); + return TELEBOT_ERROR_OPERATION_FAILED; + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e +telebot_parser_get_message_auto_delete_timer_changed(struct json_object *obj, + telebot_message_auto_delete_timer_changed_t *timer_changed) +{ + if ((obj == NULL) || (timer_changed == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *message_auto_delete_time = NULL; + if (!json_object_object_get_ex(obj, "message_auto_delete_time", &message_auto_delete_time)) + { + ERR("Object is not message auto-delete timer type, message_auto_delete_time not found"); + return TELEBOT_ERROR_OPERATION_FAILED; + } + timer_changed->message_auto_delete_time = json_object_get_int(message_auto_delete_time); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_invoice(struct json_object *obj, telebot_invoice_t *invoice) +{ + if ((obj == NULL) || (invoice == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(invoice, 0, sizeof(telebot_invoice_t)); + struct json_object *title = NULL; + if (json_object_object_get_ex(obj, "title", &title)) + invoice->title = TELEBOT_SAFE_STRDUP(json_object_get_string(title)); + + struct json_object *description = NULL; + if (json_object_object_get_ex(obj, "description", &description)) + invoice->description = TELEBOT_SAFE_STRDUP(json_object_get_string(description)); + + struct json_object *start_parameter = NULL; + if (json_object_object_get_ex(obj, "start_parameter", &start_parameter)) + invoice->start_parameter = TELEBOT_SAFE_STRDUP(json_object_get_string(start_parameter)); + + struct json_object *currency = NULL; + if (json_object_object_get_ex(obj, "currency", ¤cy)) + invoice->currency = TELEBOT_SAFE_STRDUP(json_object_get_string(currency)); + + struct json_object *total_amount = NULL; + if (json_object_object_get_ex(obj, "total_amount", &total_amount)) + invoice->total_amount = json_object_get_int(total_amount); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_shipping_address(struct json_object *obj, telebot_shipping_address_t *address) +{ + if ((obj == NULL) || (address == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(address, 0, sizeof(telebot_shipping_address_t)); + struct json_object *country_code = NULL; + if (json_object_object_get_ex(obj, "country_code", &country_code)) + address->country_code = TELEBOT_SAFE_STRDUP(json_object_get_string(country_code)); + + struct json_object *state = NULL; + if (json_object_object_get_ex(obj, "state", &state)) + address->state = TELEBOT_SAFE_STRDUP(json_object_get_string(state)); + + struct json_object *city = NULL; + if (json_object_object_get_ex(obj, "city", &city)) + address->city = TELEBOT_SAFE_STRDUP(json_object_get_string(city)); + + struct json_object *street_line1 = NULL; + if (json_object_object_get_ex(obj, "street_line1", &street_line1)) + address->street_line1 = TELEBOT_SAFE_STRDUP(json_object_get_string(street_line1)); + + struct json_object *street_line2 = NULL; + if (json_object_object_get_ex(obj, "street_line2", &street_line2)) + address->street_line2 = TELEBOT_SAFE_STRDUP(json_object_get_string(street_line2)); + + struct json_object *post_code = NULL; + if (json_object_object_get_ex(obj, "post_code", &post_code)) + address->post_code = TELEBOT_SAFE_STRDUP(json_object_get_string(post_code)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_order_info(struct json_object *obj, telebot_order_info_t *info) +{ + if ((obj == NULL) || (info == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(info, 0, sizeof(telebot_order_info_t)); + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + info->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *phone_number = NULL; + if (json_object_object_get_ex(obj, "phone_number", &phone_number)) + info->phone_number = TELEBOT_SAFE_STRDUP(json_object_get_string(phone_number)); + + struct json_object *email = NULL; + if (json_object_object_get_ex(obj, "email", &email)) + info->email = TELEBOT_SAFE_STRDUP(json_object_get_string(email)); + + struct json_object *shipping_address = NULL; + if (json_object_object_get_ex(obj, "shipping_address", &shipping_address)) + { + info->shipping_address = calloc(1, sizeof(telebot_shipping_address_t)); + telebot_parser_get_shipping_address(shipping_address, info->shipping_address); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_successful_payment(struct json_object *obj, telebot_successful_payment_t *payment) +{ + if ((obj == NULL) || (payment == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(payment, 0, sizeof(telebot_successful_payment_t)); + struct json_object *currency = NULL; + if (json_object_object_get_ex(obj, "currency", ¤cy)) + payment->currency = TELEBOT_SAFE_STRDUP(json_object_get_string(currency)); + + struct json_object *total_amount = NULL; + if (json_object_object_get_ex(obj, "total_amount", &total_amount)) + payment->total_amount = json_object_get_int(total_amount); + + struct json_object *invoice_payload = NULL; + if (json_object_object_get_ex(obj, "invoice_payload", &invoice_payload)) + payment->invoice_payload = TELEBOT_SAFE_STRDUP(json_object_get_string(invoice_payload)); + + struct json_object *shipping_option_id = NULL; + if (json_object_object_get_ex(obj, "shipping_option_id", &shipping_option_id)) + payment->shipping_option_id = TELEBOT_SAFE_STRDUP(json_object_get_string(shipping_option_id)); + + struct json_object *order_info = NULL; + if (json_object_object_get_ex(obj, "order_info", &order_info)) + { + payment->order_info = calloc(1, sizeof(telebot_order_info_t)); + telebot_parser_get_order_info(order_info, payment->order_info); + } + + struct json_object *telegram_payment_charge_id = NULL; + if (json_object_object_get_ex(obj, "telegram_payment_charge_id", &telegram_payment_charge_id)) + payment->telegram_payment_charge_id = TELEBOT_SAFE_STRDUP(json_object_get_string(telegram_payment_charge_id)); + + struct json_object *provider_payment_charge_id = NULL; + if (json_object_object_get_ex(obj, "provider_payment_charge_id", &provider_payment_charge_id)) + payment->provider_payment_charge_id = TELEBOT_SAFE_STRDUP(json_object_get_string(provider_payment_charge_id)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_passport_file(struct json_object *obj, telebot_passport_file_t *file) +{ + if ((obj == NULL) || (file == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(file, 0, sizeof(telebot_passport_file_t)); + struct json_object *file_id = NULL; + if (json_object_object_get_ex(obj, "file_id", &file_id)) + file->file_id = TELEBOT_SAFE_STRDUP(json_object_get_string(file_id)); + + struct json_object *file_unique_id = NULL; + if (json_object_object_get_ex(obj, "file_unique_id", &file_unique_id)) + file->file_unique_id = TELEBOT_SAFE_STRDUP(json_object_get_string(file_unique_id)); + + struct json_object *file_size = NULL; + if (json_object_object_get_ex(obj, "file_size", &file_size)) + file->file_size = json_object_get_int(file_size); + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + file->date = json_object_get_int(date); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_encrypted_passport_element(struct json_object *obj, telebot_encrypted_passport_element_t *element) +{ + if ((obj == NULL) || (element == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(element, 0, sizeof(telebot_encrypted_passport_element_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + element->type = TELEBOT_SAFE_STRDUP(json_object_get_string(type)); + + struct json_object *data = NULL; + if (json_object_object_get_ex(obj, "data", &data)) + element->data = TELEBOT_SAFE_STRDUP(json_object_get_string(data)); + + struct json_object *phone_number = NULL; + if (json_object_object_get_ex(obj, "phone_number", &phone_number)) + element->phone_number = TELEBOT_SAFE_STRDUP(json_object_get_string(phone_number)); + + struct json_object *email = NULL; + if (json_object_object_get_ex(obj, "email", &email)) + element->email = TELEBOT_SAFE_STRDUP(json_object_get_string(email)); + + struct json_object *files = NULL; + if (json_object_object_get_ex(obj, "files", &files)) + { + int array_len = json_object_array_length(files); + element->count_files = array_len; + element->files = calloc(array_len, sizeof(telebot_passport_file_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_passport_file(json_object_array_get_idx(files, i), &(element->files[i])); + } + + struct json_object *front_side = NULL; + if (json_object_object_get_ex(obj, "front_side", &front_side)) + { + element->front_side = calloc(1, sizeof(telebot_passport_file_t)); + telebot_parser_get_passport_file(front_side, element->front_side); + } + + struct json_object *reverse_side = NULL; + if (json_object_object_get_ex(obj, "reverse_side", &reverse_side)) + { + element->reverse_side = calloc(1, sizeof(telebot_passport_file_t)); + telebot_parser_get_passport_file(reverse_side, element->reverse_side); + } + + struct json_object *selfie = NULL; + if (json_object_object_get_ex(obj, "selfie", &selfie)) + { + element->selfie = calloc(1, sizeof(telebot_passport_file_t)); + telebot_parser_get_passport_file(selfie, element->selfie); + } + + struct json_object *translation = NULL; + if (json_object_object_get_ex(obj, "translation", &translation)) + { + int array_len = json_object_array_length(translation); + element->count_translation = array_len; + element->translation = calloc(array_len, sizeof(telebot_passport_file_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_passport_file(json_object_array_get_idx(translation, i), &(element->translation[i])); + } + + struct json_object *hash = NULL; + if (json_object_object_get_ex(obj, "hash", &hash)) + element->hash = TELEBOT_SAFE_STRDUP(json_object_get_string(hash)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_encrypted_credentials(struct json_object *obj, telebot_encrypted_credentials_t *credentials) +{ + if ((obj == NULL) || (credentials == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(credentials, 0, sizeof(telebot_encrypted_credentials_t)); + struct json_object *data = NULL; + if (json_object_object_get_ex(obj, "data", &data)) + credentials->data = TELEBOT_SAFE_STRDUP(json_object_get_string(data)); + + struct json_object *hash = NULL; + if (json_object_object_get_ex(obj, "hash", &hash)) + credentials->hash = TELEBOT_SAFE_STRDUP(json_object_get_string(hash)); + + struct json_object *secret = NULL; + if (json_object_object_get_ex(obj, "secret", &secret)) + credentials->secret = TELEBOT_SAFE_STRDUP(json_object_get_string(secret)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_passport_data(struct json_object *obj, telebot_passport_data_t *passport_data) +{ + if ((obj == NULL) || (passport_data == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(passport_data, 0, sizeof(telebot_passport_data_t)); + struct json_object *data = NULL; + if (json_object_object_get_ex(obj, "data", &data)) + { + int array_len = json_object_array_length(data); + passport_data->count_data = array_len; + passport_data->data = calloc(array_len, sizeof(telebot_encrypted_passport_element_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_encrypted_passport_element(json_object_array_get_idx(data, i), &(passport_data->data[i])); + } + + struct json_object *credentials = NULL; + if (json_object_object_get_ex(obj, "credentials", &credentials)) + { + passport_data->credentials = calloc(1, sizeof(telebot_encrypted_credentials_t)); + telebot_parser_get_encrypted_credentials(credentials, passport_data->credentials); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_proximity_alert_triggered(struct json_object *obj, telebot_proximity_alert_triggered_t *alert) +{ + if ((obj == NULL) || (alert == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(alert, 0, sizeof(telebot_proximity_alert_triggered_t)); + struct json_object *traveler = NULL; + if (json_object_object_get_ex(obj, "traveler", &traveler)) + { + alert->traveler = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(traveler, alert->traveler); + } + + struct json_object *watcher = NULL; + if (json_object_object_get_ex(obj, "watcher", &watcher)) + { + alert->watcher = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(watcher, alert->watcher); + } + + struct json_object *distance = NULL; + if (json_object_object_get_ex(obj, "distance", &distance)) + alert->distance = json_object_get_int(distance); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_forum_topic_created(struct json_object *obj, telebot_forum_topic_created_t *topic) +{ + if ((obj == NULL) || (topic == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(topic, 0, sizeof(telebot_forum_topic_created_t)); + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + topic->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *icon_color = NULL; + if (json_object_object_get_ex(obj, "icon_color", &icon_color)) + topic->icon_color = json_object_get_int(icon_color); + + struct json_object *icon_custom_emoji_id = NULL; + if (json_object_object_get_ex(obj, "icon_custom_emoji_id", &icon_custom_emoji_id)) + topic->icon_custom_emoji_id = TELEBOT_SAFE_STRDUP(json_object_get_string(icon_custom_emoji_id)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_forum_topic_edited(struct json_object *obj, telebot_forum_topic_edited_t *topic) +{ + if ((obj == NULL) || (topic == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(topic, 0, sizeof(telebot_forum_topic_edited_t)); + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + topic->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *icon_custom_emoji_id = NULL; + if (json_object_object_get_ex(obj, "icon_custom_emoji_id", &icon_custom_emoji_id)) + topic->icon_custom_emoji_id = TELEBOT_SAFE_STRDUP(json_object_get_string(icon_custom_emoji_id)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_video_chat_scheduled(struct json_object *obj, telebot_video_chat_scheduled_t *scheduled) +{ + if ((obj == NULL) || (scheduled == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(scheduled, 0, sizeof(telebot_video_chat_scheduled_t)); + struct json_object *start_date = NULL; + if (json_object_object_get_ex(obj, "start_date", &start_date)) + scheduled->start_date = json_object_get_int(start_date); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_video_chat_ended(struct json_object *obj, telebot_video_chat_ended_t *ended) +{ + if ((obj == NULL) || (ended == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(ended, 0, sizeof(telebot_video_chat_ended_t)); + struct json_object *duration = NULL; + if (json_object_object_get_ex(obj, "duration", &duration)) + ended->duration = json_object_get_int(duration); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_video_chat_participants_invited(struct json_object *obj, telebot_video_chat_participants_invited_t *invited) +{ + if ((obj == NULL) || (invited == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(invited, 0, sizeof(telebot_video_chat_participants_invited_t)); + struct json_object *users = NULL; + if (json_object_object_get_ex(obj, "users", &users)) + { + int array_len = json_object_array_length(users); + invited->count_users = array_len; + invited->users = calloc(array_len, sizeof(telebot_user_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_user(json_object_array_get_idx(users, i), &(invited->users[i])); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_web_app_data(struct json_object *obj, telebot_web_app_data_t *data) +{ + if ((obj == NULL) || (data == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(data, 0, sizeof(telebot_web_app_data_t)); + struct json_object *data_obj = NULL; + if (json_object_object_get_ex(obj, "data", &data_obj)) + data->data = TELEBOT_SAFE_STRDUP(json_object_get_string(data_obj)); + + struct json_object *button_text = NULL; + if (json_object_object_get_ex(obj, "button_text", &button_text)) + data->button_text = TELEBOT_SAFE_STRDUP(json_object_get_string(button_text)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_inline_keyboard_button(struct json_object *obj, telebot_inline_keyboard_button_t *button) +{ + if ((obj == NULL) || (button == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(button, 0, sizeof(telebot_inline_keyboard_button_t)); + struct json_object *text = NULL; + if (json_object_object_get_ex(obj, "text", &text)) + button->text = TELEBOT_SAFE_STRDUP(json_object_get_string(text)); + + struct json_object *url = NULL; + if (json_object_object_get_ex(obj, "url", &url)) + button->url = TELEBOT_SAFE_STRDUP(json_object_get_string(url)); + + struct json_object *callback_data = NULL; + if (json_object_object_get_ex(obj, "callback_data", &callback_data)) + button->callback_data = TELEBOT_SAFE_STRDUP(json_object_get_string(callback_data)); + + struct json_object *switch_inline_query = NULL; + if (json_object_object_get_ex(obj, "switch_inline_query", &switch_inline_query)) + button->switch_inline_query = TELEBOT_SAFE_STRDUP(json_object_get_string(switch_inline_query)); + + struct json_object *switch_inline_query_current_chat = NULL; + if (json_object_object_get_ex(obj, "switch_inline_query_current_chat", &switch_inline_query_current_chat)) + button->switch_inline_query_current_chat = TELEBOT_SAFE_STRDUP(json_object_get_string(switch_inline_query_current_chat)); + + struct json_object *pay = NULL; + if (json_object_object_get_ex(obj, "pay", &pay)) + button->pay = json_object_get_boolean(pay); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_inline_keyboard_markup(struct json_object *obj, telebot_inline_keyboard_markup_t *markup) +{ + if ((obj == NULL) || (markup == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(markup, 0, sizeof(telebot_inline_keyboard_markup_t)); + struct json_object *inline_keyboard = NULL; + if (json_object_object_get_ex(obj, "inline_keyboard", &inline_keyboard)) + { + int rows = json_object_array_length(inline_keyboard); + int cols = 0; + if (rows > 0) + { + struct json_object *row0 = json_object_array_get_idx(inline_keyboard, 0); + cols = json_object_array_length(row0); + } + markup->rows = rows; + markup->cols = cols; + markup->inline_keyboard = calloc(rows * cols, sizeof(telebot_inline_keyboard_button_t)); + for (int i = 0; i < rows; i++) + { + struct json_object *row = json_object_array_get_idx(inline_keyboard, i); + int row_cols = json_object_array_length(row); + for (int j = 0; j < row_cols && j < cols; j++) + { + telebot_parser_get_inline_keyboard_button(json_object_array_get_idx(row, j), &(markup->inline_keyboard[i * cols + j])); + } + } + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_invite_link(struct json_object *obj, telebot_chat_invite_link_t *invite_link) +{ + if ((obj == NULL) || (invite_link == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(invite_link, 0, sizeof(telebot_chat_invite_link_t)); + struct json_object *invite_link_obj = NULL; + if (json_object_object_get_ex(obj, "invite_link", &invite_link_obj)) + invite_link->invite_link = TELEBOT_SAFE_STRDUP(json_object_get_string(invite_link_obj)); + + struct json_object *creator = NULL; + if (json_object_object_get_ex(obj, "creator", &creator)) + { + invite_link->creator = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(creator, invite_link->creator); + } + + struct json_object *creates_join_request = NULL; + if (json_object_object_get_ex(obj, "creates_join_request", &creates_join_request)) + invite_link->creates_join_request = json_object_get_boolean(creates_join_request); + + struct json_object *is_primary = NULL; + if (json_object_object_get_ex(obj, "is_primary", &is_primary)) + invite_link->is_primary = json_object_get_boolean(is_primary); + + struct json_object *is_revoked = NULL; + if (json_object_object_get_ex(obj, "is_revoked", &is_revoked)) + invite_link->is_revoked = json_object_get_boolean(is_revoked); + + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + invite_link->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *expire_date = NULL; + if (json_object_object_get_ex(obj, "expire_date", &expire_date)) + invite_link->expire_date = json_object_get_int(expire_date); + + struct json_object *member_limit = NULL; + if (json_object_object_get_ex(obj, "member_limit", &member_limit)) + invite_link->member_limit = json_object_get_int(member_limit); + + struct json_object *pending_join_request_count = NULL; + if (json_object_object_get_ex(obj, "pending_join_request_count", &pending_join_request_count)) + invite_link->pending_join_request_count = json_object_get_int(pending_join_request_count); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_member_updated(struct json_object *obj, telebot_chat_member_updated_t *updated) +{ + if ((obj == NULL) || (updated == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(updated, 0, sizeof(telebot_chat_member_updated_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + updated->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, updated->chat); + } + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + updated->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, updated->from); + } + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + updated->date = json_object_get_int(date); + + struct json_object *old_chat_member = NULL; + if (json_object_object_get_ex(obj, "old_chat_member", &old_chat_member)) + { + updated->old_chat_member = calloc(1, sizeof(telebot_chat_member_t)); + telebot_parser_get_chat_member(old_chat_member, updated->old_chat_member); + } + + struct json_object *new_chat_member = NULL; + if (json_object_object_get_ex(obj, "new_chat_member", &new_chat_member)) + { + updated->new_chat_member = calloc(1, sizeof(telebot_chat_member_t)); + telebot_parser_get_chat_member(new_chat_member, updated->new_chat_member); + } + + struct json_object *invite_link = NULL; + if (json_object_object_get_ex(obj, "invite_link", &invite_link)) + { + updated->invite_link = calloc(1, sizeof(telebot_chat_invite_link_t)); + telebot_parser_get_chat_invite_link(invite_link, updated->invite_link); + } + + struct json_object *via_chat_folder_invite_link = NULL; + if (json_object_object_get_ex(obj, "via_chat_folder_invite_link", &via_chat_folder_invite_link)) + updated->via_chat_folder_invite_link = json_object_get_boolean(via_chat_folder_invite_link); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_join_request(struct json_object *obj, telebot_chat_join_request_t *request) +{ + if ((obj == NULL) || (request == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(request, 0, sizeof(telebot_chat_join_request_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + request->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, request->chat); + } + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + request->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, request->from); + } + + struct json_object *user_chat_id = NULL; + if (json_object_object_get_ex(obj, "user_chat_id", &user_chat_id)) + request->user_chat_id = json_object_get_int64(user_chat_id); + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + request->date = json_object_get_int(date); + + struct json_object *bio = NULL; + if (json_object_object_get_ex(obj, "bio", &bio)) + request->bio = TELEBOT_SAFE_STRDUP(json_object_get_string(bio)); + + struct json_object *invite_link = NULL; + if (json_object_object_get_ex(obj, "invite_link", &invite_link)) + { + request->invite_link = calloc(1, sizeof(telebot_chat_invite_link_t)); + telebot_parser_get_chat_invite_link(invite_link, request->invite_link); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_reaction_type(struct json_object *obj, telebot_reaction_type_t *reaction) +{ + if ((obj == NULL) || (reaction == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(reaction, 0, sizeof(telebot_reaction_type_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + reaction->type = TELEBOT_SAFE_STRDUP(json_object_get_string(type)); + + struct json_object *emoji = NULL; + if (json_object_object_get_ex(obj, "emoji", &emoji)) + reaction->emoji = TELEBOT_SAFE_STRDUP(json_object_get_string(emoji)); + + struct json_object *custom_emoji_id = NULL; + if (json_object_object_get_ex(obj, "custom_emoji_id", &custom_emoji_id)) + reaction->custom_emoji_id = TELEBOT_SAFE_STRDUP(json_object_get_string(custom_emoji_id)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_message_reaction_updated(struct json_object *obj, telebot_message_reaction_updated_t *updated) +{ + if ((obj == NULL) || (updated == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(updated, 0, sizeof(telebot_message_reaction_updated_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + updated->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, updated->chat); + } + + struct json_object *message_id = NULL; + if (json_object_object_get_ex(obj, "message_id", &message_id)) + updated->message_id = json_object_get_int(message_id); + + struct json_object *user = NULL; + if (json_object_object_get_ex(obj, "user", &user)) + { + updated->user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(user, updated->user); + } + + struct json_object *actor_chat = NULL; + if (json_object_object_get_ex(obj, "actor_chat", &actor_chat)) + { + updated->actor_chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(actor_chat, updated->actor_chat); + } + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + updated->date = json_object_get_int(date); + + struct json_object *old_reaction = NULL; + if (json_object_object_get_ex(obj, "old_reaction", &old_reaction)) + { + int array_len = json_object_array_length(old_reaction); + updated->count_old_reaction = array_len; + updated->old_reaction = calloc(array_len, sizeof(telebot_reaction_type_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_reaction_type(json_object_array_get_idx(old_reaction, i), &(updated->old_reaction[i])); + } + + struct json_object *new_reaction = NULL; + if (json_object_object_get_ex(obj, "new_reaction", &new_reaction)) + { + int array_len = json_object_array_length(new_reaction); + updated->count_new_reaction = array_len; + updated->new_reaction = calloc(array_len, sizeof(telebot_reaction_type_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_reaction_type(json_object_array_get_idx(new_reaction, i), &(updated->new_reaction[i])); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_reaction_count(struct json_object *obj, telebot_reaction_count_t *count) +{ + if ((obj == NULL) || (count == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(count, 0, sizeof(telebot_reaction_count_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + telebot_parser_get_reaction_type(type, &(count->type)); + + struct json_object *total_count = NULL; + if (json_object_object_get_ex(obj, "total_count", &total_count)) + count->total_count = json_object_get_int(total_count); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_message_reaction_count_updated(struct json_object *obj, telebot_message_reaction_count_updated_t *updated) +{ + if ((obj == NULL) || (updated == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(updated, 0, sizeof(telebot_message_reaction_count_updated_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + updated->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, updated->chat); + } + + struct json_object *message_id = NULL; + if (json_object_object_get_ex(obj, "message_id", &message_id)) + updated->message_id = json_object_get_int(message_id); + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + updated->date = json_object_get_int(date); + + struct json_object *reactions = NULL; + if (json_object_object_get_ex(obj, "reactions", &reactions)) + { + int array_len = json_object_array_length(reactions); + updated->count_reactions = array_len; + updated->reactions = calloc(array_len, sizeof(telebot_reaction_count_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_reaction_count(json_object_array_get_idx(reactions, i), &(updated->reactions[i])); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_boost_source(struct json_object *obj, telebot_chat_boost_source_t *source) +{ + if ((obj == NULL) || (source == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(source, 0, sizeof(telebot_chat_boost_source_t)); + struct json_object *source_obj = NULL; + if (json_object_object_get_ex(obj, "source", &source_obj)) + source->source = TELEBOT_SAFE_STRDUP(json_object_get_string(source_obj)); + + struct json_object *user = NULL; + if (json_object_object_get_ex(obj, "user", &user)) + { + source->user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(user, source->user); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_boost(struct json_object *obj, telebot_chat_boost_t *boost) +{ + if ((obj == NULL) || (boost == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(boost, 0, sizeof(telebot_chat_boost_t)); + struct json_object *boost_id = NULL; + if (json_object_object_get_ex(obj, "boost_id", &boost_id)) + boost->boost_id = TELEBOT_SAFE_STRDUP(json_object_get_string(boost_id)); + + struct json_object *add_date = NULL; + if (json_object_object_get_ex(obj, "add_date", &add_date)) + boost->add_date = json_object_get_int(add_date); + + struct json_object *expiration_date = NULL; + if (json_object_object_get_ex(obj, "expiration_date", &expiration_date)) + boost->expiration_date = json_object_get_int(expiration_date); + + struct json_object *source = NULL; + if (json_object_object_get_ex(obj, "source", &source)) + { + boost->source = calloc(1, sizeof(telebot_chat_boost_source_t)); + telebot_parser_get_chat_boost_source(source, boost->source); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_boost_updated(struct json_object *obj, telebot_chat_boost_updated_t *updated) +{ + if ((obj == NULL) || (updated == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(updated, 0, sizeof(telebot_chat_boost_updated_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + updated->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, updated->chat); + } + + struct json_object *boost = NULL; + if (json_object_object_get_ex(obj, "boost", &boost)) + { + updated->boost = calloc(1, sizeof(telebot_chat_boost_t)); + telebot_parser_get_chat_boost(boost, updated->boost); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chat_boost_removed(struct json_object *obj, telebot_chat_boost_removed_t *removed) +{ + if ((obj == NULL) || (removed == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(removed, 0, sizeof(telebot_chat_boost_removed_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + removed->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, removed->chat); + } + + struct json_object *boost_id = NULL; + if (json_object_object_get_ex(obj, "boost_id", &boost_id)) + removed->boost_id = TELEBOT_SAFE_STRDUP(json_object_get_string(boost_id)); + + struct json_object *remove_date = NULL; + if (json_object_object_get_ex(obj, "remove_date", &remove_date)) + removed->remove_date = json_object_get_int(remove_date); + + struct json_object *source = NULL; + if (json_object_object_get_ex(obj, "source", &source)) + { + removed->source = calloc(1, sizeof(telebot_chat_boost_source_t)); + telebot_parser_get_chat_boost_source(source, removed->source); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_forum_topic(struct json_object *obj, telebot_forum_topic_t *topic) +{ + if ((obj == NULL) || (topic == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(topic, 0, sizeof(telebot_forum_topic_t)); + struct json_object *message_thread_id = NULL; + if (json_object_object_get_ex(obj, "message_thread_id", &message_thread_id)) + topic->message_thread_id = json_object_get_int(message_thread_id); + + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + topic->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *icon_color = NULL; + if (json_object_object_get_ex(obj, "icon_color", &icon_color)) + topic->icon_color = json_object_get_int(icon_color); + + struct json_object *icon_custom_emoji_id = NULL; + if (json_object_object_get_ex(obj, "icon_custom_emoji_id", &icon_custom_emoji_id)) + topic->icon_custom_emoji_id = TELEBOT_SAFE_STRDUP(json_object_get_string(icon_custom_emoji_id)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_inline_query(struct json_object *obj, telebot_inline_query_t *query) +{ + if ((obj == NULL) || (query == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(query, 0, sizeof(telebot_inline_query_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + query->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + query->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, query->from); + } + + struct json_object *query_obj = NULL; + if (json_object_object_get_ex(obj, "query", &query_obj)) + query->query = TELEBOT_SAFE_STRDUP(json_object_get_string(query_obj)); + + struct json_object *offset = NULL; + if (json_object_object_get_ex(obj, "offset", &offset)) + query->offset = TELEBOT_SAFE_STRDUP(json_object_get_string(offset)); + + struct json_object *chat_type = NULL; + if (json_object_object_get_ex(obj, "chat_type", &chat_type)) + query->chat_type = TELEBOT_SAFE_STRDUP(json_object_get_string(chat_type)); + + struct json_object *location = NULL; + if (json_object_object_get_ex(obj, "location", &location)) + { + query->location = calloc(1, sizeof(telebot_location_t)); + telebot_parser_get_location(location, query->location); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_chosen_inline_result(struct json_object *obj, telebot_chosen_inline_result_t *result) +{ + if ((obj == NULL) || (result == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(result, 0, sizeof(telebot_chosen_inline_result_t)); + struct json_object *result_id = NULL; + if (json_object_object_get_ex(obj, "result_id", &result_id)) + result->result_id = TELEBOT_SAFE_STRDUP(json_object_get_string(result_id)); + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + result->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, result->from); + } + + struct json_object *location = NULL; + if (json_object_object_get_ex(obj, "location", &location)) + { + result->location = calloc(1, sizeof(telebot_location_t)); + telebot_parser_get_location(location, result->location); + } + + struct json_object *inline_message_id = NULL; + if (json_object_object_get_ex(obj, "inline_message_id", &inline_message_id)) + result->inline_message_id = TELEBOT_SAFE_STRDUP(json_object_get_string(inline_message_id)); + + struct json_object *query = NULL; + if (json_object_object_get_ex(obj, "query", &query)) + result->query = TELEBOT_SAFE_STRDUP(json_object_get_string(query)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_shipping_query(struct json_object *obj, telebot_shipping_query_t *query) +{ + if ((obj == NULL) || (query == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(query, 0, sizeof(telebot_shipping_query_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + query->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + query->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, query->from); + } + + struct json_object *invoice_payload = NULL; + if (json_object_object_get_ex(obj, "invoice_payload", &invoice_payload)) + query->invoice_payload = TELEBOT_SAFE_STRDUP(json_object_get_string(invoice_payload)); + + struct json_object *shipping_address = NULL; + if (json_object_object_get_ex(obj, "shipping_address", &shipping_address)) + { + query->shipping_address = calloc(1, sizeof(telebot_shipping_address_t)); + telebot_parser_get_shipping_address(shipping_address, query->shipping_address); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_pre_checkout_query(struct json_object *obj, telebot_pre_checkout_query_t *query) +{ + if ((obj == NULL) || (query == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(query, 0, sizeof(telebot_pre_checkout_query_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + query->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + query->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, query->from); + } + + struct json_object *currency = NULL; + if (json_object_object_get_ex(obj, "currency", ¤cy)) + query->currency = TELEBOT_SAFE_STRDUP(json_object_get_string(currency)); + + struct json_object *total_amount = NULL; + if (json_object_object_get_ex(obj, "total_amount", &total_amount)) + query->total_amount = json_object_get_int(total_amount); + + struct json_object *invoice_payload = NULL; + if (json_object_object_get_ex(obj, "invoice_payload", &invoice_payload)) + query->invoice_payload = TELEBOT_SAFE_STRDUP(json_object_get_string(invoice_payload)); + + struct json_object *shipping_option_id = NULL; + if (json_object_object_get_ex(obj, "shipping_option_id", &shipping_option_id)) + query->shipping_option_id = TELEBOT_SAFE_STRDUP(json_object_get_string(shipping_option_id)); + + struct json_object *order_info = NULL; + if (json_object_object_get_ex(obj, "order_info", &order_info)) + { + query->order_info = calloc(1, sizeof(telebot_order_info_t)); + telebot_parser_get_order_info(order_info, query->order_info); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_stickers(struct json_object *obj, telebot_sticker_t **stickers, int *count) +{ + // Stub: implement if needed, usually in telebot-stickers.c + return TELEBOT_ERROR_OPERATION_FAILED; +} + +static telebot_error_e telebot_parser_get_business_bot_rights(struct json_object *obj, telebot_business_bot_rights_t *rights) +{ + if ((obj == NULL) || (rights == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(rights, 0, sizeof(telebot_business_bot_rights_t)); + struct json_object *tmp = NULL; + if (json_object_object_get_ex(obj, "can_reply", &tmp)) + rights->can_reply = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_read_messages", &tmp)) + rights->can_read_messages = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_delete_sent_messages", &tmp)) + rights->can_delete_sent_messages = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_delete_all_messages", &tmp)) + rights->can_delete_all_messages = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_edit_name", &tmp)) + rights->can_edit_name = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_edit_bio", &tmp)) + rights->can_edit_bio = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_edit_profile_photo", &tmp)) + rights->can_edit_profile_photo = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_edit_username", &tmp)) + rights->can_edit_username = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_change_gift_settings", &tmp)) + rights->can_change_gift_settings = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_view_gifts_and_stars", &tmp)) + rights->can_view_gifts_and_stars = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_convert_gifts_to_stars", &tmp)) + rights->can_convert_gifts_to_stars = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_transfer_and_upgrade_gifts", &tmp)) + rights->can_transfer_and_upgrade_gifts = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_transfer_stars", &tmp)) + rights->can_transfer_stars = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "can_manage_stories", &tmp)) + rights->can_manage_stories = json_object_get_boolean(tmp); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_business_messages_deleted(struct json_object *obj, telebot_business_messages_deleted_t *deleted) +{ + if ((obj == NULL) || (deleted == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(deleted, 0, sizeof(telebot_business_messages_deleted_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "business_connection_id", &id)) + deleted->business_connection_id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + deleted->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, deleted->chat); + } + + struct json_object *message_ids = NULL; + if (json_object_object_get_ex(obj, "message_ids", &message_ids)) + { + int array_len = json_object_array_length(message_ids); + deleted->count_message_ids = array_len; + deleted->message_ids = calloc(array_len, sizeof(int)); + for (int i = 0; i < array_len; i++) + deleted->message_ids[i] = json_object_get_int(json_object_array_get_idx(message_ids, i)); + } + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_message_origin(struct json_object *obj, telebot_message_origin_t *origin) +{ + if ((obj == NULL) || (origin == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(origin, 0, sizeof(telebot_message_origin_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + origin->type = TELEBOT_SAFE_STRDUP(json_object_get_string(type)); + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + origin->date = json_object_get_int(date); + + struct json_object *sender_user = NULL; + if (json_object_object_get_ex(obj, "sender_user", &sender_user)) + { + origin->sender_user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(sender_user, origin->sender_user); + } + + struct json_object *sender_user_name = NULL; + if (json_object_object_get_ex(obj, "sender_user_name", &sender_user_name)) + origin->sender_user_name = TELEBOT_SAFE_STRDUP(json_object_get_string(sender_user_name)); + + struct json_object *sender_chat = NULL; + if (json_object_object_get_ex(obj, "sender_chat", &sender_chat)) + { + origin->sender_chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(sender_chat, origin->sender_chat); + } + + struct json_object *author_signature = NULL; + if (json_object_object_get_ex(obj, "author_signature", &author_signature)) + origin->author_signature = TELEBOT_SAFE_STRDUP(json_object_get_string(author_signature)); + + struct json_object *message_id = NULL; + if (json_object_object_get_ex(obj, "message_id", &message_id)) + origin->message_id = json_object_get_int(message_id); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_text_quote(struct json_object *obj, telebot_text_quote_t *quote) +{ + if ((obj == NULL) || (quote == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(quote, 0, sizeof(telebot_text_quote_t)); + struct json_object *text = NULL; + if (json_object_object_get_ex(obj, "text", &text)) + quote->text = TELEBOT_SAFE_STRDUP(json_object_get_string(text)); + + struct json_object *entities = NULL; + if (json_object_object_get_ex(obj, "entities", &entities)) + telebot_parser_get_message_entities(entities, &(quote->entities), &(quote->count_entities)); + + struct json_object *position = NULL; + if (json_object_object_get_ex(obj, "position", &position)) + quote->position = json_object_get_int(position); + + struct json_object *is_manual = NULL; + if (json_object_object_get_ex(obj, "is_manual", &is_manual)) + quote->is_manual = json_object_get_boolean(is_manual); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_story(struct json_object *obj, telebot_story_t *story) +{ + if ((obj == NULL) || (story == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(story, 0, sizeof(telebot_story_t)); + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + story->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, story->chat); + } + + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + story->id = json_object_get_int(id); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_external_reply_info(struct json_object *obj, telebot_external_reply_info_t *info) +{ + if ((obj == NULL) || (info == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(info, 0, sizeof(telebot_external_reply_info_t)); + struct json_object *origin = NULL; + if (json_object_object_get_ex(obj, "origin", &origin)) + telebot_parser_get_message_origin(origin, &(info->origin)); + + struct json_object *chat = NULL; + if (json_object_object_get_ex(obj, "chat", &chat)) + { + info->chat = calloc(1, sizeof(telebot_chat_t)); + telebot_parser_get_chat(chat, info->chat); + } + + struct json_object *message_id = NULL; + if (json_object_object_get_ex(obj, "message_id", &message_id)) + info->message_id = json_object_get_int(message_id); + + // ... other optional media fields can be added as needed ... + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_link_preview_options(struct json_object *obj, telebot_link_preview_options_t *options) +{ + if ((obj == NULL) || (options == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(options, 0, sizeof(telebot_link_preview_options_t)); + struct json_object *tmp = NULL; + if (json_object_object_get_ex(obj, "is_disabled", &tmp)) + options->is_disabled = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "url", &tmp)) + options->url = TELEBOT_SAFE_STRDUP(json_object_get_string(tmp)); + if (json_object_object_get_ex(obj, "prefer_small_media", &tmp)) + options->prefer_small_media = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "prefer_large_media", &tmp)) + options->prefer_large_media = json_object_get_boolean(tmp); + if (json_object_object_get_ex(obj, "show_above_text", &tmp)) + options->show_above_text = json_object_get_boolean(tmp); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_paid_media(struct json_object *obj, telebot_paid_media_t *media) +{ + if ((obj == NULL) || (media == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(media, 0, sizeof(telebot_paid_media_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + media->type = TELEBOT_SAFE_STRDUP(json_object_get_string(type)); + + struct json_object *width = NULL; + if (json_object_object_get_ex(obj, "width", &width)) + media->width = json_object_get_int(width); + + struct json_object *height = NULL; + if (json_object_object_get_ex(obj, "height", &height)) + media->height = json_object_get_int(height); + + struct json_object *duration = NULL; + if (json_object_object_get_ex(obj, "duration", &duration)) + media->duration = json_object_get_int(duration); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_paid_media_info(struct json_object *obj, telebot_paid_media_info_t *info) +{ + if ((obj == NULL) || (info == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(info, 0, sizeof(telebot_paid_media_info_t)); + struct json_object *star_count = NULL; + if (json_object_object_get_ex(obj, "star_count", &star_count)) + info->star_count = json_object_get_int(star_count); + + struct json_object *paid_media = NULL; + if (json_object_object_get_ex(obj, "paid_media", &paid_media)) + { + int array_len = json_object_array_length(paid_media); + info->count_paid_media = array_len; + info->paid_media = calloc(array_len, sizeof(telebot_paid_media_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_paid_media(json_object_array_get_idx(paid_media, i), &(info->paid_media[i])); + } + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_refunded_payment(struct json_object *obj, telebot_refunded_payment_t *payment) +{ + if ((obj == NULL) || (payment == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(payment, 0, sizeof(telebot_refunded_payment_t)); + struct json_object *currency = NULL; + if (json_object_object_get_ex(obj, "currency", ¤cy)) + payment->currency = TELEBOT_SAFE_STRDUP(json_object_get_string(currency)); + + struct json_object *total_amount = NULL; + if (json_object_object_get_ex(obj, "total_amount", &total_amount)) + payment->total_amount = json_object_get_int(total_amount); + + struct json_object *invoice_payload = NULL; + if (json_object_object_get_ex(obj, "invoice_payload", &invoice_payload)) + payment->invoice_payload = TELEBOT_SAFE_STRDUP(json_object_get_string(invoice_payload)); + + struct json_object *telegram_payment_charge_id = NULL; + if (json_object_object_get_ex(obj, "telegram_payment_charge_id", &telegram_payment_charge_id)) + payment->telegram_payment_charge_id = TELEBOT_SAFE_STRDUP(json_object_get_string(telegram_payment_charge_id)); + + struct json_object *provider_payment_charge_id = NULL; + if (json_object_object_get_ex(obj, "provider_payment_charge_id", &provider_payment_charge_id)) + payment->provider_payment_charge_id = TELEBOT_SAFE_STRDUP(json_object_get_string(provider_payment_charge_id)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_write_access_allowed(struct json_object *obj, telebot_write_access_allowed_t *allowed) +{ + if ((obj == NULL) || (allowed == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(allowed, 0, sizeof(telebot_write_access_allowed_t)); + struct json_object *web_app_name = NULL; + if (json_object_object_get_ex(obj, "web_app_name", &web_app_name)) + allowed->web_app_name = TELEBOT_SAFE_STRDUP(json_object_get_string(web_app_name)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_shared_user(struct json_object *obj, telebot_shared_user_t *user) +{ + if ((obj == NULL) || (user == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(user, 0, sizeof(telebot_shared_user_t)); + struct json_object *user_id = NULL; + if (json_object_object_get_ex(obj, "user_id", &user_id)) + user->user_id = json_object_get_int64(user_id); + + struct json_object *first_name = NULL; + if (json_object_object_get_ex(obj, "first_name", &first_name)) + user->first_name = TELEBOT_SAFE_STRDUP(json_object_get_string(first_name)); + + struct json_object *last_name = NULL; + if (json_object_object_get_ex(obj, "last_name", &last_name)) + user->last_name = TELEBOT_SAFE_STRDUP(json_object_get_string(last_name)); + + struct json_object *username = NULL; + if (json_object_object_get_ex(obj, "username", &username)) + user->username = TELEBOT_SAFE_STRDUP(json_object_get_string(username)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_users_shared(struct json_object *obj, telebot_users_shared_t *shared) +{ + if ((obj == NULL) || (shared == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(shared, 0, sizeof(telebot_users_shared_t)); + struct json_object *request_id = NULL; + if (json_object_object_get_ex(obj, "request_id", &request_id)) + shared->request_id = json_object_get_int(request_id); + + struct json_object *users = NULL; + if (json_object_object_get_ex(obj, "users", &users)) + { + int array_len = json_object_array_length(users); + shared->count_users = array_len; + shared->users = calloc(array_len, sizeof(telebot_shared_user_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_shared_user(json_object_array_get_idx(users, i), &(shared->users[i])); + } + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_chat_shared(struct json_object *obj, telebot_chat_shared_t *shared) +{ + if ((obj == NULL) || (shared == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(shared, 0, sizeof(telebot_chat_shared_t)); + struct json_object *request_id = NULL; + if (json_object_object_get_ex(obj, "request_id", &request_id)) + shared->request_id = json_object_get_int(request_id); + + struct json_object *chat_id = NULL; + if (json_object_object_get_ex(obj, "chat_id", &chat_id)) + shared->chat_id = json_object_get_int64(chat_id); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_gift(struct json_object *obj, telebot_gift_t *gift) +{ + if ((obj == NULL) || (gift == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gift, 0, sizeof(telebot_gift_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + gift->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *star_count = NULL; + if (json_object_object_get_ex(obj, "star_count", &star_count)) + gift->star_count = json_object_get_int(star_count); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_gift_info(struct json_object *obj, telebot_gift_info_t *gift_info) +{ + if ((obj == NULL) || (gift_info == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gift_info, 0, sizeof(telebot_gift_info_t)); + struct json_object *gift = NULL; + if (json_object_object_get_ex(obj, "gift", &gift)) + telebot_parser_get_gift(gift, &(gift_info->gift)); + + struct json_object *text = NULL; + if (json_object_object_get_ex(obj, "text", &text)) + gift_info->text = TELEBOT_SAFE_STRDUP(json_object_get_string(text)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_unique_gift(struct json_object *obj, telebot_unique_gift_t *gift) +{ + if ((obj == NULL) || (gift == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gift, 0, sizeof(telebot_unique_gift_t)); + struct json_object *gift_id = NULL; + if (json_object_object_get_ex(obj, "gift_id", &gift_id)) + gift->gift_id = TELEBOT_SAFE_STRDUP(json_object_get_string(gift_id)); + + struct json_object *name = NULL; + if (json_object_object_get_ex(obj, "name", &name)) + gift->name = TELEBOT_SAFE_STRDUP(json_object_get_string(name)); + + struct json_object *number = NULL; + if (json_object_object_get_ex(obj, "number", &number)) + gift->number = json_object_get_int(number); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_unique_gift_info(struct json_object *obj, telebot_unique_gift_info_t *gift_info) +{ + if ((obj == NULL) || (gift_info == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gift_info, 0, sizeof(telebot_unique_gift_info_t)); + struct json_object *gift = NULL; + if (json_object_object_get_ex(obj, "gift", &gift)) + { + gift_info->gift = calloc(1, sizeof(telebot_unique_gift_t)); + telebot_parser_get_unique_gift(gift, gift_info->gift); + } + + struct json_object *origin = NULL; + if (json_object_object_get_ex(obj, "origin", &origin)) + gift_info->origin = TELEBOT_SAFE_STRDUP(json_object_get_string(origin)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_chat_boost_added(struct json_object *obj, telebot_chat_boost_added_t *boost) +{ + if ((obj == NULL) || (boost == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(boost, 0, sizeof(telebot_chat_boost_added_t)); + struct json_object *boost_count = NULL; + if (json_object_object_get_ex(obj, "boost_count", &boost_count)) + boost->boost_count = json_object_get_int(boost_count); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_chat_background(struct json_object *obj, telebot_chat_background_t *background) +{ + if ((obj == NULL) || (background == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(background, 0, sizeof(telebot_chat_background_t)); + struct json_object *type = NULL; + if (json_object_object_get_ex(obj, "type", &type)) + { + struct json_object *type_str = NULL; + if (json_object_object_get_ex(type, "type", &type_str)) + background->type = TELEBOT_SAFE_STRDUP(json_object_get_string(type_str)); + } + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_giveaway_created(struct json_object *obj, telebot_giveaway_created_t *giveaway) +{ + if ((obj == NULL) || (giveaway == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(giveaway, 0, sizeof(telebot_giveaway_created_t)); + struct json_object *prize_star_count = NULL; + if (json_object_object_get_ex(obj, "prize_star_count", &prize_star_count)) + giveaway->prize_star_count = json_object_get_int(prize_star_count); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_giveaway_completed(struct json_object *obj, telebot_giveaway_completed_t *giveaway) +{ + if ((obj == NULL) || (giveaway == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(giveaway, 0, sizeof(telebot_giveaway_completed_t)); + struct json_object *winner_count = NULL; + if (json_object_object_get_ex(obj, "winner_count", &winner_count)) + giveaway->winner_count = json_object_get_int(winner_count); + + struct json_object *unclaimed_prize_count = NULL; + if (json_object_object_get_ex(obj, "unclaimed_prize_count", &unclaimed_prize_count)) + giveaway->unclaimed_prize_count = json_object_get_int(unclaimed_prize_count); + + struct json_object *giveaway_message = NULL; + if (json_object_object_get_ex(obj, "giveaway_message", &giveaway_message)) + { + giveaway->giveaway_message = calloc(1, sizeof(telebot_message_t)); + telebot_parser_get_message(giveaway_message, giveaway->giveaway_message); + } + + struct json_object *is_star_giveaway = NULL; + if (json_object_object_get_ex(obj, "is_star_giveaway", &is_star_giveaway)) + giveaway->is_star_giveaway = json_object_get_boolean(is_star_giveaway); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_birthdate(struct json_object *obj, telebot_birthdate_t *birthdate) +{ + if ((obj == NULL) || (birthdate == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(birthdate, 0, sizeof(telebot_birthdate_t)); + struct json_object *tmp = NULL; + if (json_object_object_get_ex(obj, "day", &tmp)) + birthdate->day = json_object_get_int(tmp); + if (json_object_object_get_ex(obj, "month", &tmp)) + birthdate->month = json_object_get_int(tmp); + if (json_object_object_get_ex(obj, "year", &tmp)) + birthdate->year = json_object_get_int(tmp); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_business_intro(struct json_object *obj, telebot_business_intro_t *intro) +{ + if ((obj == NULL) || (intro == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(intro, 0, sizeof(telebot_business_intro_t)); + struct json_object *tmp = NULL; + if (json_object_object_get_ex(obj, "title", &tmp)) + intro->title = TELEBOT_SAFE_STRDUP(json_object_get_string(tmp)); + if (json_object_object_get_ex(obj, "message", &tmp)) + intro->message = TELEBOT_SAFE_STRDUP(json_object_get_string(tmp)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_business_location(struct json_object *obj, telebot_business_location_t *location) +{ + if ((obj == NULL) || (location == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(location, 0, sizeof(telebot_business_location_t)); + struct json_object *address = NULL; + if (json_object_object_get_ex(obj, "address", &address)) + location->address = TELEBOT_SAFE_STRDUP(json_object_get_string(address)); + + struct json_object *loc = NULL; + if (json_object_object_get_ex(obj, "location", &loc)) + { + location->location = calloc(1, sizeof(telebot_location_t)); + telebot_parser_get_location(loc, location->location); + } + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_business_opening_hours(struct json_object *obj, telebot_business_opening_hours_t *hours) +{ + if ((obj == NULL) || (hours == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(hours, 0, sizeof(telebot_business_opening_hours_t)); + struct json_object *time_zone_name = NULL; + if (json_object_object_get_ex(obj, "time_zone_name", &time_zone_name)) + hours->time_zone_name = TELEBOT_SAFE_STRDUP(json_object_get_string(time_zone_name)); + + return TELEBOT_ERROR_NONE; +} + +static telebot_error_e telebot_parser_get_star_transaction(struct json_object *obj, telebot_star_transaction_t *transaction) +{ + if ((obj == NULL) || (transaction == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(transaction, 0, sizeof(telebot_star_transaction_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + transaction->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *amount = NULL; + if (json_object_object_get_ex(obj, "amount", &amount)) + transaction->amount = json_object_get_int(amount); + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + transaction->date = json_object_get_int(date); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_star_transactions(struct json_object *obj, telebot_star_transactions_t *transactions) +{ + if ((obj == NULL) || (transactions == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(transactions, 0, sizeof(telebot_star_transactions_t)); + struct json_object *array = NULL; + if (json_object_object_get_ex(obj, "transactions", &array)) + { + int array_len = json_object_array_length(array); + transactions->count_transactions = array_len; + transactions->transactions = calloc(array_len, sizeof(telebot_star_transaction_t)); + for (int i = 0; i < array_len; i++) + telebot_parser_get_star_transaction(json_object_array_get_idx(array, i), &(transactions->transactions[i])); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_prepared_inline_message(struct json_object *obj, telebot_prepared_inline_message_t *prepared_message) +{ + if ((obj == NULL) || (prepared_message == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(prepared_message, 0, sizeof(telebot_prepared_inline_message_t)); + struct json_object *id = NULL; + if (json_object_object_get_ex(obj, "id", &id)) + prepared_message->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *expiration_date = NULL; + if (json_object_object_get_ex(obj, "expiration_date", &expiration_date)) + prepared_message->expiration_date = json_object_get_int(expiration_date); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_game_high_score(struct json_object *obj, telebot_game_high_score_t *high_score) +{ + if ((obj == NULL) || (high_score == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(high_score, 0, sizeof(telebot_game_high_score_t)); + struct json_object *position = NULL; + if (json_object_object_get_ex(obj, "position", &position)) + high_score->position = json_object_get_int(position); + + struct json_object *user = NULL; + if (json_object_object_get_ex(obj, "user", &user)) + { + high_score->user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(user, high_score->user); + } + + struct json_object *score = NULL; + if (json_object_object_get_ex(obj, "score", &score)) + high_score->score = json_object_get_int(score); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_paid_media_purchased(struct json_object *obj, telebot_paid_media_purchased_t *purchased) +{ + if ((obj == NULL) || (purchased == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(purchased, 0, sizeof(telebot_paid_media_purchased_t)); + struct json_object *from = NULL; + if (json_object_object_get_ex(obj, "from", &from)) + { + purchased->from = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(from, purchased->from); + } + + struct json_object *paid_media_payload = NULL; + if (json_object_object_get_ex(obj, "paid_media_payload", &paid_media_payload)) + purchased->paid_media_payload = TELEBOT_SAFE_STRDUP(json_object_get_string(paid_media_payload)); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_gifts(struct json_object *obj, telebot_gifts_t *gifts) +{ + if ((obj == NULL) || (gifts == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gifts, 0, sizeof(telebot_gifts_t)); + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + result = obj; + + if (json_object_get_type(result) != json_type_array) + return TELEBOT_ERROR_OPERATION_FAILED; + + int array_len = json_object_array_length(result); + if (array_len > 0) + { + gifts->gifts = calloc(array_len, sizeof(telebot_gift_t)); + if (gifts->gifts == NULL) + return TELEBOT_ERROR_OUT_OF_MEMORY; + + gifts->count = array_len; + for (int i = 0; i < array_len; i++) + { + struct json_object *item = json_object_array_get_idx(result, i); + telebot_parser_get_gift(item, &(gifts->gifts[i])); + } + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_user_gift(struct json_object *obj, telebot_user_gift_t *gift) +{ + if ((obj == NULL) || (gift == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gift, 0, sizeof(telebot_user_gift_t)); + + struct json_object *gift_id = NULL; + if (json_object_object_get_ex(obj, "gift_id", &gift_id)) + gift->gift_id = TELEBOT_SAFE_STRDUP(json_object_get_string(gift_id)); + + struct json_object *sender_user = NULL; + if (json_object_object_get_ex(obj, "sender_user", &sender_user)) + { + gift->sender_user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(sender_user, gift->sender_user); + } + + struct json_object *text = NULL; + if (json_object_object_get_ex(obj, "text", &text)) + gift->text = TELEBOT_SAFE_STRDUP(json_object_get_string(text)); + + struct json_object *entities = NULL; + if (json_object_object_get_ex(obj, "entities", &entities)) + telebot_parser_get_message_entities(entities, &(gift->entities), &(gift->count_entities)); + + struct json_object *gift_obj = NULL; + if (json_object_object_get_ex(obj, "gift", &gift_obj)) + { + gift->gift = calloc(1, sizeof(telebot_gift_t)); + telebot_parser_get_gift(gift_obj, gift->gift); + } + + struct json_object *date = NULL; + if (json_object_object_get_ex(obj, "date", &date)) + gift->date = json_object_get_int(date); + + struct json_object *message_id = NULL; + if (json_object_object_get_ex(obj, "message_id", &message_id)) + gift->message_id = json_object_get_int(message_id); + + struct json_object *upgrade_star_count = NULL; + if (json_object_object_get_ex(obj, "upgrade_star_count", &upgrade_star_count)) + gift->upgrade_star_count = json_object_get_int(upgrade_star_count); + + struct json_object *is_upgraded = NULL; + if (json_object_object_get_ex(obj, "is_upgraded", &is_upgraded)) + gift->is_upgraded = json_object_get_boolean(is_upgraded); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_user_gifts(struct json_object *obj, telebot_user_gifts_t *gifts) +{ + if ((obj == NULL) || (gifts == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(gifts, 0, sizeof(telebot_user_gifts_t)); + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + result = obj; + + struct json_object *total_count = NULL; + if (json_object_object_get_ex(result, "total_count", &total_count)) + gifts->total_count = json_object_get_int(total_count); + + struct json_object *gifts_array = NULL; + if (json_object_object_get_ex(result, "gifts", &gifts_array)) + { + int array_len = json_object_array_length(gifts_array); + if (array_len > 0) + { + gifts->gifts = calloc(array_len, sizeof(telebot_user_gift_t)); + if (gifts->gifts == NULL) + return TELEBOT_ERROR_OUT_OF_MEMORY; + + gifts->count = array_len; + for (int i = 0; i < array_len; i++) + { + struct json_object *item = json_object_array_get_idx(gifts_array, i); + telebot_parser_get_user_gift(item, &(gifts->gifts[i])); + } + } + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_user_profile_audios(struct json_object *obj, telebot_user_profile_audios_t *audios) +{ + if ((obj == NULL) || (audios == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(audios, 0, sizeof(telebot_user_profile_audios_t)); + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + result = obj; + + struct json_object *total_count = NULL; + if (json_object_object_get_ex(result, "total_count", &total_count)) + audios->total_count = json_object_get_int(total_count); + + struct json_object *audios_array = NULL; + if (json_object_object_get_ex(result, "audios", &audios_array)) + { + int array_len = json_object_array_length(audios_array); + if (array_len > 0) + { + audios->audios = calloc(array_len, sizeof(telebot_audio_t)); + if (audios->audios == NULL) + return TELEBOT_ERROR_OUT_OF_MEMORY; + + audios->count = array_len; + for (int i = 0; i < array_len; i++) + { + struct json_object *item = json_object_array_get_idx(audios_array, i); + telebot_parser_get_audio(item, &(audios->audios[i])); + } + } + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_business_connection(struct json_object *obj, telebot_business_connection_t *connection) +{ + if ((obj == NULL) || (connection == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(connection, 0, sizeof(telebot_business_connection_t)); + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + result = obj; + + struct json_object *id = NULL; + if (json_object_object_get_ex(result, "id", &id)) + connection->id = TELEBOT_SAFE_STRDUP(json_object_get_string(id)); + + struct json_object *user = NULL; + if (json_object_object_get_ex(result, "user", &user)) + { + connection->user = calloc(1, sizeof(telebot_user_t)); + telebot_parser_get_user(user, connection->user); + } + + struct json_object *user_chat_id = NULL; + if (json_object_object_get_ex(result, "user_chat_id", &user_chat_id)) + connection->user_chat_id = json_object_get_int64(user_chat_id); + + struct json_object *date = NULL; + if (json_object_object_get_ex(result, "date", &date)) + connection->date = json_object_get_int(date); + + struct json_object *can_reply = NULL; + if (json_object_object_get_ex(result, "can_reply", &can_reply)) + connection->can_reply = json_object_get_boolean(can_reply); + + struct json_object *is_enabled = NULL; + if (json_object_object_get_ex(result, "is_enabled", &is_enabled)) + connection->is_enabled = json_object_get_boolean(is_enabled); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_parser_get_user_chat_boosts(struct json_object *obj, telebot_user_chat_boosts_t *boosts) +{ + if ((obj == NULL) || (boosts == NULL)) + return TELEBOT_ERROR_INVALID_PARAMETER; + + memset(boosts, 0, sizeof(telebot_user_chat_boosts_t)); + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + result = obj; + + struct json_object *boosts_array = NULL; + if (json_object_object_get_ex(result, "boosts", &boosts_array)) + { + int array_len = json_object_array_length(boosts_array); + if (array_len > 0) + { + boosts->boosts = calloc(array_len, sizeof(telebot_chat_boost_t)); + if (boosts->boosts == NULL) + return TELEBOT_ERROR_OUT_OF_MEMORY; + + boosts->count = array_len; + for (int i = 0; i < array_len; i++) + { + struct json_object *item = json_object_array_get_idx(boosts_array, i); + telebot_parser_get_chat_boost(item, &(boosts->boosts[i])); + } + } + } + + return TELEBOT_ERROR_NONE; +} + + diff --git a/src/telebot-passport.c b/src/telebot-passport.c new file mode 100644 index 0000000..d6d8cc9 --- /dev/null +++ b/src/telebot-passport.c @@ -0,0 +1,35 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +telebot_error_e telebot_set_passport_data_errors(telebot_handler_t handle, + long long int user_id, const char *errors) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_passport_data_errors(handle->core_h, user_id, errors); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} diff --git a/src/telebot-payments.c b/src/telebot-payments.c new file mode 100644 index 0000000..ffb9a88 --- /dev/null +++ b/src/telebot-payments.c @@ -0,0 +1,463 @@ +/* + * telebot + * + * Copyright (c) 2015 Elmurod Talipov. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +telebot_error_e telebot_send_invoice(telebot_handler_t handle, + long long int chat_id, int message_thread_id, const char *title, + const char *description, const char *payload, const char *provider_token, + const char *currency, const char *prices, int max_tip_amount, + const char *suggested_tip_amounts, const char *start_parameter, + const char *provider_data, const char *photo_url, int photo_size, + int photo_width, int photo_height, bool need_name, bool need_phone_number, + bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, + bool send_email_to_provider, bool is_flexible, bool disable_notification, + bool protect_content, const char *reply_parameters, const char *reply_markup, + telebot_message_t *message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (message == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_send_invoice(handle->core_h, chat_id, message_thread_id, + title, description, payload, provider_token, + currency, prices, max_tip_amount, suggested_tip_amounts, + start_parameter, provider_data, photo_url, photo_size, + photo_width, photo_height, need_name, need_phone_number, + need_email, need_shipping_address, send_phone_number_to_provider, + send_email_to_provider, is_flexible, disable_notification, + protect_content, reply_parameters, reply_markup); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_message(result, message); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_create_invoice_link(telebot_handler_t handle, + const char *title, const char *description, const char *payload, + const char *provider_token, const char *currency, const char *prices, + int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, + const char *photo_url, int photo_size, int photo_width, int photo_height, + bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, + bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, + char **invoice_link) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (invoice_link == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_create_invoice_link(handle->core_h, title, description, payload, + provider_token, currency, prices, max_tip_amount, + suggested_tip_amounts, provider_data, photo_url, + photo_size, photo_width, photo_height, need_name, + need_phone_number, need_email, need_shipping_address, + send_phone_number_to_provider, send_email_to_provider, + is_flexible); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + *invoice_link = TELEBOT_SAFE_STRDUP(json_object_get_string(result)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_answer_shipping_query(telebot_handler_t handle, + const char *shipping_query_id, bool ok, const char *shipping_options, + const char *error_message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_answer_shipping_query(handle->core_h, shipping_query_id, ok, shipping_options, error_message); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_answer_pre_checkout_query(telebot_handler_t handle, + const char *pre_checkout_query_id, bool ok, const char *error_message) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_answer_pre_checkout_query(handle->core_h, pre_checkout_query_id, ok, error_message); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_my_star_balance(telebot_handler_t handle, long long int *balance) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (balance == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_star_balance(handle->core_h); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + struct json_object *balance_obj = NULL; + if (json_object_object_get_ex(result, "balance", &balance_obj)) + { + *balance = json_object_get_int64(balance_obj); + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_star_transactions(telebot_handler_t handle, + int offset, int limit, telebot_star_transactions_t *transactions) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (transactions == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_star_transactions(handle->core_h, offset, limit); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_star_transactions(result, transactions); + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_star_transactions(telebot_star_transactions_t *transactions) +{ + if (transactions == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + if (transactions->transactions) + { + for (int i = 0; i < transactions->count_transactions; i++) + { + TELEBOT_SAFE_FREE(transactions->transactions[i].id); + // ... free transaction partners etc if needed ... + } + free(transactions->transactions); + } + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_refund_star_payment(telebot_handler_t handle, + long long int user_id, const char *telegram_payment_charge_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_refund_star_payment(handle->core_h, user_id, telegram_payment_charge_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_available_gifts(telebot_handler_t handle, + telebot_gifts_t *gifts) +{ + if (handle == NULL || gifts == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_get_available_gifts(handle->core_h); + int ret = telebot_core_get_response_code(response); + if (ret == TELEBOT_ERROR_NONE) + { + struct json_object *obj = telebot_parser_str_to_obj(telebot_core_get_response_data(response)); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + else + { + ret = telebot_parser_get_gifts(obj, gifts); + json_object_put(obj); + } + } + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_available_gifts(telebot_gifts_t *gifts) +{ + if (gifts == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + for (int i = 0; i < gifts->count; i++) + { + telebot_put_gift(&(gifts->gifts[i])); + } + TELEBOT_SAFE_FREE(gifts->gifts); + gifts->count = 0; + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_get_user_gifts(telebot_handler_t handle, + long long int user_id, int offset, int limit, telebot_user_gifts_t *gifts) +{ + if (handle == NULL || gifts == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_get_user_gifts(handle->core_h, user_id, offset, limit); + int ret = telebot_core_get_response_code(response); + if (ret == TELEBOT_ERROR_NONE) + { + struct json_object *obj = telebot_parser_str_to_obj(telebot_core_get_response_data(response)); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + else + { + ret = telebot_parser_get_user_gifts(obj, gifts); + json_object_put(obj); + } + } + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_user_gifts(telebot_user_gifts_t *gifts) +{ + if (gifts == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + for (int i = 0; i < gifts->count; i++) + { + telebot_put_user_gift(&(gifts->gifts[i])); + } + TELEBOT_SAFE_FREE(gifts->gifts); + gifts->count = 0; + gifts->total_count = 0; + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_get_chat_gifts(telebot_handler_t handle, + long long int chat_id, int offset, int limit, telebot_user_gifts_t *gifts) +{ + if (handle == NULL || gifts == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_get_chat_gifts(handle->core_h, chat_id, offset, limit); + int ret = telebot_core_get_response_code(response); + if (ret == TELEBOT_ERROR_NONE) + { + struct json_object *obj = telebot_parser_str_to_obj(telebot_core_get_response_data(response)); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + else + { + ret = telebot_parser_get_user_gifts(obj, gifts); + json_object_put(obj); + } + } + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_put_chat_gifts(telebot_user_gifts_t *gifts) +{ + return telebot_put_user_gifts(gifts); +} + +telebot_error_e telebot_upgrade_gift(telebot_handler_t handle, + const char *gift_id, bool pay_for_upgrade, const char *text, + const char *text_parse_mode, const char *text_entities) +{ + if (handle == NULL || gift_id == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_upgrade_gift(handle->core_h, gift_id, pay_for_upgrade, text, text_parse_mode, text_entities); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_transfer_gift(telebot_handler_t handle, + long long int user_id, long long int chat_id, const char *gift_id) +{ + if (handle == NULL || gift_id == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_transfer_gift(handle->core_h, user_id, chat_id, gift_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_convert_gift_to_stars(telebot_handler_t handle, + const char *gift_id) +{ + if (handle == NULL || gift_id == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_convert_gift_to_stars(handle->core_h, gift_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_send_gift(telebot_handler_t handle, + long long int user_id, long long int chat_id, const char *gift_id, + bool pay_for_upgrade, const char *text, const char *text_parse_mode, + const char *text_entities) +{ + if (handle == NULL || gift_id == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_send_gift(handle->core_h, user_id, chat_id, gift_id, pay_for_upgrade, text, text_parse_mode, text_entities); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_gift_premium_subscription(telebot_handler_t handle, + long long int user_id, int month_count, int star_count, const char *text, + const char *text_parse_mode, const char *text_entities) +{ + if (handle == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_gift_premium_subscription(handle->core_h, user_id, month_count, star_count, text, text_parse_mode, text_entities); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} diff --git a/src/telebot.c b/src/telebot.c index 602c99c..39a824e 100644 --- a/src/telebot.c +++ b/src/telebot.c @@ -25,28 +25,41 @@ #include #include #include -#include +#include #include -#include #include - -typedef struct telebot_handler_s -{ - telebot_core_handler_t *core_h; - int offset; -} telebot_hdata_t; +#include +#include +#include static const char *telebot_update_type_str[TELEBOT_UPDATE_TYPE_MAX] = { - "message", "edited_message", "channel_post", - "edited_channel_post", "inline_query", - "chonse_inline_result", "callback_query", - "shipping_query", "pre_checkout_query", - "poll", "poll_answer" -}; - -static void telebot_put_user(telebot_user_t *user); + "message", + "edited_message", + "channel_post", + "edited_channel_post", + "business_connection", + "business_message", + "edited_business_message", + "deleted_business_messages", + "message_reaction", + "message_reaction_count", + "inline_query", + "chosen_inline_result", + "callback_query", + "shipping_query", + "pre_checkout_query", + "purchased_paid_media", + "poll", + "poll_answer", + "my_chat_member", + "chat_member", + "chat_join_request", + "chat_boost", + "removed_chat_boost"}; + static void telebot_put_chat_photo(telebot_chat_photo_t *photo); static void telebot_put_chat_permissions(telebot_chat_permissions_t *permissions); +static void telebot_put_chat_location(telebot_chat_location_t *chat_location); static void telebot_put_message(telebot_message_t *msg); static void telebot_put_telebot_message_entity(telebot_message_entity_t *entity); static void telebot_put_audio(telebot_audio_t *audio); @@ -64,16 +77,38 @@ static void telebot_put_location(telebot_location_t *location); static void telebot_put_venue(telebot_venue_t *venue); static void telebot_put_file(telebot_file_t *file); static void telebot_put_callback_query(telebot_callback_query_t *query); -//static void telebot_put_game(telebot_document_t *game); -//static void telebot_put_invoice(telebot_invoice_t *invoice); -//static void telebot_put_payment(telebot_successful_payment_t *payment); +static void telebot_put_gift_info(telebot_gift_info_t *gift_info); +static void telebot_put_unique_gift_info(telebot_unique_gift_info_t *gift_info); +static void telebot_put_game(telebot_game_t *game); +static void telebot_put_invoice(telebot_invoice_t *invoice); +static void telebot_put_successful_payment(telebot_successful_payment_t *payment); +static void telebot_put_passport_data(telebot_passport_data_t *passport_data); +static void telebot_put_proximity_alert_triggered(telebot_proximity_alert_triggered_t *alert); +static void telebot_put_forum_topic_created(telebot_forum_topic_created_t *topic); +static void telebot_put_forum_topic_edited(telebot_forum_topic_edited_t *topic); +static void telebot_put_video_chat_scheduled(telebot_video_chat_scheduled_t *scheduled); +static void telebot_put_video_chat_ended(telebot_video_chat_ended_t *ended); +static void telebot_put_video_chat_participants_invited(telebot_video_chat_participants_invited_t *invited); +static void telebot_put_web_app_data(telebot_web_app_data_t *data); +static void telebot_put_inline_keyboard_markup(telebot_inline_keyboard_markup_t *markup); +static void telebot_put_chat_member_updated(telebot_chat_member_updated_t *updated); +static void telebot_put_chat_join_request(telebot_chat_join_request_t *request); +static void telebot_put_message_reaction_updated(telebot_message_reaction_updated_t *updated); +static void telebot_put_message_reaction_count_updated(telebot_message_reaction_count_updated_t *updated); +static void telebot_put_chat_boost_updated(telebot_chat_boost_updated_t *updated); +static void telebot_put_chat_boost_removed(telebot_chat_boost_removed_t *removed); +static void telebot_put_inline_query(telebot_inline_query_t *query); +static void telebot_put_chat_invite_link_internal(telebot_chat_invite_link_t *invite_link); +static void telebot_put_chosen_inline_result(telebot_chosen_inline_result_t *result); +static void telebot_put_shipping_query(telebot_shipping_query_t *query); +static void telebot_put_pre_checkout_query(telebot_pre_checkout_query_t *query); telebot_error_e telebot_create(telebot_handler_t *handle, char *token) { if ((token == NULL) || (handle == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_hdata_t *_handle = (telebot_hdata_t *)calloc(1, sizeof(telebot_hdata_t)); + telebot_handler_t _handle = calloc(1, sizeof(struct telebot_handler)); if (_handle == NULL) { ERR("Failed to allocate memory"); @@ -95,12 +130,11 @@ telebot_error_e telebot_create(telebot_handler_t *handle, char *token) telebot_error_e telebot_destroy(telebot_handler_t handle) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_destroy(&(_handle->core_h)); - TELEBOT_SAFE_FREE(_handle); + telebot_core_destroy(&(handle->core_h)); + TELEBOT_SAFE_FREE(handle); return TELEBOT_ERROR_NONE; } @@ -110,11 +144,10 @@ telebot_error_e telebot_set_proxy(telebot_handler_t handle, char *addr, char *au if (addr == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_error_e ret = telebot_core_set_proxy(_handle->core_h, addr, auth); + telebot_error_e ret = telebot_core_set_proxy(handle->core_h, addr, auth); if (ret != TELEBOT_ERROR_NONE) return ret; @@ -126,21 +159,22 @@ telebot_error_e telebot_get_proxy(telebot_handler_t handle, char **addr) if (addr == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - *addr = NULL; - - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - return telebot_core_get_proxy(_handle->core_h, addr); + return telebot_core_get_proxy(handle->core_h, addr); } -telebot_error_e telebot_get_updates(telebot_handler_t handle, int offset, - int limit, int timeout, telebot_update_type_e allowed_updates[], - int allowed_updates_count, telebot_update_t **updates, int *count) +telebot_error_e +telebot_get_updates(telebot_handler_t handle, int offset, int limit, int timeout, + telebot_update_type_e allowed_updates[], int allowed_updates_count, + telebot_update_t **updates, int *count) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + int ret = TELEBOT_ERROR_NONE; + telebot_core_response_t response; + struct json_object *obj = NULL; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((updates == NULL) || (count == NULL)) @@ -154,7 +188,8 @@ telebot_error_e telebot_get_updates(telebot_handler_t handle, int offset, if (allowed_updates_count > 0) { array = json_object_new_array(); - for (int i = 0; i < allowed_updates_count; i++) { + for (int i = 0; i < allowed_updates_count; i++) + { const char *item = telebot_update_type_str[allowed_updates[i]]; json_object_array_add(array, json_object_new_string(item)); } @@ -162,22 +197,23 @@ telebot_error_e telebot_get_updates(telebot_handler_t handle, int offset, DBG("Allowed updates: %s", str_allowed_updates); } - int _offset = offset != 0 ? offset : _handle->offset; + int _offset = offset != 0 ? offset : handle->offset; int _timeout = timeout > 0 ? timeout : 0; int _limit = TELEBOT_UPDATE_COUNT_MAX_LIMIT; if ((limit > 0) && (limit < TELEBOT_UPDATE_COUNT_MAX_LIMIT)) _limit = limit; - telebot_core_response_t response; - int ret = telebot_core_get_updates(_handle->core_h, _offset, _limit, _timeout, - str_allowed_updates, &response); - if (ret != TELEBOT_ERROR_NONE) { - if (array) json_object_put(array); - return ret; - } - if (array) json_object_put(array); + response = telebot_core_get_updates(handle->core_h, _offset, _limit, _timeout, str_allowed_updates); + if (array) + json_object_put(array); - struct json_object *obj = telebot_parser_str_to_obj(response.data); + ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *response_data = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(response_data); + ; if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -204,14 +240,15 @@ telebot_error_e telebot_get_updates(telebot_handler_t handle, int offset, telebot_update_t *ups = *updates; for (int index = 0; index < *count; index++) { - if (ups[index].update_id >= _handle->offset) - _handle->offset = ups[index].update_id + 1; + if (ups[index].update_id >= handle->offset) + handle->offset = ups[index].update_id + 1; } } finish: - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (obj) + json_object_put(obj); + telebot_core_put_response(response); return ret; } @@ -245,6 +282,40 @@ telebot_error_e telebot_put_updates(telebot_update_t *updates, int count) break; case TELEBOT_UPDATE_TYPE_POLL_ANSWER: telebot_put_poll_answer(&(updates[index].poll_answer)); + break; + case TELEBOT_UPDATE_TYPE_MY_CHAT_MEMBER: + telebot_put_chat_member_updated(&(updates[index].my_chat_member)); + break; + case TELEBOT_UPDATE_TYPE_CHAT_MEMBER: + telebot_put_chat_member_updated(&(updates[index].chat_member)); + break; + case TELEBOT_UPDATE_TYPE_CHAT_JOIN_REQUEST: + telebot_put_chat_join_request(&(updates[index].chat_join_request)); + break; + case TELEBOT_UPDATE_TYPE_MESSAGE_REACTION: + telebot_put_message_reaction_updated(&(updates[index].message_reaction)); + break; + case TELEBOT_UPDATE_TYPE_MESSAGE_REACTION_COUNT: + telebot_put_message_reaction_count_updated(&(updates[index].message_reaction_count)); + break; + case TELEBOT_UPDATE_TYPE_CHAT_BOOST: + telebot_put_chat_boost_updated(&(updates[index].chat_boost)); + break; + case TELEBOT_UPDATE_TYPE_REMOVED_CHAT_BOOST: + telebot_put_chat_boost_removed(&(updates[index].chat_boost_removed)); + break; + case TELEBOT_UPDATE_TYPE_INLINE_QUERY: + telebot_put_inline_query(&(updates[index].inline_query)); + break; + case TELEBOT_UPDATE_TYPE_CHOSEN_INLINE_RESULT: + telebot_put_chosen_inline_result(&(updates[index].chosen_inline_result)); + break; + case TELEBOT_UPDATE_TYPE_SHIPPING_QUERY: + telebot_put_shipping_query(&(updates[index].shipping_query)); + break; + case TELEBOT_UPDATE_TYPE_PRE_CHECKOUT_QUERY: + telebot_put_pre_checkout_query(&(updates[index].pre_checkout_query)); + break; default: ERR("Unsupported update type: %d", updates[index].update_type); } @@ -257,19 +328,23 @@ telebot_error_e telebot_put_updates(telebot_update_t *updates, int count) telebot_error_e telebot_get_me(telebot_handler_t handle, telebot_user_t *me) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + int ret = TELEBOT_ERROR_NONE; + telebot_core_response_t response; + struct json_object *obj = NULL; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (me == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_get_me(_handle->core_h, &response); + response = telebot_core_get_me(handle->core_h); + ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *response_data = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(response_data); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -293,91 +368,82 @@ telebot_error_e telebot_get_me(telebot_handler_t handle, telebot_user_t *me) ret = telebot_parser_get_user(result, me); finish: - if (ret) telebot_put_me(me); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_me(me); - return TELEBOT_ERROR_NONE; + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); + + return ret; } telebot_error_e telebot_put_me(telebot_user_t *me) { - if (me == NULL) - return TELEBOT_ERROR_INVALID_PARAMETER; - - telebot_put_user(me); - - return TELEBOT_ERROR_NONE; + return telebot_put_user(me); } -telebot_error_e telebot_set_webhook(telebot_handler_t handle, char *url, - char *certificate, int max_connections,telebot_update_type_e allowed_updates[], - int allowed_updates_count) +telebot_error_e telebot_set_webhook(telebot_handler_t handle, char *url, char *certificate, int max_connections, + telebot_update_type_e allowed_updates[], int allowed_updates_count) { - int i = 0; - char allowed_updates_str[TELEBOT_BUFFER_PAGE] = { - 0, - }; - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (url == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; + char allowed_updates_str[TELEBOT_BUFFER_PAGE] = {}; if (allowed_updates_count > 0) { strncat(allowed_updates_str, "[", TELEBOT_BUFFER_BLOCK); - for (i = 0; i < allowed_updates_count; i++) + for (int index = 0; index < allowed_updates_count; index++) { - strncat(allowed_updates_str, telebot_update_type_str[allowed_updates[i]], + strncat(allowed_updates_str, telebot_update_type_str[allowed_updates[index]], TELEBOT_BUFFER_BLOCK); - if (i < (allowed_updates_count - 1)) //intermediate element + if (index < (allowed_updates_count - 1)) // intermediate element strncat(allowed_updates_str, ",", TELEBOT_BUFFER_BLOCK); } strncat(allowed_updates_str, "]", TELEBOT_BUFFER_BLOCK); } - telebot_core_response_t response; - int ret = telebot_core_set_webhook(_handle->core_h, url, certificate, - max_connections, allowed_updates_str, &response); - - telebot_core_put_response(&response); + response = telebot_core_set_webhook(handle->core_h, url, certificate, max_connections, allowed_updates_str); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_delete_webhook(telebot_handler_t handle) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_delete_webhook(_handle->core_h, &response); - - telebot_core_put_response(&response); + telebot_core_response_t response = telebot_core_delete_webhook(handle->core_h); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_get_webhook_info(telebot_handler_t handle, telebot_webhook_info_t *info) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (info == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_get_webhook_info(_handle->core_h, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_webhook_info(handle->core_h); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - { - return ret; - } + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *response_data = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(response_data); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -401,9 +467,13 @@ telebot_error_e telebot_get_webhook_info(telebot_handler_t handle, telebot_webho ret = telebot_parser_get_webhook_info(result, info); finish: - if (ret) telebot_put_webhook_info(info); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_webhook_info(info); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } @@ -419,319 +489,297 @@ telebot_error_e telebot_put_webhook_info(telebot_webhook_info_t *info) return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_send_message(telebot_handler_t handle, long long int chat_id, - const char *text, const char *parse_mode, bool disable_web_page_preview, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_message(telebot_handler_t handle, long long int chat_id, const char *text, + const char *parse_mode, bool disable_web_page_preview, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (text == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_message(_handle->core_h, chat_id, text, parse_mode, - disable_web_page_preview, disable_notification, reply_to_message_id, - reply_markup, &response); - telebot_core_put_response(&response); + telebot_core_response_t response = telebot_core_send_message(handle->core_h, chat_id, text, parse_mode, + disable_web_page_preview, disable_notification, + reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_forward_message(telebot_handler_t handle, long long int chat_id, - long long int from_chat_id, bool disable_notification, int message_id) +telebot_error_e telebot_forward_message(telebot_handler_t handle, long long int chat_id, long long int from_chat_id, + bool disable_notification, int message_id) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (message_id <= 0) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_forward_message(_handle->core_h, chat_id, from_chat_id, - disable_notification, message_id, &response); - telebot_core_put_response(&response); + telebot_core_response_t response = telebot_core_forward_message(handle->core_h, chat_id, from_chat_id, + disable_notification, message_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_photo(telebot_handler_t handle, long long int chat_id, - const char *photo, bool is_file, const char *caption, const char *parse_mode, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_photo(telebot_handler_t handle, long long int chat_id, const char *photo, bool is_file, + const char *caption, const char *parse_mode, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (photo == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_photo(_handle->core_h, chat_id, photo, is_file, caption, - parse_mode, disable_notification, reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_photo(handle->core_h, chat_id, photo, is_file, caption, + parse_mode, disable_notification, reply_to_message_id, + reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_audio(telebot_handler_t handle, long long int chat_id, - const char *audio, bool is_file, const char *caption, const char *parse_mode, - int duration, const char *performer, const char *title, const char *thumb, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_audio(telebot_handler_t handle, long long int chat_id, const char *audio, bool is_file, + const char *caption, const char *parse_mode, int duration, const char *performer, + const char *title, const char *thumb, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (audio == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_audio(_handle->core_h, chat_id, audio, is_file, caption, - parse_mode, duration, performer, title, thumb, disable_notification, - reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_audio(handle->core_h, chat_id, audio, is_file, caption, + parse_mode, duration, performer, title, thumb, + disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_send_document(telebot_handler_t handle, long long int chat_id, - const char *document, bool is_file, const char *thumb, const char *caption, - const char *parse_mode, bool disable_notification, int reply_to_message_id, - const char *reply_markup) + const char *document, bool is_file, const char *thumb, const char *caption, + const char *parse_mode, bool disable_notification, int reply_to_message_id, + const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (document == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_document(_handle->core_h, chat_id, document, is_file, - thumb, caption, parse_mode, disable_notification, reply_to_message_id, - reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_document(handle->core_h, chat_id, document, is_file, thumb, caption, parse_mode, + disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_video(telebot_handler_t handle, long long int chat_id, - const char *video, bool is_file, int duration, int width, int height, - const char *thumb, const char *caption, const char *parse_mode, - bool supports_streaming, bool disable_notification, int reply_to_message_id, - const char *reply_markup) +telebot_error_e telebot_send_video(telebot_handler_t handle, long long int chat_id, const char *video, bool is_file, + int duration, int width, int height, const char *thumb, const char *caption, + const char *parse_mode, bool supports_streaming, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (video == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_video(_handle->core_h, chat_id, video, is_file, duration, - width, height, thumb, caption, parse_mode, supports_streaming, disable_notification, - reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_video(handle->core_h, chat_id, video, is_file, duration, width, height, thumb, + caption, parse_mode, supports_streaming, disable_notification, + reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_animation(telebot_handler_t handle, long long int chat_id, - const char *animation, bool is_file, int duration, int width, int height, - const char *thumb, const char *caption, const char *parse_mode, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_animation(telebot_handler_t handle, long long int chat_id, const char *animation, + bool is_file, int duration, int width, int height, const char *thumb, + const char *caption, const char *parse_mode, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (animation == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_animation(_handle->core_h, chat_id, animation, is_file, - duration, width, height, thumb, caption, parse_mode, disable_notification, - reply_to_message_id, reply_markup, &response); - if (ret != TELEBOT_ERROR_NONE) - return ret; - telebot_core_put_response(&response); + response = telebot_core_send_animation(handle->core_h, chat_id, animation, is_file, duration, width, height, + thumb, caption, parse_mode, disable_notification, reply_to_message_id, + reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); - return TELEBOT_ERROR_NONE; + return ret; } -telebot_error_e telebot_send_voice(telebot_handler_t handle, long long int chat_id, - const char *voice, bool is_file, const char *caption, const char *parse_mode, - int duration, bool disable_notification, int reply_to_message_id, - const char *reply_markup) +telebot_error_e telebot_send_voice(telebot_handler_t handle, long long int chat_id, const char *voice, bool is_file, + const char *caption, const char *parse_mode, int duration, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (voice == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_voice(_handle->core_h, chat_id, voice, is_file, - caption, parse_mode, duration, disable_notification, reply_to_message_id, - reply_markup, &response); - if (ret != TELEBOT_ERROR_NONE) - return ret; - telebot_core_put_response(&response); + response = telebot_core_send_voice(handle->core_h, chat_id, voice, is_file, caption, parse_mode, duration, + disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); - return TELEBOT_ERROR_NONE; + return ret; } telebot_error_e telebot_send_video_note(telebot_handler_t handle, long long int chat_id, - char *video_note, bool is_file, int duration, int length, const char *thumb, - bool disable_notification, int reply_to_message_id, const char *reply_markup) + char *video_note, bool is_file, int duration, int length, const char *thumb, + bool disable_notification, int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_core_response_t response; + + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (video_note == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_send_video_note(_handle->core_h, chat_id, video_note, - is_file, duration, length, thumb, disable_notification, reply_to_message_id, - reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_video_note(handle->core_h, chat_id, video_note, is_file, duration, length, thumb, + disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_media_group( - telebot_handler_t handle, - long long int chat_id, - char *media_paths[], - int count, - bool disable_notification, - int reply_to_message_id) +telebot_error_e telebot_send_media_group(telebot_handler_t handle, long long int chat_id, char *media_paths[], + int count, bool disable_notification, int reply_to_message_id) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; + telebot_core_response_t response; if ((media_paths == NULL) || (count < 2) || (count > 10)) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - telebot_error_e ret = telebot_core_send_media_group( - _handle->core_h, - chat_id, - media_paths, - count, - disable_notification, - reply_to_message_id, - &response); - - telebot_core_put_response(&response); + response = telebot_core_send_media_group(handle->core_h, chat_id, media_paths, count, disable_notification, + reply_to_message_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_send_location(telebot_handler_t handle, long long int chat_id, - float latitude, float longitude, int live_period, bool disable_notification, - int reply_to_message_id, const char *reply_markup) + float latitude, float longitude, int live_period, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_send_location(_handle->core_h, chat_id, latitude, longitude, - live_period, disable_notification, reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_location(handle->core_h, chat_id, latitude, longitude, + live_period, disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_edit_message_live_location(telebot_handler_t handle, - long long int chat_id, int message_id, const char *inline_message_id, - float latitude, float longitude, const char *reply_markup) + long long int chat_id, int message_id, const char *inline_message_id, + float latitude, float longitude, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_edit_message_live_location(_handle->core_h, chat_id, - message_id, inline_message_id, latitude, longitude, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_edit_message_live_location(handle->core_h, chat_id, + message_id, inline_message_id, latitude, longitude, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_stop_message_live_location(telebot_handler_t handle, - long long int chat_id, int message_id, char *inline_message_id, - const char *reply_markup) + long long int chat_id, int message_id, char *inline_message_id, + const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_stop_message_live_location(_handle->core_h, chat_id, - message_id, inline_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_stop_message_live_location(handle->core_h, chat_id, message_id, inline_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_send_venue(telebot_handler_t handle, long long int chat_id, - float latitude, float longitude, const char *title, const char *address, - const char *foursquare_id, const char *foursquare_type,bool disable_notification, - int reply_to_message_id, const char *reply_markup) + float latitude, float longitude, const char *title, const char *address, + const char *foursquare_id, const char *foursquare_type, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((title == NULL) || (address == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; telebot_core_response_t response; - int ret = telebot_core_send_venue(_handle->core_h, chat_id, latitude, longitude, - title, address, foursquare_id, foursquare_type, disable_notification, - reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_venue(handle->core_h, chat_id, latitude, longitude, title, address, foursquare_id, + foursquare_type, disable_notification, reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_send_contact(telebot_handler_t handle, long long int chat_id, - const char *phone_number, const char *first_name, const char *last_name, - const char *vcard, bool disable_notification, int reply_to_message_id, - const char *reply_markup) + const char *phone_number, const char *first_name, const char *last_name, + const char *vcard, bool disable_notification, int reply_to_message_id, + const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((phone_number == NULL) || (first_name == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; telebot_core_response_t response; - int ret = telebot_core_send_contact(_handle->core_h, chat_id, phone_number, - first_name, last_name, vcard, disable_notification, reply_to_message_id, - reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_contact(handle->core_h, chat_id, phone_number, + first_name, last_name, vcard, disable_notification, reply_to_message_id, + reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_poll(telebot_handler_t handle, long long int chat_id, - const char *question, const char **options, int count_options, bool is_anonymous, - const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_poll(telebot_handler_t handle, long long int chat_id, const char *question, + const char **options, int count_options, bool is_anonymous, const char *type, + bool allows_multiple_answers, int correct_option_id, bool is_closed, + bool disable_notification, int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((question == NULL) || (options == NULL) || (count_options <= 0)) @@ -745,49 +793,48 @@ telebot_error_e telebot_send_poll(telebot_handler_t handle, long long int chat_i DBG("Poll options: %s", array_options); telebot_core_response_t response; - int ret = telebot_core_send_poll(_handle->core_h, chat_id, question, array_options, - is_anonymous, type, allows_multiple_answers, correct_option_id, is_closed, - disable_notification, reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_poll(handle->core_h, chat_id, question, array_options, is_anonymous, type, + allows_multiple_answers, correct_option_id, is_closed, disable_notification, + reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); json_object_put(array); return ret; } -telebot_error_e telebot_send_dice(telebot_handler_t handle, long long int chat_id, - bool disable_notification, int reply_to_message_id, const char *reply_markup) +telebot_error_e telebot_send_dice(telebot_handler_t handle, long long int chat_id, bool disable_notification, + int reply_to_message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_send_dice(_handle->core_h, chat_id, disable_notification, - reply_to_message_id, reply_markup, &response); - telebot_core_put_response(&response); + response = telebot_core_send_dice(handle->core_h, chat_id, disable_notification, + reply_to_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_send_chat_action(telebot_handler_t handle, long long int chat_id, - char *action) +telebot_error_e telebot_send_chat_action(telebot_handler_t handle, long long int chat_id, char *action) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_send_chat_action(_handle->core_h, chat_id, action, &response); - telebot_core_put_response(&response); + response = telebot_core_send_chat_action(handle->core_h, chat_id, action); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_get_user_profile_photos(telebot_handler_t handle, int user_id, - int offset, int limit, telebot_user_profile_photos_t *photos) +telebot_error_e telebot_get_user_profile_photos(telebot_handler_t handle, int user_id, int offset, int limit, + telebot_user_profile_photos_t *photos) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (photos == NULL) @@ -796,13 +843,15 @@ telebot_error_e telebot_get_user_profile_photos(telebot_handler_t handle, int us if ((limit <= 0) || (limit > TELEBOT_USER_PROFILE_PHOTOS_LIMIT)) limit = TELEBOT_USER_PROFILE_PHOTOS_LIMIT; + struct json_object *obj = NULL; telebot_core_response_t response; - int ret = telebot_core_get_user_profile_photos(_handle->core_h, user_id, offset, - limit, &response); + response = telebot_core_get_user_profile_photos(handle->core_h, user_id, offset, limit); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -826,9 +875,14 @@ telebot_error_e telebot_get_user_profile_photos(telebot_handler_t handle, int us ret = telebot_parser_get_user_profile_photos(result, photos); finish: - if (ret) telebot_put_user_profile_photos(photos); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_user_profile_photos(photos); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); + return ret; } @@ -848,22 +902,24 @@ telebot_error_e telebot_put_user_profile_photos(telebot_user_profile_photos_t *p return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_download_file(telebot_handler_t handle, const char *file_id, const char *path) +telebot_error_e telebot_get_user_profile_audios(telebot_handler_t handle, + long long int user_id, int offset, int limit, telebot_user_profile_audios_t *audios) { - telebot_file_t file; - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - if (file_id == NULL) + if (audios == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; + struct json_object *obj = NULL; telebot_core_response_t response; - int ret = telebot_core_get_file(_handle->core_h, file_id, &response); + response = telebot_core_get_user_profile_audios(handle->core_h, user_id, offset, limit); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -878,154 +934,154 @@ telebot_error_e telebot_download_file(telebot_handler_t handle, const char *file } struct json_object *result = NULL; - if (!json_object_object_get_ex(obj, "result", &result)) { + if (!json_object_object_get_ex(obj, "result", &result)) + { ret = TELEBOT_ERROR_OPERATION_FAILED; goto finish; } - ret = telebot_parser_get_file(result, &file); - if (ret != TELEBOT_ERROR_NONE) - goto finish; + ret = telebot_parser_get_user_profile_audios(result, audios); - if (file.file_path == NULL) { - ret = TELEBOT_ERROR_OPERATION_FAILED; - goto finish; - } +finish: + if (obj) + json_object_put(obj); - ret = telebot_core_download_file(_handle->core_h, file.file_path, path); + telebot_core_put_response(response); -finish: - telebot_put_file(&file); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); return ret; } -telebot_error_e telebot_kick_chat_member(telebot_handler_t handle, long long int chat_id, - int user_id, long until_date) +telebot_error_e telebot_put_user_profile_audios(telebot_user_profile_audios_t *audios) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; + if (audios == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_kick_chat_member(_handle->core_h, chat_id, user_id, - until_date, &response); - telebot_core_put_response(&response); + if (audios->audios) + { + for (int i = 0; i < audios->count; i++) + { + telebot_put_audio(&(audios->audios[i])); + } + free(audios->audios); + } + audios->audios = NULL; + audios->count = 0; + audios->total_count = 0; - return ret; + return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_unban_chat_member(telebot_handler_t handle, long long int chat_id, - int user_id) +telebot_error_e telebot_set_my_profile_photo(telebot_handler_t handle, + const char *photo) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_unban_chat_member(_handle->core_h, chat_id, user_id, &response); - telebot_core_put_response(&response); + if (photo == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + telebot_core_response_t response = telebot_core_set_my_profile_photo(handle->core_h, photo); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_restrict_chat_member(telebot_handler_t handle, - long long int chat_id, int user_id, long until_date, bool can_send_messages, - bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, - bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, - bool can_pin_messages) +telebot_error_e telebot_remove_my_profile_photo(telebot_handler_t handle, + const char *photo_id) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_restrict_chat_member(_handle->core_h, chat_id, user_id, - until_date, can_send_messages, can_send_media_messages, can_send_polls, - can_send_other_messages, can_add_web_page_previews, can_change_info, - can_invite_users, can_pin_messages, &response); - telebot_core_put_response(&response); + if (photo_id == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + telebot_core_response_t response = telebot_core_remove_my_profile_photo(handle->core_h, photo_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_promote_chat_member(telebot_handler_t handle, - long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, - bool can_edit_messages, bool can_delete_messages, bool can_invite_users, - bool can_restrict_members, bool can_pin_messages, bool can_promote_members) +telebot_error_e telebot_get_business_connection(telebot_handler_t handle, + const char *business_connection_id, telebot_business_connection_t *connection) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; + if (connection == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; telebot_core_response_t response; - int ret = telebot_core_promote_chat_member(_handle->core_h, chat_id, user_id, - can_change_info, can_post_messages, can_edit_messages, can_delete_messages, - can_invite_users, can_restrict_members, can_pin_messages, can_promote_members, - &response); - telebot_core_put_response(&response); + response = telebot_core_get_business_connection(handle->core_h, business_connection_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; - return ret; -} + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } -telebot_error_e telebot_set_chat_admin_custom_title(telebot_handler_t handle, - long long int chat_id, int user_id, const char *custom_title) -{ - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } - if (custom_title == NULL) - return TELEBOT_ERROR_INVALID_PARAMETER; + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } - telebot_core_response_t response; - int ret = telebot_core_set_chat_admin_custom_title(_handle->core_h, chat_id, - user_id, custom_title, &response); - telebot_core_put_response(&response); + ret = telebot_parser_get_business_connection(result, connection); + +finish: + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } - -telebot_error_e telebot_set_chat_permissions(telebot_handler_t handle, - long long int chat_id, bool can_send_messages, bool can_send_media_messages, - bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, - bool can_change_info, bool can_invite_users, bool can_pin_messages) +telebot_error_e telebot_put_business_connection(telebot_business_connection_t *connection) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; + if (connection == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_set_chat_permissions(_handle->core_h, chat_id, - can_send_messages, can_send_media_messages, can_send_polls, - can_send_other_messages, can_add_web_page_previews, can_change_info, - can_invite_users, can_pin_messages, &response); - telebot_core_put_response(&response); + TELEBOT_SAFE_FREE(connection->id); + telebot_put_user(connection->user); + TELEBOT_SAFE_FREE(connection->user); - return ret; + return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_export_chat_invite_link(telebot_handler_t handle, - long long int chat_id, char **invite_link) +telebot_error_e telebot_get_user_chat_boosts(telebot_handler_t handle, + long long int chat_id, long long int user_id, telebot_user_chat_boosts_t *boosts) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - if (invite_link == NULL) + if (boosts == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - *invite_link = NULL; - + struct json_object *obj = NULL; telebot_core_response_t response; - int ret = telebot_core_export_chat_invite_link(_handle->core_h, chat_id, &response); + response = telebot_core_get_user_chat_boosts(handle->core_h, chat_id, user_id); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); - if (obj == NULL) { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { ret = TELEBOT_ERROR_OPERATION_FAILED; goto finish; } @@ -1038,145 +1094,377 @@ telebot_error_e telebot_export_chat_invite_link(telebot_handler_t handle, } struct json_object *result = NULL; - if (json_object_object_get_ex(obj, "result", &result)) - { - *invite_link = TELEBOT_SAFE_STRDUP(json_object_get_string(result)); - if (*invite_link == NULL) - ret = TELEBOT_ERROR_OUT_OF_MEMORY; - else - ret = TELEBOT_ERROR_NONE; - } - else + if (!json_object_object_get_ex(obj, "result", &result)) { ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; } + ret = telebot_parser_get_user_chat_boosts(result, boosts); + finish: - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_set_chat_photo(telebot_handler_t handle, long long int chat_id, - const char *photo) +static void telebot_put_chat_boost_source(telebot_chat_boost_source_t *source) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; - - telebot_core_response_t response; - int ret = telebot_core_set_chat_photo(_handle->core_h, chat_id, photo, &response); - telebot_core_put_response(&response); - - return ret; + if (source == NULL) + return; + TELEBOT_SAFE_FREE(source->source); + telebot_put_user(source->user); + TELEBOT_SAFE_FREE(source->user); } -telebot_error_e telebot_delete_chat_photo(telebot_handler_t handle, long long int chat_id) +static void telebot_put_chat_boost(telebot_chat_boost_t *boost) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; - - telebot_core_response_t response; - int ret = telebot_core_delete_chat_photo(_handle->core_h, chat_id, &response); - telebot_core_put_response(&response); - - return ret; + if (boost == NULL) + return; + TELEBOT_SAFE_FREE(boost->boost_id); + telebot_put_chat_boost_source(boost->source); + TELEBOT_SAFE_FREE(boost->source); } -telebot_error_e telebot_set_chat_title(telebot_handler_t handle, long long int chat_id, - const char *title) +telebot_error_e telebot_put_user_chat_boosts(telebot_user_chat_boosts_t *boosts) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) - return TELEBOT_ERROR_NOT_SUPPORTED; - - if (title == NULL) + if (boosts == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_set_chat_title(_handle->core_h, chat_id, title, &response); - telebot_core_put_response(&response); + if (boosts->boosts) + { + for (int i = 0; i < boosts->count; i++) + { + telebot_put_chat_boost(&(boosts->boosts[i])); + } + free(boosts->boosts); + } + boosts->boosts = NULL; + boosts->count = 0; - return ret; + return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_set_chat_description(telebot_handler_t handle, - long long int chat_id, const char *description) +telebot_error_e telebot_download_file(telebot_handler_t handle, const char *file_id, const char *path) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + telebot_file_t file; + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - if (description == NULL) + if (file_id == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; + struct json_object *obj = NULL; telebot_core_response_t response; - int ret = telebot_core_set_chat_description(_handle->core_h, chat_id, description, - &response); - telebot_core_put_response(&response); - + response = telebot_core_get_file(handle->core_h, file_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (!json_object_object_get_ex(obj, "result", &result)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_parser_get_file(result, &file); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (file.file_path == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + ret = telebot_core_download_file(handle->core_h, file.file_path, path); + +finish: + telebot_put_file(&file); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_pin_chat_message(telebot_handler_t handle, long long int chat_id, - int message_id, bool disable_notification) +telebot_error_e telebot_kick_chat_member(telebot_handler_t handle, long long int chat_id, int user_id, long until_date) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_kick_chat_member(handle->core_h, chat_id, user_id, until_date); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_unban_chat_member(telebot_handler_t handle, long long int chat_id, + int user_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_unban_chat_member(handle->core_h, chat_id, user_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_restrict_chat_member(telebot_handler_t handle, long long int chat_id, int user_id, + long until_date, bool can_send_messages, bool can_send_media_messages, + bool can_send_polls, bool can_send_other_messages, + bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, + bool can_pin_messages) +{ + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_pin_chat_message(_handle->core_h, chat_id, message_id, - disable_notification, &response); - telebot_core_put_response(&response); + response = telebot_core_restrict_chat_member(handle->core_h, chat_id, user_id, + until_date, can_send_messages, can_send_media_messages, can_send_polls, + can_send_other_messages, can_add_web_page_previews, can_change_info, + can_invite_users, can_pin_messages); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_promote_chat_member(telebot_handler_t handle, + long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, + bool can_edit_messages, bool can_delete_messages, bool can_invite_users, + bool can_restrict_members, bool can_pin_messages, bool can_promote_members) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + telebot_core_response_t response = telebot_core_promote_chat_member(handle->core_h, chat_id, user_id, + can_change_info, can_post_messages, + can_edit_messages, can_delete_messages, + can_invite_users, can_restrict_members, + can_pin_messages, can_promote_members); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_unpin_chat_message(telebot_handler_t handle, long long int chat_id) +telebot_error_e telebot_set_chat_admin_custom_title(telebot_handler_t handle, + long long int chat_id, int user_id, const char *custom_title) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + if (custom_title == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response; + response = telebot_core_set_chat_admin_custom_title(handle->core_h, chat_id, + user_id, custom_title); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_chat_permissions(telebot_handler_t handle, + long long int chat_id, bool can_send_messages, bool can_send_media_messages, + bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, + bool can_change_info, bool can_invite_users, bool can_pin_messages) +{ + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_unpin_chat_message(_handle->core_h, chat_id, &response); - telebot_core_put_response(&response); + response = telebot_core_set_chat_permissions(handle->core_h, chat_id, + can_send_messages, can_send_media_messages, can_send_polls, + can_send_other_messages, can_add_web_page_previews, can_change_info, + can_invite_users, can_pin_messages); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_leave_chat(telebot_handler_t handle, long long int chat_id) +telebot_error_e telebot_export_chat_invite_link(telebot_handler_t handle, + long long int chat_id, char **invite_link) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + if (invite_link == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response; + response = telebot_core_export_chat_invite_link(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + *invite_link = TELEBOT_SAFE_STRDUP(json_object_get_string(result)); + if (*invite_link == NULL) + ret = TELEBOT_ERROR_OUT_OF_MEMORY; + else + ret = TELEBOT_ERROR_NONE; + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_chat_photo(telebot_handler_t handle, long long int chat_id, + const char *photo) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_chat_photo(handle->core_h, chat_id, photo); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_delete_chat_photo(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_delete_chat_photo(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_chat_title(telebot_handler_t handle, long long int chat_id, + const char *title) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + if (title == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_set_chat_title(handle->core_h, chat_id, title); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_chat_description(telebot_handler_t handle, + long long int chat_id, const char *description) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + if (description == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + telebot_core_response_t response = telebot_core_set_chat_description(handle->core_h, chat_id, description); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_pin_chat_message(telebot_handler_t handle, long long int chat_id, + int message_id, bool disable_notification) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response; + response = telebot_core_pin_chat_message(handle->core_h, chat_id, message_id, + disable_notification); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_unpin_chat_message(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; telebot_core_response_t response; - int ret = telebot_core_leave_chat(_handle->core_h, chat_id, &response); - telebot_core_put_response(&response); + response = telebot_core_unpin_chat_message(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_leave_chat(telebot_handler_t handle, long long int chat_id) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + telebot_core_response_t response; + response = telebot_core_leave_chat(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_get_chat(telebot_handler_t handle, long long int chat_id, - telebot_chat_t *chat) + telebot_chat_t *chat) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (chat == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_get_chat(_handle->core_h, chat_id, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_chat(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -1200,31 +1488,33 @@ telebot_error_e telebot_get_chat(telebot_handler_t handle, long long int chat_id ret = telebot_parser_get_chat(result, chat); finish: - if (ret) telebot_put_chat(chat); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_chat(chat); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } telebot_error_e telebot_get_chat_admins(telebot_handler_t handle, long long int chat_id, - telebot_chat_member_t **admins, int *count) + telebot_chat_member_t **admins, int *count) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((admins == NULL) || (count == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; - *admins = NULL; - *count = 0; - - telebot_core_response_t response; - int ret = telebot_core_get_chat_admins(_handle->core_h, chat_id, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_chat_admins(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -1248,9 +1538,13 @@ telebot_error_e telebot_get_chat_admins(telebot_handler_t handle, long long int ret = telebot_parser_get_chat_admins(result, admins, count); finish: - if (ret) telebot_put_chat_admins(*admins, *count); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_chat_admins(*admins, *count); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } @@ -1268,24 +1562,24 @@ telebot_error_e telebot_put_chat_admins(telebot_chat_member_t *admins, int count return TELEBOT_ERROR_NONE; } -telebot_error_e telebot_get_chat_members_count(telebot_handler_t handle, - long long int chat_id, int *count) +telebot_error_e telebot_get_chat_members_count(telebot_handler_t handle, long long int chat_id, int *count) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (count == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - *count = 0; - telebot_core_response_t response; - int ret = telebot_core_get_chat_members_count(_handle->core_h, chat_id, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_chat_members_count(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); - if (obj == NULL) { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { ret = TELEBOT_ERROR_OPERATION_FAILED; goto finish; } @@ -1304,28 +1598,30 @@ telebot_error_e telebot_get_chat_members_count(telebot_handler_t handle, ret = TELEBOT_ERROR_OPERATION_FAILED; finish: - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (obj) + json_object_put(obj); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_get_chat_member(telebot_handler_t handle, long long int chat_id, - int user_id, telebot_chat_member_t *member) + int user_id, telebot_chat_member_t *member) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (member == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_get_chat_member(_handle->core_h, chat_id, user_id, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_chat_member(handle->core_h, chat_id, user_id); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -1349,9 +1645,13 @@ telebot_error_e telebot_get_chat_member(telebot_handler_t handle, long long int ret = telebot_parser_get_chat_member(result, member); finish: - if (ret) telebot_put_chat_member(member); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret != TELEBOT_ERROR_NONE) + telebot_put_chat_member(member); + + if (obj) + json_object_put(obj); + + telebot_core_put_response(response); return ret; } @@ -1368,61 +1668,54 @@ telebot_error_e telebot_put_chat_member(telebot_chat_member_t *member) } telebot_error_e telebot_set_chat_sticker_set(telebot_handler_t handle, - long long int chat_id, const char *sticker_set_name) + long long int chat_id, const char *sticker_set_name) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (sticker_set_name == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_set_chat_sticker_set(_handle->core_h, chat_id, - sticker_set_name, &response); - telebot_core_put_response(&response); + telebot_core_response_t response = telebot_core_set_chat_sticker_set(handle->core_h, chat_id, sticker_set_name); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_delete_chat_sticker_set(telebot_handler_t handle, - long long int chat_id) + long long int chat_id) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_delete_chat_sticker_set(_handle->core_h, chat_id, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_delete_chat_sticker_set(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_answer_callback_query(telebot_handler_t handle, - const char *callback_query_id, const char *text, bool show_alert, - const char *url, int cache_time) + const char *callback_query_id, const char *text, bool show_alert, + const char *url, int cache_time) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (callback_query_id == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_answer_callback_query(_handle->core_h, callback_query_id, - text, show_alert, url, cache_time, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_answer_callback_query(handle->core_h, callback_query_id, + text, show_alert, url, cache_time); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_set_my_commands(telebot_handler_t handle, - telebot_bot_command_t commands[], int count) + telebot_bot_command_t commands[], int count) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((commands == NULL) || (count <= 0)) @@ -1443,32 +1736,30 @@ telebot_error_e telebot_set_my_commands(telebot_handler_t handle, const char *array_options = json_object_to_json_string(array); DBG("Commands: %s", array_options); - telebot_core_response_t response; - int ret = telebot_core_set_my_commands(_handle->core_h, array_options, &response); - telebot_core_put_response(&response); + telebot_core_response_t response = telebot_core_set_my_commands(handle->core_h, array_options); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); json_object_put(array); - return ret; } telebot_error_e telebot_get_my_commands(telebot_handler_t handle, - telebot_bot_command_t **commands, int *count) + telebot_bot_command_t **commands, int *count) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if ((commands == NULL) || (count == NULL)) return TELEBOT_ERROR_INVALID_PARAMETER; - *commands = NULL; - *count = 0; - telebot_core_response_t response; - int ret = telebot_core_get_my_commands(_handle->core_h, &response); + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_commands(handle->core_h); + int ret = telebot_core_get_response_code(response); if (ret != TELEBOT_ERROR_NONE) - return ret; + goto finish; - struct json_object *obj = telebot_parser_str_to_obj(response.data); + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); if (obj == NULL) { ret = TELEBOT_ERROR_OPERATION_FAILED; @@ -1492,9 +1783,11 @@ telebot_error_e telebot_get_my_commands(telebot_handler_t handle, ret = telebot_parser_get_array_bot_command(result, commands, count); finish: - if (ret) telebot_put_my_commands(*commands, *count); - if (obj) json_object_put(obj); - telebot_core_put_response(&response); + if (ret) + telebot_put_my_commands(*commands, *count); + if (obj) + json_object_put(obj); + telebot_core_put_response(response); return ret; } @@ -1513,100 +1806,92 @@ telebot_error_e telebot_put_my_commands(telebot_bot_command_t *commands, int cou } telebot_error_e telebot_edit_message_text(telebot_handler_t handle, - long long int chat_id, int message_id, const char *inline_message_id, - const char *text, const char *parse_mode, bool disable_web_page_preview, - const char *reply_markup) + long long int chat_id, int message_id, const char *inline_message_id, + const char *text, const char *parse_mode, bool disable_web_page_preview, + const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; if (text == NULL) return TELEBOT_ERROR_INVALID_PARAMETER; - telebot_core_response_t response; - int ret = telebot_core_edit_message_text(_handle->core_h, chat_id, message_id, - inline_message_id, text, parse_mode, disable_web_page_preview, - reply_markup, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_edit_message_text(handle->core_h, chat_id, message_id, + inline_message_id, text, parse_mode, + disable_web_page_preview, + reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_edit_message_caption(telebot_handler_t handle, - long long int chat_id, int message_id, const char *inline_message_id, - const char *caption, const char *parse_mode, const char *reply_markup) + long long int chat_id, int message_id, const char *inline_message_id, + const char *caption, const char *parse_mode, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_edit_message_caption(_handle->core_h, chat_id, message_id, - inline_message_id, caption, parse_mode, reply_markup, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_edit_message_caption(handle->core_h, chat_id, message_id, + inline_message_id, caption, parse_mode, + reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } telebot_error_e telebot_edit_message_reply_markup(telebot_handler_t handle, - long long int chat_id, int message_id, const char *inline_message_id, - const char *reply_markup) + long long int chat_id, int message_id, const char *inline_message_id, + const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_edit_message_reply_markup(_handle->core_h, chat_id, - message_id, inline_message_id, reply_markup, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_edit_message_reply_markup(handle->core_h, chat_id, message_id, + inline_message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } - telebot_error_e telebot_stop_poll(telebot_handler_t handle, long long int chat_id, - int message_id, const char *reply_markup) + int message_id, const char *reply_markup) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_stop_poll(_handle->core_h, chat_id, - message_id, reply_markup, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_stop_poll(handle->core_h, chat_id, message_id, reply_markup); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } -telebot_error_e telebot_delete_message(telebot_handler_t handle, long long int chat_id, - int message_id) +telebot_error_e telebot_delete_message(telebot_handler_t handle, long long int chat_id, int message_id) { - telebot_hdata_t *_handle = (telebot_hdata_t *)handle; - if (_handle == NULL) + if (handle == NULL) return TELEBOT_ERROR_NOT_SUPPORTED; - telebot_core_response_t response; - int ret = telebot_core_delete_message(_handle->core_h, chat_id, - message_id, &response); - telebot_core_put_response(&response); - + telebot_core_response_t response = telebot_core_delete_message(handle->core_h, chat_id, message_id); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); return ret; } /* Utility functions for releasing memory */ -static void telebot_put_user(telebot_user_t *user) +telebot_error_e telebot_put_user(telebot_user_t *user) { if (user == NULL) - return; + return TELEBOT_ERROR_INVALID_PARAMETER; + TELEBOT_SAFE_FREE(user->first_name); TELEBOT_SAFE_FREE(user->last_name); TELEBOT_SAFE_FREE(user->username); TELEBOT_SAFE_FREE(user->language_code); + + return TELEBOT_ERROR_NONE; } + telebot_error_e telebot_put_chat(telebot_chat_t *chat) { if (chat == NULL) @@ -1621,6 +1906,14 @@ telebot_error_e telebot_put_chat(telebot_chat_t *chat) telebot_put_chat_photo(chat->photo); TELEBOT_SAFE_FREE(chat->photo); + for (size_t index = 0; index < chat->count_active_usernames; index++) + TELEBOT_SAFE_FREE(chat->active_usernames[index]); + TELEBOT_SAFE_FREE(chat->active_usernames); + chat->count_active_usernames = 0; + + TELEBOT_SAFE_FREE(chat->emoji_status_custom_emoji_id); + TELEBOT_SAFE_FREE(chat->bio); + TELEBOT_SAFE_FREE(chat->description); TELEBOT_SAFE_FREE(chat->invite_link); @@ -1631,6 +1924,8 @@ telebot_error_e telebot_put_chat(telebot_chat_t *chat) TELEBOT_SAFE_FREE(chat->permissions); TELEBOT_SAFE_FREE(chat->sticker_set_name); + telebot_put_chat_location(chat->location); + TELEBOT_SAFE_FREE(chat->location); return TELEBOT_ERROR_NONE; } @@ -1649,10 +1944,19 @@ static void telebot_put_chat_permissions(telebot_chat_permissions_t *permissions { if (permissions == NULL) return; - //Nothing for now + // Nothing for now return; } +static void telebot_put_chat_location(telebot_chat_location_t *chat_location) +{ + if (chat_location == NULL) + return; + + TELEBOT_SAFE_FREE(chat_location->address); + telebot_put_location(chat_location->location); +} + static void telebot_put_message(telebot_message_t *msg) { if (msg == NULL) @@ -1661,6 +1965,9 @@ static void telebot_put_message(telebot_message_t *msg) telebot_put_user(msg->from); TELEBOT_SAFE_FREE(msg->from); + telebot_put_chat(msg->sender_chat); + TELEBOT_SAFE_FREE(msg->sender_chat); + telebot_put_chat(msg->chat); TELEBOT_SAFE_FREE(msg->chat); @@ -1676,6 +1983,9 @@ static void telebot_put_message(telebot_message_t *msg) telebot_put_message(msg->reply_to_message); TELEBOT_SAFE_FREE(msg->reply_to_message); + telebot_put_user(msg->via_bot); + TELEBOT_SAFE_FREE(msg->via_bot); + TELEBOT_SAFE_FREE(msg->media_group_id); TELEBOT_SAFE_FREE(msg->author_signature); TELEBOT_SAFE_FREE(msg->text); @@ -1688,13 +1998,8 @@ static void telebot_put_message(telebot_message_t *msg) msg->count_entities = 0; } - if (msg->caption_entities) - { - for (int index = 0; index < msg->count_caption_entities; index++) - telebot_put_telebot_message_entity(&(msg->caption_entities[index])); - TELEBOT_SAFE_FREE(msg->caption_entities); - msg->count_caption_entities = 0; - } + telebot_put_animation(msg->animation); + TELEBOT_SAFE_FREE(msg->animation); telebot_put_audio(msg->audio); TELEBOT_SAFE_FREE(msg->audio); @@ -1702,13 +2007,6 @@ static void telebot_put_message(telebot_message_t *msg) telebot_put_document(msg->document); TELEBOT_SAFE_FREE(msg->document); - //TODO - //telebot_put_game(msg->game); - //TELEBOT_SAFE_FREE(msg->game); - - telebot_put_animation(msg->animation); - TELEBOT_SAFE_FREE(msg->animation); - if (msg->photos) { for (int index = 0; index < msg->count_photos; index++) @@ -1717,35 +2015,50 @@ static void telebot_put_message(telebot_message_t *msg) msg->count_photos = 0; } - //TODO - //telebot_put_sticker(msg->sticker); - //TELEBOT_SAFE_FREE(msg->sticker); + telebot_put_sticker(msg->sticker); + TELEBOT_SAFE_FREE(msg->sticker); telebot_put_video(msg->video); TELEBOT_SAFE_FREE(msg->video); - telebot_put_voice(msg->voice); - TELEBOT_SAFE_FREE(msg->voice); - telebot_put_video_note(msg->video_note); TELEBOT_SAFE_FREE(msg->video_note); + telebot_put_voice(msg->voice); + TELEBOT_SAFE_FREE(msg->voice); + TELEBOT_SAFE_FREE(msg->caption); + if (msg->caption_entities) + { + for (int index = 0; index < msg->count_caption_entities; index++) + telebot_put_telebot_message_entity(&(msg->caption_entities[index])); + TELEBOT_SAFE_FREE(msg->caption_entities); + msg->count_caption_entities = 0; + } telebot_put_contact(msg->contact); TELEBOT_SAFE_FREE(msg->contact); - telebot_put_location(msg->location); - TELEBOT_SAFE_FREE(msg->location); + telebot_put_dice(msg->dice); + TELEBOT_SAFE_FREE(msg->dice); - telebot_put_venue(msg->venue); - TELEBOT_SAFE_FREE(msg->venue); + telebot_put_game(msg->game); + TELEBOT_SAFE_FREE(msg->game); telebot_put_poll(msg->poll); TELEBOT_SAFE_FREE(msg->poll); - telebot_put_dice(msg->dice); - TELEBOT_SAFE_FREE(msg->dice); + telebot_put_venue(msg->venue); + TELEBOT_SAFE_FREE(msg->venue); + + telebot_put_location(msg->location); + TELEBOT_SAFE_FREE(msg->location); + + telebot_put_gift_info(msg->gift); + TELEBOT_SAFE_FREE(msg->gift); + + telebot_put_unique_gift_info(msg->unique_gift); + TELEBOT_SAFE_FREE(msg->unique_gift); if (msg->new_chat_members) { @@ -1773,23 +2086,56 @@ static void telebot_put_message(telebot_message_t *msg) msg->count_new_chat_photos = 0; } + TELEBOT_SAFE_FREE(msg->message_auto_delete_timer_changed); + telebot_put_message(msg->pinned_message); + TELEBOT_SAFE_FREE(msg->pinned_message); + + telebot_put_invoice(msg->invoice); + TELEBOT_SAFE_FREE(msg->invoice); + + telebot_put_successful_payment(msg->successful_payment); + TELEBOT_SAFE_FREE(msg->successful_payment); - //TODO - //telebot_put_invoice(msg->invoice); - //TELEBOT_SAFE_FREE(msg->invoice); + TELEBOT_SAFE_FREE(msg->connected_website); - //TODO - //telebot_put_payment(msg->successful_payment); - //TELEBOT_SAFE_FREE(msg->successful_payment); + telebot_put_passport_data(msg->passport_data); + TELEBOT_SAFE_FREE(msg->passport_data); - //TODO - //telebot_put_passport_data(msg->passport_data); - //TELEBOT_SAFE_FREE(msg->passport_data); + telebot_put_proximity_alert_triggered(msg->proximity_alert_triggered); + TELEBOT_SAFE_FREE(msg->proximity_alert_triggered); - //TODO - //telebot_put_inline_keyboard_markup(msg->reply_markup); - //TELEBOT_SAFE_FREE(msg->reply_markup); + telebot_put_forum_topic_created(msg->forum_topic_created); + TELEBOT_SAFE_FREE(msg->forum_topic_created); + + telebot_put_forum_topic_edited(msg->forum_topic_edited); + TELEBOT_SAFE_FREE(msg->forum_topic_edited); + + telebot_put_forum_topic_created((telebot_forum_topic_created_t *)msg->forum_topic_closed); + TELEBOT_SAFE_FREE(msg->forum_topic_closed); + + telebot_put_forum_topic_created((telebot_forum_topic_created_t *)msg->forum_topic_reopened); + TELEBOT_SAFE_FREE(msg->forum_topic_reopened); + + TELEBOT_SAFE_FREE(msg->general_forum_topic_hidden); + TELEBOT_SAFE_FREE(msg->general_forum_topic_unhidden); + + telebot_put_video_chat_scheduled(msg->video_chat_scheduled); + TELEBOT_SAFE_FREE(msg->video_chat_scheduled); + + TELEBOT_SAFE_FREE(msg->video_chat_started); + + telebot_put_video_chat_ended(msg->video_chat_ended); + TELEBOT_SAFE_FREE(msg->video_chat_ended); + + telebot_put_video_chat_participants_invited(msg->video_chat_participants_invited); + TELEBOT_SAFE_FREE(msg->video_chat_participants_invited); + + telebot_put_web_app_data(msg->web_app_data); + TELEBOT_SAFE_FREE(msg->web_app_data); + + telebot_put_inline_keyboard_markup(msg->reply_markup); + TELEBOT_SAFE_FREE(msg->reply_markup); } static void telebot_put_telebot_message_entity(telebot_message_entity_t *entity) @@ -1907,7 +2253,7 @@ static void telebot_put_location(telebot_location_t *location) { if (location == NULL) return; - //Nothing to free + // Nothing to free return; } @@ -1973,7 +2319,7 @@ static void telebot_put_dice(telebot_dice_t *dice) { if (dice == NULL) return; - //Nothing to free + // Nothing to free return; } @@ -1993,6 +2339,956 @@ static void telebot_put_callback_query(telebot_callback_query_t *query) TELEBOT_SAFE_FREE(query->game_short_name); } -//TODO: static void telebot_put_invoice(telebot_invoice_t *invoice); -//TODO: static void telebot_put_payment(telebot_successful_payment_t *payment); -//TODO: static void telebot_put_game(telebot_game_t *game); +telebot_error_e telebot_put_sticker(telebot_sticker_t *sticker) +{ + if (sticker == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + TELEBOT_SAFE_FREE(sticker->file_id); + TELEBOT_SAFE_FREE(sticker->file_unique_id); + telebot_put_photo(sticker->thumb); + TELEBOT_SAFE_FREE(sticker->thumb); + TELEBOT_SAFE_FREE(sticker->emoji); + TELEBOT_SAFE_FREE(sticker->set_name); + // telebot_put_mask_position(sticker->mask_position); + TELEBOT_SAFE_FREE(sticker->mask_position); + + return TELEBOT_ERROR_NONE; +} + +telebot_error_e telebot_put_gift(telebot_gift_t *gift) +{ + if (gift == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + TELEBOT_SAFE_FREE(gift->id); + telebot_put_sticker(gift->sticker); + TELEBOT_SAFE_FREE(gift->sticker); + + return TELEBOT_ERROR_NONE; +} + +static void telebot_put_gift_info(telebot_gift_info_t *gift_info) +{ + if (gift_info == NULL) + return; + + telebot_put_gift(&(gift_info->gift)); + TELEBOT_SAFE_FREE(gift_info->text); + if (gift_info->entities) + { + for (int i = 0; i < gift_info->count_entities; i++) + telebot_put_telebot_message_entity(&(gift_info->entities[i])); + TELEBOT_SAFE_FREE(gift_info->entities); + } +} + +static void telebot_put_unique_gift(telebot_unique_gift_t *gift) +{ + if (gift == NULL) + return; + + TELEBOT_SAFE_FREE(gift->gift_id); + TELEBOT_SAFE_FREE(gift->name); + telebot_put_sticker(gift->sticker); + TELEBOT_SAFE_FREE(gift->sticker); +} + +static void telebot_put_unique_gift_info(telebot_unique_gift_info_t *gift_info) +{ + if (gift_info == NULL) + return; + + telebot_put_unique_gift(gift_info->gift); + TELEBOT_SAFE_FREE(gift_info->gift); + TELEBOT_SAFE_FREE(gift_info->origin); +} + +telebot_error_e telebot_put_user_gift(telebot_user_gift_t *user_gift) +{ + if (user_gift == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + TELEBOT_SAFE_FREE(user_gift->gift_id); + telebot_put_user(user_gift->sender_user); + TELEBOT_SAFE_FREE(user_gift->sender_user); + TELEBOT_SAFE_FREE(user_gift->text); + if (user_gift->entities) + { + for (int i = 0; i < user_gift->count_entities; i++) + telebot_put_telebot_message_entity(&(user_gift->entities[i])); + TELEBOT_SAFE_FREE(user_gift->entities); + } + telebot_put_gift(user_gift->gift); + TELEBOT_SAFE_FREE(user_gift->gift); + + return TELEBOT_ERROR_NONE; +} + +static void telebot_put_game(telebot_game_t *game) +{ + if (game == NULL) + return; + + TELEBOT_SAFE_FREE(game->title); + TELEBOT_SAFE_FREE(game->description); + if (game->photo) + { + for (int i = 0; i < game->count_photo; i++) + telebot_put_photo(&(game->photo[i])); + TELEBOT_SAFE_FREE(game->photo); + } + TELEBOT_SAFE_FREE(game->text); + if (game->text_entities) + { + for (int i = 0; i < game->count_text_entities; i++) + telebot_put_telebot_message_entity(&(game->text_entities[i])); + TELEBOT_SAFE_FREE(game->text_entities); + } + telebot_put_animation(game->animation); + TELEBOT_SAFE_FREE(game->animation); +} + +telebot_error_e telebot_log_out(telebot_handler_t handle) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_log_out(handle->core_h); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_close(telebot_handler_t handle) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_close(handle->core_h); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_my_name(telebot_handler_t handle, const char *name, const char *language_code) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_my_name(handle->core_h, name, language_code); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_my_name(telebot_handler_t handle, const char *language_code, char **name) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (name == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_name(handle->core_h, language_code); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + struct json_object *name_obj = NULL; + if (json_object_object_get_ex(result, "name", &name_obj)) + { + *name = TELEBOT_SAFE_STRDUP(json_object_get_string(name_obj)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_my_description(telebot_handler_t handle, const char *description, const char *language_code) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_my_description(handle->core_h, description, language_code); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_my_description(telebot_handler_t handle, const char *language_code, char **description) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (description == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_description(handle->core_h, language_code); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + struct json_object *desc_obj = NULL; + if (json_object_object_get_ex(result, "description", &desc_obj)) + { + *description = TELEBOT_SAFE_STRDUP(json_object_get_string(desc_obj)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_my_short_description(telebot_handler_t handle, const char *short_description, const char *language_code) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_my_short_description(handle->core_h, short_description, language_code); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_my_short_description(telebot_handler_t handle, const char *language_code, char **short_description) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (short_description == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_short_description(handle->core_h, language_code); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + struct json_object *desc_obj = NULL; + if (json_object_object_get_ex(result, "short_description", &desc_obj)) + { + *short_description = TELEBOT_SAFE_STRDUP(json_object_get_string(desc_obj)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_chat_menu_button(telebot_handler_t handle, long long int chat_id, const char *menu_button) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_chat_menu_button(handle->core_h, chat_id, menu_button); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_chat_menu_button(telebot_handler_t handle, long long int chat_id, char **menu_button) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (menu_button == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_chat_menu_button(handle->core_h, chat_id); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + *menu_button = TELEBOT_SAFE_STRDUP(json_object_get_string(result)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_set_my_default_administrator_rights(telebot_handler_t handle, const char *rights, bool for_channels) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_set_my_default_administrator_rights(handle->core_h, rights, for_channels); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_get_my_default_administrator_rights(telebot_handler_t handle, bool for_channels, char **rights) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + if (rights == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_get_my_default_administrator_rights(handle->core_h, for_channels); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + *rights = TELEBOT_SAFE_STRDUP(json_object_get_string(result)); + } + else + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_delete_my_commands(telebot_handler_t handle, const char *scope, const char *language_code) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_delete_my_commands(handle->core_h, scope, language_code); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_copy_message(telebot_handler_t handle, long long int chat_id, long long int from_chat_id, int message_id, + const char *caption, const char *parse_mode, const char *caption_entities, + bool disable_notification, bool protect_content, int reply_to_message_id, + bool allow_sending_without_reply, const char *reply_markup, int *message_id_out) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_copy_message(handle->core_h, chat_id, from_chat_id, message_id, + caption, parse_mode, caption_entities, disable_notification, + protect_content, reply_to_message_id, allow_sending_without_reply, + reply_markup); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (message_id_out) + { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + struct json_object *mid_obj = NULL; + if (json_object_object_get_ex(result, "message_id", &mid_obj)) + { + *message_id_out = json_object_get_int(mid_obj); + } + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_copy_messages(telebot_handler_t handle, long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content, bool remove_caption, + int **message_ids_out, int *count) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_copy_messages(handle->core_h, chat_id, from_chat_id, message_ids, + disable_notification, protect_content, remove_caption); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (message_ids_out && count) + { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + int array_len = json_object_array_length(result); + *count = array_len; + *message_ids_out = calloc(array_len, sizeof(int)); + for (int i = 0; i < array_len; i++) + { + struct json_object *mid_obj = json_object_array_get_idx(result, i); + (*message_ids_out)[i] = json_object_get_int(mid_obj); + } + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_forward_messages(telebot_handler_t handle, long long int chat_id, long long int from_chat_id, const char *message_ids, + bool disable_notification, bool protect_content, int **message_ids_out, int *count) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + struct json_object *obj = NULL; + telebot_core_response_t response = telebot_core_forward_messages(handle->core_h, chat_id, from_chat_id, message_ids, + disable_notification, protect_content); + int ret = telebot_core_get_response_code(response); + if (ret != TELEBOT_ERROR_NONE) + goto finish; + + if (message_ids_out && count) + { + const char *rdata = telebot_core_get_response_data(response); + obj = telebot_parser_str_to_obj(rdata); + if (obj == NULL) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *ok = NULL; + if (!json_object_object_get_ex(obj, "ok", &ok) || !json_object_get_boolean(ok)) + { + ret = TELEBOT_ERROR_OPERATION_FAILED; + goto finish; + } + + struct json_object *result = NULL; + if (json_object_object_get_ex(obj, "result", &result)) + { + int array_len = json_object_array_length(result); + *count = array_len; + *message_ids_out = calloc(array_len, sizeof(int)); + for (int i = 0; i < array_len; i++) + { + struct json_object *mid_obj = json_object_array_get_idx(result, i); + (*message_ids_out)[i] = json_object_get_int(mid_obj); + } + } + } + +finish: + if (obj) + json_object_put(obj); + telebot_core_put_response(response); + return ret; +} + +telebot_error_e telebot_delete_messages(telebot_handler_t handle, long long int chat_id, const char *message_ids) +{ + if (handle == NULL) + return TELEBOT_ERROR_NOT_SUPPORTED; + + telebot_core_response_t response = telebot_core_delete_messages(handle->core_h, chat_id, message_ids); + int ret = telebot_core_get_response_code(response); + telebot_core_put_response(response); + return ret; +} + +static void telebot_put_invoice(telebot_invoice_t *invoice) +{ + if (invoice == NULL) + return; + TELEBOT_SAFE_FREE(invoice->title); + TELEBOT_SAFE_FREE(invoice->description); + TELEBOT_SAFE_FREE(invoice->start_parameter); + TELEBOT_SAFE_FREE(invoice->currency); +} + +static void telebot_put_shipping_address(telebot_shipping_address_t *address) +{ + if (address == NULL) + return; + TELEBOT_SAFE_FREE(address->country_code); + TELEBOT_SAFE_FREE(address->state); + TELEBOT_SAFE_FREE(address->city); + TELEBOT_SAFE_FREE(address->street_line1); + TELEBOT_SAFE_FREE(address->street_line2); + TELEBOT_SAFE_FREE(address->post_code); +} + +static void telebot_put_order_info(telebot_order_info_t *info) +{ + if (info == NULL) + return; + TELEBOT_SAFE_FREE(info->name); + TELEBOT_SAFE_FREE(info->phone_number); + TELEBOT_SAFE_FREE(info->email); + telebot_put_shipping_address(info->shipping_address); + TELEBOT_SAFE_FREE(info->shipping_address); +} + +static void telebot_put_successful_payment(telebot_successful_payment_t *payment) +{ + if (payment == NULL) + return; + TELEBOT_SAFE_FREE(payment->currency); + TELEBOT_SAFE_FREE(payment->invoice_payload); + TELEBOT_SAFE_FREE(payment->shipping_option_id); + telebot_put_order_info(payment->order_info); + TELEBOT_SAFE_FREE(payment->order_info); + TELEBOT_SAFE_FREE(payment->telegram_payment_charge_id); + TELEBOT_SAFE_FREE(payment->provider_payment_charge_id); +} + +static void telebot_put_passport_data(telebot_passport_data_t *passport_data) +{ + if (passport_data == NULL) + return; + if (passport_data->data) + { + for (int i = 0; i < passport_data->count_data; i++) + { + TELEBOT_SAFE_FREE(passport_data->data[i].type); + TELEBOT_SAFE_FREE(passport_data->data[i].data); + TELEBOT_SAFE_FREE(passport_data->data[i].phone_number); + TELEBOT_SAFE_FREE(passport_data->data[i].email); + if (passport_data->data[i].files) + { + for (int j = 0; j < passport_data->data[i].count_files; j++) + { + TELEBOT_SAFE_FREE(passport_data->data[i].files[j].file_id); + TELEBOT_SAFE_FREE(passport_data->data[i].files[j].file_unique_id); + } + TELEBOT_SAFE_FREE(passport_data->data[i].files); + } + TELEBOT_SAFE_FREE(passport_data->data[i].hash); + } + TELEBOT_SAFE_FREE(passport_data->data); + } + if (passport_data->credentials) + { + TELEBOT_SAFE_FREE(passport_data->credentials->data); + TELEBOT_SAFE_FREE(passport_data->credentials->hash); + TELEBOT_SAFE_FREE(passport_data->credentials->secret); + TELEBOT_SAFE_FREE(passport_data->credentials); + } +} + +static void telebot_put_proximity_alert_triggered(telebot_proximity_alert_triggered_t *alert) +{ + if (alert == NULL) + return; + telebot_put_user(alert->traveler); + TELEBOT_SAFE_FREE(alert->traveler); + telebot_put_user(alert->watcher); + TELEBOT_SAFE_FREE(alert->watcher); +} + +static void telebot_put_forum_topic_created(telebot_forum_topic_created_t *topic) +{ + if (topic == NULL) + return; + TELEBOT_SAFE_FREE(topic->name); + TELEBOT_SAFE_FREE(topic->icon_custom_emoji_id); +} + +static void telebot_put_forum_topic_edited(telebot_forum_topic_edited_t *topic) +{ + if (topic == NULL) + return; + TELEBOT_SAFE_FREE(topic->name); + TELEBOT_SAFE_FREE(topic->icon_custom_emoji_id); +} + +static void telebot_put_video_chat_scheduled(telebot_video_chat_scheduled_t *scheduled) +{ + if (scheduled == NULL) + return; +} + +static void telebot_put_video_chat_ended(telebot_video_chat_ended_t *ended) +{ + if (ended == NULL) + return; +} + +static void telebot_put_video_chat_participants_invited(telebot_video_chat_participants_invited_t *invited) +{ + if (invited == NULL) + return; + if (invited->users) + { + for (int i = 0; i < invited->count_users; i++) + telebot_put_user(&(invited->users[i])); + TELEBOT_SAFE_FREE(invited->users); + } +} + +static void telebot_put_web_app_data(telebot_web_app_data_t *data) +{ + if (data == NULL) + return; + TELEBOT_SAFE_FREE(data->data); + TELEBOT_SAFE_FREE(data->button_text); +} + +static void telebot_put_inline_keyboard_markup(telebot_inline_keyboard_markup_t *markup) +{ + if (markup == NULL) + return; + if (markup->inline_keyboard) + { + int count = markup->rows * markup->cols; + for (int i = 0; i < count; i++) + { + TELEBOT_SAFE_FREE(markup->inline_keyboard[i].text); + TELEBOT_SAFE_FREE(markup->inline_keyboard[i].url); + TELEBOT_SAFE_FREE(markup->inline_keyboard[i].callback_data); + TELEBOT_SAFE_FREE(markup->inline_keyboard[i].switch_inline_query); + TELEBOT_SAFE_FREE(markup->inline_keyboard[i].switch_inline_query_current_chat); + } + TELEBOT_SAFE_FREE(markup->inline_keyboard); + } +} + +static void telebot_put_chat_member_updated(telebot_chat_member_updated_t *updated) +{ + if (updated == NULL) + return; + telebot_put_chat(updated->chat); + TELEBOT_SAFE_FREE(updated->chat); + telebot_put_user(updated->from); + TELEBOT_SAFE_FREE(updated->from); + telebot_put_chat_member(updated->old_chat_member); + TELEBOT_SAFE_FREE(updated->old_chat_member); + telebot_put_chat_member(updated->new_chat_member); + TELEBOT_SAFE_FREE(updated->new_chat_member); + telebot_put_chat_invite_link_internal(updated->invite_link); + TELEBOT_SAFE_FREE(updated->invite_link); +} + +static void telebot_put_chat_join_request(telebot_chat_join_request_t *request) +{ + if (request == NULL) + return; + telebot_put_chat(request->chat); + TELEBOT_SAFE_FREE(request->chat); + telebot_put_user(request->from); + TELEBOT_SAFE_FREE(request->from); + TELEBOT_SAFE_FREE(request->bio); + telebot_put_chat_invite_link_internal(request->invite_link); + TELEBOT_SAFE_FREE(request->invite_link); +} + +static void telebot_put_reaction_type(telebot_reaction_type_t *reaction) +{ + if (reaction == NULL) + return; + TELEBOT_SAFE_FREE(reaction->type); + TELEBOT_SAFE_FREE(reaction->emoji); + TELEBOT_SAFE_FREE(reaction->custom_emoji_id); +} + +static void telebot_put_message_reaction_updated(telebot_message_reaction_updated_t *updated) +{ + if (updated == NULL) + return; + telebot_put_chat(updated->chat); + TELEBOT_SAFE_FREE(updated->chat); + telebot_put_user(updated->user); + TELEBOT_SAFE_FREE(updated->user); + telebot_put_chat(updated->actor_chat); + TELEBOT_SAFE_FREE(updated->actor_chat); + if (updated->old_reaction) + { + for (int i = 0; i < updated->count_old_reaction; i++) + telebot_put_reaction_type(&(updated->old_reaction[i])); + TELEBOT_SAFE_FREE(updated->old_reaction); + } + if (updated->new_reaction) + { + for (int i = 0; i < updated->count_new_reaction; i++) + telebot_put_reaction_type(&(updated->new_reaction[i])); + TELEBOT_SAFE_FREE(updated->new_reaction); + } +} + +static void telebot_put_message_reaction_count_updated(telebot_message_reaction_count_updated_t *updated) +{ + if (updated == NULL) + return; + telebot_put_chat(updated->chat); + TELEBOT_SAFE_FREE(updated->chat); + if (updated->reactions) + { + for (int i = 0; i < updated->count_reactions; i++) + telebot_put_reaction_type(&(updated->reactions[i].type)); + TELEBOT_SAFE_FREE(updated->reactions); + } +} + +static void telebot_put_chat_boost_updated(telebot_chat_boost_updated_t *updated) +{ + if (updated == NULL) + return; + telebot_put_chat(updated->chat); + TELEBOT_SAFE_FREE(updated->chat); + if (updated->boost) + { + TELEBOT_SAFE_FREE(updated->boost->boost_id); + if (updated->boost->source) + { + TELEBOT_SAFE_FREE(updated->boost->source->source); + telebot_put_user(updated->boost->source->user); + TELEBOT_SAFE_FREE(updated->boost->source->user); + TELEBOT_SAFE_FREE(updated->boost->source); + } + TELEBOT_SAFE_FREE(updated->boost); + } +} + +static void telebot_put_chat_boost_removed(telebot_chat_boost_removed_t *removed) +{ + if (removed == NULL) + return; + telebot_put_chat(removed->chat); + TELEBOT_SAFE_FREE(removed->chat); + TELEBOT_SAFE_FREE(removed->boost_id); + if (removed->source) + { + TELEBOT_SAFE_FREE(removed->source->source); + telebot_put_user(removed->source->user); + TELEBOT_SAFE_FREE(removed->source->user); + TELEBOT_SAFE_FREE(removed->source); + } +} + +static void telebot_put_inline_query(telebot_inline_query_t *query) +{ + if (query == NULL) + return; + TELEBOT_SAFE_FREE(query->id); + telebot_put_user(query->from); + TELEBOT_SAFE_FREE(query->from); + TELEBOT_SAFE_FREE(query->query); + TELEBOT_SAFE_FREE(query->offset); + TELEBOT_SAFE_FREE(query->chat_type); + telebot_put_location(query->location); + TELEBOT_SAFE_FREE(query->location); +} + +static void telebot_put_chosen_inline_result(telebot_chosen_inline_result_t *result) +{ + if (result == NULL) + return; + TELEBOT_SAFE_FREE(result->result_id); + telebot_put_user(result->from); + TELEBOT_SAFE_FREE(result->from); + telebot_put_location(result->location); + TELEBOT_SAFE_FREE(result->location); + TELEBOT_SAFE_FREE(result->inline_message_id); + TELEBOT_SAFE_FREE(result->query); +} + +static void telebot_put_shipping_query(telebot_shipping_query_t *query) +{ + if (query == NULL) + return; + TELEBOT_SAFE_FREE(query->id); + telebot_put_user(query->from); + TELEBOT_SAFE_FREE(query->from); + TELEBOT_SAFE_FREE(query->invoice_payload); + telebot_put_shipping_address(query->shipping_address); + TELEBOT_SAFE_FREE(query->shipping_address); +} + +static void telebot_put_pre_checkout_query(telebot_pre_checkout_query_t *query) +{ + if (query == NULL) + return; + TELEBOT_SAFE_FREE(query->id); + telebot_put_user(query->from); + TELEBOT_SAFE_FREE(query->from); + TELEBOT_SAFE_FREE(query->currency); + TELEBOT_SAFE_FREE(query->invoice_payload); + TELEBOT_SAFE_FREE(query->shipping_option_id); + telebot_put_order_info(query->order_info); + TELEBOT_SAFE_FREE(query->order_info); +} + +static void telebot_put_chat_invite_link_internal(telebot_chat_invite_link_t *invite_link) +{ + if (invite_link == NULL) + return; + + TELEBOT_SAFE_FREE(invite_link->invite_link); + telebot_put_user(invite_link->creator); + TELEBOT_SAFE_FREE(invite_link->creator); + TELEBOT_SAFE_FREE(invite_link->name); +} + +telebot_error_e telebot_put_chat_invite_link(telebot_chat_invite_link_t *invite_link) +{ + if (invite_link == NULL) + return TELEBOT_ERROR_INVALID_PARAMETER; + telebot_put_chat_invite_link_internal(invite_link); + return TELEBOT_ERROR_NONE; +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0d599b5..c24b77e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ -SET(TEST_NAME echobot) -SET(TEST_SRC echobot.c) +SET(TEST_NAME testbot) +SET(TEST_SRC testbot.c) ADD_EXECUTABLE(${TEST_NAME} ${TEST_SRC}) TARGET_LINK_LIBRARIES(${TEST_NAME} ${PKGS_LDFLAGS} ${PROJECT_NAME} pthread) diff --git a/test/echobot.c b/test/echobot.c deleted file mode 100644 index fbb2fef..0000000 --- a/test/echobot.c +++ /dev/null @@ -1,102 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) - -int main(int argc, char *argv[]) -{ - printf("Welcome to Echobot\n"); - - FILE *fp = fopen(".token", "r"); - if (fp == NULL) - { - printf("Failed to open .token file\n"); - return -1; - } - - char token[1024]; - if (fscanf(fp, "%s", token) == 0) - { - printf("Failed to read token\n"); - fclose(fp); - return -1; - } - printf("Token: %s\n", token); - fclose(fp); - - telebot_handler_t handle; - if (telebot_create(&handle, token) != TELEBOT_ERROR_NONE) - { - printf("Telebot create failed\n"); - return -1; - } - - telebot_user_t me; - if (telebot_get_me(handle, &me) != TELEBOT_ERROR_NONE) - { - printf("Failed to get bot information\n"); - telebot_destroy(handle); - return -1; - } - - printf("ID: %d\n", me.id); - printf("First Name: %s\n", me.first_name); - printf("User Name: %s\n", me.username); - - telebot_put_me(&me); - - int index, count, offset = -1; - telebot_error_e ret; - telebot_message_t message; - telebot_update_type_e update_types[] = {TELEBOT_UPDATE_TYPE_MESSAGE}; - - while (1) - { - telebot_update_t *updates; - ret = telebot_get_updates(handle, offset, 20, 0, update_types, 0, &updates, &count); - if (ret != TELEBOT_ERROR_NONE) - continue; - printf("Number of updates: %d\n", count); - for (index = 0; index < count; index++) - { - message = updates[index].message; - if (message.text) - { - printf("%s: %s \n", message.from->first_name, message.text); - if (strstr(message.text, "/dice")) - { - telebot_send_dice(handle, message.chat->id, false, 0, ""); - } - else - { - char str[4096]; - if (strstr(message.text, "/start")) - { - snprintf(str, SIZE_OF_ARRAY(str), "Hello %s", message.from->first_name); - } - else - { - snprintf(str, SIZE_OF_ARRAY(str), "%s", message.text); - } - ret = telebot_send_message(handle, message.chat->id, str, "HTML", false, false, updates[index].message.message_id, ""); - } - if (ret != TELEBOT_ERROR_NONE) - { - printf("Failed to send message: %d \n", ret); - } - } - offset = updates[index].update_id + 1; - } - telebot_put_updates(updates, count); - - sleep(1); - } - - telebot_destroy(handle); - - return 0; -} diff --git a/test/samples/animation.gif b/test/samples/animation.gif new file mode 100644 index 0000000..87dd7c8 Binary files /dev/null and b/test/samples/animation.gif differ diff --git a/test/samples/audio.mp3 b/test/samples/audio.mp3 new file mode 100644 index 0000000..d7f7afe Binary files /dev/null and b/test/samples/audio.mp3 differ diff --git a/test/samples/document.md b/test/samples/document.md new file mode 100644 index 0000000..228e2e1 --- /dev/null +++ b/test/samples/document.md @@ -0,0 +1,9 @@ +# Telebot Sample Document + +This is a sample markdown document used for testing the document sending feature of the telebot library. + +## Features tested +- Sending local files +- Inline keyboards +- Callback queries +- Bot command registration diff --git a/test/samples/logo.png b/test/samples/logo.png new file mode 100644 index 0000000..4d88b2a Binary files /dev/null and b/test/samples/logo.png differ diff --git a/test/samples/video.mp4 b/test/samples/video.mp4 new file mode 100644 index 0000000..0a4dd5b Binary files /dev/null and b/test/samples/video.mp4 differ diff --git a/test/samples/voice.wav b/test/samples/voice.wav new file mode 100644 index 0000000..3f6c1b6 Binary files /dev/null and b/test/samples/voice.wav differ diff --git a/test/testbot.c b/test/testbot.c new file mode 100644 index 0000000..8d697f6 --- /dev/null +++ b/test/testbot.c @@ -0,0 +1,275 @@ +#include +#include +#include +#include +#include +#include +#include + +#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) + +/* Local sample media paths */ +#define SAMPLE_PHOTO "test/samples/logo.png" +#define SAMPLE_AUDIO "test/samples/audio.mp3" +#define SAMPLE_VIDEO "test/samples/video.mp4" +#define SAMPLE_DOC "test/samples/document.md" +#define SAMPLE_ANIMATION "test/samples/animation.gif" +#define SAMPLE_VOICE "test/samples/voice.wav" + +void setup_commands(telebot_handler_t handle) +{ + telebot_bot_command_t commands[] = { + {"start", "Start the bot and show help"}, + {"media", "Test sending various media types"}, + {"keyboard", "Test custom reply keyboard"}, + {"poll", "Send a regular poll"}, + {"quiz", "Send a quiz poll"}, + {"dice", "Send a random dice"}, + {"location", "Send a static location"}, + {"venue", "Send a venue"}, + {"contact", "Send a contact"}, + {"description", "Set chat description"}, + {"info", "Get chat information"}}; + + telebot_error_e ret = telebot_set_my_commands(handle, commands, SIZE_OF_ARRAY(commands)); + if (ret != TELEBOT_ERROR_NONE) + { + printf("Failed to set my commands: %d\n", ret); + } + else + { + printf("Bot commands registered successfully\n"); + } +} + +void handle_message(telebot_handler_t handle, telebot_message_t *message) +{ + if (message->text == NULL) + return; + + printf("Message from %s: %s\n", message->from->first_name, message->text); + + telebot_error_e ret = TELEBOT_ERROR_NONE; + + if (strstr(message->text, "/start")) + { + char welcome[1024]; + snprintf(welcome, sizeof(welcome), + "Welcome %s!\n" + "I am a test bot for telebot library.\n\n" + "Use the menu or type / to see available commands.", + message->from->first_name); + ret = telebot_send_message(handle, message->chat->id, welcome, "", false, false, 0, ""); + } + else if (strstr(message->text, "/media")) + { + const char *keyboard = "{\"inline_keyboard\":[[" + "{\"text\":\"Photo\",\"callback_data\":\"media_photo\"}," + "{\"text\":\"Audio\",\"callback_data\":\"media_audio\"}]," + "[{\"text\":\"Video\",\"callback_data\":\"media_video\"}," + "{\"text\":\"Document\",\"callback_data\":\"media_doc\"}]," + "[{\"text\":\"Animation\",\"callback_data\":\"media_animation\"}," + "{\"text\":\"Voice\",\"callback_data\":\"media_voice\"}]]}"; + ret = telebot_send_message(handle, message->chat->id, "Select media to send:", "", false, false, 0, keyboard); + } + else if (strstr(message->text, "/keyboard")) + { + const char *keyboard = "{\"keyboard\":[[{\"text\":\"Button 1\"},{\"text\":\"Button 2\"}],[{\"text\":\"Button 3\"}]],\"resize_keyboard\":true,\"one_time_keyboard\":true}"; + ret = telebot_send_message(handle, message->chat->id, "Testing reply keyboard:", "", false, false, 0, keyboard); + } + else if (strstr(message->text, "/poll")) + { + const char *options[] = {"Option 1", "Option 2", "Option 3"}; + ret = telebot_send_poll(handle, message->chat->id, "Test Poll", options, 3, false, "regular", false, 0, false, false, 0, ""); + } + else if (strstr(message->text, "/quiz")) + { + const char *options[] = {"A", "B", "C", "D"}; + ret = telebot_send_poll(handle, message->chat->id, "Which one is correct?", options, 4, false, "quiz", false, 1, false, false, 0, ""); + } + else if (strstr(message->text, "/dice")) + { + ret = telebot_send_dice(handle, message->chat->id, false, 0, ""); + } + else if (strstr(message->text, "/location")) + { + ret = telebot_send_location(handle, message->chat->id, 41.311081f, 69.240562f, 0, false, 0, ""); + } + else if (strstr(message->text, "/venue")) + { + ret = telebot_send_venue(handle, message->chat->id, 41.311081f, 69.240562f, "Tashkent", "Uzbekistan", "", "", false, 0, ""); + } + else if (strstr(message->text, "/contact")) + { + ret = telebot_send_contact(handle, message->chat->id, "+998901234567", "John", "Doe", "", false, 0, ""); + } + else if (strstr(message->text, "/description")) + { + char desc[256]; + snprintf(desc, sizeof(desc), "Test description set at %ld", (long)time(NULL)); + ret = telebot_set_chat_description(handle, message->chat->id, desc); + if (ret == TELEBOT_ERROR_NONE) + telebot_send_message(handle, message->chat->id, "Chat description updated!", "", false, false, 0, ""); + } + else if (strstr(message->text, "/info")) + { + telebot_chat_t chat; + ret = telebot_get_chat(handle, message->chat->id, &chat); + if (ret == TELEBOT_ERROR_NONE) + { + char info[1024]; + snprintf(info, sizeof(info), "Chat Info:\nID: %lld\nType: %s\nTitle: %s\nDescription: %s", + chat.id, chat.type ? chat.type : "N/A", + chat.title ? chat.title : "N/A", + chat.description ? chat.description : "N/A"); + telebot_send_message(handle, message->chat->id, info, "", false, false, 0, ""); + telebot_put_chat(&chat); + } + } + else + { + char echo[4096]; + snprintf(echo, sizeof(echo), "Echo: %s", message->text); + ret = telebot_send_message(handle, message->chat->id, echo, "", false, false, 0, ""); + } + + if (ret != TELEBOT_ERROR_NONE) + { + printf("Error: %d\n", ret); + } +} + +void handle_callback_query(telebot_handler_t handle, telebot_callback_query_t *query) +{ + if (query->data == NULL) + return; + + printf("Callback query from %s: %s\n", query->from->first_name, query->data); + + telebot_error_e ret = TELEBOT_ERROR_NONE; + long long int chat_id = query->message->chat->id; + + int duration = 0; + int width = 0; + int height = 0; + const char *thumb = NULL; + bool disable_notification = false; + int reply_to_message_id = 0; + const char *reply_markup = NULL; + const char *parse_mode = ""; + bool is_file = true; + + if (strcmp(query->data, "media_photo") == 0) + { + ret = telebot_send_photo(handle, chat_id, SAMPLE_PHOTO, is_file, "Test Photo", parse_mode, disable_notification, reply_to_message_id, reply_markup); + } + else if (strcmp(query->data, "media_audio") == 0) + { + ret = telebot_send_audio(handle, chat_id, SAMPLE_AUDIO, is_file, "Test Audio", parse_mode, duration, "Artist", "Title", parse_mode, disable_notification, reply_to_message_id, reply_markup); + } + else if (strcmp(query->data, "media_video") == 0) + { + ret = telebot_send_video(handle, chat_id, SAMPLE_VIDEO, is_file, duration, width, height, thumb, "Test Video", parse_mode, disable_notification, false, reply_to_message_id, reply_markup); + } + else if (strcmp(query->data, "media_doc") == 0) + { + ret = telebot_send_document(handle, chat_id, SAMPLE_DOC, is_file, thumb, "Test Document", parse_mode, disable_notification, reply_to_message_id, reply_markup); + } + else if (strcmp(query->data, "media_animation") == 0) + { + ret = telebot_send_animation(handle, chat_id, SAMPLE_ANIMATION, is_file, duration, width, height, thumb, "Test Animation", parse_mode, disable_notification, reply_to_message_id, reply_markup); + } + else if (strcmp(query->data, "media_voice") == 0) + { + ret = telebot_send_voice(handle, chat_id, SAMPLE_VOICE, is_file, "Test Voice", parse_mode, duration, disable_notification, reply_to_message_id, reply_markup); + } + + /* Acknowledge callback query */ + telebot_answer_callback_query(handle, query->id, "Sending media...", false, "", 0); + + if (ret != TELEBOT_ERROR_NONE) + { + printf("Error in callback: %d\n", ret); + char err[64]; + snprintf(err, sizeof(err), "Error sending media: %d", ret); + telebot_send_message(handle, chat_id, err, "", false, false, 0, ""); + } +} + +int main(int argc, char *argv[]) +{ + printf("Welcome to Testbot\n"); + + FILE *fp = fopen(".token", "r"); + if (fp == NULL) + { + printf("Failed to open .token file. Please create it and put your bot token there.\n"); + return -1; + } + + char token[1024]; + if (fscanf(fp, "%s", token) == 0) + { + printf("Failed to read token\n"); + fclose(fp); + return -1; + } + fclose(fp); + + telebot_handler_t handle; + if (telebot_create(&handle, token) != TELEBOT_ERROR_NONE) + { + printf("Telebot create failed\n"); + return -1; + } + + telebot_user_t me; + if (telebot_get_me(handle, &me) != TELEBOT_ERROR_NONE) + { + printf("Failed to get bot information\n"); + telebot_destroy(handle); + return -1; + } + + printf("Bot ID: %lld\n", me.id); + printf("Bot Name: %s\n", me.first_name); + printf("Bot Username: %s\n", me.username); + telebot_put_me(&me); + + /* Setup bot commands in Telegram menu */ + setup_commands(handle); + + int index, count, offset = -1; + telebot_error_e ret; + telebot_update_type_e update_types[] = {TELEBOT_UPDATE_TYPE_MESSAGE, TELEBOT_UPDATE_TYPE_CALLBACK_QUERY}; + + while (1) + { + telebot_update_t *updates; + ret = telebot_get_updates(handle, offset, 20, 0, update_types, 2, &updates, &count); + if (ret != TELEBOT_ERROR_NONE) + { + sleep(1); + continue; + } + + for (index = 0; index < count; index++) + { + if (updates[index].update_type == TELEBOT_UPDATE_TYPE_MESSAGE) + { + handle_message(handle, &(updates[index].message)); + } + else if (updates[index].update_type == TELEBOT_UPDATE_TYPE_CALLBACK_QUERY) + { + handle_callback_query(handle, &(updates[index].callback_query)); + } + offset = updates[index].update_id + 1; + } + telebot_put_updates(updates, count); + sleep(1); + } + + telebot_destroy(handle); + + return 0; +}