Telebot  4.7.0
Library for Telegram bot API
Classes | Typedefs | Functions
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...
 

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.
 

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

Detailed Description

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

Function Documentation

◆ telebot_core_answer_callback_query()

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.

Parameters
[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]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.

◆ telebot_core_create()

telebot_error_e telebot_core_create ( telebot_core_handler_t **  core_h,
const char *  token 
)

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[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.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_delete_chat_photo()

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.

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).
[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.

◆ telebot_core_delete_chat_sticker_set()

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.

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).
[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.

◆ telebot_core_delete_message()

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:

  • 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
    [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().
    Returns
    on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_delete_webhook()

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.

Parameters
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_destroy()

telebot_error_e telebot_core_destroy ( 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
[in,out]core_hThe A pointer to telebot core handler created with telebot_core_create().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_download_file()

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.

Parameters
[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. No response, i.e., core_h->resp_data contains nothing.

◆ telebot_core_edit_message_caption()

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).

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_edit_message_live_location()

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().

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_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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_edit_message_reply_markup()

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).

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_edit_message_text()

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).

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_export_chat_invite_link()

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.

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).
[out]responseResponse data that contains the new invite link on success. It MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_forward_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.

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]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.

◆ telebot_core_get_chat()

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).

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).
[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.

◆ telebot_core_get_chat_admins()

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.

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).
[out]responseResponse data that contains a array of chat members on success. It MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_chat_member()

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.

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.
[out]responseResponse data that contains a chat member on success. It MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_chat_members_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 
)

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).
[out]responseResponse data that contains number of chat members on success. It MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_file()

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.

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_me()

telebot_error_e telebot_core_get_me ( telebot_core_handler_t core_h,
telebot_core_response_t response 
)

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
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_my_commands()

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

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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ 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_updates()

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.

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).
[out]responseResponse data, MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_user_profile_photos()

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.

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.
[out]responseResponse data that contains user's profile photos on success. It MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_get_webhook_info()

telebot_error_e telebot_core_get_webhook_info ( telebot_core_handler_t core_h,
telebot_core_response_t response 
)

Get current webhook status.

Parameters
[in]core_hThe telebot core handler created with telebot_core_create().
[out]responseResponse data, MUST be freed with telebot_core_put_response().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_kick_chat_member()

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.

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.
[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.

◆ telebot_core_leave_chat()

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.

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).
[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.

◆ telebot_core_pin_chat_message()

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.

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.
[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.

◆ telebot_core_promote_chat_member()

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.

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).
[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.

◆ telebot_core_put_response()

void telebot_core_put_response ( telebot_core_response_t response)

Release response data obtained with telebot core methods.

Parameters
[in]responsePointer to response to release.

◆ telebot_core_restrict_chat_member()

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.

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

◆ telebot_core_send_animation()

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).

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.
[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.

◆ telebot_core_send_audio()

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.

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.
[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.

◆ telebot_core_send_chat_action()

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.

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.
[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.

◆ telebot_core_send_contact()

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.

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.
[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.

◆ telebot_core_send_dice()

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.

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.
[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.

◆ telebot_core_send_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.

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.
[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.

◆ telebot_core_send_location()

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.

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.
[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.

◆ telebot_core_send_message()

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.

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]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.
[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.

◆ telebot_core_send_photo()

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.

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]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. 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.

◆ telebot_core_send_poll()

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.

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]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. 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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_send_venue()

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.

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 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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_send_video()

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).

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]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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_send_video_note()

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.

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]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.

◆ telebot_core_send_voice()

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).

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]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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_set_chat_admin_custom_title()

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.

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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_set_chat_description()

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.

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.
[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.

◆ telebot_core_set_chat_permissions()

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.

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

◆ telebot_core_set_chat_photo()

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.

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.
[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.

◆ telebot_core_set_chat_sticker_set()

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.

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]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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_set_chat_title()

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.

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]titleNew chat title, 1-255 characters.
[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.

◆ telebot_core_set_my_commands()

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.

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_set_proxy()

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.

Parameters
[in]core_hThe telebot core handler created with telebot_core_create().
[in]addrProxy address in full.
[in]authProxy authorization informatio.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_set_webhook()

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.

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_stop_message_live_location()

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.

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_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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_stop_poll()

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.

Parameters
[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().
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_core_unban_chat_member()

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.

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
[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.

◆ telebot_core_unpin_chat_message()

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.

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).
[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.