tgbotxx 1.2.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
Api.hpp
Go to the documentation of this file.
1#pragma once
2#include <cpr/cpr.h>
3#include <functional>
4#include <nlohmann/json.hpp>
5#include <optional>
6#include <string>
8#include <variant>
9namespace nl = nlohmann;
10
11namespace tgbotxx {
13 struct User;
14 struct Message;
15 struct Update;
16 struct Chat;
17 struct MessageEntity;
18 struct IReplyMarkup;
19 struct MessageId;
20 struct InputMedia;
21 struct UserProfilePhotos;
22 struct File;
23 struct ChatMember;
24 struct ChatPermissions;
25 struct ChatInviteLink;
26 struct Sticker;
27 struct ForumTopic;
28 struct BotCommand;
29 struct BotCommandScope;
30 struct BotName;
32 struct BotDescription;
33 struct InlineQueryResult;
35 struct MenuButton;
37 struct WebhookInfo;
38 struct Poll;
39 struct InputPollOption;
40 struct LabeledPrice;
41 struct ShippingOption;
42 struct SentWebAppMessage;
43 struct ReplyParameters;
44 struct StickerSet;
45 struct InputSticker;
46 struct MaskPosition;
48 struct GameHighScore;
49 struct ReactionType;
50 struct LinkPreviewOptions;
52 struct InputChecklist;
53 struct UserChatBoosts;
54 struct Gifts;
55 struct InputProfilePhoto;
56 struct AcceptedGiftTypes;
57 struct StarAmount;
58 struct OwnedGifts;
59 struct InputStoryContent;
60 struct Story;
61 struct StoryArea;
62 struct StarTransactions;
63 struct InputPaidMedia;
64
75 class Api {
76 friend class Bot;
77
78 static const std::string DEFAULT_API_URL;
79 static const cpr::ConnectTimeout DEFAULT_CONNECT_TIMEOUT;
80 static const cpr::Timeout DEFAULT_TIMEOUT;
81 static const cpr::Timeout DEFAULT_LONG_POLL_TIMEOUT;
82 static const cpr::Timeout DEFAULT_UPLOAD_FILES_TIMEOUT;
83 static const cpr::Timeout DEFAULT_DOWNLOAD_FILES_TIMEOUT;
84
85 const std::string m_token;
86 std::string m_apiUrl = DEFAULT_API_URL;
87 cpr::ConnectTimeout m_connectTimeout = DEFAULT_CONNECT_TIMEOUT;
88 cpr::Timeout m_timeout = DEFAULT_TIMEOUT;
89 cpr::Timeout m_longPollTimeout = DEFAULT_LONG_POLL_TIMEOUT;
90 std::int32_t m_updatesLimit = 100;
91 cpr::Timeout m_uploadFilesTimeout = DEFAULT_UPLOAD_FILES_TIMEOUT;
92 cpr::Timeout m_downloadFilesTimeout = DEFAULT_DOWNLOAD_FILES_TIMEOUT;
93 cpr::Proxies m_proxies = cpr::Proxies();
94 std::vector<std::string> m_allowedUpdates;
99 struct Cache {
100 explicit Cache(const Api& pApi) noexcept;
101
102 std::span<std::string> getBotCommands() const;
103 std::string_view getBotUsername() const;
104
105 const Api& api;
106 mutable std::string botUsername;
107 mutable std::vector<std::string> botCommands;
108 };
109 Cache m_cache;
110
111 public:
114 explicit Api(const std::string& token);
115
116 public:
121
128 bool logOut() const;
129
136 bool close() const;
137
160 Ptr<Message> sendMessage(const std::variant<std::int64_t, std::string>& chatId,
161 const std::string& text,
162 std::int32_t messageThreadId = 0,
163 const std::string& parseMode = "",
164 const std::vector<Ptr<MessageEntity>>& entities = std::vector<Ptr<MessageEntity>>(),
165 bool disableNotification = false,
166 bool protectContent = false,
167 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
168 const std::string& businessConnectionId = "",
169 std::int32_t directMessagesTopicId = 0,
170 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr,
171 bool allowPaidBroadcast = false,
172 const std::string& messageEffectId = "",
173 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
174 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
175
191 Ptr<Message> forwardMessage(const std::variant<std::int64_t, std::string>& chatId,
192 const std::variant<std::int64_t, std::string>& fromChatId,
193 std::int32_t messageId,
194 std::int32_t messageThreadId = 0,
195 bool disableNotification = false,
196 bool protectContent = false,
197 std::int32_t directMessagesTopicId = 0,
198 std::time_t videoStartTimestamp = 0,
199 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr) const;
200
201
218 std::vector<Ptr<MessageId>> forwardMessages(const std::variant<std::int64_t, std::string>& chatId,
219 const std::variant<std::int64_t, std::string>& fromChatId,
220 const std::vector<std::int32_t>& messageIds,
221 std::int32_t messageThreadId = 0,
222 bool disableNotification = false,
223 bool protectContent = false,
224 std::int32_t directMessagesTopicId = 0) const;
225
226
251 Ptr<MessageId> copyMessage(const std::variant<std::int64_t, std::string>& chatId,
252 const std::variant<std::int64_t, std::string>& fromChatId,
253 std::int32_t messageId,
254 std::int32_t messageThreadId = 0,
255 const std::string& caption = "",
256 const std::string& parseMode = "",
257 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
258 bool disableNotification = false,
259 bool protectContent = false,
260 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
261 std::int32_t directMessagesTopicId = 0,
262 std::time_t videoStartTimestamp = 0,
263 bool showCaptionAboveMedia = false,
264 bool allowPaidBroadcast = false,
265 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
266 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
267
287 std::vector<Ptr<MessageId>> copyMessages(const std::variant<std::int64_t, std::string>& chatId,
288 const std::variant<std::int64_t, std::string>& fromChatId,
289 const std::vector<std::int32_t>& messageIds,
290 std::int32_t messageThreadId = 0,
291 std::int32_t directMessagesTopicId = 0,
292 bool disableNotification = false,
293 bool protectContent = false,
294 bool removeCaption = false) const;
295
323 Ptr<Message> sendPhoto(const std::variant<std::int64_t, std::string>& chatId,
324 const std::variant<cpr::File, std::string>& photo,
325 std::int32_t messageThreadId = 0,
326 const std::string& caption = "",
327 const std::string& parseMode = "",
328 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
329 bool disableNotification = false,
330 bool protectContent = false,
331 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
332 const std::string& businessConnectionId = "",
333 std::int32_t directMessagesTopicId = 0,
334 bool showCaptionAboveMedia = false,
335 bool hasSpoiler = false,
336 bool allowPaidBroadcast = false,
337 const std::string& messageEffectId = "",
338 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
339 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
340
376 Ptr<Message> sendAudio(const std::variant<std::int64_t, std::string>& chatId,
377 const std::variant<cpr::File, std::string>& audio,
378 std::int32_t messageThreadId = 0,
379 const std::string& caption = "",
380 const std::string& parseMode = "",
381 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
382 std::time_t duration = 0,
383 const std::string& performer = "",
384 const std::string& title = "",
385 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
386 bool disableNotification = false,
387 bool protectContent = false,
388 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
389 const std::string& businessConnectionId = "",
390 std::int32_t directMessagesTopicId = 0,
391 bool allowPaidBroadcast = false,
392 const std::string& messageEffectId = "",
393 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
394 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
395
396
426 Ptr<Message> sendDocument(const std::variant<std::int64_t, std::string>& chatId,
427 const std::variant<cpr::File, std::string>& document,
428 std::int32_t messageThreadId = 0,
429 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
430 const std::string& caption = "",
431 const std::string& parseMode = "",
432 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
433 bool disableNotification = false,
434 bool protectContent = false,
435 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
436 const std::string& businessConnectionId = "",
437 std::int32_t directMessagesTopicId = 0,
438 bool disableContentTypeDetection = false,
439 bool allowPaidBroadcast = false,
440 const std::string& messageEffectId = "",
441 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
442 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
443
444
482 Ptr<Message> sendVideo(const std::variant<std::int64_t, std::string>& chatId,
483 const std::variant<cpr::File, std::string>& video,
484 std::int32_t messageThreadId = 0,
485 std::time_t duration = 0,
486 std::int32_t width = 0,
487 std::int32_t height = 0,
488 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
489 const std::variant<std::monostate, cpr::File, std::string>& cover = std::monostate{},
490 std::time_t startTimestamp = 0,
491 const std::string& caption = "",
492 const std::string& parseMode = "",
493 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
494 bool showCaptionAboveMedia = false,
495 bool hasSpoiler = false,
496 bool supportsStreaming = false,
497 bool disableNotification = false,
498 bool protectContent = false,
499 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
500 const std::string& businessConnectionId = "",
501 std::int32_t directMessagesTopicId = 0,
502 bool allowPaidBroadcast = false,
503 const std::string& messageEffectId = "",
505 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
506
507
538 Ptr<Message> sendAnimation(const std::variant<std::int64_t, std::string>& chatId,
539 const std::variant<cpr::File, std::string>& animation,
540 std::int32_t messageThreadId = 0,
541 std::time_t duration = 0,
542 std::int32_t width = 0,
543 std::int32_t height = 0,
544 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
545 const std::string& caption = "",
546 const std::string& parseMode = "",
547 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
548 bool disableNotification = false,
549 bool protectContent = false,
550 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
551 const std::string& businessConnectionId = "",
552 std::int32_t directMessagesTopicId = 0,
553 bool allowPaidBroadcast = false,
554 const std::string& messageEffectId = "",
556 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
557
558
582 Ptr<Message> sendVoice(const std::variant<std::int64_t, std::string>& chatId,
583 const std::variant<cpr::File, std::string>& voice,
584 std::int32_t messageThreadId = 0,
585 const std::string& caption = "",
586 const std::string& parseMode = "",
587 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
588 std::time_t duration = 0,
589 bool disableNotification = false,
590 bool protectContent = false,
591 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
592 const std::string& businessConnectionId = "",
593 std::int32_t directMessagesTopicId = 0,
594 bool allowPaidBroadcast = false,
595 const std::string& messageEffectId = "",
597 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
598
599
627 Ptr<Message> sendVideoNote(const std::variant<std::int64_t, std::string>& chatId,
628 const std::variant<cpr::File, std::string>& videoNote,
629 std::int32_t messageThreadId = 0,
630 std::time_t duration = 0,
631 std::int32_t length = 0,
632 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
633 bool disableNotification = false,
634 bool protectContent = false,
635 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
636 const std::string& businessConnectionId = "",
637 std::int32_t directMessagesTopicId = 0,
638 bool allowPaidBroadcast = false,
639 const std::string& messageEffectId = "",
641 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
642
643
665 Ptr<Message> sendPaidMedia(const std::variant<std::int64_t, std::string>& chatId,
666 std::int32_t starCount,
667 const std::vector<Ptr<InputPaidMedia>>& media,
668 const std::string& payload = "",
669 std::int32_t messageThreadId = 0,
670 const std::string& caption = "",
671 const std::string& parseMode = "",
672 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
673 bool showCaptionAboveMedia = false,
674 bool disableNotification = false,
675 bool protectContent = false,
676 bool allowPaidBroadcast = false,
677 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
678 const std::string& businessConnectionId = "",
679 std::int32_t directMessagesTopicId = 0,
681 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
682
697 std::vector<Ptr<Message>> sendMediaGroup(const std::variant<std::int64_t, std::string>& chatId,
698 const std::vector<Ptr<InputMedia>>& media,
699 std::int32_t messageThreadId = 0,
700 bool disableNotification = false,
701 bool protectContent = false,
702 const std::string& businessConnectionId = "",
703 std::int32_t directMessagesTopicId = 0,
704 bool allowPaidBroadcast = false,
705 const std::string& messageEffectId = "",
706 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
707
708
728 Ptr<Message> sendLocation(const std::variant<std::int64_t, std::string>& chatId,
729 float latitude,
730 float longitude,
731 std::int32_t messageThreadId = 0,
732 float horizontalAccuracy = 0.0f,
733 std::int32_t livePeriod = 0,
734 std::int32_t heading = 0,
735 std::int32_t proximityAlertRadius = 0,
736 bool disableNotification = false,
737 bool protectContent = false,
738 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
739 const std::string& businessConnectionId = "",
740 std::int32_t directMessagesTopicId = 0,
741 bool allowPaidBroadcast = false,
742 const std::string& messageEffectId = "",
744 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
745
746
769 Ptr<Message> sendVenue(const std::variant<std::int64_t, std::string>& chatId,
770 float latitude,
771 float longitude,
772 const std::string& title,
773 const std::string& address,
774 std::int32_t messageThreadId = 0,
775 const std::string& foursquareId = "",
776 const std::string& foursquareType = "",
777 const std::string& googlePlaceId = "",
778 const std::string& googlePlaceType = "",
779 bool disableNotification = false,
780 bool protectContent = false,
781 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
782 const std::string& businessConnectionId = "",
783 std::int32_t directMessagesTopicId = 0,
784 bool allowPaidBroadcast = false,
785 const std::string& messageEffectId = "",
787 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
788
806 Ptr<Message> sendContact(const std::variant<std::int64_t, std::string>& chatId,
807 const std::string& phoneNumber,
808 const std::string& firstName,
809 const std::string& lastName = "",
810 const std::string& vcard = "",
811 std::int32_t messageThreadId = 0,
812 bool disableNotification = false,
813 bool protectContent = false,
814 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
815 const std::string& businessConnectionId = "",
816 std::int32_t directMessagesTopicId = 0,
817 bool allowPaidBroadcast = false,
818 const std::string& messageEffectId = "",
820 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
821
847 Ptr<Message> sendPoll(const std::variant<std::int64_t, std::string>& chatId,
848 const std::string& question,
849 const std::vector<Ptr<InputPollOption>>& options,
850 std::int32_t messageThreadId = 0,
851 const std::string& questionParseMode = "",
852 const std::vector<Ptr<MessageEntity>>& questionEntities = std::vector<Ptr<MessageEntity>>(),
853 bool isAnonymous = true,
854 const std::string& type = "regular",
855 bool allowsMultipleAnswers = false,
856 std::int32_t correctOptionId = -1,
857 const std::string& explanation = "",
858 const std::string& explanationParseMode = "",
859 const std::vector<Ptr<MessageEntity>>& explanationEntities = std::vector<Ptr<MessageEntity>>(),
860 std::time_t openPeriod = 0,
861 std::time_t closeDate = 0,
862 bool isClosed = false,
863 bool disableNotification = false,
864 bool protectContent = false,
865 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
866 const std::string& businessConnectionId = "",
867 bool allowPaidBroadcast = false,
868 const std::string& messageEffectId = "",
869 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
870
871
882 Ptr<Message> sendChecklist(const std::variant<std::int64_t, std::string>& chatId,
883 const std::string& businessConnectionId,
884 const Ptr<InputChecklist>& checklist,
885 bool disableNotification = false,
886 bool protectContent = false,
887 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
888 const std::string& messageEffectId = "",
889 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
890
891
911 Ptr<Message> sendDice(const std::variant<std::int64_t, std::string>& chatId,
912 const std::string& emoji = "🎲",
913 std::int32_t messageThreadId = 0,
914 bool disableNotification = false,
915 bool protectContent = false,
916 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
917 const std::string& businessConnectionId = "",
918 std::int32_t directMessagesTopicId = 0,
919 bool allowPaidBroadcast = false,
920 const std::string& messageEffectId = "",
922 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
923
924
947 bool sendChatAction(const std::variant<std::int64_t, std::string>& chatId,
948 const std::string& action,
949 std::int32_t messageThreadId = 0,
950 const std::string& businessConnectionId = "") const;
951
952
964 bool setMessageReaction(const std::variant<std::int64_t, std::string>& chatId,
965 std::int32_t messageId,
966 const std::vector<Ptr<ReactionType>>& reaction = std::vector<Ptr<ReactionType>>(),
967 bool isBig = false) const;
968
969
978 std::int32_t offset = 0,
979 std::int32_t limit = 100) const;
980
981
991 Ptr<File> getFile(const std::string& fileId) const;
992
993
1003 std::string downloadFile(const std::string& filePath, const std::function<bool(cpr::cpr_off_t downloadTotal, cpr::cpr_off_t downloadNow)>& progressCallback = nullptr) const;
1004
1005
1018 bool banChatMember(const std::variant<std::int64_t, std::string>& chatId,
1019 std::int64_t userId,
1020 std::time_t untilDate = 0,
1021 bool revokeMessages = false) const;
1022
1023
1035 bool unbanChatMember(const std::variant<std::int64_t, std::string>& chatId,
1036 std::int64_t userId,
1037 bool onlyIfBanned = false) const;
1038
1039
1053 bool restrictChatMember(const std::variant<std::int64_t, std::string>& chatId,
1054 std::int64_t userId,
1055 const Ptr<ChatPermissions>& permissions,
1056 bool useIndependentChatPermissions = false,
1057 std::time_t untilDate = 0) const;
1058
1059
1085 bool promoteChatMember(const std::variant<std::int64_t, std::string>& chatId,
1086 std::int64_t userId,
1087 bool isAnonymous = false,
1088 bool canManageChat = false,
1089 bool canDeleteMessages = false,
1090 bool canManageVideoChats = false,
1091 bool canRestrictMembers = false,
1092 bool canPromoteMembers = false,
1093 bool canChangeInfo = false,
1094 bool canInviteUsers = false,
1095 bool canPostMessages = false,
1096 bool canEditMessages = false,
1097 bool canPinMessages = false,
1098 bool canPostStories = false,
1099 bool canEditStories = false,
1100 bool canDeleteStories = false,
1101 bool canManageTopics = false,
1102 bool canManageDirectMessages = false) const;
1103
1104
1112 bool setChatAdministratorCustomTitle(const std::variant<std::int64_t, std::string>& chatId,
1113 std::int64_t userId,
1114 const std::string& customTitle) const;
1115
1116
1127 bool banChatSenderChat(const std::variant<std::int64_t, std::string>& chatId,
1128 std::int64_t senderChatId) const;
1129
1130
1140 bool unbanChatSenderChat(const std::variant<std::int64_t, std::string>& chatId,
1141 std::int64_t senderChatId) const;
1142
1143
1155 bool setChatPermissions(const std::variant<std::int64_t, std::string>& chatId,
1156 const Ptr<ChatPermissions>& permissions,
1157 bool useIndependentChatPermissions = false) const;
1158
1159
1174 std::string exportChatInviteLink(const std::variant<std::int64_t, std::string>& chatId) const;
1175
1176
1189 Ptr<ChatInviteLink> createChatInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1190 const std::string& name = "",
1191 std::time_t expireDate = 0,
1192 std::int32_t memberLimit = 0,
1193 bool createsJoinRequest = false) const;
1194
1195
1208 Ptr<ChatInviteLink> editChatInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1209 const std::string& inviteLink,
1210 const std::string& name = "",
1211 std::time_t expireDate = 0,
1212 std::int32_t memberLimit = 0,
1213 bool createsJoinRequest = false) const;
1214
1226 Ptr<ChatInviteLink> createChatSubscriptionInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1227 std::time_t subscriptionPeriod,
1228 std::int32_t subscriptionPrice,
1229 const std::string& name = "") const;
1230
1240 Ptr<ChatInviteLink> editChatSubscriptionInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1241 const std::string& inviteLink,
1242 const std::string& name = "") const;
1243
1244
1253 Ptr<ChatInviteLink> revokeChatInviteLink(const std::variant<std::int64_t, std::string>& chatId, const std::string& inviteLink) const;
1254
1255
1264 bool approveChatJoinRequest(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1265
1266
1275 bool declineChatJoinRequest(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1276
1277
1286 bool setChatPhoto(const std::variant<std::int64_t, std::string>& chatId, const cpr::File& photo) const;
1287
1288
1296 bool deleteChatPhoto(const std::variant<std::int64_t, std::string>& chatId) const;
1297
1298
1306 bool setChatTitle(const std::variant<std::int64_t, std::string>& chatId, const std::string& title) const;
1307
1308
1316 bool setChatDescription(const std::variant<std::int64_t, std::string>& chatId, const std::string& description = "") const;
1317
1318
1331 bool pinChatMessage(const std::variant<std::int64_t, std::string>& chatId,
1332 std::int32_t messageId,
1333 bool disableNotification = false,
1334 const std::string& businessConnectionId = "") const;
1335
1336
1347 bool unpinChatMessage(const std::variant<std::int64_t, std::string>& chatId,
1348 std::int32_t messageId = 0,
1349 const std::string& businessConnectionId = "") const;
1350
1351
1360 bool unpinAllChatMessages(const std::variant<std::int64_t, std::string>& chatId) const;
1361
1362
1368 bool leaveChat(const std::variant<std::int64_t, std::string>& chatId) const;
1369
1370
1376 Ptr<Chat> getChat(const std::variant<std::int64_t, std::string>& chatId) const;
1377
1378
1384 std::vector<Ptr<ChatMember>> getChatAdministrators(const std::variant<std::int64_t, std::string>& chatId) const;
1385
1386
1392 std::int32_t getChatMemberCount(const std::variant<std::int64_t, std::string>& chatId) const;
1393
1394
1402 Ptr<ChatMember> getChatMember(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1403
1404
1414 bool setChatStickerSet(const std::variant<std::int64_t, std::string>& chatId, const std::string& stickerSetName) const;
1415
1416
1425 bool deleteChatStickerSet(const std::variant<std::int64_t, std::string>& chatId) const;
1426
1427
1435 std::vector<Ptr<Sticker>> getForumTopicIconStickers() const;
1436
1437
1449 Ptr<ForumTopic> createForumTopic(const std::variant<std::int64_t, std::string>& chatId,
1450 const std::string& name,
1451 std::int32_t iconColor = 0x000000,
1452 const std::string& iconCustomEmojiId = "") const;
1453
1454
1468 bool editForumTopic(const std::variant<std::int64_t, std::string>& chatId,
1469 std::int32_t messageThreadId,
1470 const std::string& name,
1471 const std::optional<std::string>& iconCustomEmojiId = std::nullopt) const;
1472
1473
1483 bool closeForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1484
1485
1495 bool reopenForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1496
1497
1507 bool deleteForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1508
1509
1518 bool unpinAllForumTopicMessages(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1519
1520
1528 bool editGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId, const std::string& name) const;
1529
1530
1537 bool closeGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1538
1539
1546 bool reopenGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1547
1548
1555 bool hideGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1556
1557
1564 bool unhideGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1565
1566
1573 bool unpinAllGeneralForumTopicMessages(const std::variant<std::int64_t, std::string>& chatId) const;
1574
1575
1592 bool answerCallbackQuery(const std::string& callbackQueryId,
1593 const std::string& text = "",
1594 bool showAlert = false,
1595 const std::string& url = "",
1596 std::time_t cacheTime = 0) const;
1597
1604 Ptr<UserChatBoosts> getUserChatBoosts(const std::variant<std::int64_t, std::string>& chatId,
1605 std::int64_t userId) const;
1606
1616 bool setMyCommands(const std::vector<Ptr<BotCommand>>& commands,
1617 const Ptr<BotCommandScope>& scope = nullptr,
1618 const std::string& languageCode = "") const;
1619
1620
1629 bool deleteMyCommands(const Ptr<BotCommandScope>& scope = nullptr, const std::string& languageCode = "") const;
1630
1631
1638 std::vector<Ptr<BotCommand>> getMyCommands(const Ptr<BotCommandScope>& scope = nullptr, const std::string& languageCode = "") const;
1639
1640
1647 bool setMyName(const std::string& name = "", const std::string& languageCode = "") const;
1648
1649
1655 Ptr<BotName> getMyName(const std::string& languageCode = "") const;
1656
1657
1664 bool setMyDescription(const std::string& description = "", const std::string& languageCode = "") const;
1665
1666
1672 Ptr<BotDescription> getMyDescription(const std::string& languageCode = "") const;
1673
1680 bool setMyShortDescription(const std::string& shortDescription = "", const std::string& languageCode = "") const;
1681
1687 Ptr<BotShortDescription> getMyShortDescription(const std::string& languageCode = "") const;
1688
1695 bool setChatMenuButton(const std::variant<std::int64_t, std::string>& chatId = std::string{}, const Ptr<MenuButton>& menuButton = nullptr) const;
1696
1702 Ptr<MenuButton> getChatMenuButton(const std::variant<std::int64_t, std::string>& chatId = std::string{}) const;
1703
1711 bool setMyDefaultAdministratorRights(const Ptr<ChatAdministratorRights>& rights = nullptr, bool forChannels = false) const;
1712
1719
1720 public: // Gifts
1726
1738 bool sendGift(const std::string& giftId,
1739 std::int64_t userId = 0,
1740 const std::variant<std::int64_t, std::string>& chatId = 0,
1741 bool payForUpgrade = false,
1742 const std::string& text = "",
1743 const std::string& textParseMode = "",
1744 const std::vector<Ptr<MessageEntity>>& textEntities = std::vector<Ptr<MessageEntity>>()) const;
1745
1758 bool giftPremiumSubscription(std::int64_t userId,
1759 std::int32_t monthCount,
1760 std::int32_t starCount,
1761 const std::string& text = "",
1762 const std::string& textParseMode = "",
1763 const std::vector<Ptr<MessageEntity>>& textEntities = std::vector<Ptr<MessageEntity>>()) const;
1764
1765 public: // Verification
1774 bool verifyUser(std::int64_t userId, const std::string& customDescription = "") const;
1775
1784 bool verifyChat(const std::variant<std::int64_t, std::string>& chatId, const std::string& customDescription = "") const;
1785
1792 bool removeUserVerification(std::int64_t userId) const;
1793
1800 bool removeChatVerification(const std::variant<std::int64_t, std::string>& chatId) const;
1801
1802 public: // Business
1811 bool readBusinessMessage(const std::string& businessConnectionId,
1812 const std::variant<std::int64_t, std::string>& chatId,
1813 std::int32_t messageId) const;
1814
1824 bool deleteBusinessMessages(const std::string& businessConnectionId,
1825 const std::vector<std::int32_t>& messageIds) const;
1826
1834 bool setBusinessAccountName(const std::string& businessConnectionId,
1835 const std::string& firstName,
1836 const std::string& lastName = "") const;
1837
1844 bool setBusinessAccountUsername(const std::string& businessConnectionId,
1845 const std::string& username = "") const;
1846
1853 bool setBusinessAccountBio(const std::string& businessConnectionId,
1854 const std::string& bio = "") const;
1855
1863 bool setBusinessAccountProfilePhoto(const std::string& businessConnectionId,
1864 const Ptr<InputProfilePhoto>& photo,
1865 bool isPublic = false) const;
1866
1874 bool removeBusinessAccountProfilePhoto(const std::string& businessConnectionId,
1875 bool isPublic = false) const;
1876
1884 bool setBusinessAccountGiftSettings(const std::string& businessConnectionId,
1885 bool showGiftButton,
1887
1894 Ptr<StarAmount> getBusinessAccountStarBalance(const std::string& businessConnectionId) const;
1895
1902 bool transferBusinessAccountStars(const std::string& businessConnectionId,
1903 std::int32_t starCount) const;
1904
1919 Ptr<OwnedGifts> getBusinessAccountGifts(const std::string& businessConnectionId,
1920 bool excludeUnsaved = false,
1921 bool excludeSaved = false,
1922 bool excludeUnlimited = false,
1923 bool excludeLimited = false,
1924 bool excludeUnique = false,
1925 bool sortByPrice = false,
1926 const std::string& offset = "",
1927 std::int32_t limit = 100) const;
1928
1935 bool convertGiftToStars(const std::string& businessConnectionId, const std::string& ownedGiftId) const;
1936
1947 bool upgradeGift(const std::string& businessConnectionId,
1948 const std::string& ownedGiftId,
1949 bool keepOriginalDetails = false,
1950 std::int32_t starCount = -1) const;
1951
1961 bool transferGift(const std::string& businessConnectionId,
1962 const std::string& ownedGiftId,
1963 std::int64_t newOwnerChatId,
1964 std::int32_t starCount = -1) const;
1965
1966 public: // Story
1980 Ptr<Story> postStory(const std::string& businessConnectionId,
1982 std::time_t activePeriod,
1983 const std::string& caption = "",
1984 const std::string& parseMode = "",
1985 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
1986 const std::vector<Ptr<StoryArea>>& areas = std::vector<Ptr<StoryArea>>(),
1987 bool postToChatPage = false,
1988 bool protectContent = false) const;
1989
2001 Ptr<Story> editStory(const std::string& businessConnectionId,
2002 std::int32_t storyId,
2004 const std::string& caption = "",
2005 const std::string& parseMode = "",
2006 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
2007 const std::vector<Ptr<StoryArea>>& areas = std::vector<Ptr<StoryArea>>()) const;
2008
2015 bool deleteStory(const std::string& businessConnectionId, std::int32_t storyId) const;
2016
2017 public:
2056 Ptr<Message> sendInvoice(const std::variant<std::int64_t, std::string>& chatId,
2057 const std::string& title,
2058 const std::string& description,
2059 const std::string& payload,
2060 const std::string& currency,
2061 const std::vector<Ptr<LabeledPrice>>& prices,
2062 const std::string& providerToken = "",
2063 std::int32_t messageThreadId = 0,
2064 std::int32_t maxTipAmount = 0,
2065 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
2066 const std::string& startParameter = "",
2067 const std::string& providerData = "",
2068 const std::string& photoUrl = "",
2069 std::int32_t photoSize = 0,
2070 std::int32_t photoWidth = 0,
2071 std::int32_t photoHeight = 0,
2072 bool needName = false,
2073 bool needPhoneNumber = false,
2074 bool needEmail = false,
2075 bool needShippingAddress = false,
2076 bool sendPhoneNumberToProvider = false,
2077 bool sendEmailToProvider = false,
2078 bool isFlexible = false,
2079 bool disableNotification = false,
2080 bool protectContent = false,
2081 bool allowPaidBroadcast = false,
2082 const std::string& messageEffectId = "",
2084 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2085
2121 std::string createInvoiceLink(const std::string& title,
2122 const std::string& description,
2123 const std::string& payload,
2124 const std::string& currency,
2125 const std::vector<Ptr<LabeledPrice>>& prices,
2126 const std::string& businessConnectionId = "",
2127 const std::string& providerToken = "",
2128 std::time_t subscriptionPeriod = 0,
2129 std::int32_t maxTipAmount = 0,
2130 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
2131 const std::string& providerData = "",
2132 const std::string& photoUrl = "",
2133 std::int32_t photoSize = 0,
2134 std::int32_t photoWidth = 0,
2135 std::int32_t photoHeight = 0,
2136 bool needName = false,
2137 bool needPhoneNumber = false,
2138 bool needEmail = false,
2139 bool needShippingAddress = false,
2140 bool sendPhoneNumberToProvider = false,
2141 bool sendEmailToProvider = false,
2142 bool isFlexible = false) const;
2143
2144
2156 bool answerShippingQuery(const std::string& shippingQueryId,
2157 bool ok,
2158 const std::vector<Ptr<ShippingOption>>& shippingOptions = std::vector<Ptr<ShippingOption>>(),
2159 const std::string& errorMessage = "") const;
2160
2161
2174 bool ok,
2175 const std::string& errorMessage = "") const;
2176
2183
2191 Ptr<StarTransactions> getStarTransactions(std::int32_t offset = 0, std::int32_t limit = 100) const;
2192
2199 bool refundStarPayment(std::int64_t userId, const std::string& telegramPaymentChargeId) const;
2200
2209 bool editUserStarSubscription(std::int64_t userId,
2210 const std::string& telegramPaymentChargeId,
2211 bool isCancelled) const;
2212
2213
2214 public:
2229 std::vector<Ptr<Update>> getUpdates(std::int32_t offset, const std::shared_ptr<std::atomic<bool>>& cancellationParam = nullptr) const;
2230
2256 bool setWebhook(const std::string& url,
2257 const std::optional<cpr::File>& certificate = std::nullopt,
2258 const std::string& ipAddress = "",
2259 std::int32_t maxConnections = 40,
2260 const std::vector<std::string>& allowedUpdates = std::vector<std::string>(),
2261 bool dropPendingUpdates = false,
2262 const std::string& secretToken = "") const;
2263
2271 bool deleteWebhook(bool dropPendingUpdates = false) const;
2272
2279
2280 public:
2297 Ptr<Message> editMessageText(const std::string& text,
2298 const std::variant<std::int64_t, std::string>& chatId = 0,
2299 std::int32_t messageId = 0,
2300 const std::string& inlineMessageId = "",
2301 const std::string& parseMode = "",
2302 const std::vector<Ptr<MessageEntity>>& entities = std::vector<Ptr<MessageEntity>>(),
2303 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2304 const std::string& businessConnectionId = "",
2305 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr) const;
2306
2307
2320 Ptr<Message> editMessageCaption(const std::variant<std::int64_t, std::string>& chatId = 0,
2321 std::int32_t messageId = 0,
2322 const std::string& inlineMessageId = "",
2323 const std::string& caption = "",
2324 const std::string& parseMode = "",
2325 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
2326 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2327 const std::string& businessConnectionId = "",
2328 bool showCaptionAboveMedia = false) const;
2329
2330
2343 const std::variant<std::int64_t, std::string>& chatId = 0,
2344 std::int32_t messageId = 0,
2345 const std::string& inlineMessageId = "",
2346 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2347 const std::string& businessConnectionId = "") const;
2348
2349
2366 float longitude,
2367 const std::variant<std::int64_t, std::string>& chatId = 0,
2368 std::int32_t messageId = 0,
2369 const std::string& inlineMessageId = "",
2370 std::int32_t livePeriod = 0,
2371 float horizontalAccuracy = 0.0f,
2372 std::int32_t heading = 0,
2373 std::int32_t proximityAlertRadius = 0,
2374 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2375 const std::string& businessConnectionId = "") const;
2376
2377
2386 Ptr<Message> stopMessageLiveLocation(const std::variant<std::int64_t, std::string>& chatId = 0,
2387 std::int32_t messageId = 0,
2388 const std::string& inlineMessageId = "",
2389 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2390 const std::string& businessConnectionId = "") const;
2391
2401 std::int32_t messageId,
2402 const Ptr<InputChecklist>& checklist,
2403 const std::string& businessConnectionId,
2404 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2405
2414 Ptr<Message> editMessageReplyMarkup(const std::variant<std::int64_t, std::string>& chatId = 0,
2415 std::int32_t messageId = 0,
2416 const std::string& inlineMessageId = "",
2417 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2418 const std::string& businessConnectionId = "") const;
2419
2420
2428 Ptr<Poll> stopPoll(const std::variant<std::int64_t, std::string>& chatId,
2429 std::int32_t messageId,
2430 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2431 const std::string& businessConnectionId = "") const;
2432
2433
2440 bool approveSuggestedPost(std::int64_t chatId,
2441 std::int32_t messageId,
2442 std::time_t sendDate = 0) const;
2443
2450 bool declineSuggestedPost(std::int64_t chatId,
2451 std::int32_t messageId,
2452 const std::string& comment = "") const;
2453
2468 bool deleteMessage(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageId) const;
2469
2476 bool deleteMessages(const std::variant<std::int64_t, std::string>& chatId, const std::vector<std::int32_t>& messageIds) const;
2477
2478 public:
2501 Ptr<Message> sendSticker(const std::variant<std::int64_t, std::string>& chatId,
2502 const std::variant<cpr::File, std::string>& sticker,
2503 std::int32_t messageThreadId = 0,
2504 const std::string& emoji = "",
2505 bool disableNotification = false,
2506 bool protectContent = false,
2507 const Ptr<ReplyParameters>& replyParameters = nullptr,
2508 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2509 const std::string& businessConnectionId = "",
2510 std::int32_t directMessagesTopicId = 0,
2511 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr,
2512 bool allowPaidBroadcast = false,
2513 const std::string& messageEffectId = "",
2515
2521 Ptr<StickerSet> getStickerSet(const std::string& name) const;
2522
2528 std::vector<Ptr<Sticker>> getCustomEmojiStickers(const std::vector<std::string>& customEmojiIds) const;
2529
2539 Ptr<File> uploadStickerFile(std::int64_t userId,
2540 const cpr::File& sticker,
2541 const std::string& stickerFormat) const;
2542
2557 bool createNewStickerSet(std::int64_t userId,
2558 const std::string& name,
2559 const std::string& title,
2560 const std::vector<Ptr<InputSticker>>& stickers,
2561 const std::string& stickerType = "regular",
2562 bool needsRepainting = false) const;
2563
2574 bool addStickerToSet(std::int64_t userId,
2575 const std::string& name,
2576 const Ptr<InputSticker>& sticker) const;
2577
2584 bool setStickerPositionInSet(const std::string& sticker, std::int32_t position) const;
2585
2591 bool deleteStickerFromSet(const std::string& sticker) const;
2592
2603 bool replaceStickerInSet(std::int64_t userId,
2604 const std::string& name,
2605 const std::string& oldSticker,
2606 const Ptr<InputSticker>& sticker) const;
2607
2615 bool setStickerEmojiList(const std::string& sticker, const std::vector<std::string>& emojiList) const;
2616
2624 bool setStickerKeywords(const std::string& sticker, const std::vector<std::string>& keywords = std::vector<std::string>()) const;
2625
2633 bool setStickerMaskPosition(const std::string& sticker,
2634 const Ptr<MaskPosition>& maskPosition = nullptr) const;
2635
2642 bool setStickerSetTitle(const std::string& name, const std::string& title) const;
2643
2660 bool setStickerSetThumbnail(const std::string& name,
2661 std::int64_t userId,
2662 const std::string& format,
2663 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{}) const;
2664
2672 bool setCustomEmojiStickerSetThumbnail(const std::string& name, const std::optional<std::string>& customEmojiId = std::nullopt) const;
2673
2679 bool deleteStickerSet(const std::string& name) const;
2680
2681 public:
2693 bool setPassportDataErrors(std::int64_t userId, const std::vector<Ptr<PassportElementError>>& errors) const;
2694
2695 public:
2708 Ptr<Message> sendGame(const std::variant<std::int64_t, std::string>& chatId,
2709 const std::string& gameShortName,
2710 std::int32_t messageThreadId = 0,
2711 bool disableNotification = false,
2712 bool protectContent = false,
2713 const Ptr<ReplyParameters>& replyParameters = nullptr,
2714 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2715
2727 Ptr<Message> setGameScore(std::int64_t userId,
2728 std::int32_t score,
2729 bool force = false,
2730 bool disableEditMessage = false,
2731 std::int64_t chatId = 0,
2732 std::int32_t messageId = 0,
2733 const std::string& inlineMessageId = "") const;
2734
2735
2747 std::vector<Ptr<GameHighScore>> getGameHighScores(std::int64_t userId,
2748 std::int64_t chatId = 0,
2749 std::int32_t messageId = 0,
2750 const std::string& inlineMessageId = "") const;
2751
2752 public:
2766 bool answerInlineQuery(const std::string& inlineQueryId,
2767 const std::vector<Ptr<InlineQueryResult>>& results,
2768 std::int32_t cacheTime = 300,
2769 bool isPersonal = false,
2770 const std::string& nextOffset = "",
2771 const Ptr<InlineQueryResultsButton>& button = nullptr) const;
2772
2773
2782
2783 public:
2785 void setUrl(const std::string& url) noexcept;
2787 const std::string& getUrl() const noexcept;
2788
2793
2799
2804
2809
2814
2819
2824
2829 void setAllowedUpdates(const std::vector<std::string>& allowedUpdates) noexcept;
2832
2836
2837 private:
2838 nl::json sendRequest(const std::string& endpoint,
2839 const cpr::Multipart& data = cpr::Multipart({}),
2840 const std::shared_ptr<std::atomic<bool>>& cancellationParam = nullptr) const;
2841 };
2842}
Api Methods https://core.telegram.org/bots/api#available-methods.
Definition Api.hpp:75
bool logOut() const
Use this method to log out from the cloud Bot API server before launching the bot locally....
bool setChatTitle(const std::variant< std::int64_t, std::string > &chatId, const std::string &title) const
Use this method to change the title of a chat. Titles can't be changed for private chats....
std::vector< Ptr< BotCommand > > getMyCommands(const Ptr< BotCommandScope > &scope=nullptr, const std::string &languageCode="") const
Use this method to get the current list of the bot's commands for the given scope and user language.
bool setBusinessAccountProfilePhoto(const std::string &businessConnectionId, const Ptr< InputProfilePhoto > &photo, bool isPublic=false) const
Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business...
Ptr< Gifts > getAvailableGifts() const
Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no paramet...
void setUpdatesLimit(const std::int32_t limit) noexcept
Set the number of long polling updates to be retrieved by getUpdates(). Values between 1-100 are acce...
Ptr< Message > editMessageCaption(const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", bool showCaptionAboveMedia=false) const
Use this method to edit captions of messages.
bool reopenGeneralForumTopic(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an adm...
Ptr< BotShortDescription > getMyShortDescription(const std::string &languageCode="") const
Use this method to get the current bot short description for the given user language.
std::vector< Ptr< Sticker > > getForumTopicIconStickers() const
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user....
cpr::Timeout getTimeout() const noexcept
Get Api requests timeout.
Ptr< Poll > stopPoll(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="") const
Use this method to stop a poll which was sent by the bot.
bool setChatPhoto(const std::variant< std::int64_t, std::string > &chatId, const cpr::File &photo) const
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats....
std::vector< Ptr< MessageId > > copyMessages(const std::variant< std::int64_t, std::string > &chatId, const std::variant< std::int64_t, std::string > &fromChatId, const std::vector< std::int32_t > &messageIds, std::int32_t messageThreadId=0, std::int32_t directMessagesTopicId=0, bool disableNotification=false, bool protectContent=false, bool removeCaption=false) const
Use this method to copy messages of any kind. /// If some of the specified messages can't be found or...
bool setBusinessAccountUsername(const std::string &businessConnectionId, const std::string &username="") const
Changes the first and last name of a managed business account. Requires the can_change_name business ...
void setUploadFilesTimeout(const cpr::Timeout &timeout) noexcept
Set Api file uploads timeout.
Ptr< Message > sendChecklist(const std::variant< std::int64_t, std::string > &chatId, const std::string &businessConnectionId, const Ptr< InputChecklist > &checklist, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &messageEffectId="", const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send a checklist on behalf of a connected business account. On success,...
bool unbanChatSenderChat(const std::variant< std::int64_t, std::string > &chatId, std::int64_t senderChatId) const
Use this method to unban a previously banned channel chat in a supergroup or channel....
Ptr< Message > sendAudio(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &audio, std::int32_t messageThreadId=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), std::time_t duration=0, const std::string &performer="", const std::string &title="", const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send audio files, if you want Telegram clients to display them in the music player...
Ptr< Message > editMessageText(const std::string &text, const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &entities=std::vector< Ptr< MessageEntity > >(), const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", const Ptr< LinkPreviewOptions > &linkPreviewOptions=nullptr) const
Use this method to edit text and game messages.
bool setChatMenuButton(const std::variant< std::int64_t, std::string > &chatId=std::string{}, const Ptr< MenuButton > &menuButton=nullptr) const
Use this method to change the bot's menu button in a private chat, or the default menu button.
Ptr< StickerSet > getStickerSet(const std::string &name) const
Use this method to get a sticker set. On success, a StickerSet object is returned.
bool sendChatAction(const std::variant< std::int64_t, std::string > &chatId, const std::string &action, std::int32_t messageThreadId=0, const std::string &businessConnectionId="") const
Use this method when you need to tell the user that something is happening on the bot's side....
Ptr< MenuButton > getChatMenuButton(const std::variant< std::int64_t, std::string > &chatId=std::string{}) const
Use this method to get the current value of the bot's menu button in a private chat,...
Ptr< ChatInviteLink > editChatInviteLink(const std::variant< std::int64_t, std::string > &chatId, const std::string &inviteLink, const std::string &name="", std::time_t expireDate=0, std::int32_t memberLimit=0, bool createsJoinRequest=false) const
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrato...
Ptr< Message > sendGame(const std::variant< std::int64_t, std::string > &chatId, const std::string &gameShortName, std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, const Ptr< ReplyParameters > &replyParameters=nullptr, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send a game.
bool deleteStickerSet(const std::string &name) const
Use this method to delete a sticker set that was created by the bot.
bool removeChatVerification(const std::variant< std::int64_t, std::string > &chatId) const
Removes verification from a chat that is currently verified on behalf of the organization represented...
void setTimeout(const cpr::Timeout &timeout)
Set Api requests timeout.
bool setChatDescription(const std::variant< std::int64_t, std::string > &chatId, const std::string &description="") const
Use this method to change the description of a group, a supergroup or a channel. The bot must be an a...
Ptr< StarTransactions > getStarTransactions(std::int32_t offset=0, std::int32_t limit=100) const
Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransa...
Ptr< Message > sendVideo(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &video, std::int32_t messageThreadId=0, std::time_t duration=0, std::int32_t width=0, std::int32_t height=0, const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}, const std::variant< std::monostate, cpr::File, std::string > &cover=std::monostate{}, std::time_t startTimestamp=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool showCaptionAboveMedia=false, bool hasSpoiler=false, bool supportsStreaming=false, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send video files, if you want Telegram clients to display them as a video message.
bool pinChatMessage(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId, bool disableNotification=false, const std::string &businessConnectionId="") const
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a priva...
bool setBusinessAccountName(const std::string &businessConnectionId, const std::string &firstName, const std::string &lastName="") const
Changes the first and last name of a managed business account. Requires the can_change_name business ...
Ptr< ChatInviteLink > createChatSubscriptionInviteLink(const std::variant< std::int64_t, std::string > &chatId, std::time_t subscriptionPeriod, std::int32_t subscriptionPrice, const std::string &name="") const
Use this method to create a subscription invite link for a channel chat. The bot must have the can_in...
cpr::Timeout getDownloadFilesTimeout() const noexcept
Get Api file downloads timeout.
Ptr< ForumTopic > createForumTopic(const std::variant< std::int64_t, std::string > &chatId, const std::string &name, std::int32_t iconColor=0x000000, const std::string &iconCustomEmojiId="") const
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the...
bool editUserStarSubscription(std::int64_t userId, const std::string &telegramPaymentChargeId, bool isCancelled) const
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars....
std::int32_t getChatMemberCount(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to get the number of members in a chat.
bool refundStarPayment(std::int64_t userId, const std::string &telegramPaymentChargeId) const
Refunds a successful payment in Telegram Stars. Returns True on success.
bool setStickerPositionInSet(const std::string &sticker, std::int32_t position) const
Use this method to move a sticker in a set created by the bot to a specific position.
bool verifyChat(const std::variant< std::int64_t, std::string > &chatId, const std::string &customDescription="") const
Verifies a chat on behalf of the organization which is represented by the bot.
Ptr< MessageId > copyMessage(const std::variant< std::int64_t, std::string > &chatId, const std::variant< std::int64_t, std::string > &fromChatId, std::int32_t messageId, std::int32_t messageThreadId=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, std::int32_t directMessagesTopicId=0, std::time_t videoStartTimestamp=0, bool showCaptionAboveMedia=false, bool allowPaidBroadcast=false, const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to copy messages of any kind. Service messages, paid media messages,...
void setAllowedUpdates(const std::vector< std::string > &allowedUpdates) noexcept
Ptr< OwnedGifts > getBusinessAccountGifts(const std::string &businessConnectionId, bool excludeUnsaved=false, bool excludeSaved=false, bool excludeUnlimited=false, bool excludeLimited=false, bool excludeUnique=false, bool sortByPrice=false, const std::string &offset="", std::int32_t limit=100) const
Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_s...
const cpr::Proxies & getProxies() const noexcept
Get Api requests proxy.
Ptr< ChatInviteLink > editChatSubscriptionInviteLink(const std::variant< std::int64_t, std::string > &chatId, const std::string &inviteLink, const std::string &name="") const
Use this method to edit a subscription invite link created by the bot. The bot must have the can_invi...
Api(const std::string &token)
Constructs Api object.
std::string createInvoiceLink(const std::string &title, const std::string &description, const std::string &payload, const std::string &currency, const std::vector< Ptr< LabeledPrice > > &prices, const std::string &businessConnectionId="", const std::string &providerToken="", std::time_t subscriptionPeriod=0, std::int32_t maxTipAmount=0, const std::vector< std::int32_t > &suggestedTipAmounts=std::vector< std::int32_t >(), const std::string &providerData="", const std::string &photoUrl="", std::int32_t photoSize=0, std::int32_t photoWidth=0, std::int32_t photoHeight=0, bool needName=false, bool needPhoneNumber=false, bool needEmail=false, bool needShippingAddress=false, bool sendPhoneNumberToProvider=false, bool sendEmailToProvider=false, bool isFlexible=false) const
Use this method to create a link for an invoice. Returns the created invoice link as std::string on s...
Ptr< BotDescription > getMyDescription(const std::string &languageCode="") const
Use this method to get the current bot description for the given user language.
Ptr< Story > postStory(const std::string &businessConnectionId, const Ptr< InputStoryContent > &content, std::time_t activePeriod, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), const std::vector< Ptr< StoryArea > > &areas=std::vector< Ptr< StoryArea > >(), bool postToChatPage=false, bool protectContent=false) const
Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot r...
void setDownloadFilesTimeout(const cpr::Timeout &timeout) noexcept
Set Api file downloads timeout.
bool transferBusinessAccountStars(const std::string &businessConnectionId, std::int32_t starCount) const
Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_tra...
bool setChatPermissions(const std::variant< std::int64_t, std::string > &chatId, const Ptr< ChatPermissions > &permissions, bool useIndependentChatPermissions=false) const
Use this method to set default chat permissions for all members. The bot must be an administrator in ...
bool transferGift(const std::string &businessConnectionId, const std::string &ownedGiftId, std::int64_t newOwnerChatId, std::int32_t starCount=-1) const
Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business ...
Ptr< Message > sendPhoto(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &photo, std::int32_t messageThreadId=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool showCaptionAboveMedia=false, bool hasSpoiler=false, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send photos. On success, the sent Message is returned.
const std::string & getUrl() const noexcept
Get Api URL.
bool giftPremiumSubscription(std::int64_t userId, std::int32_t monthCount, std::int32_t starCount, const std::string &text="", const std::string &textParseMode="", const std::vector< Ptr< MessageEntity > > &textEntities=std::vector< Ptr< MessageEntity > >()) const
Gifts a Telegram Premium subscription to the given user.
bool deleteMessages(const std::variant< std::int64_t, std::string > &chatId, const std::vector< std::int32_t > &messageIds) const
Use this method to delete multiple messages simultaneously. If some of the specified messages can't b...
bool readBusinessMessage(const std::string &businessConnectionId, const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId) const
Marks incoming message as read on behalf of a business account. Requires the can_read_messages busine...
bool deleteWebhook(bool dropPendingUpdates=false) const
Use this method to remove webhook integration if you decide to switch back to getUpdates.
const Cache & getCache() const noexcept
Get cached data about this bot e.g: username, commands... Use this when possible to avoid unnecessary...
bool unpinAllChatMessages(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat,...
bool setStickerSetThumbnail(const std::string &name, std::int64_t userId, const std::string &format, const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}) const
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail fi...
bool answerInlineQuery(const std::string &inlineQueryId, const std::vector< Ptr< InlineQueryResult > > &results, std::int32_t cacheTime=300, bool isPersonal=false, const std::string &nextOffset="", const Ptr< InlineQueryResultsButton > &button=nullptr) const
Use this method to send answers to an inline query. No more than 50 results per query are allowed.
bool banChatSenderChat(const std::variant< std::int64_t, std::string > &chatId, std::int64_t senderChatId) const
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned,...
bool unhideGeneralForumTopic(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administ...
Ptr< Message > editMessageReplyMarkup(const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="") const
Use this method to edit only the reply markup of messages.
bool verifyUser(std::int64_t userId, const std::string &customDescription="") const
Verifies a user on behalf of the organization which is represented by the bot.
bool createNewStickerSet(std::int64_t userId, const std::string &name, const std::string &title, const std::vector< Ptr< InputSticker > > &stickers, const std::string &stickerType="regular", bool needsRepainting=false) const
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker...
Ptr< ChatAdministratorRights > getMyDefaultAdministratorRights(bool forChannels=false) const
Use this method to get the current default administrator rights of the bot.
bool deleteStickerFromSet(const std::string &sticker) const
Use this method to delete a sticker from a set created by the bot.
bool setChatStickerSet(const std::variant< std::int64_t, std::string > &chatId, const std::string &stickerSetName) const
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in ...
bool unpinAllForumTopicMessages(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageThreadId) const
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrat...
bool answerShippingQuery(const std::string &shippingQueryId, bool ok, const std::vector< Ptr< ShippingOption > > &shippingOptions=std::vector< Ptr< ShippingOption > >(), const std::string &errorMessage="") const
If you sent an invoice requesting a shipping address and the parameter isFlexible was specified,...
bool setBusinessAccountBio(const std::string &businessConnectionId, const std::string &bio="") const
Changes the bio of a managed business account. Requires the can_change_bio business bot right.
Ptr< Message > sendDocument(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &document, std::int32_t messageThreadId=0, const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool disableContentTypeDetection=false, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send general files.
std::string exportChatInviteLink(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to generate a new primary invite link for a chat; any previously generated primary li...
bool setStickerSetTitle(const std::string &name, const std::string &title) const
Use this method to set the title of a created sticker set.
bool declineSuggestedPost(std::int64_t chatId, std::int32_t messageId, const std::string &comment="") const
Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_man...
bool setCustomEmojiStickerSetThumbnail(const std::string &name, const std::optional< std::string > &customEmojiId=std::nullopt) const
Use this method to set the thumbnail of a custom emoji sticker set.
Ptr< ChatInviteLink > createChatInviteLink(const std::variant< std::int64_t, std::string > &chatId, const std::string &name="", std::time_t expireDate=0, std::int32_t memberLimit=0, bool createsJoinRequest=false) const
Use this method to create an additional invite link for a chat. The bot must be an administrator in t...
bool editGeneralForumTopic(const std::variant< std::int64_t, std::string > &chatId, const std::string &name) const
Use this method to edit the name of the 'General' topic in a forum supergroup chat....
bool unpinChatMessage(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId=0, const std::string &businessConnectionId="") const
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a ...
bool setPassportDataErrors(std::int64_t userId, const std::vector< Ptr< PassportElementError > > &errors) const
Informs a user that some of the Telegram Passport elements they provided contains errors....
bool deleteMyCommands(const Ptr< BotCommandScope > &scope=nullptr, const std::string &languageCode="") const
Use this method to delete the list of the bot's commands for the given scope and user language....
Ptr< BotName > getMyName(const std::string &languageCode="") const
Use this method to get the current bot name for the given user language.
bool replaceStickerInSet(std::int64_t userId, const std::string &name, const std::string &oldSticker, const Ptr< InputSticker > &sticker) const
Use this method to replace an existing sticker in a sticker set with a new one. The method is equival...
bool convertGiftToStars(const std::string &businessConnectionId, const std::string &ownedGiftId) const
Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot...
bool editForumTopic(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageThreadId, const std::string &name, const std::optional< std::string > &iconCustomEmojiId=std::nullopt) const
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an admin...
Ptr< ChatInviteLink > revokeChatInviteLink(const std::variant< std::int64_t, std::string > &chatId, const std::string &inviteLink) const
Use this method to revoke an invite link created by the bot. If the primary link is revoked,...
Ptr< Message > sendPoll(const std::variant< std::int64_t, std::string > &chatId, const std::string &question, const std::vector< Ptr< InputPollOption > > &options, std::int32_t messageThreadId=0, const std::string &questionParseMode="", const std::vector< Ptr< MessageEntity > > &questionEntities=std::vector< Ptr< MessageEntity > >(), bool isAnonymous=true, const std::string &type="regular", bool allowsMultipleAnswers=false, std::int32_t correctOptionId=-1, const std::string &explanation="", const std::string &explanationParseMode="", const std::vector< Ptr< MessageEntity > > &explanationEntities=std::vector< Ptr< MessageEntity > >(), std::time_t openPeriod=0, std::time_t closeDate=0, bool isClosed=false, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send a native poll. On success, the sent Message is returned.
std::vector< Ptr< ChatMember > > getChatAdministrators(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to get a list of administrators in a chat, which aren't bots.
Ptr< Message > sendDice(const std::variant< std::int64_t, std::string > &chatId, const std::string &emoji="🎲", std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send an animated emoji that will display a random value. On success,...
bool closeForumTopic(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageThreadId) const
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator i...
cpr::Timeout getLongPollTimeout() const noexcept
Get long polling timeout.
bool setMyDescription(const std::string &description="", const std::string &languageCode="") const
Use this method to change the bot's description, which is shown in the chat with the bot if the chat ...
bool removeBusinessAccountProfilePhoto(const std::string &businessConnectionId, bool isPublic=false) const
Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo ...
bool deleteStory(const std::string &businessConnectionId, std::int32_t storyId) const
Deletes a story previously posted by the bot on behalf of a managed business account....
const std::vector< std::string > & getAllowedUpdates() const noexcept
Get list of the update types you want your bot to receive.
Ptr< Message > editMessageLiveLocation(float latitude, float longitude, const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", std::int32_t livePeriod=0, float horizontalAccuracy=0.0f, std::int32_t heading=0, std::int32_t proximityAlertRadius=0, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="") const
Use this method to edit live location messages. A location can be edited until its livePeriod expires...
Ptr< Message > forwardMessage(const std::variant< std::int64_t, std::string > &chatId, const std::variant< std::int64_t, std::string > &fromChatId, std::int32_t messageId, std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, std::int32_t directMessagesTopicId=0, std::time_t videoStartTimestamp=0, const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr) const
Use this method to forward messages of any kind. Service messages and messages with protected content...
bool unpinAllGeneralForumTopicMessages(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to clear the list of pinned messages in a General forum topic. The bot must be an adm...
bool approveSuggestedPost(std::int64_t chatId, std::int32_t messageId, std::time_t sendDate=0) const
Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_pos...
bool hideGeneralForumTopic(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administra...
std::vector< Ptr< Message > > sendMediaGroup(const std::variant< std::int64_t, std::string > &chatId, const std::vector< Ptr< InputMedia > > &media, std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send a group of photos, videos, or documents as an album. On success,...
Ptr< StarAmount > getBusinessAccountStarBalance(const std::string &businessConnectionId) const
Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts...
Ptr< File > uploadStickerFile(std::int64_t userId, const cpr::File &sticker, const std::string &stickerFormat) const
Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStick...
bool deleteChatStickerSet(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in ...
Ptr< Message > sendAnimation(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &animation, std::int32_t messageThreadId=0, std::time_t duration=0, std::int32_t width=0, std::int32_t height=0, const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send animation files (GIFs or H.264/MPEG-4 AVC videos without sound).
cpr::Timeout getUploadFilesTimeout() const noexcept
Get Api file uploads timeout.
bool leaveChat(const std::variant< std::int64_t, std::string > &chatId) const
Use this method for your bot to leave a group, supergroup or channel.
bool setMyDefaultAdministratorRights(const Ptr< ChatAdministratorRights > &rights=nullptr, bool forChannels=false) const
Use this method to change the default administrator rights requested by the bot when it's added as an...
Ptr< ChatMember > getChatMember(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId) const
Use this method to get information about a member of a chat. The method is only guaranteed to work fo...
bool deleteMessage(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId) const
Use this method to delete a message, including service messages, with the following limitations:
bool deleteForumTopic(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageThreadId) const
Use this method to delete a forum topic along with all its messages in a forum supergroup chat....
Ptr< Message > sendSticker(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &sticker, std::int32_t messageThreadId=0, const std::string &emoji="", bool disableNotification=false, bool protectContent=false, const Ptr< ReplyParameters > &replyParameters=nullptr, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, const Ptr< LinkPreviewOptions > &linkPreviewOptions=nullptr, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr) const
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success,...
void setProxies(const cpr::Proxies &proxies)
Set Api requests proxy.
bool sendGift(const std::string &giftId, std::int64_t userId=0, const std::variant< std::int64_t, std::string > &chatId=0, bool payForUpgrade=false, const std::string &text="", const std::string &textParseMode="", const std::vector< Ptr< MessageEntity > > &textEntities=std::vector< Ptr< MessageEntity > >()) const
Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the ...
std::vector< Ptr< Update > > getUpdates(std::int32_t offset, const std::shared_ptr< std::atomic< bool > > &cancellationParam=nullptr) const
Use this method to receive incoming updates using long polling.
bool setStickerKeywords(const std::string &sticker, const std::vector< std::string > &keywords=std::vector< std::string >()) const
Use this method to change search keywords assigned to a regular or custom emoji sticker....
bool answerPreCheckoutQuery(const std::string &preCheckoutQueryId, bool ok, const std::string &errorMessage="") const
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmat...
std::string downloadFile(const std::string &filePath, const std::function< bool(cpr::cpr_off_t downloadTotal, cpr::cpr_off_t downloadNow)> &progressCallback=nullptr) const
Use this method to download a file from Telegram and save it in memory. For the moment,...
bool setChatAdministratorCustomTitle(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, const std::string &customTitle) const
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
bool promoteChatMember(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, bool isAnonymous=false, bool canManageChat=false, bool canDeleteMessages=false, bool canManageVideoChats=false, bool canRestrictMembers=false, bool canPromoteMembers=false, bool canChangeInfo=false, bool canInviteUsers=false, bool canPostMessages=false, bool canEditMessages=false, bool canPinMessages=false, bool canPostStories=false, bool canEditStories=false, bool canDeleteStories=false, bool canManageTopics=false, bool canManageDirectMessages=false) const
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administ...
void setLongPollTimeout(const cpr::Timeout &longPollTimeout)
Set long polling timeout.
void setConnectTimeout(const cpr::ConnectTimeout &timeout) noexcept
Set Api requests connection timeout.
Ptr< Message > sendContact(const std::variant< std::int64_t, std::string > &chatId, const std::string &phoneNumber, const std::string &firstName, const std::string &lastName="", const std::string &vcard="", std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send phone contacts. On success, the sent Message is returned.
std::vector< Ptr< Sticker > > getCustomEmojiStickers(const std::vector< std::string > &customEmojiIds) const
Use this method to get information about custom emoji stickers by their identifiers.
bool deleteBusinessMessages(const std::string &businessConnectionId, const std::vector< std::int32_t > &messageIds) const
Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot r...
bool setStickerEmojiList(const std::string &sticker, const std::vector< std::string > &emojiList) const
Use this method to change the list of emoji assigned to a regular or custom emoji sticker....
bool unbanChatMember(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, bool onlyIfBanned=false) const
Use this method to unban a previously banned user in a supergroup or channel. The user will not retur...
Ptr< WebhookInfo > getWebhookInfo() const
Use this method to get current webhook status. Requires no parameters. On success,...
bool declineChatJoinRequest(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId) const
Use this method to decline a chat join request. The bot must be an administrator in the chat for this...
Ptr< UserProfilePhotos > getUserProfilePhotos(std::int64_t userId, std::int32_t offset=0, std::int32_t limit=100) const
Use this method to get a list of profile pictures for a user.
bool upgradeGift(const std::string &businessConnectionId, const std::string &ownedGiftId, bool keepOriginalDetails=false, std::int32_t starCount=-1) const
Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business ...
Ptr< Chat > getChat(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to get up to date information about the chat (current name of the user for one-on-one...
void setUrl(const std::string &url) noexcept
Set Api URL.
bool addStickerToSet(std::int64_t userId, const std::string &name, const Ptr< InputSticker > &sticker) const
Use this method to add a new sticker to a set created by the bot. The format of the added sticker mus...
bool setStickerMaskPosition(const std::string &sticker, const Ptr< MaskPosition > &maskPosition=nullptr) const
Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker s...
Ptr< UserChatBoosts > getUserChatBoosts(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId) const
Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in...
Ptr< Message > sendVenue(const std::variant< std::int64_t, std::string > &chatId, float latitude, float longitude, const std::string &title, const std::string &address, std::int32_t messageThreadId=0, const std::string &foursquareId="", const std::string &foursquareType="", const std::string &googlePlaceId="", const std::string &googlePlaceType="", bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send information about a venue. On success, the sent Message is returned.
Ptr< Message > sendLocation(const std::variant< std::int64_t, std::string > &chatId, float latitude, float longitude, std::int32_t messageThreadId=0, float horizontalAccuracy=0.0f, std::int32_t livePeriod=0, std::int32_t heading=0, std::int32_t proximityAlertRadius=0, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send a point on the map. On success, the sent Message is returned.
bool setBusinessAccountGiftSettings(const std::string &businessConnectionId, bool showGiftButton, const Ptr< AcceptedGiftTypes > &acceptedGiftTypes) const
Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo ...
Ptr< Message > sendPaidMedia(const std::variant< std::int64_t, std::string > &chatId, std::int32_t starCount, const std::vector< Ptr< InputPaidMedia > > &media, const std::string &payload="", std::int32_t messageThreadId=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), bool showCaptionAboveMedia=false, bool disableNotification=false, bool protectContent=false, bool allowPaidBroadcast=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send paid media. On success, an array of the sent Messages is returned.
bool banChatMember(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, std::time_t untilDate=0, bool revokeMessages=false) const
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and c...
bool removeUserVerification(std::int64_t userId) const
Removes verification from a user who is currently verified on behalf of the organization represented ...
bool setMyShortDescription(const std::string &shortDescription="", const std::string &languageCode="") const
Use this method to change the bot's short description, which is shown on the bot's profile page and i...
Ptr< Message > setGameScore(std::int64_t userId, std::int32_t score, bool force=false, bool disableEditMessage=false, std::int64_t chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="") const
Use this method to set the score of the specified user in a game message.
bool approveChatJoinRequest(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId) const
Use this method to approve a chat join request. The bot must be an administrator in the chat for this...
Ptr< File > getFile(const std::string &fileId) const
Use this method to get basic information about a file and prepare it for downloading....
bool setMyCommands(const std::vector< Ptr< BotCommand > > &commands, const Ptr< BotCommandScope > &scope=nullptr, const std::string &languageCode="") const
Use this method to change the list of the bot's commands. See this manual for more details about bot ...
Ptr< Message > editMessageMedia(const Ptr< InputMedia > &media, const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="") const
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of...
Ptr< Message > stopMessageLiveLocation(const std::variant< std::int64_t, std::string > &chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="") const
Use this method to stop updating a live location message before livePeriod expires.
bool answerCallbackQuery(const std::string &callbackQueryId, const std::string &text="", bool showAlert=false, const std::string &url="", std::time_t cacheTime=0) const
Use this method to send answers to callback queries sent from inline keyboards. The answer will be di...
std::int32_t getUpdatesLimit() const noexcept
Get Set the number of long polling updates to be retrieved by getUpdates().
Ptr< SentWebAppMessage > answerWebAppQuery(const std::string &webAppQueryId, const Ptr< InlineQueryResult > &result) const
Use this method to set the result of an interaction with a Web App and send a corresponding message o...
Ptr< User > getMe() const
A simple method for testing your bot's authentication token.
std::vector< Ptr< GameHighScore > > getGameHighScores(std::int64_t userId, std::int64_t chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="") const
Use this method to get data for high score tables.
Ptr< Story > editStory(const std::string &businessConnectionId, std::int32_t storyId, const Ptr< InputStoryContent > &content, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), const std::vector< Ptr< StoryArea > > &areas=std::vector< Ptr< StoryArea > >()) const
Edits a story previously posted by the bot on behalf of a managed business account....
bool closeGeneralForumTopic(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an admin...
bool close() const
Use this method to close the bot instance before moving it from one local server to another....
Ptr< Message > sendVideoNote(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &videoNote, std::int32_t messageThreadId=0, std::time_t duration=0, std::int32_t length=0, const std::variant< std::monostate, cpr::File, std::string > &thumbnail=std::monostate{}, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send video notes. On success, the sent Message is returned. As of v....
Ptr< Message > sendInvoice(const std::variant< std::int64_t, std::string > &chatId, const std::string &title, const std::string &description, const std::string &payload, const std::string &currency, const std::vector< Ptr< LabeledPrice > > &prices, const std::string &providerToken="", std::int32_t messageThreadId=0, std::int32_t maxTipAmount=0, const std::vector< std::int32_t > &suggestedTipAmounts=std::vector< std::int32_t >(), const std::string &startParameter="", const std::string &providerData="", const std::string &photoUrl="", std::int32_t photoSize=0, std::int32_t photoWidth=0, std::int32_t photoHeight=0, bool needName=false, bool needPhoneNumber=false, bool needEmail=false, bool needShippingAddress=false, bool sendPhoneNumberToProvider=false, bool sendEmailToProvider=false, bool isFlexible=false, bool disableNotification=false, bool protectContent=false, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send invoices.
std::vector< Ptr< MessageId > > forwardMessages(const std::variant< std::int64_t, std::string > &chatId, const std::variant< std::int64_t, std::string > &fromChatId, const std::vector< std::int32_t > &messageIds, std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, std::int32_t directMessagesTopicId=0) const
Use this method to forward multiple messages of any kind. If some of the specified messages can't be ...
bool setMyName(const std::string &name="", const std::string &languageCode="") const
Use this method to change the bot's name.
bool reopenForumTopic(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageThreadId) const
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator...
Ptr< Message > editMessageChecklist(std::int64_t chatId, std::int32_t messageId, const Ptr< InputChecklist > &checklist, const std::string &businessConnectionId, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to edit a checklist on behalf of a connected business account. On success,...
Ptr< Message > sendVoice(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &voice, std::int32_t messageThreadId=0, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &captionEntities=std::vector< Ptr< MessageEntity > >(), std::time_t duration=0, bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send audio files as voice messages. On success, the sent Message is returned.
bool setWebhook(const std::string &url, const std::optional< cpr::File > &certificate=std::nullopt, const std::string &ipAddress="", std::int32_t maxConnections=40, const std::vector< std::string > &allowedUpdates=std::vector< std::string >(), bool dropPendingUpdates=false, const std::string &secretToken="") const
Use this method to specify a URL and receive incoming updates via an outgoing webhook....
cpr::ConnectTimeout getConnectTimeout() const noexcept
Get Api requests connection timeout.
Ptr< Message > sendMessage(const std::variant< std::int64_t, std::string > &chatId, const std::string &text, std::int32_t messageThreadId=0, const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &entities=std::vector< Ptr< MessageEntity > >(), bool disableNotification=false, bool protectContent=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr, const std::string &businessConnectionId="", std::int32_t directMessagesTopicId=0, const Ptr< LinkPreviewOptions > &linkPreviewOptions=nullptr, bool allowPaidBroadcast=false, const std::string &messageEffectId="", const Ptr< SuggestedPostParameters > &suggestedPostParameters=nullptr, const Ptr< ReplyParameters > &replyParameters=nullptr) const
Use this method to send text messages. On success, the sent Message is returned.
bool setMessageReaction(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId, const std::vector< Ptr< ReactionType > > &reaction=std::vector< Ptr< ReactionType > >(), bool isBig=false) const
Use this method to change the chosen reactions on a message. Service messages can't be reacted to....
bool deleteChatPhoto(const std::variant< std::int64_t, std::string > &chatId) const
Use this method to delete a chat photo. Photos can't be changed for private chats....
bool restrictChatMember(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, const Ptr< ChatPermissions > &permissions, bool useIndependentChatPermissions=false, std::time_t untilDate=0) const
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergrou...
Ptr< StarAmount > getMyStarBalance() const
A method to get the current Telegram Stars balance of the bot. Requires no parameters....
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
This object describes the types of gifts that can be gifted to a user or a chat. https://core....
This object represents a bot command. https://core.telegram.org/bots/api#botcommand.
Definition BotCommand.hpp:8
Base class of all bot commands scopes This object represents the scope to which bot commands are appl...
This object represents the bot's description. https://core.telegram.org/bots/api#botdescription.
This object represents the bot's name. https://core.telegram.org/bots/api#botname.
Definition BotName.hpp:7
This object represents the bot's short description. https://core.telegram.org/bots/api#botshortdescri...
Represents the rights of an administrator in a chat. https://core.telegram.org/bots/api#chatadministr...
This object represents a chat. https://core.telegram.org/bots/api#chat.
Definition Chat.hpp:7
The base class of all chat members objects. This object contains information about one member of a ch...
Describes actions that a non-administrator user is allowed to take in a chat. https://core....
This object represents a file ready to be downloaded.
Definition File.hpp:13
This object represents a forum topic. https://core.telegram.org/bots/api#forumtopic.
Definition ForumTopic.hpp:7
This object represents one row of the high scores table for a game. https://core.telegram....
This object represents a list of gifts. https://core.telegram.org/bots/api#gifts.
Definition Gifts.hpp:9
The interface of reply markup objects InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove ...
Base class of all inline query results This object represents one result of an inline query....
This object represents a button to be shown above inline query results. You must use exactly one of t...
Describes a checklist to create. https://core.telegram.org/bots/api#inputchecklist.
This object represents the content of a media message to be sent. It should be one of:
Base class describing paid media to send https://core.telegram.org/bots/api#inputpaidmedia.
This object contains information about one answer option in a poll to be sent. https://core....
Base class for profile photos to set https://core.telegram.org/bots/api#inputprofilephoto.
This object describes a sticker to be added to a sticker set. https://core.telegram....
Base class for story content to post https://core.telegram.org/bots/api#inputstorycontentphoto.
This object represents a portion of the price for goods or services. https://core....
This object describes the position on faces where a mask should be placed by default....
This object describes the bot's menu button in a private chat. It should be one of:
This object represents one special entity in a text message. For example, hashtags,...
This object represents a message. https://core.telegram.org/bots/api#message.
Definition Message.hpp:72
This object represents a unique message identifier. https://core.telegram.org/bots/api#messageid.
Definition MessageId.hpp:7
Contains the list of gifts received and owned by a user or a chat. https://core.telegram....
Definition OwnedGifts.hpp:9
This object represents an error in the Telegram Passport element which was submitted that should be r...
This object contains information about a poll. https://core.telegram.org/bots/api#poll.
Definition Poll.hpp:10
This object describes the type of a reaction. Currently, it can be one of:
Describes reply parameters for the message that is being sent. https://core.telegram....
Describes an inline message sent by a Web App on behalf of a user. https://core.telegram....
This object represents one shipping option. https://core.telegram.org/bots/api#shippingoption.
Describes an amount of Telegram Stars. https://core.telegram.org/bots/api#staramount.
Definition StarAmount.hpp:7
Contains a list of Telegram Star transactions. https://core.telegram.org/bots/api#startransactions.
This object represents a sticker. https://core.telegram.org/bots/api#sticker.
Definition Sticker.hpp:10
This object represents a sticker set. https://core.telegram.org/bots/api#stickerset.
Definition StickerSet.hpp:9
Describes a clickable area on a story media https://core.telegram.org/bots/api#storyarea.
Definition StoryArea.hpp:10
This object represents a story. . https://core.telegram.org/bots/api#story.
Definition Story.hpp:8
Contains parameters of a post that is being suggested by the bot. https://core.telegram....
This object represents an incoming update. At most one of the optional parameters can be present in a...
Definition Update.hpp:27
This object represents a list of boosts added to a chat by a user. https://core.telegram....
This object represents a Telegram user or bot. https://core.telegram.org/bots/api#user.
Definition User.hpp:7
This object represent a user's profile pictures. https://core.telegram.org/bots/api#userprofilephotos...
Describes the current status of a webhook. https://core.telegram.org/bots/api#webhookinfo.