5 #include <nlohmann/json.hpp>
12 namespace nl = nlohmann;
57 static const std::string DEFAULT_API_URL;
58 static const cpr::ConnectTimeout DEFAULT_CONNECT_TIMEOUT;
59 static const cpr::Timeout DEFAULT_TIMEOUT;
60 static const cpr::Timeout DEFAULT_LONG_POLL_TIMEOUT;
61 static const cpr::Timeout DEFAULT_UPLOAD_FILES_TIMEOUT;
62 static const cpr::Timeout DEFAULT_DOWNLOAD_FILES_TIMEOUT;
64 const std::string m_token;
65 std::string m_apiUrl = DEFAULT_API_URL;
66 cpr::ConnectTimeout m_connectTimeout = DEFAULT_CONNECT_TIMEOUT;
67 cpr::Timeout m_timeout = DEFAULT_TIMEOUT;
68 cpr::Timeout m_longPollTimeout = DEFAULT_LONG_POLL_TIMEOUT;
69 cpr::Timeout m_uploadFilesTimeout = DEFAULT_UPLOAD_FILES_TIMEOUT;
70 cpr::Timeout m_downloadFilesTimeout = DEFAULT_DOWNLOAD_FILES_TIMEOUT;
71 std::vector<std::string> m_allowedUpdates;
82 explicit Api(
const std::string& token);
123 const std::string& text,
124 std::int32_t messageThreadId = 0,
125 const std::string& parseMode =
"",
127 bool disableWebPagePreview =
false,
128 bool disableNotification =
false,
129 bool protectContent =
false,
130 std::int32_t replyToMessageId = 0,
131 bool allowSendingWithoutReply =
false,
145 const std::variant<std::int64_t, std::string>& fromChatId,
146 std::int32_t messageId,
147 std::int32_t messageThreadId = 0,
148 bool disableNotification =
false,
149 bool protectContent =
false)
const;
172 const std::variant<std::int64_t, std::string>& fromChatId,
173 std::int32_t messageId,
174 std::int32_t messageThreadId = 0,
175 const std::string& caption =
"",
176 const std::string& parseMode =
"",
178 bool disableNotification =
false,
179 bool protectContent =
false,
180 std::int32_t replyToMessageId = 0,
181 bool allowSendingWithoutReply =
false,
206 const std::variant<cpr::File, std::string>& photo,
207 std::int32_t messageThreadId = 0,
208 const std::string& caption =
"",
209 const std::string& parseMode =
"",
211 bool disableNotification =
false,
212 bool protectContent =
false,
213 std::int32_t replyToMessageId = 0,
214 bool allowSendingWithoutReply =
false,
248 const std::variant<cpr::File, std::string>& audio,
249 std::int32_t messageThreadId = 0,
250 const std::string& caption =
"",
251 const std::string& parseMode =
"",
253 std::int32_t duration = 0,
254 const std::string& performer =
"",
255 const std::string& title =
"",
256 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt,
257 bool disableNotification =
false,
258 bool protectContent =
false,
259 std::int32_t replyToMessageId = 0,
260 bool allowSendingWithoutReply =
false,
291 const std::variant<cpr::File, std::string>& document,
292 std::int32_t messageThreadId = 0,
293 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt,
294 const std::string& caption =
"",
295 const std::string& parseMode =
"",
297 bool disableNotification =
false,
298 bool protectContent =
false,
299 std::int32_t replyToMessageId = 0,
300 bool allowSendingWithoutReply =
false,
336 const std::variant<cpr::File, std::string>& video,
337 std::int32_t messageThreadId = 0,
338 std::int32_t duration = 0,
339 std::int32_t width = 0,
340 std::int32_t height = 0,
341 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt,
342 const std::string& caption =
"",
343 const std::string& parseMode =
"",
345 bool hasSpoiler =
false,
346 bool supportsStreaming =
false,
347 bool disableNotification =
false,
348 bool protectContent =
false,
349 std::int32_t replyToMessageId = 0,
350 bool allowSendingWithoutReply =
false,
385 const std::variant<cpr::File, std::string>& animation,
386 std::int32_t messageThreadId = 0,
387 std::int32_t duration = 0,
388 std::int32_t width = 0,
389 std::int32_t height = 0,
390 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt,
391 const std::string& caption =
"",
392 const std::string& parseMode =
"",
394 bool hasSpoiler =
false,
395 bool disableNotification =
false,
396 bool protectContent =
false,
397 std::int32_t replyToMessageId = 0,
398 bool allowSendingWithoutReply =
false,
426 const std::variant<cpr::File, std::string>& voice,
427 std::int32_t messageThreadId = 0,
428 const std::string& caption =
"",
429 const std::string& parseMode =
"",
431 std::int32_t duration = 0,
432 bool disableNotification =
false,
433 bool protectContent =
false,
434 std::int32_t replyToMessageId = 0,
435 bool allowSendingWithoutReply =
false,
466 const std::variant<cpr::File, std::string>& videoNote,
467 std::int32_t messageThreadId = 0,
468 std::int32_t duration = 0,
469 std::int32_t length = 0,
470 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt,
471 bool disableNotification =
false,
472 bool protectContent =
false,
473 std::int32_t replyToMessageId = 0,
474 bool allowSendingWithoutReply =
false,
493 std::vector<Ptr<Message>>
sendMediaGroup(
const std::variant<std::int64_t, std::string>& chatId,
495 std::int32_t messageThreadId = 0,
496 bool disableNotification =
false,
497 bool protectContent =
false,
498 std::int32_t replyToMessageId = 0,
499 bool allowSendingWithoutReply =
false)
const;
523 std::int32_t messageThreadId = 0,
524 float horizontalAccuracy = 0.0f,
525 std::int32_t livePeriod = 0,
526 std::int32_t heading = 0,
527 std::int32_t proximityAlertRadius = 0,
528 bool disableNotification =
false,
529 bool protectContent =
false,
530 std::int32_t replyToMessageId = 0,
531 bool allowSendingWithoutReply =
false,
558 const std::string& title,
559 const std::string& address,
560 std::int32_t messageThreadId = 0,
561 const std::string& foursquareId =
"",
562 const std::string& foursquareType =
"",
563 const std::string& googlePlaceId =
"",
564 const std::string& googlePlaceType =
"",
565 bool disableNotification =
false,
566 bool protectContent =
false,
567 std::int32_t replyToMessageId = 0,
568 bool allowSendingWithoutReply =
false,
589 const std::string& phoneNumber,
590 const std::string& firstName,
591 const std::string& lastName =
"",
592 const std::string& vcard =
"",
593 std::int32_t messageThreadId = 0,
594 bool disableNotification =
false,
595 bool protectContent =
false,
596 std::int32_t replyToMessageId = 0,
597 bool allowSendingWithoutReply =
false,
626 const std::string& question,
627 const std::vector<std::string>& options,
628 bool isAnonymous =
true,
629 const std::string& type =
"regular",
630 bool allowsMultipleAnswers =
false,
631 std::int32_t correctOptionId = -1,
632 const std::string& explanation =
"",
633 const std::string& explanationParseMode =
"",
635 std::int32_t openPeriod = 0,
636 std::int32_t closeDate = 0,
637 bool isClosed =
false,
638 std::int32_t messageThreadId = 0,
639 bool disableNotification =
false,
640 bool protectContent =
false,
641 std::int32_t replyToMessageId = 0,
642 bool allowSendingWithoutReply =
false,
661 const std::string& emoji =
"🎲",
662 std::int32_t messageThreadId = 0,
663 bool disableNotification =
false,
664 bool protectContent =
false,
665 std::int32_t replyToMessageId = 0,
666 bool allowSendingWithoutReply =
false,
692 const std::string& action,
693 std::int32_t messageThreadId = 0)
const;
708 std::int32_t messageId,
710 bool isBig =
false)
const;
721 std::int32_t offset = 0,
722 std::int32_t limit = 100)
const;
746 std::string
downloadFile(
const std::string& filePath,
const std::function<
bool(cpr::cpr_off_t downloadTotal, cpr::cpr_off_t downloadNow)>& progressCallback =
nullptr)
const;
763 std::time_t untilDate = 0,
764 bool revokeMessages =
false)
const;
780 bool onlyIfBanned =
false)
const;
799 bool useIndependentChatPermissions =
false,
800 std::time_t untilDate = 0)
const;
829 bool isAnonymous =
false,
830 bool canManageChat =
false,
831 bool canDeleteMessages =
false,
832 bool canManageVideoChats =
false,
833 bool canRestrictMembers =
false,
834 bool canPromoteMembers =
false,
835 bool canChangeInfo =
false,
836 bool canInviteUsers =
false,
837 bool canPostMessages =
false,
838 bool canEditMessages =
false,
839 bool canPinMessages =
false,
840 bool canPostStories =
false,
841 bool canEditStories =
false,
842 bool canDeleteStories =
false,
843 bool canManageTopics =
false)
const;
855 const std::string& customTitle)
const;
869 std::int64_t senderChatId)
const;
882 std::int64_t senderChatId)
const;
898 bool useIndependentChatPermissions =
false)
const;
931 const std::string& name =
"",
932 std::time_t expireDate = 0,
933 std::int32_t memberLimit = 0,
934 bool createsJoinRequest =
false)
const;
950 const std::string& inviteLink,
951 const std::string& name =
"",
952 std::time_t expireDate = 0,
953 std::int32_t memberLimit = 0,
954 bool createsJoinRequest =
false)
const;
998 bool setChatPhoto(
const std::variant<std::int64_t, std::string>& chatId,
const cpr::File& photo)
const;
1018 bool setChatTitle(
const std::variant<std::int64_t, std::string>& chatId,
const std::string& title)
const;
1028 bool setChatDescription(
const std::variant<std::int64_t, std::string>& chatId,
const std::string& description =
"")
const;
1043 std::int32_t messageId,
1044 bool disableNotification =
false)
const;
1056 bool unpinChatMessage(
const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageId = 0)
const;
1075 bool leaveChat(
const std::variant<std::int64_t, std::string>& chatId)
const;
1121 bool setChatStickerSet(
const std::variant<std::int64_t, std::string>& chatId,
const std::string& stickerSetName)
const;
1157 const std::string& name,
1158 std::int32_t iconColor = 0x000000,
1159 const std::string& iconCustomEmojiId =
"")
const;
1176 std::int32_t messageThreadId,
1177 const std::string& name,
1178 const std::optional<std::string>& iconCustomEmojiId = std::nullopt)
const;
1190 bool closeForumTopic(
const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId)
const;
1202 bool reopenForumTopic(
const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId)
const;
1214 bool deleteForumTopic(
const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageThreadId)
const;
1300 const std::string& text =
"",
1301 bool showAlert =
false,
1302 const std::string& url =
"",
1303 std::int32_t cacheTime = 0)
const;
1317 const std::string& languageCode =
"")
const;
1346 bool setMyName(
const std::string& name =
"",
const std::string& languageCode =
"")
const;
1363 bool setMyDescription(
const std::string& description =
"",
const std::string& languageCode =
"")
const;
1459 const std::string& title,
1460 const std::string& description,
1461 const std::string& payload,
1462 const std::string& providerToken,
1463 const std::string& currency,
1465 std::int32_t messageThreadId = 0,
1466 std::int32_t maxTipAmount = 0,
1467 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
1468 const std::string& startParameter =
"",
1469 const std::string& providerData =
"",
1470 const std::string& photoUrl =
"",
1471 std::int32_t photoSize = 0,
1472 std::int32_t photoWidth = 0,
1473 std::int32_t photoHeight = 0,
1474 bool needName =
false,
1475 bool needPhoneNumber =
false,
1476 bool needEmail =
false,
1477 bool needShippingAddress =
false,
1478 bool sendPhoneNumberToProvider =
false,
1479 bool sendEmailToProvider =
false,
1480 bool isFlexible =
false,
1481 bool disableNotification =
false,
1482 bool protectContent =
false,
1483 std::int32_t replyToMessageId = 0,
1484 bool allowSendingWithoutReply =
false,
1517 const std::string& description,
1518 const std::string& payload,
1519 const std::string& providerToken,
1520 const std::string& currency,
1522 std::int32_t maxTipAmount = 0,
1523 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
1524 const std::string& providerData =
"",
1525 const std::string& photoUrl =
"",
1526 std::int32_t photoSize = 0,
1527 std::int32_t photoWidth = 0,
1528 std::int32_t photoHeight = 0,
1529 bool needName =
false,
1530 bool needPhoneNumber =
false,
1531 bool needEmail =
false,
1532 bool needShippingAddress =
false,
1533 bool sendPhoneNumberToProvider =
false,
1534 bool sendEmailToProvider =
false,
1535 bool isFlexible =
false)
const;
1552 const std::string& errorMessage =
"")
const;
1568 const std::string& errorMessage =
"")
const;
1587 std::vector<Ptr<Update>>
getUpdates(std::int32_t offset, std::int32_t limit = 100)
const;
1615 const std::optional<cpr::File>& certificate = std::nullopt,
1616 const std::string& ipAddress =
"",
1617 std::int32_t maxConnections = 40,
1618 const std::vector<std::string>& allowedUpdates = std::vector<std::string>(),
1619 bool dropPendingUpdates =
false,
1620 const std::string& secretToken =
"")
const;
1655 const std::variant<std::int64_t, std::string>& chatId = 0,
1656 std::int32_t messageId = 0,
1657 const std::string& inlineMessageId =
"",
1658 const std::string& parseMode =
"",
1660 bool disableWebPagePreview =
false,
1675 std::int32_t messageId = 0,
1676 const std::string& inlineMessageId =
"",
1677 const std::string& caption =
"",
1678 const std::string& parseMode =
"",
1694 const std::variant<std::int64_t, std::string>& chatId = 0,
1695 std::int32_t messageId = 0,
1696 const std::string& inlineMessageId =
"",
1715 const std::variant<std::int64_t, std::string>& chatId = 0,
1716 std::int32_t messageId = 0,
1717 const std::string& inlineMessageId =
"",
1718 float horizontalAccuracy = 0.0f,
1719 std::int32_t heading = 0,
1720 std::int32_t proximityAlertRadius = 0,
1732 std::int32_t messageId = 0,
1733 const std::string& inlineMessageId =
"",
1745 std::int32_t messageId = 0,
1746 const std::string& inlineMessageId =
"",
1757 std::int32_t messageId,
1775 bool deleteMessage(
const std::variant<std::int64_t, std::string>& chatId, std::int32_t messageId)
const;
1795 const std::variant<cpr::File, std::string>& sticker,
1796 std::int32_t messageThreadId = 0,
1797 const std::string& emoji =
"",
1798 bool disableNotification =
false,
1799 bool protectContent =
false,
1827 const cpr::File& sticker,
1828 const std::string& stickerFormat)
const;
1846 const std::string& name,
1847 const std::string& title,
1849 const std::string& stickerFormat,
1850 const std::string& stickerType =
"regular",
1851 bool needsRepainting =
false)
const;
1864 const std::string& name,
1898 bool setStickerKeywords(
const std::string& sticker,
const std::vector<std::string>& keywords = std::vector<std::string>())
const;
1934 const std::string& title,
1935 const std::optional<std::variant<cpr::File, std::string>>& thumbnail = std::nullopt)
const;
1981 const std::string& gameShortName,
1982 std::int32_t messageThreadId = 0,
1983 bool disableNotification =
false,
1984 bool protectContent =
false,
2002 bool disableEditMessage =
false,
2003 std::int64_t chatId = 0,
2004 std::int32_t messageId = 0,
2005 const std::string& inlineMessageId =
"")
const;
2020 std::int64_t chatId = 0,
2021 std::int32_t messageId = 0,
2022 const std::string& inlineMessageId =
"")
const;
2040 std::int32_t cacheTime = 300,
2041 bool isPersonal =
false,
2042 const std::string& nextOffset =
"",
2057 void setUrl(
const std::string& url) noexcept;
2095 nl::json sendRequest(const std::
string& endpoint, const cpr::Multipart& data = cpr::Multipart({}))
const;
Api Methods https://core.telegram.org/bots/api#available-methods.
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....
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...
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...
cpr::Timeout getTimeout() const noexcept
Get Api requests timeout.
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....
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::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity >> &captionEntities=std::vector< Ptr< MessageEntity >>(), bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send general files.
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....
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.
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.
void setUploadFilesTimeout(const cpr::Timeout &timeout) noexcept
Set Api file uploads timeout.
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::int32_t duration=0, const std::string &performer="", const std::string &title="", const std::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send audio files, if you want Telegram clients to display them in the music player...
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....
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.
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...
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.
bool deleteStickerSet(const std::string &name) const
Use this method to delete a sticker set that was created by the bot.
void setTimeout(const cpr::Timeout &timeout)
Set Api requests timeout.
Ptr< BotDescription > getMyDescription(const std::string &languageCode="") const
Use this method to get the current bot description for the given user language.
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< Poll > stopPoll(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to stop a poll which was sent by the bot.
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,...
bool pinChatMessage(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId, bool disableNotification=false) const
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a priva...
Ptr< BotName > getMyName(const std::string &languageCode="") const
Use this method to get the current bot name for the given user language.
cpr::Timeout getDownloadFilesTimeout() const noexcept
Get Api file downloads timeout.
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to copy messages of any kind. Service messages and invoice messages can't be copied....
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.
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 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.
std::string createInvoiceLink(const std::string &title, const std::string &description, const std::string &payload, const std::string &providerToken, const std::string ¤cy, const std::vector< Ptr< LabeledPrice >> &prices, 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...
bool sendChatAction(const std::variant< std::int64_t, std::string > &chatId, const std::string &action, std::int32_t messageThreadId=0) const
Use this method when you need to tell the user that something is happening on the bot's side....
void setAllowedUpdates(const std::vector< std::string > &allowedUpdates) noexcept
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send phone contacts.
Ptr< User > getMe() const
A simple method for testing your bot's authentication token.
Ptr< File > getFile(const std::string &fileId) const
Use this method to get basic information about a file and prepare it for downloading....
Api(const std::string &token)
Constructs Api object.
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send an animated emoji that will display a random value.
void setDownloadFilesTimeout(const cpr::Timeout &timeout) noexcept
Set Api file downloads timeout.
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 ...
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
Use this method to edit only the reply markup of messages.
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false) const
Use this method to send a group of photos, videos, documents or audios as an album....
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...
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="", float horizontalAccuracy=0.0f, std::int32_t heading=0, std::int32_t proximityAlertRadius=0, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to edit live location messages. A location can be edited until its livePeriod expires...
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::int32_t duration=0, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send audio files, if you want Telegram clients to display the file as a playable v...
bool deleteWebhook(bool dropPendingUpdates=false) const
Use this method to remove webhook integration if you decide to switch back to getUpdates.
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
Use this method to forward messages of any kind. Service messages can't be forwarded.
bool setPassportDataErrors(std::int64_t userId, const std::vector< Ptr< PassportElementError >> &errors) const
Informs a user that some of the Telegram Passport elements they provided contains errors....
bool unpinChatMessage(const std::variant< std::int64_t, std::string > &chatId, std::int32_t messageId=0) const
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a ...
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 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 setStickerSetThumbnail(const std::string &name, const std::string &title, const std::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt) const
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail fi...
Ptr< Message > sendPoll(const std::variant< std::int64_t, std::string > &chatId, const std::string &question, const std::vector< std::string > &options, 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::int32_t openPeriod=0, std::int32_t closeDate=0, bool isClosed=false, std::int32_t messageThreadId=0, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send a native poll.
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 > sendAnimation(const std::variant< std::int64_t, std::string > &chatId, const std::variant< cpr::File, std::string > &animation, std::int32_t messageThreadId=0, std::int32_t duration=0, std::int32_t width=0, std::int32_t height=0, const std::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity >> &captionEntities=std::vector< Ptr< MessageEntity >>(), bool hasSpoiler=false, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound)....
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...
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.
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 > 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
Use this method to stop updating a live location message before livePeriod expires.
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...
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::int32_t duration=0, std::int32_t width=0, std::int32_t height=0, const std::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt, const std::string &caption="", const std::string &parseMode="", const std::vector< Ptr< MessageEntity >> &captionEntities=std::vector< Ptr< MessageEntity >>(), bool hasSpoiler=false, bool supportsStreaming=false, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent...
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.
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 createNewStickerSet(std::int64_t userId, const std::string &name, const std::string &title, const std::vector< Ptr< InputSticker >> &stickers, const std::string &stickerFormat, 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< 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.
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 &providerToken, const std::string ¤cy, const std::vector< Ptr< LabeledPrice >> &prices, 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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send invoices.
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....
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...
bool answerCallbackQuery(const std::string &callbackQueryId, const std::string &text="", bool showAlert=false, const std::string &url="", std::int32_t cacheTime=0) const
Use this method to send answers to callback queries sent from inline keyboards. The answer will be di...
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 ...
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.
std::vector< Ptr< Update > > getUpdates(std::int32_t offset, std::int32_t limit=100) const
Use this method to receive incoming updates using long polling.
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 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...
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::int32_t duration=0, std::int32_t length=0, const std::optional< std::variant< cpr::File, std::string >> &thumbnail=std::nullopt, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long....
Ptr< ForumTopic > createForumTopic(const std::variant< std::int64_t, std::string > &chatId, const std::string &name, std::int32_t iconColor=0x000000, const std::string &iconCustomEmojiId="") const
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the...
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.
Ptr< BotShortDescription > getMyShortDescription(const std::string &languageCode="") const
Use this method to get the current bot short description for the given user language.
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 ...
cpr::Timeout getUploadFilesTimeout() const noexcept
Get Api file uploads timeout.
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send information about a venue.
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...
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< 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,...
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...
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send point on the map.
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 > 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 >>(), bool disableWebPagePreview=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to edit text and game messages.
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,...
Ptr< ChatAdministratorRights > getMyDefaultAdministratorRights(bool forChannels=false) const
Use this method to get the current default administrator rights of the bot.
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.
void setLongPollTimeout(const cpr::Timeout &longPollTimeout)
Set long polling timeout.
void setConnectTimeout(const cpr::ConnectTimeout &timeout) noexcept
Set Api requests connection timeout.
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 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) const
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administ...
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...
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...
void setUrl(const std::string &url) noexcept
Set Api URL.
Ptr< WebhookInfo > getWebhookInfo() const
Use this method to get current webhook status. Requires no parameters. On success,...
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 disableWebPagePreview=false, bool disableNotification=false, bool protectContent=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send text messages. On success, the sent Message is returned.
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< 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
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success,...
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 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...
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...
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....
const std::vector< std::string > & getAllowedUpdates() const noexcept
Get list of the update types you want your bot to receive.
Ptr< StickerSet > getStickerSet(const std::string &name) const
Use this method to get a sticker set. On success, a StickerSet object is returned.
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< 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
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of...
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...
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
Use this method to edit captions of messages.
bool close() const
Use this method to close the bot instance before moving it from one local server to another....
bool setMyName(const std::string &name="", const std::string &languageCode="") const
Use this method to change the bot's name.
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 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...
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....
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, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, const Ptr< IReplyMarkup > &replyMarkup=nullptr) const
Use this method to send photos.
cpr::ConnectTimeout getConnectTimeout() const noexcept
Get Api requests connection timeout.
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< 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...
const std::string & getUrl() const noexcept
Get Api URL.
This object represents a bot command. https://core.telegram.org/bots/api#botcommand.
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.
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.
Represents an invite link for a chat. https://core.telegram.org/bots/api#chatinvitelink.
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.
This object represents a forum topic. https://core.telegram.org/bots/api#forumtopic.
This object represents one row of the high scores table for a game. https://core.telegram....
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 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 represents one special entity in a text message. For example, hashtags,...
This object represents a message. https://core.telegram.org/bots/api#message.
This object represents a unique message identifier. https://core.telegram.org/bots/api#messageid.
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.
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.
This object represents a sticker. https://core.telegram.org/bots/api#sticker.
This object represents a sticker set. https://core.telegram.org/bots/api#stickerset.
This object represents an incoming update. At most one of the optional parameters can be present in a...
This object represents a Telegram user or bot. https://core.telegram.org/bots/api#user.
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.