19 #ifndef __TELEBOT_CORE_API_H__ 20 #define __TELEBOT_CORE_API_H__ 129 int limit,
int timeout,
const char *allowed_updates,
152 const char *certificate,
int max_connections,
const char *allowed_updates,
201 long long int chat_id,
const char *text,
const char *parse_mode,
202 bool disable_web_page_preview,
bool disable_notification,
int reply_to_message_id,
220 long long int chat_id,
long long int from_chat_id,
bool disable_notification,
245 long long int chat_id,
const char *photo,
bool is_file,
const char *caption,
246 const char *parse_mode,
bool disable_notification,
int reply_to_message_id,
283 long long int chat_id,
const char *audio,
bool is_file,
const char *caption,
284 const char *parse_mode,
int duration,
const char *performer,
const char *title,
285 const char *thumb,
bool disable_notification,
int reply_to_message_id,
313 long long int chat_id,
const char *document,
bool is_file,
const char *thumb,
314 const char *caption,
const char *parse_mode,
bool disable_notification,
315 int reply_to_message_id,
const char *reply_markup,
348 long long int chat_id,
const char *video,
bool is_file,
int duration,
349 int width,
int height,
const char *thumb,
const char *caption,
350 const char *parse_mode,
bool supports_streaming,
bool disable_notification,
351 int reply_to_message_id,
const char *reply_markup,
381 long long int chat_id,
const char *animation,
bool is_file,
int duration,
382 int width,
int height,
const char *thumb,
const char *caption,
383 const char *parse_mode,
bool disable_notification,
int reply_to_message_id,
409 long long int chat_id,
const char *voice,
bool is_file,
const char *caption,
410 const char *parse_mode,
int duration,
bool disable_notification,
411 int reply_to_message_id,
const char *reply_markup,
439 long long int chat_id,
char *video_note,
bool is_file,
int duration,
int length,
440 const char *thumb,
bool disable_notification,
int reply_to_message_id,
462 long long int chat_id,
float latitude,
float longitude,
int live_period,
463 bool disable_notification,
int reply_to_message_id,
const char *reply_markup,
485 long long int chat_id,
int message_id,
const char *inline_message_id,
486 float latitude,
float longitude,
const char *reply_markup,
505 long long int chat_id,
int message_id,
char *inline_message_id,
530 long long int chat_id,
float latitude,
float longitude,
const char *title,
531 const char *address,
const char *foursquare_id,
const char *foursquare_type,
532 bool disable_notification,
int reply_to_message_id,
const char *reply_markup,
555 long long int chat_id,
const char *phone_number,
const char *first_name,
556 const char *last_name,
const char *vcard,
bool disable_notification,
557 int reply_to_message_id,
const char *reply_markup,
587 long long int chat_id,
const char *question,
const char *options,
588 bool is_anonymous,
const char *type,
bool allows_multiple_answers,
589 int correct_option_id,
bool is_closed,
bool disable_notification,
590 int reply_to_message_id,
const char *reply_markup,
609 long long int chat_id,
bool disable_notification,
610 int reply_to_message_id,
const char *reply_markup,
676 const char *file_path,
const char *out_file);
696 long long int chat_id,
int user_id,
long until_date,
747 long long int chat_id,
int user_id,
long until_date,
bool can_send_messages,
748 bool can_send_media_messages,
bool can_send_polls,
bool can_send_other_messages,
749 bool can_add_web_page_previews,
bool can_change_info,
bool can_invite_users,
783 long long int chat_id,
int user_id,
bool can_change_info,
bool can_post_messages,
784 bool can_edit_messages,
bool can_delete_messages,
bool can_invite_users,
785 bool can_restrict_members,
bool can_pin_messages,
bool can_promote_members,
803 long long int chat_id,
int user_id,
const char *custom_title,
835 long long int chat_id,
bool can_send_messages,
bool can_send_media_messages,
836 bool can_send_polls,
bool can_send_other_messages,
bool can_add_web_page_previews,
837 bool can_change_info,
bool can_invite_users,
bool can_pin_messages,
911 long long int chat_id,
const char *description,
930 long long int chat_id,
int message_id,
bool disable_notification,
1027 long long int chat_id,
const char *sticker_set_name,
1067 const char *callback_query_id,
const char *text,
bool show_alert,
1111 long long int chat_id,
int message_id,
const char *inline_message_id,
1112 const char *text,
const char *parse_mode,
bool disable_web_page_preview,
1131 long long int chat_id,
int message_id,
const char *inline_message_id,
1132 const char *caption,
const char *parse_mode,
const char *reply_markup,
1152 long long int chat_id,
int message_id,
const char *inline_message_id,
1171 long long int chat_id,
int message_id,
const char *reply_markup,
telebot_error_e
Enumerations of error code for telebot programming interface.
Definition: telebot-common.h:45
telebot_error_e telebot_core_send_message(telebot_core_handler_t *core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send text messages.
telebot_error_e telebot_core_export_chat_invite_link(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an a...
telebot_error_e telebot_core_get_chat(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Get up to date information about the chat (current name of the user for one-on-one conversations...
telebot_error_e telebot_core_send_poll(telebot_core_handler_t *core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send a native poll.
telebot_error_e telebot_core_edit_message_text(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup, telebot_core_response_t *response)
Edit text and game messages sent by the bot or via the bot (for inline bots).
telebot_error_e telebot_core_get_user_profile_photos(telebot_core_handler_t *core_h, int user_id, int offset, int limit, telebot_core_response_t *response)
Get user profile pictures object.
telebot_error_e telebot_core_get_me(telebot_core_handler_t *core_h, telebot_core_response_t *response)
Get basic information about the bot.
This object represents a core telebot handler.
Definition: telebot-core.h:50
telebot_error_e telebot_core_stop_poll(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *reply_markup, telebot_core_response_t *response)
Stop a poll which was sent by the bot.
telebot_error_e telebot_core_get_proxy(telebot_core_handler_t *core_h, char **addr)
Get currently used proxy address.
telebot_error_e telebot_core_set_chat_title(telebot_core_handler_t *core_h, long long int chat_id, const char *title, telebot_core_response_t *response)
Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrat...
telebot_error_e telebot_core_edit_message_caption(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup, telebot_core_response_t *response)
Edit captions of messages sent by the bot or via the bot (for inline bots).
telebot_error_e telebot_core_answer_callback_query(telebot_core_handler_t *core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time, telebot_core_response_t *response)
Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user...
telebot_error_e telebot_core_get_chat_admins(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Get a list of administrators in a chat. Response contains an array of objects that contains informati...
telebot_error_e telebot_core_set_my_commands(telebot_core_handler_t *core_h, const char *commands, telebot_core_response_t *response)
Change the list of the bot's commands.
void telebot_core_put_response(telebot_core_response_t *response)
Release response data obtained with telebot core methods.
telebot_error_e telebot_core_get_webhook_info(telebot_core_handler_t *core_h, telebot_core_response_t *response)
Get current webhook status.
telebot_error_e telebot_core_stop_message_live_location(telebot_core_handler_t *core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_pe...
telebot_error_e telebot_core_destroy(telebot_core_handler_t **core_h)
Final function to use telebot core APIs.
telebot_error_e telebot_core_create(telebot_core_handler_t **core_h, const char *token)
Start function to use telebot core APIs.
telebot_error_e telebot_core_send_audio(telebot_core_handler_t *core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send audio files. if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size. For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an .ogg file encoded with OPUS. For sending voice messages, use the telegram_core_send_voice() function instead.
telebot_error_e telebot_core_delete_chat_photo(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in t...
telebot_error_e telebot_core_download_file(telebot_core_handler_t *core_h, const char *file_path, const char *out_file)
Download file using file_path obtained with telebot_core_get_file(). It is guaranteed that the link w...
telebot_error_e telebot_core_send_photo(telebot_core_handler_t *core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send photos.
telebot_error_e telebot_core_get_chat_members_count(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Get the number of members in a chat.
char * token
Definition: telebot-core.h:51
telebot_error_e telebot_core_restrict_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work ...
telebot_error_e telebot_core_unpin_chat_message(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this t...
telebot_error_e telebot_core_set_proxy(telebot_core_handler_t *core_h, const char *addr, const char *auth)
Set proxy address to use telebot behind proxy.
telebot_error_e telebot_core_send_voice(telebot_core_handler_t *core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send audio files, if you want Telegram clients to display the file as a playable voice message...
telebot_error_e telebot_core_forward_message(telebot_core_handler_t *core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id, telebot_core_response_t *response)
Forward messages of any kind.
struct telebot_core_response telebot_core_response_t
This object represents a telegram bot response.
telebot_error_e telebot_core_unban_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
Unban a previously kicked user in a supergroup or channel. The user will not return to the group or c...
This object represents a telegram bot response.
Definition: telebot-core.h:59
telebot_error_e telebot_core_edit_message_reply_markup(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup, telebot_core_response_t *response)
Edit only the reply markup of messages sent by the bot or via the bot (for inline bots)...
telebot_error_e telebot_core_send_video_note(telebot_core_handler_t *core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minut...
telebot_error_e telebot_core_set_chat_photo(telebot_core_handler_t *core_h, long long int chat_id, const char *photo, telebot_core_response_t *response)
Set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an a...
telebot_error_e telebot_core_send_venue(telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send information about a venue.
telebot_error_e telebot_core_send_location(telebot_core_handler_t *core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send point on the map.
telebot_error_e telebot_core_kick_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, long until_date, telebot_core_response_t *response)
Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels...
telebot_error_e telebot_core_get_file(telebot_core_handler_t *core_h, const char *file_id, telebot_core_response_t *response)
Get basic info about a file and prepare it for downloading. For the moment, bots can download files o...
telebot_error_e telebot_core_set_chat_description(telebot_core_handler_t *core_h, long long int chat_id, const char *description, telebot_core_response_t *response)
Change the description of a supergroup or a channel. The bot must be an administrator in the chat for...
telebot_error_e telebot_core_leave_chat(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Leave a group, supergroup or channel.
telebot_error_e telebot_core_delete_message(telebot_core_handler_t *core_h, long long int chat_id, int message_id, telebot_core_response_t *response)
Delete a message, including service messages, with the following limitations:
telebot_error_e telebot_core_get_updates(telebot_core_handler_t *core_h, int offset, int limit, int timeout, const char *allowed_updates, telebot_core_response_t *response)
Receive incoming updates (long polling). It will not work if an outgoing webhook is set up...
telebot_error_e telebot_core_send_chat_action(telebot_core_handler_t *core_h, long long int chat_id, const char *action, telebot_core_response_t *response)
Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less ...
char * data
Definition: telebot-core.h:61
telebot_error_e telebot_core_send_dice(telebot_core_handler_t *core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send a dice, which will have a random value from 1 to 6.
struct telebot_core_handler telebot_core_handler_t
This object represents a core telebot handler.
size_t size
Definition: telebot-core.h:60
telebot_error_e telebot_core_set_chat_permissions(telebot_core_handler_t *core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages, telebot_core_response_t *response)
Set default chat permissions for all members. The bot must be an administrator in the group or a supe...
telebot_error_e telebot_core_promote_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members, telebot_core_response_t *response)
Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat f...
telebot_error_e telebot_core_send_video(telebot_core_handler_t *core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send video files, Telegram clients support mp4 videos (other formats may be sent as Document)...
telebot_error_e telebot_core_send_document(telebot_core_handler_t *core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send general files.
telebot_error_e telebot_core_delete_webhook(telebot_core_handler_t *core_h, telebot_core_response_t *response)
Remove webhook integration if you decide to switch back to getUpdates.
telebot_error_e telebot_core_send_contact(telebot_core_handler_t *core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send phone contacts.
telebot_error_e telebot_core_send_animation(telebot_core_handler_t *core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup, telebot_core_response_t *response)
Send animation files (GIF or H.264/MPEG-4 AVC without sound).
telebot_error_e telebot_core_get_chat_member(telebot_core_handler_t *core_h, long long int chat_id, int user_id, telebot_core_response_t *response)
Get information about a member of a chat.
telebot_error_e telebot_core_pin_chat_message(telebot_core_handler_t *core_h, long long int chat_id, int message_id, bool disable_notification, telebot_core_response_t *response)
Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to ...
telebot_error_e telebot_core_edit_message_live_location(telebot_core_handler_t *core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup, telebot_core_response_t *response)
Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edite...
telebot_error_e telebot_core_set_chat_sticker_set(telebot_core_handler_t *core_h, long long int chat_id, const char *sticker_set_name, telebot_core_response_t *response)
Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this t...
telebot_error_e telebot_core_get_my_commands(telebot_core_handler_t *core_h, telebot_core_response_t *response)
Get the current list of the bot's commands..
telebot_error_e telebot_core_delete_chat_sticker_set(telebot_core_handler_t *core_h, long long int chat_id, telebot_core_response_t *response)
Delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this t...
telebot_error_e telebot_core_set_chat_admin_custom_title(telebot_core_handler_t *core_h, long long int chat_id, int user_id, const char *custom_title, telebot_core_response_t *response)
Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for ...
telebot_error_e telebot_core_set_webhook(telebot_core_handler_t *core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates, telebot_core_response_t *response)
Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for t...