Telebot
4.7.0
Library for 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... | |
The APIs for the telegram bot interface, response is unparsed json sting.
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | callback_query_id | Unique identifier for the query to be answered. |
[in] | text | Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters |
[in] | show_alert | If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. |
[in] | url | URL 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_time | The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
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. |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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:
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target message_id Message identifier to be deleted. |
[out] | response | Response data that contains "True" on succes, It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[out] | response | Response data, MUST be freed with telebot_core_put_response(). |
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.
[in,out] | core_h | The A pointer to telebot core handler created with telebot_core_create(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | file_path | A file path take from the response of telebot_core_get_file() |
[in] | out_file | Full path to download and save file. |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Required if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | caption | New caption of the message. |
[in] | reply_markup | A JSON-serialized object for an inline keyboard. |
[out] | response | Response data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response(). |
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().
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | latitude | Latitude of location. |
[in] | longitude | Longitude of location. |
[in] | reply_markup | A JSON-serialized object for a new inline keyboard. |
[out] | response | Response data that contains the sent message on success. Otherwise, True is returned. It MUST be freed with telebot_core_put_response(). |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Required if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | reply_markup | A JSON-serialized object for an inline keyboard. |
[out] | response | Response data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response(). |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Required if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | text | New text of the message. |
[in] | parse_mode | Send 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_priview | Disables link previews for links in this message. |
[in] | reply_markup | A JSON-serialized object for an inline keyboard. |
[out] | response | Response data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains the new invite link on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | from_chat_id | Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername). |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | message_id | Unique message identifier. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains a Chat object on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains a array of chat members on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | user_id | Unique identifier of the target user. |
[out] | response | Response data that contains a chat member on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains number of chat members on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | file_id | File identifier to get info about. |
[out] | response | Response data that contains file object on success. It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_get_me | ( | telebot_core_handler_t * | core_h, |
telebot_core_response_t * | response | ||
) |
Get basic information about the bot.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[out] | response | Response data, MUST be freed with telebot_core_put_response(). |
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..
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_get_proxy | ( | telebot_core_handler_t * | core_h, |
char ** | addr | ||
) |
Get currently used proxy address.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[out] | addr | Current proxy address or NULL, MUST be freed after use. |
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.
[in] | core_h | Telebot core handler creating using telebot_core_create(). |
[in] | offset | Identifier 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] | limit | Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. |
[in] | timeout | Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. |
[in] | allowed_updates | List the types of update you want your bot to receive. Specify an empty list to receive all updates regardless of type (default). |
[out] | response | Response data, MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | user_id | Unique identifier of the target user. |
[in] | offset | Sequential number of the first photo to be returned. By default, all photos are returned. |
[in] | limit | Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. |
[out] | response | Response data that contains user's profile photos on success. It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_get_webhook_info | ( | telebot_core_handler_t * | core_h, |
telebot_core_response_t * | response | ||
) |
Get current webhook status.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[out] | response | Response data, MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | user_id | Unique identifier of the target user |
[in] | until_date | Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Identifier of a message to pin. |
[in] | disable_notification | Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | user_id | Unique identifier of the target user. |
[in] | can_change_info | Pass true, if the administrator can change chat title, photo and other settings. |
[in] | can_post_messages | Pass true, if the administrator can create channel posts, channels only. |
[in] | can_edit_messages | Pass true, if the administrator can edit messages of other users and can pin messages, channels only. |
[in] | can_delete_messages | Pass true, if the administrator can delete messages of other users. |
[in] | can_invite_users | Pass true, if the administrator can invite new users to the chat. |
[in] | can_restrict_members | Pass true, if the administrator can restrict, ban or unban chat members. |
[in] | can_pin_messages | Pass true, if the administrator can pin messages, supergroups only. |
[in] | can_promote_members | Pass 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] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
void telebot_core_put_response | ( | telebot_core_response_t * | response | ) |
Release response data obtained with telebot core methods.
[in] | response | Pointer to response to release. |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | user_id | Unique identifier of the target user. |
[in] | until_date | Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever. |
[in] | can_send_messages | Pass true, if the user is allowed to send text messages, contacts, locations and venues |
[in] | can_send_media_messages | Pass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | animation | Animation 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_file | False if animation is file_id, true, if animation is a file path. |
[in] | duration | Duration of sent animation in seconds. |
[in] | width | Animation width |
[in] | height | Animation height |
[in] | thumb | Thumbnail 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] | caption | Animation caption. (may also be used when resending animations). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | audio | Audio 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_file | False if audio is file_id, true, if audio is a file path. |
[in] | caption | Audio caption. (may also be used when resending audios). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message. |
[in] | duration | Duration of sent audio in seconds. |
[in] | performer | The performer of the audio. |
[in] | title | The track name of the audio. |
[in] | thumb | Thumbnail 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_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | action | Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | phone_number | Contact's phone numbers. |
[in] | first_name | Contact's first name. |
[in] | last_name | Contact's last name. |
[in] | vcard | Additional data about the contact in the form of a vCard, 0-2048 bytes. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | document | Document 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_file | False if document is file_id, true, if document is a file path. |
[in] | thumb | Thumbnail 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] | caption | Document caption. (may also be used when resending documents). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_send_location | ( | telebot_core_handler_t * | core_h, |
long long int | chat_id, | ||
float | latitude, | ||
float | longitude, | ||
int | live_period, | ||
bool | disable_notification, | ||
int | reply_to_message_id, | ||
const char * | reply_markup, | ||
telebot_core_response_t * | response | ||
) |
Send point on the map.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | latitude | Latitude of location. |
[in] | longitude | Longitude of location. |
[in] | live_period | Period in secnods for which the location will be updated. Should be between 60 and 86400. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | text | Text of the message to be sent, 1-4096 characters after entities parsing. |
[in] | parse_mode | Send 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_preview | Disables link previews for links in this message. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | photo | Photo 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_file | False if photo is file_id, true, if photo is a file path. |
[in] | caption | Photo caption. (may also be used when resending photos). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | question | Poll question, 1-255 characters. |
[in] | options | A JSON-serialized list of answer options, 2-10 strings 1-100 characters each. |
[in] | is_anonymous | True, if the poll needs to be anonymous, defaults to True. |
[in] | type | Poll type, “quiz” or “regular”, defaults to “regular”. |
[in] | allows_multiple_answers | True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False |
[in] | correct_option_id | 0-based identifier of the correct answer option, required for polls in quiz mode. |
[in] | is_closed | Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | latitude | Latitude of venue. |
[in] | longitude | Longitude of venue. |
[in] | title | Name of the venue |
[in] | address | Address of the venue. |
[in] | foursquare_id | Foursquare identifier of the venue. |
[in] | foursquare_type | Foursquare type of the venue, if known. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | video | Video 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_file | False if video is file_id, true, if video is a file path. |
[in] | duration | Duration of sent video in seconds. Optional, set 0 for ignoring. |
[in] | width | Video width. Optional, set 0 for ignoring. |
[in] | height | Video heigh. Optional, set 0 for ignoring. |
[in] | thumb | Thumbnail 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] | caption | Video caption. (may also be used when resending videos). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width or inline URLs in your bot's message. |
[in] | supports_streaming | Pass True, if the uploaded video is suitable for streaming. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | video_not | Video 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_file | False if video note is file_id, true, if video note is a file path. |
[in] | duration | Duration of sent video in seconds. |
[in] | length | Video width and height, i.e. diameter of the video message. |
[in] | thumb | Thumbnail 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_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
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).
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | voice | Audio 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_file | False if voice is file_id, true, if voice is a file path. |
[in] | caption | Voice message caption. (may also be used when resending). |
[in] | parse_mode | Send Markdown or HTML, if you want Telegram apps to show bold, |
[in] | duration | Duration of sent voice/audio in seconds. |
[in] | disable_notification | Sends the message silently. Users will receive a notification with no sound. |
[in] | reply_to_message_id | If the message is a reply, ID of the original message. |
[in] | reply_markup | Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user. |
[out] | response | Response data that contains the sent message on success. It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_set_chat_admin_custom_title | ( | telebot_core_handler_t * | core_h, |
long long int | chat_id, | ||
int | user_id, | ||
const char * | custom_title, | ||
telebot_core_response_t * | response | ||
) |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | user_id | Unique identifier of the target user. |
[in] | custom_title | New custom title for the administrator; 0-16 characters, emoji are not allowed. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | description | New chat description, 0-255 characters. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | can_send_messages | Pass true, if the user is allowed to send text messages, contacts, locations and venues |
[in] | can_send_media_messages | Pass true, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | photo | New chat photo file path. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | sticker_set_name | Name of the sticker set to be set as the group sticker set. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | title | New chat title, 1-255 characters. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | commands | A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | addr | Proxy address in full. |
[in] | auth | Proxy authorization informatio. |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | url | HTTPS url to send updates to. Use an empty string to remove webhook integration |
[in] | certificate | A path to to a public key certificate to upload server. |
[in] | max_connections | Optional 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_updates | List the types of updates you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. |
[out] | response | Response data, MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | reply_markup | A JSON-serialized object for a new inline keyboard. |
[out] | response | Response data that contains the sent message on success. Otherwise, True is returned. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Required if inline_message_id. Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[in] | message_id | Required if inline_message_id is not specified. Identifier of the sent message. |
[in] | inline_message_id | Required if chat_id and message_id are not specified. Identifier of the inline message. |
[in] | reply_markup | A JSON-serialized object for an inline keyboard. |
[out] | response | Response data that contains the message sent on succes, otherwise "True". It MUST be freed with telebot_core_put_response(). |
telebot_error_e telebot_core_unban_chat_member | ( | telebot_core_handler_t * | core_h, |
long long int | chat_id, | ||
int | user_id, | ||
telebot_core_response_t * | response | ||
) |
Unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
[in] | user_id | Unique identifier of the target user |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |
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.
[in] | core_h | The telebot core handler created with telebot_core_create(). |
[in] | chat_id | Unique identifier for the target chat or username of the target channel (in the format @channelusername). |
[out] | response | Response data that contains "True" on success. It MUST be freed with telebot_core_put_response(). |