tgbotxx 1.2.9.5
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 UserProfileAudios;
23 struct File;
24 struct ChatMember;
25 struct ChatPermissions;
26 struct ChatInviteLink;
27 struct Sticker;
28 struct ForumTopic;
29 struct BotCommand;
30 struct BotCommandScope;
31 struct BotName;
33 struct BotDescription;
34 struct InlineQueryResult;
36 struct MenuButton;
38 struct WebhookInfo;
39 struct Poll;
40 struct InputPollOption;
41 struct LabeledPrice;
42 struct ShippingOption;
43 struct SentWebAppMessage;
44 struct ReplyParameters;
45 struct StickerSet;
46 struct InputSticker;
47 struct MaskPosition;
49 struct GameHighScore;
50 struct ReactionType;
51 struct LinkPreviewOptions;
53 struct InputChecklist;
54 struct UserChatBoosts;
55 struct Gifts;
56 struct InputProfilePhoto;
57 struct AcceptedGiftTypes;
58 struct StarAmount;
59 struct OwnedGifts;
60 struct InputStoryContent;
61 struct Story;
62 struct StoryArea;
63 struct StarTransactions;
64 struct InputPaidMedia;
65
76 class Api {
77 friend class Bot;
78
79 static const std::string DEFAULT_API_URL;
80 static const cpr::ConnectTimeout DEFAULT_CONNECT_TIMEOUT;
81 static const cpr::Timeout DEFAULT_TIMEOUT;
82 static const cpr::Timeout DEFAULT_LONG_POLL_TIMEOUT;
83 static const cpr::Timeout DEFAULT_UPLOAD_FILES_TIMEOUT;
84 static const cpr::Timeout DEFAULT_DOWNLOAD_FILES_TIMEOUT;
85
86 const std::string m_token;
87 std::string m_apiUrl = DEFAULT_API_URL;
88 cpr::ConnectTimeout m_connectTimeout = DEFAULT_CONNECT_TIMEOUT;
89 cpr::Timeout m_timeout = DEFAULT_TIMEOUT;
90 cpr::Timeout m_longPollTimeout = DEFAULT_LONG_POLL_TIMEOUT;
91 std::int32_t m_updatesLimit = 100;
92 cpr::Timeout m_uploadFilesTimeout = DEFAULT_UPLOAD_FILES_TIMEOUT;
93 cpr::Timeout m_downloadFilesTimeout = DEFAULT_DOWNLOAD_FILES_TIMEOUT;
94 cpr::Proxies m_proxies = cpr::Proxies();
95 std::vector<std::string> m_allowedUpdates;
100 struct Cache {
101 explicit Cache(const Api& pApi) noexcept;
102
103 std::span<std::string> getBotCommands() const;
104 std::string_view getBotUsername() const;
105
106 const Api& api;
107 mutable std::string botUsername;
108 mutable std::vector<std::string> botCommands;
109 };
110 Cache m_cache;
111
112 public:
115 explicit Api(const std::string& token);
116
117 public:
122
129 bool logOut() const;
130
137 bool close() const;
138
161 Ptr<Message> sendMessage(const std::variant<std::int64_t, std::string>& chatId,
162 const std::string& text,
163 std::int32_t messageThreadId = 0,
164 const std::string& parseMode = "",
165 const std::vector<Ptr<MessageEntity>>& entities = std::vector<Ptr<MessageEntity>>(),
166 bool disableNotification = false,
167 bool protectContent = false,
168 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
169 const std::string& businessConnectionId = "",
170 std::int32_t directMessagesTopicId = 0,
171 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr,
172 bool allowPaidBroadcast = false,
173 const std::string& messageEffectId = "",
174 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
175 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
176
193 Ptr<Message> forwardMessage(const std::variant<std::int64_t, std::string>& chatId,
194 const std::variant<std::int64_t, std::string>& fromChatId,
195 std::int32_t messageId,
196 std::int32_t messageThreadId = 0,
197 bool disableNotification = false,
198 bool protectContent = false,
199 const std::string& messageEffectId = "",
200 std::int32_t directMessagesTopicId = 0,
201 std::time_t videoStartTimestamp = 0,
202 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr) const;
203
204
221 std::vector<Ptr<MessageId>> forwardMessages(const std::variant<std::int64_t, std::string>& chatId,
222 const std::variant<std::int64_t, std::string>& fromChatId,
223 const std::vector<std::int32_t>& messageIds,
224 std::int32_t messageThreadId = 0,
225 bool disableNotification = false,
226 bool protectContent = false,
227 std::int32_t directMessagesTopicId = 0) const;
228
229
255 Ptr<MessageId> copyMessage(const std::variant<std::int64_t, std::string>& chatId,
256 const std::variant<std::int64_t, std::string>& fromChatId,
257 std::int32_t messageId,
258 std::int32_t messageThreadId = 0,
259 const std::string& caption = "",
260 const std::string& parseMode = "",
261 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
262 bool disableNotification = false,
263 bool protectContent = false,
264 const std::string& messageEffectId = "",
265 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
266 std::int32_t directMessagesTopicId = 0,
267 std::time_t videoStartTimestamp = 0,
268 bool showCaptionAboveMedia = false,
269 bool allowPaidBroadcast = false,
270 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
271 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
272
292 std::vector<Ptr<MessageId>> copyMessages(const std::variant<std::int64_t, std::string>& chatId,
293 const std::variant<std::int64_t, std::string>& fromChatId,
294 const std::vector<std::int32_t>& messageIds,
295 std::int32_t messageThreadId = 0,
296 std::int32_t directMessagesTopicId = 0,
297 bool disableNotification = false,
298 bool protectContent = false,
299 bool removeCaption = false) const;
300
328 Ptr<Message> sendPhoto(const std::variant<std::int64_t, std::string>& chatId,
329 const std::variant<cpr::File, std::string>& photo,
330 std::int32_t messageThreadId = 0,
331 const std::string& caption = "",
332 const std::string& parseMode = "",
333 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
334 bool disableNotification = false,
335 bool protectContent = false,
336 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
337 const std::string& businessConnectionId = "",
338 std::int32_t directMessagesTopicId = 0,
339 bool showCaptionAboveMedia = false,
340 bool hasSpoiler = false,
341 bool allowPaidBroadcast = false,
342 const std::string& messageEffectId = "",
343 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
344 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
345
381 Ptr<Message> sendAudio(const std::variant<std::int64_t, std::string>& chatId,
382 const std::variant<cpr::File, std::string>& audio,
383 std::int32_t messageThreadId = 0,
384 const std::string& caption = "",
385 const std::string& parseMode = "",
386 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
387 std::time_t duration = 0,
388 const std::string& performer = "",
389 const std::string& title = "",
390 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
391 bool disableNotification = false,
392 bool protectContent = false,
393 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
394 const std::string& businessConnectionId = "",
395 std::int32_t directMessagesTopicId = 0,
396 bool allowPaidBroadcast = false,
397 const std::string& messageEffectId = "",
398 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
399 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
400
401
431 Ptr<Message> sendDocument(const std::variant<std::int64_t, std::string>& chatId,
432 const std::variant<cpr::File, std::string>& document,
433 std::int32_t messageThreadId = 0,
434 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
435 const std::string& caption = "",
436 const std::string& parseMode = "",
437 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
438 bool disableNotification = false,
439 bool protectContent = false,
440 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
441 const std::string& businessConnectionId = "",
442 std::int32_t directMessagesTopicId = 0,
443 bool disableContentTypeDetection = false,
444 bool allowPaidBroadcast = false,
445 const std::string& messageEffectId = "",
446 const Ptr<SuggestedPostParameters>& suggestedPostParameters = nullptr,
447 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
448
449
487 Ptr<Message> sendVideo(const std::variant<std::int64_t, std::string>& chatId,
488 const std::variant<cpr::File, std::string>& video,
489 std::int32_t messageThreadId = 0,
490 std::time_t duration = 0,
491 std::int32_t width = 0,
492 std::int32_t height = 0,
493 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
494 const std::variant<std::monostate, cpr::File, std::string>& cover = std::monostate{},
495 std::time_t startTimestamp = 0,
496 const std::string& caption = "",
497 const std::string& parseMode = "",
498 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
499 bool showCaptionAboveMedia = false,
500 bool hasSpoiler = false,
501 bool supportsStreaming = false,
502 bool disableNotification = false,
503 bool protectContent = false,
504 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
505 const std::string& businessConnectionId = "",
506 std::int32_t directMessagesTopicId = 0,
507 bool allowPaidBroadcast = false,
508 const std::string& messageEffectId = "",
510 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
511
512
543 Ptr<Message> sendAnimation(const std::variant<std::int64_t, std::string>& chatId,
544 const std::variant<cpr::File, std::string>& animation,
545 std::int32_t messageThreadId = 0,
546 std::time_t duration = 0,
547 std::int32_t width = 0,
548 std::int32_t height = 0,
549 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
550 const std::string& caption = "",
551 const std::string& parseMode = "",
552 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
553 bool disableNotification = false,
554 bool protectContent = false,
555 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
556 const std::string& businessConnectionId = "",
557 std::int32_t directMessagesTopicId = 0,
558 bool allowPaidBroadcast = false,
559 const std::string& messageEffectId = "",
561 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
562
563
587 Ptr<Message> sendVoice(const std::variant<std::int64_t, std::string>& chatId,
588 const std::variant<cpr::File, std::string>& voice,
589 std::int32_t messageThreadId = 0,
590 const std::string& caption = "",
591 const std::string& parseMode = "",
592 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
593 std::time_t duration = 0,
594 bool disableNotification = false,
595 bool protectContent = false,
596 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
597 const std::string& businessConnectionId = "",
598 std::int32_t directMessagesTopicId = 0,
599 bool allowPaidBroadcast = false,
600 const std::string& messageEffectId = "",
602 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
603
604
632 Ptr<Message> sendVideoNote(const std::variant<std::int64_t, std::string>& chatId,
633 const std::variant<cpr::File, std::string>& videoNote,
634 std::int32_t messageThreadId = 0,
635 std::time_t duration = 0,
636 std::int32_t length = 0,
637 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{},
638 bool disableNotification = false,
639 bool protectContent = false,
640 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
641 const std::string& businessConnectionId = "",
642 std::int32_t directMessagesTopicId = 0,
643 bool allowPaidBroadcast = false,
644 const std::string& messageEffectId = "",
646 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
647
648
670 Ptr<Message> sendPaidMedia(const std::variant<std::int64_t, std::string>& chatId,
671 std::int32_t starCount,
672 const std::vector<Ptr<InputPaidMedia>>& media,
673 const std::string& payload = "",
674 std::int32_t messageThreadId = 0,
675 const std::string& caption = "",
676 const std::string& parseMode = "",
677 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
678 bool showCaptionAboveMedia = false,
679 bool disableNotification = false,
680 bool protectContent = false,
681 bool allowPaidBroadcast = false,
682 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
683 const std::string& businessConnectionId = "",
684 std::int32_t directMessagesTopicId = 0,
686 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
687
702 std::vector<Ptr<Message>> sendMediaGroup(const std::variant<std::int64_t, std::string>& chatId,
703 const std::vector<Ptr<InputMedia>>& media,
704 std::int32_t messageThreadId = 0,
705 bool disableNotification = false,
706 bool protectContent = false,
707 const std::string& businessConnectionId = "",
708 std::int32_t directMessagesTopicId = 0,
709 bool allowPaidBroadcast = false,
710 const std::string& messageEffectId = "",
711 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
712
713
733 Ptr<Message> sendLocation(const std::variant<std::int64_t, std::string>& chatId,
734 float latitude,
735 float longitude,
736 std::int32_t messageThreadId = 0,
737 float horizontalAccuracy = 0.0f,
738 std::int32_t livePeriod = 0,
739 std::int32_t heading = 0,
740 std::int32_t proximityAlertRadius = 0,
741 bool disableNotification = false,
742 bool protectContent = false,
743 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
744 const std::string& businessConnectionId = "",
745 std::int32_t directMessagesTopicId = 0,
746 bool allowPaidBroadcast = false,
747 const std::string& messageEffectId = "",
749 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
750
751
774 Ptr<Message> sendVenue(const std::variant<std::int64_t, std::string>& chatId,
775 float latitude,
776 float longitude,
777 const std::string& title,
778 const std::string& address,
779 std::int32_t messageThreadId = 0,
780 const std::string& foursquareId = "",
781 const std::string& foursquareType = "",
782 const std::string& googlePlaceId = "",
783 const std::string& googlePlaceType = "",
784 bool disableNotification = false,
785 bool protectContent = false,
786 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
787 const std::string& businessConnectionId = "",
788 std::int32_t directMessagesTopicId = 0,
789 bool allowPaidBroadcast = false,
790 const std::string& messageEffectId = "",
792 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
793
811 Ptr<Message> sendContact(const std::variant<std::int64_t, std::string>& chatId,
812 const std::string& phoneNumber,
813 const std::string& firstName,
814 const std::string& lastName = "",
815 const std::string& vcard = "",
816 std::int32_t messageThreadId = 0,
817 bool disableNotification = false,
818 bool protectContent = false,
819 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
820 const std::string& businessConnectionId = "",
821 std::int32_t directMessagesTopicId = 0,
822 bool allowPaidBroadcast = false,
823 const std::string& messageEffectId = "",
825 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
826
852 Ptr<Message> sendPoll(const std::variant<std::int64_t, std::string>& chatId,
853 const std::string& question,
854 const std::vector<Ptr<InputPollOption>>& options,
855 std::int32_t messageThreadId = 0,
856 const std::string& questionParseMode = "",
857 const std::vector<Ptr<MessageEntity>>& questionEntities = std::vector<Ptr<MessageEntity>>(),
858 bool isAnonymous = true,
859 const std::string& type = "regular",
860 bool allowsMultipleAnswers = false,
861 std::int32_t correctOptionId = -1,
862 const std::string& explanation = "",
863 const std::string& explanationParseMode = "",
864 const std::vector<Ptr<MessageEntity>>& explanationEntities = std::vector<Ptr<MessageEntity>>(),
865 std::time_t openPeriod = 0,
866 std::time_t closeDate = 0,
867 bool isClosed = false,
868 bool disableNotification = false,
869 bool protectContent = false,
870 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
871 const std::string& businessConnectionId = "",
872 bool allowPaidBroadcast = false,
873 const std::string& messageEffectId = "",
874 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
875
876
887 Ptr<Message> sendChecklist(const std::variant<std::int64_t, std::string>& chatId,
888 const std::string& businessConnectionId,
889 const Ptr<InputChecklist>& checklist,
890 bool disableNotification = false,
891 bool protectContent = false,
892 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
893 const std::string& messageEffectId = "",
894 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
895
896
916 Ptr<Message> sendDice(const std::variant<std::int64_t, std::string>& chatId,
917 const std::string& emoji = "🎲",
918 std::int32_t messageThreadId = 0,
919 bool disableNotification = false,
920 bool protectContent = false,
921 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
922 const std::string& businessConnectionId = "",
923 std::int32_t directMessagesTopicId = 0,
924 bool allowPaidBroadcast = false,
925 const std::string& messageEffectId = "",
927 const Ptr<ReplyParameters>& replyParameters = nullptr) const;
928
929
938 bool sendMessageDraft(std::int64_t chatId,
939 std::int64_t draftId,
940 const std::string& text,
941 std::int32_t messageThreadId = 0,
942 const std::string& parseMode = "",
943 const std::vector<Ptr<MessageEntity>>& entities = std::vector<Ptr<MessageEntity>>()) const;
944
945
968 bool sendChatAction(const std::variant<std::int64_t, std::string>& chatId,
969 const std::string& action,
970 std::int32_t messageThreadId = 0,
971 const std::string& businessConnectionId = "") const;
972
973
985 bool setMessageReaction(const std::variant<std::int64_t, std::string>& chatId,
986 std::int32_t messageId,
987 const std::vector<Ptr<ReactionType>>& reaction = std::vector<Ptr<ReactionType>>(),
988 bool isBig = false) const;
989
990
999 std::int32_t offset = 0,
1000 std::int32_t limit = 100) const;
1001
1010 std::int32_t offset = 0,
1011 std::int32_t limit = 100) const;
1012
1013
1023 Ptr<File> getFile(const std::string& fileId) const;
1024
1025
1035 std::string downloadFile(const std::string& filePath, const std::function<bool(cpr::cpr_off_t downloadTotal, cpr::cpr_off_t downloadNow)>& progressCallback = nullptr) const;
1036
1037
1050 bool banChatMember(const std::variant<std::int64_t, std::string>& chatId,
1051 std::int64_t userId,
1052 std::time_t untilDate = 0,
1053 bool revokeMessages = false) const;
1054
1055
1067 bool unbanChatMember(const std::variant<std::int64_t, std::string>& chatId,
1068 std::int64_t userId,
1069 bool onlyIfBanned = false) const;
1070
1071
1085 bool restrictChatMember(const std::variant<std::int64_t, std::string>& chatId,
1086 std::int64_t userId,
1087 const Ptr<ChatPermissions>& permissions,
1088 bool useIndependentChatPermissions = false,
1089 std::time_t untilDate = 0) const;
1090
1091
1118 bool promoteChatMember(const std::variant<std::int64_t, std::string>& chatId,
1119 std::int64_t userId,
1120 bool isAnonymous = false,
1121 bool canManageChat = false,
1122 bool canDeleteMessages = false,
1123 bool canManageVideoChats = false,
1124 bool canRestrictMembers = false,
1125 bool canPromoteMembers = false,
1126 bool canChangeInfo = false,
1127 bool canInviteUsers = false,
1128 bool canPostMessages = false,
1129 bool canEditMessages = false,
1130 bool canPinMessages = false,
1131 bool canPostStories = false,
1132 bool canEditStories = false,
1133 bool canDeleteStories = false,
1134 bool canManageTopics = false,
1135 bool canManageDirectMessages = false,
1136 bool canManageTags = false) const;
1137
1138
1146 bool setChatAdministratorCustomTitle(const std::variant<std::int64_t, std::string>& chatId,
1147 std::int64_t userId,
1148 const std::string& customTitle) const;
1149
1150
1161 bool banChatSenderChat(const std::variant<std::int64_t, std::string>& chatId,
1162 std::int64_t senderChatId) const;
1163
1164
1174 bool unbanChatSenderChat(const std::variant<std::int64_t, std::string>& chatId,
1175 std::int64_t senderChatId) const;
1176
1177
1189 bool setChatPermissions(const std::variant<std::int64_t, std::string>& chatId,
1190 const Ptr<ChatPermissions>& permissions,
1191 bool useIndependentChatPermissions = false) const;
1192
1193
1208 std::string exportChatInviteLink(const std::variant<std::int64_t, std::string>& chatId) const;
1209
1210
1223 Ptr<ChatInviteLink> createChatInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1224 const std::string& name = "",
1225 std::time_t expireDate = 0,
1226 std::int32_t memberLimit = 0,
1227 bool createsJoinRequest = false) const;
1228
1229
1242 Ptr<ChatInviteLink> editChatInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1243 const std::string& inviteLink,
1244 const std::string& name = "",
1245 std::time_t expireDate = 0,
1246 std::int32_t memberLimit = 0,
1247 bool createsJoinRequest = false) const;
1248
1260 Ptr<ChatInviteLink> createChatSubscriptionInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1261 std::time_t subscriptionPeriod,
1262 std::int32_t subscriptionPrice,
1263 const std::string& name = "") const;
1264
1274 Ptr<ChatInviteLink> editChatSubscriptionInviteLink(const std::variant<std::int64_t, std::string>& chatId,
1275 const std::string& inviteLink,
1276 const std::string& name = "") const;
1277
1278
1287 Ptr<ChatInviteLink> revokeChatInviteLink(const std::variant<std::int64_t, std::string>& chatId, const std::string& inviteLink) const;
1288
1289
1298 bool approveChatJoinRequest(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1299
1300
1309 bool declineChatJoinRequest(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1310
1311
1320 bool setChatPhoto(const std::variant<std::int64_t, std::string>& chatId, const cpr::File& photo) const;
1321
1322
1330 bool deleteChatPhoto(const std::variant<std::int64_t, std::string>& chatId) const;
1331
1332
1340 bool setChatTitle(const std::variant<std::int64_t, std::string>& chatId, const std::string& title) const;
1341
1342
1350 bool setChatDescription(const std::variant<std::int64_t, std::string>& chatId, const std::string& description = "") const;
1351
1352
1365 bool pinChatMessage(const std::variant<std::int64_t, std::string>& chatId,
1366 std::int32_t messageId,
1367 bool disableNotification = false,
1368 const std::string& businessConnectionId = "") const;
1369
1370
1381 bool unpinChatMessage(const std::variant<std::int64_t, std::string>& chatId,
1382 std::int32_t messageId = 0,
1383 const std::string& businessConnectionId = "") const;
1384
1385
1394 bool unpinAllChatMessages(const std::variant<std::int64_t, std::string>& chatId) const;
1395
1396
1402 bool leaveChat(const std::variant<std::int64_t, std::string>& chatId) const;
1403
1404
1410 Ptr<Chat> getChat(const std::variant<std::int64_t, std::string>& chatId) const;
1411
1412
1418 std::vector<Ptr<ChatMember>> getChatAdministrators(const std::variant<std::int64_t, std::string>& chatId) const;
1419
1420
1426 std::int32_t getChatMemberCount(const std::variant<std::int64_t, std::string>& chatId) const;
1427
1428
1436 Ptr<ChatMember> getChatMember(const std::variant<std::int64_t, std::string>& chatId, std::int64_t userId) const;
1437
1438
1448 bool setChatStickerSet(const std::variant<std::int64_t, std::string>& chatId, const std::string& stickerSetName) const;
1449
1450
1459 bool deleteChatStickerSet(const std::variant<std::int64_t, std::string>& chatId) const;
1460
1461
1469 std::vector<Ptr<Sticker>> getForumTopicIconStickers() const;
1470
1471
1474 // must have the can_manage_topics administrator right.
1484 Ptr<ForumTopic> createForumTopic(const std::variant<std::int64_t, std::string>& chatId,
1485 const std::string& name,
1486 std::int32_t iconColor = 0x000000,
1487 const std::string& iconCustomEmojiId = "") const;
1488
1489
1503 bool editForumTopic(const std::variant<std::int64_t, std::string>& chatId,
1504 std::int32_t messageThreadId,
1505 const std::string& name,
1506 const std::optional<std::string>& iconCustomEmojiId = std::nullopt) const;
1507
1508
1518 bool closeForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1519
1520
1530 bool reopenForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1531
1532
1542 bool deleteForumTopic(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1543
1544
1553 bool unpinAllForumTopicMessages(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId) const;
1554
1555
1563 bool editGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId, const std::string& name) const;
1564
1565
1572 bool closeGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1573
1574
1581 bool reopenGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1582
1583
1590 bool hideGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1591
1592
1599 bool unhideGeneralForumTopic(const std::variant<std::int64_t, std::string>& chatId) const;
1600
1601
1608 bool unpinAllGeneralForumTopicMessages(const std::variant<std::int64_t, std::string>& chatId) const;
1609
1610
1627 bool answerCallbackQuery(const std::string& callbackQueryId,
1628 const std::string& text = "",
1629 bool showAlert = false,
1630 const std::string& url = "",
1631 std::time_t cacheTime = 0) const;
1632
1639 Ptr<UserChatBoosts> getUserChatBoosts(const std::variant<std::int64_t, std::string>& chatId,
1640 std::int64_t userId) const;
1641
1651 bool setMyCommands(const std::vector<Ptr<BotCommand>>& commands,
1652 const Ptr<BotCommandScope>& scope = nullptr,
1653 const std::string& languageCode = "") const;
1654
1655
1664 bool deleteMyCommands(const Ptr<BotCommandScope>& scope = nullptr, const std::string& languageCode = "") const;
1665
1666
1673 std::vector<Ptr<BotCommand>> getMyCommands(const Ptr<BotCommandScope>& scope = nullptr, const std::string& languageCode = "") const;
1674
1675
1682 bool setMyName(const std::string& name = "", const std::string& languageCode = "") const;
1683
1684
1690 Ptr<BotName> getMyName(const std::string& languageCode = "") const;
1691
1692
1699 bool setMyDescription(const std::string& description = "", const std::string& languageCode = "") const;
1700
1701
1707 Ptr<BotDescription> getMyDescription(const std::string& languageCode = "") const;
1708
1715 bool setMyShortDescription(const std::string& shortDescription = "", const std::string& languageCode = "") const;
1716
1722 Ptr<BotShortDescription> getMyShortDescription(const std::string& languageCode = "") const;
1723
1730
1736
1743 bool setChatMenuButton(const std::variant<std::int64_t, std::string>& chatId = std::string{}, const Ptr<MenuButton>& menuButton = nullptr) const;
1744
1750 Ptr<MenuButton> getChatMenuButton(const std::variant<std::int64_t, std::string>& chatId = std::string{}) const;
1751
1759 bool setMyDefaultAdministratorRights(const Ptr<ChatAdministratorRights>& rights = nullptr, bool forChannels = false) const;
1760
1767
1775 bool setChatMemberTag(const std::variant<std::int64_t, std::string>& chatId,
1776 std::int64_t userId,
1777 const std::string& tag = "") const;
1778
1779
1780 public: // Gifts
1786
1798 bool sendGift(const std::string& giftId,
1799 std::int64_t userId = 0,
1800 const std::variant<std::int64_t, std::string>& chatId = 0,
1801 bool payForUpgrade = false,
1802 const std::string& text = "",
1803 const std::string& textParseMode = "",
1804 const std::vector<Ptr<MessageEntity>>& textEntities = std::vector<Ptr<MessageEntity>>()) const;
1805
1818 bool giftPremiumSubscription(std::int64_t userId,
1819 std::int32_t monthCount,
1820 std::int32_t starCount,
1821 const std::string& text = "",
1822 const std::string& textParseMode = "",
1823 const std::vector<Ptr<MessageEntity>>& textEntities = std::vector<Ptr<MessageEntity>>()) const;
1824
1838 Ptr<OwnedGifts> getUserGifts(std::int64_t userId,
1839 bool excludeUnlimited = false,
1840 bool excludeLimitedUpgradable = false,
1841 bool excludeLimitedNonUpgradable = false,
1842 bool excludeFromBlockchain = false,
1843 bool excludeUnique = false,
1844 bool sortByPrice = false,
1845 const std::string& offset = "",
1846 std::int32_t limit = 100) const;
1847
1863 Ptr<OwnedGifts> getChatGifts(const std::variant<std::int64_t, std::string>& chatId,
1864 bool excludeUnsaved = false,
1865 bool excludeSaved = false,
1866 bool excludeUnlimited = false,
1867 bool excludeLimitedUpgradable = false,
1868 bool excludeLimitedNonUpgradable = false,
1869 bool excludeFromBlockchain = false,
1870 bool excludeUnique = false,
1871 bool sortByPrice = false,
1872 const std::string& offset = "",
1873 std::int32_t limit = 100) const;
1874
1875 public: // Verification
1884 bool verifyUser(std::int64_t userId, const std::string& customDescription = "") const;
1885
1894 bool verifyChat(const std::variant<std::int64_t, std::string>& chatId, const std::string& customDescription = "") const;
1895
1902 bool removeUserVerification(std::int64_t userId) const;
1903
1910 bool removeChatVerification(const std::variant<std::int64_t, std::string>& chatId) const;
1911
1912 public: // Business
1921 bool readBusinessMessage(const std::string& businessConnectionId,
1922 const std::variant<std::int64_t, std::string>& chatId,
1923 std::int32_t messageId) const;
1924
1934 bool deleteBusinessMessages(const std::string& businessConnectionId,
1935 const std::vector<std::int32_t>& messageIds) const;
1936
1944 bool setBusinessAccountName(const std::string& businessConnectionId,
1945 const std::string& firstName,
1946 const std::string& lastName = "") const;
1947
1954 bool setBusinessAccountUsername(const std::string& businessConnectionId,
1955 const std::string& username = "") const;
1956
1963 bool setBusinessAccountBio(const std::string& businessConnectionId,
1964 const std::string& bio = "") const;
1965
1973 bool setBusinessAccountProfilePhoto(const std::string& businessConnectionId,
1974 const Ptr<InputProfilePhoto>& photo,
1975 bool isPublic = false) const;
1976
1984 bool removeBusinessAccountProfilePhoto(const std::string& businessConnectionId,
1985 bool isPublic = false) const;
1986
1994 bool setBusinessAccountGiftSettings(const std::string& businessConnectionId,
1995 bool showGiftButton,
1997
2004 Ptr<StarAmount> getBusinessAccountStarBalance(const std::string& businessConnectionId) const;
2005
2012 bool transferBusinessAccountStars(const std::string& businessConnectionId,
2013 std::int32_t starCount) const;
2014
2031 Ptr<OwnedGifts> getBusinessAccountGifts(const std::string& businessConnectionId,
2032 bool excludeUnsaved = false,
2033 bool excludeSaved = false,
2034 bool excludeUnlimited = false,
2035 bool excludeLimitedUpgradable = false,
2036 bool excludeLimitedNonUpgradable = false,
2037 bool excludeUnique = false,
2038 bool excludeFromBlockchain = false,
2039 bool sortByPrice = false,
2040 const std::string& offset = "",
2041 std::int32_t limit = 100) const;
2042
2049 bool convertGiftToStars(const std::string& businessConnectionId, const std::string& ownedGiftId) const;
2050
2061 bool upgradeGift(const std::string& businessConnectionId,
2062 const std::string& ownedGiftId,
2063 bool keepOriginalDetails = false,
2064 std::int32_t starCount = -1) const;
2065
2075 bool transferGift(const std::string& businessConnectionId,
2076 const std::string& ownedGiftId,
2077 std::int64_t newOwnerChatId,
2078 std::int32_t starCount = -1) const;
2079
2080 public: // Story
2094 Ptr<Story> postStory(const std::string& businessConnectionId,
2096 std::time_t activePeriod,
2097 const std::string& caption = "",
2098 const std::string& parseMode = "",
2099 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
2100 const std::vector<Ptr<StoryArea>>& areas = std::vector<Ptr<StoryArea>>(),
2101 bool postToChatPage = false,
2102 bool protectContent = false) const;
2103
2116 Ptr<Story> repostStory(const std::string& businessConnectionId,
2117 std::int64_t fromChatId,
2118 std::int32_t fromStoryId,
2119 std::time_t activePeriod,
2120 bool postToChatPage = false,
2121 bool protectContent = false) const;
2122
2134 Ptr<Story> editStory(const std::string& businessConnectionId,
2135 std::int32_t storyId,
2137 const std::string& caption = "",
2138 const std::string& parseMode = "",
2139 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
2140 const std::vector<Ptr<StoryArea>>& areas = std::vector<Ptr<StoryArea>>()) const;
2141
2148 bool deleteStory(const std::string& businessConnectionId, std::int32_t storyId) const;
2149
2150 public:
2189 Ptr<Message> sendInvoice(const std::variant<std::int64_t, std::string>& chatId,
2190 const std::string& title,
2191 const std::string& description,
2192 const std::string& payload,
2193 const std::string& currency,
2194 const std::vector<Ptr<LabeledPrice>>& prices,
2195 const std::string& providerToken = "",
2196 std::int32_t messageThreadId = 0,
2197 std::int32_t maxTipAmount = 0,
2198 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
2199 const std::string& startParameter = "",
2200 const std::string& providerData = "",
2201 const std::string& photoUrl = "",
2202 std::int32_t photoSize = 0,
2203 std::int32_t photoWidth = 0,
2204 std::int32_t photoHeight = 0,
2205 bool needName = false,
2206 bool needPhoneNumber = false,
2207 bool needEmail = false,
2208 bool needShippingAddress = false,
2209 bool sendPhoneNumberToProvider = false,
2210 bool sendEmailToProvider = false,
2211 bool isFlexible = false,
2212 bool disableNotification = false,
2213 bool protectContent = false,
2214 bool allowPaidBroadcast = false,
2215 const std::string& messageEffectId = "",
2217 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2218
2254 std::string createInvoiceLink(const std::string& title,
2255 const std::string& description,
2256 const std::string& payload,
2257 const std::string& currency,
2258 const std::vector<Ptr<LabeledPrice>>& prices,
2259 const std::string& businessConnectionId = "",
2260 const std::string& providerToken = "",
2261 std::time_t subscriptionPeriod = 0,
2262 std::int32_t maxTipAmount = 0,
2263 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
2264 const std::string& providerData = "",
2265 const std::string& photoUrl = "",
2266 std::int32_t photoSize = 0,
2267 std::int32_t photoWidth = 0,
2268 std::int32_t photoHeight = 0,
2269 bool needName = false,
2270 bool needPhoneNumber = false,
2271 bool needEmail = false,
2272 bool needShippingAddress = false,
2273 bool sendPhoneNumberToProvider = false,
2274 bool sendEmailToProvider = false,
2275 bool isFlexible = false) const;
2276
2277
2289 bool answerShippingQuery(const std::string& shippingQueryId,
2290 bool ok,
2291 const std::vector<Ptr<ShippingOption>>& shippingOptions = std::vector<Ptr<ShippingOption>>(),
2292 const std::string& errorMessage = "") const;
2293
2294
2307 bool ok,
2308 const std::string& errorMessage = "") const;
2309
2316
2324 Ptr<StarTransactions> getStarTransactions(std::int32_t offset = 0, std::int32_t limit = 100) const;
2325
2332 bool refundStarPayment(std::int64_t userId, const std::string& telegramPaymentChargeId) const;
2333
2342 bool editUserStarSubscription(std::int64_t userId,
2343 const std::string& telegramPaymentChargeId,
2344 bool isCancelled) const;
2345
2346
2347 public:
2362 std::vector<Ptr<Update>> getUpdates(std::int32_t offset, const std::shared_ptr<std::atomic<bool>>& cancellationParam = nullptr) const;
2363
2389 bool setWebhook(const std::string& url,
2390 const std::optional<cpr::File>& certificate = std::nullopt,
2391 const std::string& ipAddress = "",
2392 std::int32_t maxConnections = 40,
2393 const std::vector<std::string>& allowedUpdates = std::vector<std::string>(),
2394 bool dropPendingUpdates = false,
2395 const std::string& secretToken = "") const;
2396
2404 bool deleteWebhook(bool dropPendingUpdates = false) const;
2405
2412
2413 public:
2430 Ptr<Message> editMessageText(const std::string& text,
2431 const std::variant<std::int64_t, std::string>& chatId = 0,
2432 std::int32_t messageId = 0,
2433 const std::string& inlineMessageId = "",
2434 const std::string& parseMode = "",
2435 const std::vector<Ptr<MessageEntity>>& entities = std::vector<Ptr<MessageEntity>>(),
2436 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2437 const std::string& businessConnectionId = "",
2438 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr) const;
2439
2440
2453 Ptr<Message> editMessageCaption(const std::variant<std::int64_t, std::string>& chatId = 0,
2454 std::int32_t messageId = 0,
2455 const std::string& inlineMessageId = "",
2456 const std::string& caption = "",
2457 const std::string& parseMode = "",
2458 const std::vector<Ptr<MessageEntity>>& captionEntities = std::vector<Ptr<MessageEntity>>(),
2459 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2460 const std::string& businessConnectionId = "",
2461 bool showCaptionAboveMedia = false) const;
2462
2463
2476 const std::variant<std::int64_t, std::string>& chatId = 0,
2477 std::int32_t messageId = 0,
2478 const std::string& inlineMessageId = "",
2479 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2480 const std::string& businessConnectionId = "") const;
2481
2482
2499 float longitude,
2500 const std::variant<std::int64_t, std::string>& chatId = 0,
2501 std::int32_t messageId = 0,
2502 const std::string& inlineMessageId = "",
2503 std::int32_t livePeriod = 0,
2504 float horizontalAccuracy = 0.0f,
2505 std::int32_t heading = 0,
2506 std::int32_t proximityAlertRadius = 0,
2507 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2508 const std::string& businessConnectionId = "") const;
2509
2510
2519 Ptr<Message> stopMessageLiveLocation(const std::variant<std::int64_t, std::string>& chatId = 0,
2520 std::int32_t messageId = 0,
2521 const std::string& inlineMessageId = "",
2522 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2523 const std::string& businessConnectionId = "") const;
2524
2534 std::int32_t messageId,
2535 const Ptr<InputChecklist>& checklist,
2536 const std::string& businessConnectionId,
2537 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2538
2547 Ptr<Message> editMessageReplyMarkup(const std::variant<std::int64_t, std::string>& chatId = 0,
2548 std::int32_t messageId = 0,
2549 const std::string& inlineMessageId = "",
2550 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2551 const std::string& businessConnectionId = "") const;
2552
2553
2561 Ptr<Poll> stopPoll(const std::variant<std::int64_t, std::string>& chatId,
2562 std::int32_t messageId,
2563 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2564 const std::string& businessConnectionId = "") const;
2565
2566
2573 bool approveSuggestedPost(std::int64_t chatId,
2574 std::int32_t messageId,
2575 std::time_t sendDate = 0) const;
2576
2583 bool declineSuggestedPost(std::int64_t chatId,
2584 std::int32_t messageId,
2585 const std::string& comment = "") const;
2586
2601 bool deleteMessage(const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageId) const;
2602
2609 bool deleteMessages(const std::variant<std::int64_t, std::string>& chatId, const std::vector<std::int32_t>& messageIds) const;
2610
2611 public:
2634 Ptr<Message> sendSticker(const std::variant<std::int64_t, std::string>& chatId,
2635 const std::variant<cpr::File, std::string>& sticker,
2636 std::int32_t messageThreadId = 0,
2637 const std::string& emoji = "",
2638 bool disableNotification = false,
2639 bool protectContent = false,
2640 const Ptr<ReplyParameters>& replyParameters = nullptr,
2641 const Ptr<IReplyMarkup>& replyMarkup = nullptr,
2642 const std::string& businessConnectionId = "",
2643 std::int32_t directMessagesTopicId = 0,
2644 const Ptr<LinkPreviewOptions>& linkPreviewOptions = nullptr,
2645 bool allowPaidBroadcast = false,
2646 const std::string& messageEffectId = "",
2648
2654 Ptr<StickerSet> getStickerSet(const std::string& name) const;
2655
2661 std::vector<Ptr<Sticker>> getCustomEmojiStickers(const std::vector<std::string>& customEmojiIds) const;
2662
2672 Ptr<File> uploadStickerFile(std::int64_t userId,
2673 const cpr::File& sticker,
2674 const std::string& stickerFormat) const;
2675
2690 bool createNewStickerSet(std::int64_t userId,
2691 const std::string& name,
2692 const std::string& title,
2693 const std::vector<Ptr<InputSticker>>& stickers,
2694 const std::string& stickerType = "regular",
2695 bool needsRepainting = false) const;
2696
2707 bool addStickerToSet(std::int64_t userId,
2708 const std::string& name,
2709 const Ptr<InputSticker>& sticker) const;
2710
2717 bool setStickerPositionInSet(const std::string& sticker, std::int32_t position) const;
2718
2724 bool deleteStickerFromSet(const std::string& sticker) const;
2725
2736 bool replaceStickerInSet(std::int64_t userId,
2737 const std::string& name,
2738 const std::string& oldSticker,
2739 const Ptr<InputSticker>& sticker) const;
2740
2748 bool setStickerEmojiList(const std::string& sticker, const std::vector<std::string>& emojiList) const;
2749
2757 bool setStickerKeywords(const std::string& sticker, const std::vector<std::string>& keywords = std::vector<std::string>()) const;
2758
2766 bool setStickerMaskPosition(const std::string& sticker,
2767 const Ptr<MaskPosition>& maskPosition = nullptr) const;
2768
2775 bool setStickerSetTitle(const std::string& name, const std::string& title) const;
2776
2793 bool setStickerSetThumbnail(const std::string& name,
2794 std::int64_t userId,
2795 const std::string& format,
2796 const std::variant<std::monostate, cpr::File, std::string>& thumbnail = std::monostate{}) const;
2797
2805 bool setCustomEmojiStickerSetThumbnail(const std::string& name, const std::optional<std::string>& customEmojiId = std::nullopt) const;
2806
2812 bool deleteStickerSet(const std::string& name) const;
2813
2814 public:
2826 bool setPassportDataErrors(std::int64_t userId, const std::vector<Ptr<PassportElementError>>& errors) const;
2827
2828 public:
2841 Ptr<Message> sendGame(const std::variant<std::int64_t, std::string>& chatId,
2842 const std::string& gameShortName,
2843 std::int32_t messageThreadId = 0,
2844 bool disableNotification = false,
2845 bool protectContent = false,
2846 const Ptr<ReplyParameters>& replyParameters = nullptr,
2847 const Ptr<IReplyMarkup>& replyMarkup = nullptr) const;
2848
2860 Ptr<Message> setGameScore(std::int64_t userId,
2861 std::int32_t score,
2862 bool force = false,
2863 bool disableEditMessage = false,
2864 std::int64_t chatId = 0,
2865 std::int32_t messageId = 0,
2866 const std::string& inlineMessageId = "") const;
2867
2868
2880 std::vector<Ptr<GameHighScore>> getGameHighScores(std::int64_t userId,
2881 std::int64_t chatId = 0,
2882 std::int32_t messageId = 0,
2883 const std::string& inlineMessageId = "") const;
2884
2885 public:
2899 bool answerInlineQuery(const std::string& inlineQueryId,
2900 const std::vector<Ptr<InlineQueryResult>>& results,
2901 std::int32_t cacheTime = 300,
2902 bool isPersonal = false,
2903 const std::string& nextOffset = "",
2904 const Ptr<InlineQueryResultsButton>& button = nullptr) const;
2905
2906
2915
2916 public:
2918 void setUrl(const std::string& url) noexcept;
2920 const std::string& getUrl() const noexcept;
2921
2926
2932
2937
2942
2947
2952
2957
2962 void setAllowedUpdates(const std::vector<std::string>& allowedUpdates) noexcept;
2965
2969
2970 private:
2971 nl::json sendRequest(const std::string& endpoint,
2972 const cpr::Multipart& data = cpr::Multipart({}),
2973 const std::shared_ptr<std::atomic<bool>>& cancellationParam = nullptr) const;
2974 };
2975}
Api Methods https://core.telegram.org/bots/api#available-methods.
Definition Api.hpp:76
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 removeMyProfilePhoto() const
Removes the profile photo of the bot. Requires no parameters.
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.
Ptr< OwnedGifts > getChatGifts(const std::variant< std::int64_t, std::string > &chatId, bool excludeUnsaved=false, bool excludeSaved=false, bool excludeUnlimited=false, bool excludeLimitedUpgradable=false, bool excludeLimitedNonUpgradable=false, bool excludeFromBlockchain=false, bool excludeUnique=false, bool sortByPrice=false, const std::string &offset="", std::int32_t limit=100) const
Returns the gifts owned by a chat.
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 or a private chat with a user....
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.
void setAllowedUpdates(const std::vector< std::string > &allowedUpdates) noexcept
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 setMyProfilePhoto(const Ptr< InputProfilePhoto > &photo) const
Changes the profile photo of the bot.
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.
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, const std::string &messageEffectId="", 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 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....
Ptr< Story > repostStory(const std::string &businessConnectionId, std::int64_t fromChatId, std::int32_t fromStoryId, std::time_t activePeriod, bool postToChatPage=false, bool protectContent=false) const
Reposts a story on behalf of a business account from another business account. Both business accounts...
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...
Ptr< OwnedGifts > getBusinessAccountGifts(const std::string &businessConnectionId, bool excludeUnsaved=false, bool excludeSaved=false, bool excludeUnlimited=false, bool excludeLimitedUpgradable=false, bool excludeLimitedNonUpgradable=false, bool excludeUnique=false, bool excludeFromBlockchain=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...
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...
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 setChatMemberTag(const std::variant< std::int64_t, std::string > &chatId, std::int64_t userId, const std::string &tag="") const
Use this method to get the current default administrator rights of the bot.
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...
bool sendMessageDraft(std::int64_t chatId, std::int64_t draftId, const std::string &text, std::int32_t messageThreadId=0, const std::string &parseMode="", const std::vector< Ptr< MessageEntity > > &entities=std::vector< Ptr< MessageEntity > >()) const
Use this method to stream a partial message to a user while the message is being generated....
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, bool canManageTags=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...
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 std::string &messageEffectId="", 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 setUrl(const std::string &url) noexcept
Set Api URL.
Ptr< OwnedGifts > getUserGifts(std::int64_t userId, bool excludeUnlimited=false, bool excludeLimitedUpgradable=false, bool excludeLimitedNonUpgradable=false, bool excludeFromBlockchain=false, bool excludeUnique=false, bool sortByPrice=false, const std::string &offset="", std::int32_t limit=100) const
Returns the gifts owned and hosted by a user.
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.
Ptr< UserProfileAudios > getUserProfileAudios(std::int64_t userId, std::int32_t offset=0, std::int32_t limit=100) const
Use this method to get a list of profile audios for a user.
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:74
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 represents the audios displayed on a user's profile. https://core.telegram....
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.