Telebot 9.4
Library for Telegram bot API
Loading...
Searching...
No Matches
telebot-core.h
Go to the documentation of this file.
1/*
2 * telebot
3 *
4 * Copyright (c) 2015 Elmurod Talipov.
5 *
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef __TELEBOT_CORE_API_H__
20#define __TELEBOT_CORE_API_H__
21
22#include <stdbool.h>
23#include <pthread.h>
24#include "telebot-common.h"
25
26#ifdef __cplusplus
27extern "C"
28{
29#endif
30
51typedef struct telebot_core_handler *telebot_core_handler_t;
52
56typedef struct telebot_core_response *telebot_core_response_t;
57
65
73
79
92
104
114 const char *auth);
115
124
147 int offset, int limit, int timeout, const char *allowed_updates);
148
171 const char *url, const char *certificate, int max_connections,
172 const char *allowed_updates);
173
183
193
204
225 long long int chat_id, const char *text, const char *parse_mode,
226 bool disable_web_page_preview, bool disable_notification,
227 int reply_to_message_id, const char *reply_markup);
228
245 long long int chat_id, long long int from_chat_id, bool disable_notification,
246 int message_id);
247
271 long long int chat_id, const char *photo, bool is_file, const char *caption,
272 const char *parse_mode, bool disable_notification, int reply_to_message_id,
273 const char *reply_markup);
274
310 long long int chat_id, const char *audio, bool is_file, const char *caption,
311 const char *parse_mode, int duration, const char *performer, const char *title,
312 const char *thumb, bool disable_notification, int reply_to_message_id,
313 const char *reply_markup);
314
341 long long int chat_id, const char *document, bool is_file, const char *thumb,
342 const char *caption, const char *parse_mode, bool disable_notification,
343 int reply_to_message_id, const char *reply_markup);
344
376 long long int chat_id, const char *video, bool is_file, int duration,
377 int width, int height, const char *thumb, const char *caption,
378 const char *parse_mode, bool supports_streaming, bool disable_notification,
379 int reply_to_message_id, const char *reply_markup);
380
409 long long int chat_id, const char *animation, bool is_file, int duration,
410 int width, int height, const char *thumb, const char *caption,
411 const char *parse_mode, bool disable_notification, int reply_to_message_id,
412 const char *reply_markup);
413
438 long long int chat_id, const char *voice, bool is_file, const char *caption,
439 const char *parse_mode, int duration, bool disable_notification,
440 int reply_to_message_id, const char *reply_markup);
441
468 long long int chat_id, char *video_note, bool is_file, int duration, int length,
469 const char *thumb, bool disable_notification, int reply_to_message_id,
470 const char *reply_markup);
471
487 long long int chat_id, char *media_paths[], int count, bool disable_notification,
488 int reply_to_message_id);
489
510 long long int chat_id, float latitude, float longitude, int live_period,
511 bool disable_notification, int reply_to_message_id, const char *reply_markup);
512
533 long long int chat_id, int message_id, const char *inline_message_id,
534 float latitude, float longitude, const char *reply_markup);
535
553 long long int chat_id, int message_id, char *inline_message_id,
554 const char *reply_markup);
555
579 long long int chat_id, float latitude, float longitude, const char *title,
580 const char *address, const char *foursquare_id, const char *foursquare_type,
581 bool disable_notification, int reply_to_message_id, const char *reply_markup);
582
604 long long int chat_id, const char *phone_number, const char *first_name,
605 const char *last_name, const char *vcard, bool disable_notification,
606 int reply_to_message_id, const char *reply_markup);
607
636 long long int chat_id, const char *question, const char *options,
637 bool is_anonymous, const char *type, bool allows_multiple_answers,
638 int correct_option_id, bool is_closed, bool disable_notification,
639 int reply_to_message_id, const char *reply_markup);
640
658 long long int chat_id, bool disable_notification,
659 int reply_to_message_id, const char *reply_markup);
660
684 long long int chat_id, const char *action);
685
700 int user_id, int offset, int limit);
701
713
726 const char *file_path, const char *out_file);
727
747 long long int chat_id, int user_id, long until_date);
748
763 long long int chat_id, int user_id);
764
799 long long int chat_id, int user_id, long until_date, bool can_send_messages,
800 bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages,
801 bool can_add_web_page_previews, bool can_change_info, bool can_invite_users,
802 bool can_pin_messages);
803
836 long long int chat_id, int user_id, bool can_change_info, bool can_post_messages,
837 bool can_edit_messages, bool can_delete_messages, bool can_invite_users,
838 bool can_restrict_members, bool can_pin_messages, bool can_promote_members);
839
856 long long int chat_id, int user_id, const char *custom_title);
857
888 long long int chat_id, bool can_send_messages, bool can_send_media_messages,
889 bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews,
890 bool can_change_info, bool can_invite_users, bool can_pin_messages);
891
905 long long int chat_id);
906
921 long long int chat_id, const char *photo);
922
936 long long int chat_id);
937
952 long long int chat_id, const char *title);
953
968 long long int chat_id, const char *description);
969
987 long long int chat_id, int message_id, bool disable_notification);
988
1002 long long int chat_id);
1003
1015
1028 long long int chat_id);
1029
1044 long long int chat_id);
1045
1057 long long int chat_id);
1058
1071 long long int chat_id, int user_id);
1072
1089 long long int chat_id, const char *sticker_set_name);
1090
1105 long long int chat_id);
1106
1130 const char *callback_query_id, const char *text, bool show_alert,
1131 const char *url, int cache_time);
1132
1144 const char *commands);
1145
1155
1176 long long int chat_id, int message_id, const char *inline_message_id,
1177 const char *text, const char *parse_mode, bool disable_web_page_preview,
1178 const char *reply_markup);
1179
1197 long long int chat_id, int message_id, const char *inline_message_id,
1198 const char *caption, const char *parse_mode, const char *reply_markup);
1199
1217 long long int chat_id, int message_id, const char *inline_message_id,
1218 const char *reply_markup);
1219
1233 long long int chat_id, int message_id, const char *inline_message_id,
1234 const char *media, const char *reply_markup);
1235
1252 long long int chat_id, int message_id, const char *reply_markup);
1253
1273 long long int chat_id, int message_id);
1274
1282
1290
1299 const char *name, const char *language_code);
1300
1308 const char *language_code);
1309
1318 const char *description, const char *language_code);
1319
1327 const char *language_code);
1328
1337 const char *short_description, const char *language_code);
1338
1346 const char *language_code);
1347
1356 long long int chat_id, const char *menu_button);
1357
1365 long long int chat_id);
1366
1375 const char *rights, bool for_channels);
1376
1384 bool for_channels);
1385
1394 const char *scope, const char *language_code);
1395
1413 long long int chat_id, long long int from_chat_id, int message_id,
1414 const char *caption, const char *parse_mode, const char *caption_entities,
1415 bool disable_notification, bool protect_content, int reply_to_message_id,
1416 bool allow_sending_without_reply, const char *reply_markup);
1417
1432 long long int chat_id, long long int from_chat_id, const char *message_ids,
1433 bool disable_notification, bool protect_content, bool remove_caption);
1434
1446 long long int chat_id, long long int from_chat_id, const char *message_ids,
1447 bool disable_notification, bool protect_content);
1448
1457 long long int chat_id, const char *message_ids);
1458
1469 long long int chat_id, int user_id, long until_date, bool revoke_messages);
1470
1479 long long int chat_id, long long int sender_chat_id);
1480
1489 long long int chat_id, long long int sender_chat_id);
1490
1502 long long int chat_id, const char *name, long expire_date, int member_limit,
1503 bool creates_join_request);
1504
1517 long long int chat_id, const char *invite_link, const char *name,
1518 long expire_date, int member_limit, bool creates_join_request);
1519
1528 long long int chat_id, const char *invite_link);
1529
1538 long long int chat_id, int user_id);
1539
1548 long long int chat_id, int user_id);
1549
1560 long long int chat_id, int message_id, const char *reaction, bool is_big);
1561
1572 long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id);
1573
1584 long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id);
1585
1594 long long int chat_id, int message_thread_id);
1595
1604 long long int chat_id, int message_thread_id);
1605
1614 long long int chat_id, int message_thread_id);
1615
1624 long long int chat_id, int message_thread_id);
1625
1632
1641 long long int chat_id, const char *name);
1642
1650 long long int chat_id);
1651
1659 long long int chat_id);
1660
1668 long long int chat_id);
1669
1677 long long int chat_id);
1678
1686 long long int chat_id);
1687
1695 const char *custom_emoji_ids);
1696
1705 const char *web_app_query_id, const char *result);
1706
1724 long long int chat_id, int star_count, const char *media, const char *caption,
1725 const char *parse_mode, const char *caption_entities, bool show_caption_above_media,
1726 bool disable_notification, bool protect_content, const char *reply_parameters,
1727 const char *reply_markup);
1728
1745 const char *inline_query_id, const char *results, int cache_time,
1746 bool is_personal, const char *next_offset, const char *button);
1747
1760 long long int user_id, const char *result, bool allow_user_chats,
1761 bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats);
1762
1776 long long int user_id, long long int chat_id, const char *gift_id,
1777 bool pay_for_upgrade, const char *text, const char *text_parse_mode,
1778 const char *text_entities);
1779
1792 long long int user_id, int month_count, int star_count, const char *text,
1793 const char *text_parse_mode, const char *text_entities);
1794
1801
1810 int offset, int limit);
1811
1820 long long int user_id, const char *telegram_payment_charge_id);
1821
1828
1838 long long int user_id, int offset, int limit);
1839
1849 long long int chat_id, int offset, int limit);
1850
1862 const char *gift_id, bool pay_for_upgrade, const char *text,
1863 const char *text_parse_mode, const char *text_entities);
1864
1874 long long int user_id, long long int chat_id, const char *gift_id);
1875
1883 const char *gift_id);
1884
1894 long long int user_id, int offset, int limit);
1895
1903 const char *photo);
1904
1912 const char *photo_id);
1913
1921 const char *business_connection_id);
1922
1931 long long int chat_id, long long int user_id);
1932
1937 long long int user_id, int score, bool force, bool disable_edit_message,
1938 long long int chat_id, int message_id, const char *inline_message_id);
1939
1944 long long int user_id, long long int chat_id, int message_id, const char *inline_message_id);
1945
1950 long long int chat_id, int message_thread_id, const char *game_short_name,
1951 bool disable_notification, bool protect_content, const char *reply_parameters,
1952 const char *reply_markup);
1953
1958 long long int user_id, const char *errors);
1959
1964 long long int chat_id, int message_thread_id, const char *title,
1965 const char *description, const char *payload, const char *provider_token,
1966 const char *currency, const char *prices, int max_tip_amount,
1967 const char *suggested_tip_amounts, const char *start_parameter,
1968 const char *provider_data, const char *photo_url, int photo_size,
1969 int photo_width, int photo_height, bool need_name, bool need_phone_number,
1970 bool need_email, bool need_shipping_address, bool send_phone_number_to_provider,
1971 bool send_email_to_provider, bool is_flexible, bool disable_notification,
1972 bool protect_content, const char *reply_parameters, const char *reply_markup);
1973
1978 const char *title, const char *description, const char *payload,
1979 const char *provider_token, const char *currency, const char *prices,
1980 int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data,
1981 const char *photo_url, int photo_size, int photo_width, int photo_height,
1982 bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address,
1983 bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible);
1984
1989 const char *shipping_query_id, bool ok, const char *shipping_options,
1990 const char *error_message);
1991
1996 const char *pre_checkout_query_id, bool ok, const char *error_message);
1997
2002#ifdef __cplusplus
2003}
2004#endif
2005
2006#endif /* __TELEBOT_CORE_API_H__ */
telebot_error_e
Enumerations of error code for telebot programming interface.
Definition telebot-common.h:45
telebot_core_response_t telebot_core_delete_chat_photo(telebot_core_handler_t core_h, long long int chat_id)
Delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in t...
telebot_core_response_t telebot_core_decline_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id)
Use this method to decline a chat join request.
telebot_core_response_t telebot_core_get_my_description(telebot_core_handler_t core_h, const char *language_code)
Use this method to get the current bot description for the given user language.
telebot_core_response_t telebot_core_unpin_all_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
Use this method to unpin all messages in a forum topic.
telebot_core_response_t telebot_core_send_location(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, int live_period, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send point on the map.
telebot_core_response_t telebot_core_answer_shipping_query(telebot_core_handler_t core_h, const char *shipping_query_id, bool ok, const char *shipping_options, const char *error_message)
Use this method to reply to shipping queries.
telebot_core_response_t telebot_core_reopen_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
Use this method to reopen a closed 'General' topic in a forum supergroup chat.
telebot_core_response_t telebot_core_close_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
Use this method to close an open 'General' topic in a forum supergroup chat.
telebot_core_response_t telebot_core_set_my_name(telebot_core_handler_t core_h, const char *name, const char *language_code)
Use this method to change the bot's name.
telebot_core_response_t telebot_core_send_venue(telebot_core_handler_t core_h, long long int chat_id, float latitude, float longitude, const char *title, const char *address, const char *foursquare_id, const char *foursquare_type, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send information about a venue.
telebot_core_response_t telebot_core_answer_inline_query(telebot_core_handler_t core_h, const char *inline_query_id, const char *results, int cache_time, bool is_personal, const char *next_offset, const char *button)
Use this method to send answers to an inline query.
struct telebot_core_response * telebot_core_response_t
Telebot core response opaque type.
Definition telebot-core.h:56
telebot_core_response_t telebot_core_unhide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
Use this method to unhide the 'General' topic in a forum supergroup chat.
telebot_core_response_t telebot_core_delete_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id)
Delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this t...
telebot_core_response_t telebot_core_set_chat_sticker_set(telebot_core_handler_t core_h, long long int chat_id, const char *sticker_set_name)
Set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this t...
telebot_core_response_t telebot_core_get_user_profile_photos(telebot_core_handler_t core_h, int user_id, int offset, int limit)
Get user profile pictures object.
telebot_core_response_t telebot_core_edit_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link, const char *name, long expire_date, int member_limit, bool creates_join_request)
Use this method to edit a non-primary invite link created by the bot.
telebot_core_response_t telebot_core_get_chat_members_count(telebot_core_handler_t core_h, long long int chat_id)
Get the number of members in a chat.
telebot_core_response_t telebot_core_restrict_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work ...
struct telebot_core_handler * telebot_core_handler_t
Telebot core handler opaque type.
Definition telebot-core.h:51
telebot_core_response_t telebot_core_send_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to send a gift.
telebot_core_response_t telebot_core_unpin_all_general_forum_topic_messages(telebot_core_handler_t core_h, long long int chat_id)
Use this method to unpin all messages in a General forum topic.
telebot_core_response_t telebot_core_get_my_short_description(telebot_core_handler_t core_h, const char *language_code)
Use this method to get the current bot short description for the given user language.
telebot_core_response_t telebot_core_set_my_profile_photo(telebot_core_handler_t core_h, const char *photo)
Use this method to set the bot's profile photo.
telebot_core_response_t telebot_core_get_my_star_balance(telebot_core_handler_t core_h)
Use this method to get the current Telegram Stars balance of the bot.
telebot_core_response_t telebot_core_copy_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content, bool remove_caption)
Use this method to copy messages of any kind. Service messages, giveaway messages,...
telebot_core_response_t telebot_core_pin_chat_message(telebot_core_handler_t core_h, long long int chat_id, int message_id, bool disable_notification)
Pin a message in a supergroup or a channel. The bot must be an administrator in the chat for this to ...
telebot_core_response_t telebot_core_set_chat_title(telebot_core_handler_t core_h, long long int chat_id, const char *title)
Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrat...
telebot_core_response_t telebot_core_gift_premium_subscription(telebot_core_handler_t core_h, long long int user_id, int month_count, int star_count, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to gift a Telegram Premium subscription to a user.
void telebot_core_put_response(telebot_core_response_t response)
Release response data obtained with telebot core methods.
telebot_core_response_t telebot_core_hide_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id)
Use this method to hide the 'General' topic in a forum supergroup chat.
telebot_core_response_t telebot_core_unban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
Use this method to unban a previously banned channel chat in a supergroup or a channel.
telebot_core_response_t telebot_core_upgrade_gift(telebot_core_handler_t core_h, const char *gift_id, bool pay_for_upgrade, const char *text, const char *text_parse_mode, const char *text_entities)
Use this method to upgrade a gift.
telebot_core_response_t telebot_core_forward_messages(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, const char *message_ids, bool disable_notification, bool protect_content)
Use this method to forward multiple messages of any kind.
const char * telebot_core_get_response_data(telebot_core_response_t response)
Get response data.
telebot_error_e telebot_core_get_proxy(telebot_core_handler_t core_h, char **addr)
Get currently used proxy address.
telebot_core_response_t telebot_core_set_chat_admin_custom_title(telebot_core_handler_t core_h, long long int chat_id, int user_id, const char *custom_title)
Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for ...
telebot_core_response_t telebot_core_send_contact(telebot_core_handler_t core_h, long long int chat_id, const char *phone_number, const char *first_name, const char *last_name, const char *vcard, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send phone contacts.
telebot_core_response_t telebot_core_send_paid_media(telebot_core_handler_t core_h, long long int chat_id, int star_count, const char *media, const char *caption, const char *parse_mode, const char *caption_entities, bool show_caption_above_media, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
Use this method to send paid media to a user.
telebot_core_response_t telebot_core_edit_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *name, const char *icon_custom_emoji_id)
Use this method to edit name and icon of a topic in a forum supergroup chat.
telebot_error_e telebot_core_create(telebot_core_handler_t *core_h, const char *token)
Start function to use telebot core APIs.
telebot_core_response_t telebot_core_send_video(telebot_core_handler_t core_h, long long int chat_id, const char *video, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool supports_streaming, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
telebot_core_response_t telebot_core_get_business_connection(telebot_core_handler_t core_h, const char *business_connection_id)
Use this method to get information about the business connection.
telebot_core_response_t telebot_core_close(telebot_core_handler_t core_h)
Use this method to close the bot instance before moving it from one local server to another.
telebot_core_response_t telebot_core_edit_message_reply_markup(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *reply_markup)
Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
telebot_core_response_t telebot_core_set_my_description(telebot_core_handler_t core_h, const char *description, const char *language_code)
Use this method to change the bot's description.
telebot_core_response_t telebot_core_get_my_commands(telebot_core_handler_t core_h)
Get the current list of the bot's commands..
telebot_core_response_t telebot_core_get_available_gifts(telebot_core_handler_t core_h)
Use this method to get a list of gifts that can be sent by the bot to users.
telebot_core_response_t telebot_core_export_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id)
Generate a new invite link for a chat; any previously generated link is revoked. The bot must be an a...
telebot_core_response_t telebot_core_get_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id)
Use this method to get the current value of the bot's menu button in a private chat,...
telebot_core_response_t telebot_core_set_my_default_administrator_rights(telebot_core_handler_t core_h, const char *rights, bool for_channels)
Use this method to change the default administrator rights requested by the bot when it's added as an...
telebot_core_response_t telebot_core_get_chat_admins(telebot_core_handler_t core_h, long long int chat_id)
Get a list of administrators in a chat. Response contains an array of objects that contains informati...
telebot_core_response_t telebot_core_delete_webhook(telebot_core_handler_t core_h)
Remove webhook integration if you decide to switch back to getUpdates.
telebot_core_response_t telebot_core_save_prepared_inline_message(telebot_core_handler_t core_h, long long int user_id, const char *result, bool allow_user_chats, bool allow_bot_chats, bool allow_group_chats, bool allow_channel_chats)
Use this method to save a prepared inline message.
telebot_core_response_t telebot_core_set_game_score(telebot_core_handler_t core_h, long long int user_id, int score, bool force, bool disable_edit_message, long long int chat_id, int message_id, const char *inline_message_id)
Use this method to set the score of the specified user in a game.
telebot_core_response_t telebot_core_create_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name, int icon_color, const char *icon_custom_emoji_id)
Use this method to create a topic in a forum supergroup chat.
telebot_core_response_t telebot_core_edit_message_text(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *text, const char *parse_mode, bool disable_web_page_preview, const char *reply_markup)
Edit text and game messages sent by the bot or via the bot (for inline bots).
telebot_core_response_t telebot_core_set_my_commands(telebot_core_handler_t core_h, const char *commands)
Change the list of the bot's commands.
telebot_core_response_t telebot_core_get_my_name(telebot_core_handler_t core_h, const char *language_code)
Use this method to get the current bot name for the given user language.
telebot_core_response_t telebot_core_set_webhook(telebot_core_handler_t core_h, const char *url, const char *certificate, int max_connections, const char *allowed_updates)
Specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for t...
telebot_core_response_t telebot_core_reopen_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
Use this method to reopen a closed topic in a forum supergroup chat.
telebot_core_response_t telebot_core_delete_messages(telebot_core_handler_t core_h, long long int chat_id, const char *message_ids)
Use this method to delete multiple messages in a chat.
telebot_core_response_t telebot_core_set_chat_description(telebot_core_handler_t core_h, long long int chat_id, const char *description)
Change the description of a supergroup or a channel. The bot must be an administrator in the chat for...
telebot_core_response_t telebot_core_get_forum_topic_icon_stickers(telebot_core_handler_t core_h)
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
telebot_core_response_t telebot_core_approve_chat_join_request(telebot_core_handler_t core_h, long long int chat_id, int user_id)
Use this method to approve a chat join request.
telebot_core_response_t telebot_core_send_video_note(telebot_core_handler_t core_h, long long int chat_id, char *video_note, bool is_file, int duration, int length, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send video messages. As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minut...
telebot_core_response_t telebot_core_stop_poll(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reply_markup)
Stop a poll which was sent by the bot.
telebot_core_response_t telebot_core_get_updates(telebot_core_handler_t core_h, int offset, int limit, int timeout, const char *allowed_updates)
Receive incoming updates (long polling). It will not work if an outgoing webhook is set up....
telebot_core_response_t telebot_core_set_passport_data_errors(telebot_core_handler_t core_h, long long int user_id, const char *errors)
Use this method to set passport data errors.
telebot_core_response_t telebot_core_convert_gift_to_stars(telebot_core_handler_t core_h, const char *gift_id)
Use this method to convert a gift to Telegram Stars.
telebot_core_response_t telebot_core_get_user_profile_audios(telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
Use this method to get user profile audios.
telebot_core_response_t telebot_core_edit_message_media(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *media, const char *reply_markup)
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of...
telebot_core_response_t telebot_core_refund_star_payment(telebot_core_handler_t core_h, long long int user_id, const char *telegram_payment_charge_id)
Use this method to refund a successful payment in Telegram Stars.
telebot_core_response_t telebot_core_delete_my_commands(telebot_core_handler_t core_h, const char *scope, const char *language_code)
Use this method to delete the list of the bot's commands for the given scope and user language.
telebot_core_response_t telebot_core_send_chat_action(telebot_core_handler_t core_h, long long int chat_id, const char *action)
Tell the user that something is happening on the bot's side. The status is set for 5 seconds or less ...
telebot_core_response_t telebot_core_get_webhook_info(telebot_core_handler_t core_h)
Get current webhook status.
telebot_core_response_t telebot_core_unban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id)
Unban a previously kicked user in a supergroup or channel. The user will not return to the group or c...
telebot_core_response_t telebot_core_get_file(telebot_core_handler_t core_h, const char *file_id)
Get basic info about a file and prepare it for downloading. For the moment, bots can download files o...
telebot_core_response_t telebot_core_get_user_gifts(telebot_core_handler_t core_h, long long int user_id, int offset, int limit)
Use this method to get a list of gifts received by a user.
telebot_core_response_t telebot_core_send_animation(telebot_core_handler_t core_h, long long int chat_id, const char *animation, bool is_file, int duration, int width, int height, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send animation files (GIF or H.264/MPEG-4 AVC without sound).
telebot_core_response_t telebot_core_send_message(telebot_core_handler_t core_h, long long int chat_id, const char *text, const char *parse_mode, bool disable_web_page_preview, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send text messages.
telebot_core_response_t telebot_core_delete_message(telebot_core_handler_t core_h, long long int chat_id, int message_id)
Delete a message, including service messages, with the following limitations:
telebot_core_response_t telebot_core_create_invoice_link(telebot_core_handler_t core_h, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible)
Use this method to create a link for an invoice.
telebot_core_response_t telebot_core_edit_message_caption(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, const char *caption, const char *parse_mode, const char *reply_markup)
Edit captions of messages sent by the bot or via the bot (for inline bots).
telebot_error_e telebot_core_set_proxy(telebot_core_handler_t core_h, const char *addr, const char *auth)
Set proxy address to use telebot behind proxy.
telebot_core_response_t telebot_core_answer_web_app_query(telebot_core_handler_t core_h, const char *web_app_query_id, const char *result)
Use this method to send answers to an inline query to a user from a Web App.
telebot_core_response_t telebot_core_delete_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
telebot_core_response_t telebot_core_forward_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, bool disable_notification, int message_id)
Forward messages of any kind.
telebot_error_e telebot_core_destroy(telebot_core_handler_t *core_h)
Final function to use telebot core APIs.
telebot_core_response_t telebot_core_edit_general_forum_topic(telebot_core_handler_t core_h, long long int chat_id, const char *name)
Use this method to edit the name of the 'General' topic in a forum supergroup chat.
telebot_core_response_t telebot_core_send_poll(telebot_core_handler_t core_h, long long int chat_id, const char *question, const char *options, bool is_anonymous, const char *type, bool allows_multiple_answers, int correct_option_id, bool is_closed, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send a native poll.
telebot_core_response_t telebot_core_send_document(telebot_core_handler_t core_h, long long int chat_id, const char *document, bool is_file, const char *thumb, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send general files.
telebot_core_response_t telebot_core_set_chat_menu_button(telebot_core_handler_t core_h, long long int chat_id, const char *menu_button)
Use this method to change the bot's menu button in a private chat, or the default menu button.
telebot_core_response_t telebot_core_send_audio(telebot_core_handler_t core_h, long long int chat_id, const char *audio, bool is_file, const char *caption, const char *parse_mode, int duration, const char *performer, const char *title, const char *thumb, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send audio files. if you want Telegram clients to display them in the music player....
telebot_core_response_t telebot_core_create_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *name, long expire_date, int member_limit, bool creates_join_request)
Use this method to create an additional invite link for a chat.
telebot_core_response_t telebot_core_ban_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date, bool revoke_messages)
Use this method to ban a user in a group, a supergroup or a channel.
telebot_core_response_t telebot_core_unpin_chat_message(telebot_core_handler_t core_h, long long int chat_id)
Unpin a message in a supergroup or a channel. The bot must be an administrator in the chat for this t...
telebot_core_response_t telebot_core_get_chat_gifts(telebot_core_handler_t core_h, long long int chat_id, int offset, int limit)
Use this method to get a list of gifts received by a chat.
telebot_core_response_t telebot_core_get_game_high_scores(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, int message_id, const char *inline_message_id)
Use this method to get data for high score tables.
telebot_core_response_t telebot_core_get_me(telebot_core_handler_t core_h)
Get basic information about the bot.
telebot_core_response_t telebot_core_stop_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, char *inline_message_id, const char *reply_markup)
Stop updating a live location message sent by the bot or via the bot (for inline bots) before live_pe...
telebot_core_response_t telebot_core_get_star_transactions(telebot_core_handler_t core_h, int offset, int limit)
Use this method to get the bot's Telegram Star transactions.
telebot_core_response_t telebot_core_get_chat(telebot_core_handler_t core_h, long long int chat_id)
Get up to date information about the chat (current name of the user for one-on-one conversations,...
telebot_core_response_t telebot_core_send_game(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *game_short_name, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
Use this method to send a game.
telebot_core_response_t telebot_core_promote_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, bool can_change_info, bool can_post_messages, bool can_edit_messages, bool can_delete_messages, bool can_invite_users, bool can_restrict_members, bool can_pin_messages, bool can_promote_members)
Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat f...
telebot_core_response_t telebot_core_set_my_short_description(telebot_core_handler_t core_h, const char *short_description, const char *language_code)
Use this method to change the bot's short description.
telebot_core_response_t telebot_core_send_invoice(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id, const char *title, const char *description, const char *payload, const char *provider_token, const char *currency, const char *prices, int max_tip_amount, const char *suggested_tip_amounts, const char *start_parameter, const char *provider_data, const char *photo_url, int photo_size, int photo_width, int photo_height, bool need_name, bool need_phone_number, bool need_email, bool need_shipping_address, bool send_phone_number_to_provider, bool send_email_to_provider, bool is_flexible, bool disable_notification, bool protect_content, const char *reply_parameters, const char *reply_markup)
Use this method to send an invoice.
telebot_core_response_t telebot_core_revoke_chat_invite_link(telebot_core_handler_t core_h, long long int chat_id, const char *invite_link)
Use this method to revoke an invite link created by the bot.
telebot_core_response_t telebot_core_edit_message_live_location(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *inline_message_id, float latitude, float longitude, const char *reply_markup)
Edit live location messages sent by the bot or via the bot (for inline bots). A location can be edite...
telebot_core_response_t telebot_core_get_my_default_administrator_rights(telebot_core_handler_t core_h, bool for_channels)
Use this method to get the current default administrator rights of the bot.
telebot_core_response_t telebot_core_set_chat_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo)
Set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an a...
telebot_error_e telebot_core_get_response_code(telebot_core_response_t response)
Get response error code.
telebot_core_response_t telebot_core_copy_message(telebot_core_handler_t core_h, long long int chat_id, long long int from_chat_id, int message_id, const char *caption, const char *parse_mode, const char *caption_entities, bool disable_notification, bool protect_content, int reply_to_message_id, bool allow_sending_without_reply, const char *reply_markup)
Use this method to copy messages of any kind.
telebot_core_response_t telebot_core_ban_chat_sender_chat(telebot_core_handler_t core_h, long long int chat_id, long long int sender_chat_id)
Use this method to ban a channel chat in a supergroup or a channel.
telebot_core_response_t telebot_core_kick_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id, long until_date)
Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels,...
telebot_core_response_t telebot_core_transfer_gift(telebot_core_handler_t core_h, long long int user_id, long long int chat_id, const char *gift_id)
Use this method to transfer a gift.
telebot_core_response_t telebot_core_get_chat_member(telebot_core_handler_t core_h, long long int chat_id, int user_id)
Get information about a member of a chat.
telebot_core_response_t telebot_core_log_out(telebot_core_handler_t core_h)
Use this method to log out from the cloud Bot API server before launching the bot locally.
telebot_core_response_t telebot_core_get_user_chat_boosts(telebot_core_handler_t core_h, long long int chat_id, long long int user_id)
Use this method to get user chat boosts.
telebot_core_response_t telebot_core_get_custom_emoji_stickers(telebot_core_handler_t core_h, const char *custom_emoji_ids)
Use this method to get information about custom emoji stickers by their identifiers.
telebot_core_response_t telebot_core_close_forum_topic(telebot_core_handler_t core_h, long long int chat_id, int message_thread_id)
Use this method to close an open topic in a forum supergroup chat.
telebot_core_response_t telebot_core_send_media_group(telebot_core_handler_t core_h, long long int chat_id, char *media_paths[], int count, bool disable_notification, int reply_to_message_id)
Send a group of photos as an album.
telebot_core_response_t telebot_core_send_photo(telebot_core_handler_t core_h, long long int chat_id, const char *photo, bool is_file, const char *caption, const char *parse_mode, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send photos.
telebot_core_response_t telebot_core_set_message_reaction(telebot_core_handler_t core_h, long long int chat_id, int message_id, const char *reaction, bool is_big)
Use this method to set a new message reaction.
telebot_core_response_t telebot_core_send_dice(telebot_core_handler_t core_h, long long int chat_id, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send a dice, which will have a random value from 1 to 6.
telebot_core_response_t telebot_core_leave_chat(telebot_core_handler_t core_h, long long int chat_id)
Leave a group, supergroup or channel.
telebot_core_response_t telebot_core_set_chat_permissions(telebot_core_handler_t core_h, long long int chat_id, bool can_send_messages, bool can_send_media_messages, bool can_send_polls, bool can_send_other_messages, bool can_add_web_page_previews, bool can_change_info, bool can_invite_users, bool can_pin_messages)
Set default chat permissions for all members. The bot must be an administrator in the group or a supe...
telebot_core_response_t telebot_core_answer_pre_checkout_query(telebot_core_handler_t core_h, const char *pre_checkout_query_id, bool ok, const char *error_message)
Use this method to respond to pre-checkout queries.
telebot_core_response_t telebot_core_answer_callback_query(telebot_core_handler_t core_h, const char *callback_query_id, const char *text, bool show_alert, const char *url, int cache_time)
Send answers to callback queries sent from inline keyboards. The answer will be displayed to the user...
telebot_core_response_t telebot_core_remove_my_profile_photo(telebot_core_handler_t core_h, const char *photo_id)
Use this method to remove the bot's profile photo.
telebot_core_response_t telebot_core_send_voice(telebot_core_handler_t core_h, long long int chat_id, const char *voice, bool is_file, const char *caption, const char *parse_mode, int duration, bool disable_notification, int reply_to_message_id, const char *reply_markup)
Send audio files, if you want Telegram clients to display the file as a playable voice message....
telebot_error_e telebot_core_download_file(telebot_core_handler_t core_h, const char *file_path, const char *out_file)
Download file using file_path obtained with telebot_core_get_file(). It is guaranteed that the link w...
This file contains telegram bot common defintions.