Telebot  4.7.0
Library for Telegram bot API
Files | Classes | Typedefs | Enumerations | Functions
Simple Telegram Bot API

Simplified APIs to create telegram bot. More...

Files

file  telebot-common.h
 This file contains telegram bot common defintions.
 
file  telebot-methods.h
 This file contains methods used to create telegram bot.
 
file  telebot-stickers.h
 This file contains stickers feature of telegram bot.
 
file  telebot-types.h
 This file contains types used to create telegram bot.
 

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_user
 This object represents a Telegram user or bot. More...
 
struct  telebot_chat
 This object represents a chat. More...
 
struct  telebot_message
 This object represents a message. More...
 
struct  telebot_message_entity
 This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. More...
 
struct  telebot_photo
 This object represents one size of a photo or a file / sticker thumbnail. More...
 
struct  telebot_audio
 This object represents an audio file to be treated as music by the Telegram clients. More...
 
struct  telebot_document
 This object represents a general file (as opposed to photos, voice messages and audio files). More...
 
struct  telebot_video
 This object represents a video file. More...
 
struct  telebot_animation
 This object represents a video file. More...
 
struct  telebot_voice
 This object represents a voice note. More...
 
struct  telebot_video_note
 This object represents a video message (available in Telegram apps as of v.4.0). More...
 
struct  telebot_contact
 This object represents a phone contact. More...
 
struct  telebot_location
 This object represents a point on the map. More...
 
struct  telebot_venue
 This object represents a venue. More...
 
struct  telebot_poll_option
 This object contains information about one answer option in a poll. More...
 
struct  telebot_poll_answer
 This object represents an answer of a user in a non-anonymous poll. More...
 
struct  telebot_poll
 This object contains information about a poll. More...
 
struct  telebot_dice
 This object represents a dice with random value from 1 to 6. More...
 
struct  telebot_user_profile_photos
 This object represent a user's profile pictures. More...
 
struct  telebot_file
 This object represents a file ready to be downloaded. 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
 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...
 
struct  telebot_reply_keyboard_markup
 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...
 
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_force_reply
 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. More...
 
struct  telebot_chat_photo
 This object represents a chat photo. More...
 
struct  telebot_chat_member
 This object contains information about one member of a chat. More...
 
struct  telebot_chat_permissions
 Describes actions that a non-administrator user is allowed to take in a chat. More...
 
struct  telebot_bot_command
 This object represents a bot command. More...
 
struct  telebot_response_paramters
 Contains information about why a request was unsuccessful. 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...
 

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.
 

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,
  TELEBOT_ERROR_NO_CONNECTION = -4, TELEBOT_ERROR_INVALID_PARAMETER = -5
}
 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
}
 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_destroy (telebot_handler_t handle)
 Final function to use telebo APIs. More...
 
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_get_proxy (telebot_handler_t handle, char **addr)
 Get proxy address currently used. 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. More...
 
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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_leave_chat (telebot_handler_t handle, long long int chat_id)
 Leave a group, supergroup or channel. 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). More...
 
telebot_error_e telebot_put_chat (telebot_chat_t *chat)
 Release chat obtained with telebot_get_chat(). 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. More...
 
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_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_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_put_chat_member (telebot_chat_member_t *member)
 Release chat member otained with telebot_get_chat_member(). 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. 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. 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. 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. 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. More...
 
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_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_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_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_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_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_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_get_sticker_set (telebot_handler_t handle, const char *name, telebot_sticker_set_t *stickers)
 Get a sticker set. More...
 
telebot_error_e telebot_put_sticker_set (telebot_sticker_set_t *stickers)
 Release sticker set obtained with telebot_get_sticker_set() More...
 

Detailed Description

Simplified APIs to create telegram bot.

Typedef Documentation

◆ telebot_file_t

typedef struct telebot_file telebot_file_t

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.

Enumeration Type Documentation

◆ telebot_error_e

Enumerations of error code for telebot programming interface.

Enumerator
TELEBOT_ERROR_NONE 

Successful

TELEBOT_ERROR_OPERATION_FAILED 

Operation failed

TELEBOT_ERROR_NOT_SUPPORTED 

Not supported

TELEBOT_ERROR_OUT_OF_MEMORY 

Out of memory

TELEBOT_ERROR_NO_CONNECTION 

No Internet connection

TELEBOT_ERROR_INVALID_PARAMETER 

Invalid parameter

◆ telebot_update_type

Enumerations of telegram update types.

Enumerator
TELEBOT_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_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_POLL 

Poll

TELEBOT_UPDATE_TYPE_POLL_ANSWER 

Poll answer

TELEBOT_UPDATE_TYPE_MAX 

Number of update types

Function Documentation

◆ telebot_answer_callback_query()

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.

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

◆ telebot_create()

telebot_error_e telebot_create ( telebot_handler_t handle,
char *  token 
)

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
[out]handlePointer to create telebot handler to use APIs, it must be destroyed with telebot_destroy().
[in]tokenTelegram Bot token to use.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_delete_chat_photo()

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.

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

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.

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

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:

  • 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]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_delete_webhook()

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.

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)

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

◆ telebot_download_file()

telebot_error_e telebot_download_file ( telebot_handler_t  handle,
const char *  file_id,
const char *  path 
)

This function is used to download file.

Parameters
[in]file_idFile identifier to get info about.
[in]pathA path where the file is downloaded
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_edit_message_caption()

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

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

◆ telebot_edit_message_live_location()

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

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

◆ telebot_edit_message_reply_markup()

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

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]reply_markupA JSON-serialized object for an inline keyboard.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_edit_message_text()

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

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

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_t member 
)

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

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.

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_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_t stickers 
)

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]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.
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_t photos 
)

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_t info 
)

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_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_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_t chat)

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_t admins,
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_member()

telebot_error_e telebot_put_chat_member ( telebot_chat_member_t member)

Release chat member otained with telebot_get_chat_member().

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

◆ telebot_put_me()

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.

Parameters
[in]mePointer to telegram user object obtained with telebot_get_me.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative

◆ telebot_put_my_commands()

telebot_error_e telebot_put_my_commands ( telebot_bot_command_t commands,
int  count 
)

Release bot commands obtained with telebot_get_my_commands().

Parameters
[in]commandsPointer to commands to be released.
[in]countThe number of commands to be released.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_put_sticker_set()

telebot_error_e telebot_put_sticker_set ( telebot_sticker_set_t stickers)

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

◆ telebot_put_updates()

telebot_error_e telebot_put_updates ( telebot_update_t updates,
int  count 
)

This function is used to release memory used for obtained updates.

Parameters

◆ telebot_put_user_profile_photos()

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.

Parameters
[in]photosA pointer to user profile photo object, obtained with telebot_get_user_profile_photos.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_put_webhook_info()

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.

Parameters
[in]infoTelegram webhook information object obtained with telebot_get_webhook_info.
Returns
on Success, TELEBOT_ERROR_NONE is returned.

◆ telebot_restrict_chat_member()

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.

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

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

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

◆ telebot_send_audio()

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.

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

◆ telebot_send_chat_action()

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.

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

◆ telebot_send_contact()

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.

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

◆ telebot_send_dice()

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.

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]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_document()

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.

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

◆ telebot_send_location()

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.

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

◆ telebot_send_message()

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.

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

◆ telebot_send_photo()

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.

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

◆ telebot_send_poll()

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.

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]questionPoll question, 1-255 characters.
[in]optionsA aray of answer options, 2-10 strings 1-100 characters each.
[in]count_optionsNumber of answer options.
[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.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_send_sticker()

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.

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]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.
[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_venue()

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

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.

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

◆ telebot_send_voice()

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

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

◆ telebot_set_chat_admin_custom_title()

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.

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]custom_titleNew custom title for the administrator; 0-16 characters, emoji are not allowed.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_set_chat_description()

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.

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

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.

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]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_set_chat_photo()

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.

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]photoNew chat photo file path.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_set_chat_sticker_set()

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.

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

◆ telebot_set_chat_title()

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.

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]titleNew chat title, 1-255 characters.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_set_my_commands()

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.

Parameters
[in]handleThe telebot handler created with telebot_create().
[in]commandsArray of telegram bot commands.
[in]commandsThe number of commands in array.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_set_proxy()

telebot_error_e telebot_set_proxy ( telebot_handler_t  handle,
char *  addr,
char *  auth 
)

Set proxy address to use telebot behind proxy.

Parameters
[in]handleThe telebot handler created with telebot_create().
[in]addrProxy address to use.
[in]authProxy authorization information.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_set_webhook()

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.

Parameters
[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.
[in]allowed_updatesArray of the update types you want your bot to receive.
[in]allowed_updates_countSize of array of the update types.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

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

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

◆ telebot_stop_poll()

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.

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]reply_markupA JSON-serialized object for an inline keyboard.
Returns
on Success, TELEBOT_ERROR_NONE is returned, otherwise a negative error value.

◆ telebot_unban_chat_member()

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.

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

◆ telebot_unpin_chat_message()

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.

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.