30#include <boost/property_tree/ptree.hpp>
31#include <boost/variant.hpp>
50typedef std::shared_ptr<std::vector<std::string>> StringArrayPtr;
55 Api(std::string token,
const HttpClient& httpClient,
const std::string& url);
70 std::vector<Update::Ptr>
getUpdates(std::int32_t offset = 0,
71 std::int32_t limit = 100,
72 std::int32_t timeout = 0,
73 const StringArrayPtr& allowedUpdates =
nullptr)
const;
105 std::int32_t maxConnections = 40,
106 const StringArrayPtr& allowedUpdates =
nullptr,
107 const std::string& ipAddress =
"",
108 bool dropPendingUpdates =
false,
109 const std::string& secretToken =
"")
const;
180 const std::string& text,
181 bool disableWebPagePreview =
false,
182 std::int32_t replyToMessageId = 0,
184 const std::string& parseMode =
"",
185 bool disableNotification =
false,
186 const std::vector<MessageEntity::Ptr>& entities = std::vector<MessageEntity::Ptr>(),
187 bool allowSendingWithoutReply =
false,
188 bool protectContent =
false,
189 std::int32_t messageThreadId = 0)
const;
206 boost::variant<std::int64_t, std::string> fromChatId,
207 std::int32_t messageId,
208 bool disableNotification =
false,
209 bool protectContent =
false,
210 std::int32_t messageThreadId = 0)
const;
235 boost::variant<std::int64_t, std::string> fromChatId,
236 std::int32_t messageId,
237 const std::string& caption =
"",
238 const std::string& parseMode =
"",
239 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
240 bool disableNotification =
false,
241 std::int32_t replyToMessageId = 0,
242 bool allowSendingWithoutReply =
false,
244 bool protectContent =
false,
245 std::int32_t messageThreadId = 0)
const;
266 boost::variant<InputFile::Ptr, std::string> photo,
267 const std::string& caption =
"",
268 std::int32_t replyToMessageId = 0,
270 const std::string& parseMode =
"",
271 bool disableNotification =
false,
272 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
273 bool allowSendingWithoutReply =
false,
274 bool protectContent =
false,
275 std::int32_t messageThreadId = 0,
276 bool hasSpoiler =
false)
const;
305 boost::variant<InputFile::Ptr, std::string> audio,
306 const std::string& caption =
"",
307 std::int32_t duration = 0,
308 const std::string& performer =
"",
309 const std::string& title =
"",
310 boost::variant<InputFile::Ptr, std::string> thumb =
"",
311 std::int32_t replyToMessageId = 0,
313 const std::string& parseMode =
"",
314 bool disableNotification =
false,
315 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
316 bool allowSendingWithoutReply =
false,
317 bool protectContent =
false,
318 std::int32_t messageThreadId = 0)
const;
342 boost::variant<InputFile::Ptr, std::string> document,
343 boost::variant<InputFile::Ptr, std::string> thumb =
"",
344 const std::string& caption =
"",
345 std::int32_t replyToMessageId = 0,
347 const std::string& parseMode =
"",
348 bool disableNotification =
false,
349 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
350 bool disableContentTypeDetection =
false,
351 bool allowSendingWithoutReply =
false,
352 bool protectContent =
false,
353 std::int32_t messageThreadId = 0)
const;
381 boost::variant<InputFile::Ptr, std::string> video,
382 bool supportsStreaming =
false,
383 std::int32_t duration = 0,
384 std::int32_t width = 0,
385 std::int32_t height = 0,
386 boost::variant<InputFile::Ptr, std::string> thumb =
"",
387 const std::string& caption =
"",
388 std::int32_t replyToMessageId = 0,
390 const std::string& parseMode =
"",
391 bool disableNotification =
false,
392 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
393 bool allowSendingWithoutReply =
false,
394 bool protectContent =
false,
395 std::int32_t messageThreadId = 0,
396 bool hasSpoiler =
false)
const;
423 boost::variant<InputFile::Ptr, std::string> animation,
424 std::int32_t duration = 0,
425 std::int32_t width = 0,
426 std::int32_t height = 0,
427 boost::variant<InputFile::Ptr, std::string> thumb =
"",
428 const std::string& caption =
"",
429 std::int32_t replyToMessageId = 0,
431 const std::string& parseMode =
"",
432 bool disableNotification =
false,
433 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
434 bool allowSendingWithoutReply =
false,
435 bool protectContent =
false,
436 std::int32_t messageThreadId = 0,
437 bool hasSpoiler =
false)
const;
461 boost::variant<InputFile::Ptr, std::string> voice,
462 const std::string& caption =
"",
463 std::int32_t duration = 0,
464 std::int32_t replyToMessageId = 0,
466 const std::string& parseMode =
"",
467 bool disableNotification =
false,
468 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
469 bool allowSendingWithoutReply =
false,
470 bool protectContent =
false,
471 std::int32_t messageThreadId = 0)
const;
493 boost::variant<InputFile::Ptr, std::string> videoNote,
494 std::int64_t replyToMessageId = 0,
495 bool disableNotification =
false,
496 std::int32_t duration = 0,
497 std::int32_t length = 0,
498 boost::variant<InputFile::Ptr, std::string> thumb =
"",
500 bool allowSendingWithoutReply =
false,
501 bool protectContent =
false,
502 std::int32_t messageThreadId = 0)
const;
519 std::vector<Message::Ptr>
sendMediaGroup(boost::variant<std::int64_t, std::string> chatId,
520 const std::vector<InputMedia::Ptr>& media,
521 bool disableNotification =
false,
522 std::int32_t replyToMessageId = 0,
523 bool allowSendingWithoutReply =
false,
524 bool protectContent =
false,
525 std::int32_t messageThreadId = 0)
const;
549 std::int32_t livePeriod = 0,
550 std::int32_t replyToMessageId = 0,
552 bool disableNotification =
false,
553 float horizontalAccuracy = 0,
554 std::int32_t heading = 0,
555 std::int32_t proximityAlertRadius = 0,
556 bool allowSendingWithoutReply =
false,
557 bool protectContent =
false,
558 std::int32_t messageThreadId = 0)
const;
579 boost::variant<std::int64_t, std::string> chatId =
"",
580 std::int32_t messageId = 0,
581 const std::string& inlineMessageId =
"",
583 float horizontalAccuracy = 0,
584 std::int32_t heading = 0,
585 std::int32_t proximityAlertRadius = 0)
const;
598 std::int32_t messageId = 0,
599 const std::string& inlineMessageId =
"",
626 const std::string& title,
627 const std::string& address,
628 const std::string& foursquareId =
"",
629 const std::string& foursquareType =
"",
630 bool disableNotification =
false,
631 std::int32_t replyToMessageId = 0,
633 const std::string& googlePlaceId =
"",
634 const std::string& googlePlaceType =
"",
635 bool allowSendingWithoutReply =
false,
636 bool protectContent =
false,
637 std::int32_t messageThreadId = 0)
const;
657 const std::string& phoneNumber,
658 const std::string& firstName,
659 const std::string& lastName =
"",
660 const std::string& vcard =
"",
661 bool disableNotification =
false,
662 std::int32_t replyToMessageId = 0,
664 bool allowSendingWithoutReply =
false,
665 bool protectContent =
false,
666 std::int32_t messageThreadId = 0)
const;
694 const std::string& question,
695 const std::vector<std::string>& options,
696 bool disableNotification =
false,
697 std::int32_t replyToMessageId = 0,
699 bool isAnonymous =
true,
700 const std::string& type =
"",
701 bool allowsMultipleAnswers =
false,
702 std::int32_t correctOptionId = -1,
703 const std::string& explanation =
"",
704 const std::string& explanationParseMode =
"",
705 const std::vector<MessageEntity::Ptr>& explanationEntities = std::vector<MessageEntity::Ptr>(),
706 std::int32_t openPeriod = 0,
707 std::int32_t closeDate = 0,
708 bool isClosed =
false,
709 bool allowSendingWithoutReply =
false,
710 bool protectContent =
false,
711 std::int32_t messageThreadId = 0)
const;
728 bool disableNotification =
false,
729 std::int32_t replyToMessageId = 0,
731 const std::string& emoji =
"",
732 bool allowSendingWithoutReply =
false,
733 bool protectContent =
false,
734 std::int32_t messageThreadId = 0)
const;
753 const std::string& action,
754 std::int32_t messageThreadId = 0)
const;
766 std::int32_t offset = 0,
767 std::int32_t limit = 100)
const;
801 std::int32_t untilDate = 0,
802 bool revokeMessages =
true)
const;
821 bool onlyIfBanned =
false)
const;
840 std::int64_t untilDate = 0,
841 bool useIndependentChatPermissions =
false)
const;
868 bool canChangeInfo =
false,
869 bool canPostMessages =
false,
870 bool canEditMessages =
false,
871 bool canDeleteMessages =
false,
872 bool canInviteUsers =
false,
873 bool canPinMessages =
false,
874 bool canPromoteMembers =
false,
875 bool isAnonymous =
false,
876 bool canManageChat =
false,
877 bool canManageVideoChats =
false,
878 bool canRestrictMembers =
false,
879 bool canManageTopics =
false)
const;
892 const std::string& customTitle)
const;
906 std::int64_t senderChatId)
const;
919 std::int64_t senderChatId)
const;
934 bool useIndependentChatPermissions =
false)
const;
967 std::int32_t expireDate = 0,
968 std::int32_t memberLimit = 0,
969 const std::string& name =
"",
970 bool createsJoinRequest =
false)
const;
987 const std::string& inviteLink,
988 std::int32_t expireDate = 0,
989 std::int32_t memberLimit = 0,
990 const std::string& name =
"",
991 bool createsJoinRequest =
false)
const;
1005 const std::string& inviteLink)
const;
1018 std::int64_t userId)
const;
1031 std::int64_t userId)
const;
1071 const std::string& title)
const;
1084 const std::string& description =
"")
const;
1098 std::int32_t messageId,
1099 bool disableNotification =
false)
const;
1112 std::int32_t messageId = 0)
const;
1132 bool leaveChat(boost::variant<std::int64_t, std::string> chatId)
const;
1172 std::int64_t userId)
const;
1186 const std::string& stickerSetName)
const;
1220 const std::string& name,
1221 std::int32_t iconColor = 0,
1222 const std::string& iconCustomEmojiId =
"")
const;
1237 std::int32_t messageThreadId,
1238 const std::string& name =
"",
1239 boost::variant<std::int8_t, std::string> iconCustomEmojiId = 0)
const;
1252 std::int32_t messageThreadId)
const;
1265 std::int32_t messageThreadId)
const;
1278 std::int32_t messageThreadId)
const;
1291 std::int32_t messageThreadId)
const;
1304 std::string name)
const;
1370 const std::string& text =
"",
1371 bool showAlert =
false,
1372 const std::string& url =
"",
1373 std::int32_t cacheTime = 0)
const;
1388 const std::string& languageCode =
"")
const;
1401 const std::string& languageCode =
"")
const;
1412 const std::string& languageCode =
"")
const;
1445 bool forChannels =
false)
const;
1471 boost::variant<std::int64_t, std::string> chatId = 0,
1472 std::int32_t messageId = 0,
1473 const std::string& inlineMessageId =
"",
1474 const std::string& parseMode =
"",
1475 bool disableWebPagePreview =
false,
1477 const std::vector<MessageEntity::Ptr>& entities = std::vector<MessageEntity::Ptr>())
const;
1493 std::int32_t messageId = 0,
1494 const std::string& caption =
"",
1495 const std::string& inlineMessageId =
"",
1497 const std::string& parseMode =
"",
1498 const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>())
const;
1515 boost::variant<std::int64_t, std::string> chatId = 0,
1516 std::int32_t messageId = 0,
1517 const std::string& inlineMessageId =
"",
1531 std::int32_t messageId = 0,
1532 const std::string& inlineMessageId =
"",
1545 std::int64_t messageId,
1566 std::int32_t messageId)
const;
1583 boost::variant<InputFile::Ptr, std::string> sticker,
1584 std::int32_t replyToMessageId = 0,
1586 bool disableNotification =
false,
1587 bool allowSendingWithoutReply =
false,
1588 bool protectContent =
false,
1589 std::int32_t messageThreadId = 0)
const;
1639 const std::string& name,
1640 const std::string& title,
1641 const std::string& emojis,
1643 boost::variant<InputFile::Ptr, std::string> pngSticker =
"",
1646 const std::string& stickerType =
"")
const;
1667 const std::string& name,
1668 const std::string& emojis,
1670 boost::variant<InputFile::Ptr, std::string> pngSticker =
"",
1683 std::int32_t position)
const;
1707 std::int64_t userId,
1708 boost::variant<InputFile::Ptr, std::string> thumb =
"")
const;
1726 const std::vector<InlineQueryResult::Ptr>& results,
1727 std::int32_t cacheTime = 300,
1728 bool isPersonal =
false,
1729 const std::string& nextOffset =
"",
1730 const std::string& switchPmText =
"",
1731 const std::string& switchPmParameter =
"")
const;
1779 const std::string& title,
1780 const std::string& description,
1781 const std::string& payload,
1782 const std::string& providerToken,
1783 const std::string& currency,
1784 const std::vector<LabeledPrice::Ptr>& prices,
1785 const std::string& providerData =
"",
1786 const std::string& photoUrl =
"",
1787 std::int32_t photoSize = 0,
1788 std::int32_t photoWidth = 0,
1789 std::int32_t photoHeight = 0,
1790 bool needName =
false,
1791 bool needPhoneNumber =
false,
1792 bool needEmail =
false,
1793 bool needShippingAddress =
false,
1794 bool sendPhoneNumberToProvider =
false,
1795 bool sendEmailToProvider =
false,
1796 bool isFlexible =
false,
1797 std::int32_t replyToMessageId = 0,
1799 bool disableNotification =
false,
1800 bool allowSendingWithoutReply =
false,
1801 std::int32_t maxTipAmount = 0,
1802 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
1803 const std::string& startParameter =
"",
1804 bool protectContent =
false,
1805 std::int32_t messageThreadId = 0)
const;
1834 const std::string& description,
1835 const std::string& payload,
1836 const std::string& providerToken,
1837 const std::string& currency,
1838 const std::vector<LabeledPrice::Ptr>& prices,
1839 std::int32_t maxTipAmount = 0,
1840 const std::vector<std::int32_t>& suggestedTipAmounts = std::vector<std::int32_t>(),
1841 const std::string& providerData =
"",
1842 const std::string& photoUrl =
"",
1843 std::int32_t photoSize = 0,
1844 std::int32_t photoWidth = 0,
1845 std::int32_t photoHeight = 0,
1846 bool needName =
false,
1847 bool needPhoneNumber =
false,
1848 bool needEmail =
false,
1849 bool needShippingAddress =
false,
1850 bool sendPhoneNumberToProvider =
false,
1851 bool sendEmailToProvider =
false,
1852 bool isFlexible =
false)
const;
1868 const std::vector<ShippingOption::Ptr>& shippingOptions = std::vector<ShippingOption::Ptr>(),
1869 const std::string& errorMessage =
"")
const;
1885 const std::string& errorMessage =
"")
const;
1901 const std::vector<PassportElementError::Ptr>& errors)
const;
1918 const std::string& gameShortName,
1919 std::int32_t replyToMessageId = 0,
1921 bool disableNotification =
false,
1922 bool allowSendingWithoutReply =
false,
1923 bool protectContent =
false,
1924 std::int32_t messageThreadId = 0)
const;
1944 bool disableEditMessage =
false,
1945 std::int64_t chatId = 0,
1946 std::int32_t messageId = 0,
1947 const std::string& inlineMessageId =
"")
const;
1966 std::int64_t chatId = 0,
1967 std::int32_t messageId = 0,
1968 const std::string& inlineMessageId =
"")
const;
1979 const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>())
const;
1993 boost::property_tree::ptree
sendRequest(
const std::string& method,
const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>())
const;
This class executes telegram api methods. Telegram docs: https://core.telegram.org/bots/api#available...
std::string exportChatInviteLink(boost::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 unbanChatSenderChat(boost::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.
Message::Ptr sendLocation(boost::variant< std::int64_t, std::string > chatId, float latitude, float longitude, std::int32_t livePeriod=0, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, bool disableNotification=false, float horizontalAccuracy=0, std::int32_t heading=0, std::int32_t proximityAlertRadius=0, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send point on the map.
bool promoteChatMember(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId, bool canChangeInfo=false, bool canPostMessages=false, bool canEditMessages=false, bool canDeleteMessages=false, bool canInviteUsers=false, bool canPinMessages=false, bool canPromoteMembers=false, bool isAnonymous=false, bool canManageChat=false, bool canManageVideoChats=false, bool canRestrictMembers=false, bool canManageTopics=false) const
Use this method to promote or demote a user in a supergroup or a channel.
const TgTypeParser _tgTypeParser
bool deleteMyCommands(BotCommandScope::Ptr 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 deleteWebhook(bool dropPendingUpdates=false) const
Use this method to remove webhook integration if you decide to switch back to Api::getUpdates.
bool setChatPhoto(boost::variant< std::int64_t, std::string > chatId, InputFile::Ptr photo) const
Use this method to set a new profile photo for the chat.
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 declineChatJoinRequest(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId) const
Use this method to decline a chat join request.
MessageId::Ptr copyMessage(boost::variant< std::int64_t, std::string > chatId, boost::variant< std::int64_t, std::string > fromChatId, std::int32_t messageId, const std::string &caption="", const std::string &parseMode="", const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool disableNotification=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to copy messages of any kind.
bool sendChatAction(std::int64_t 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....
bool closeGeneralForumTopic(boost::variant< std::int64_t, std::string > chatId) const
Use this method to close an open 'General' topic in a forum supergroup chat.
bool unhideGeneralForumTopic(boost::variant< std::int64_t, std::string > chatId) const
Use this method to unhide the 'General' topic in a forum supergroup chat.
bool answerShippingQuery(const std::string &shippingQueryId, bool ok, const std::vector< ShippingOption::Ptr > &shippingOptions=std::vector< ShippingOption::Ptr >(), const std::string &errorMessage="") const
Use this method to reply to shipping queries.
StickerSet::Ptr getStickerSet(const std::string &name) const
Use this method to get a sticker set.
bool approveChatJoinRequest(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId) const
Use this method to approve a chat join request.
Message::Ptr sendVideo(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > video, bool supportsStreaming=false, std::int32_t duration=0, std::int32_t width=0, std::int32_t height=0, boost::variant< InputFile::Ptr, std::string > thumb="", const std::string &caption="", std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0, bool hasSpoiler=false) const
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent...
Message::Ptr editMessageReplyMarkup(boost::variant< std::int64_t, std::string > chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", GenericReply::Ptr replyMarkup=nullptr) const
Use this method to edit only the reply markup of messages.
std::vector< Message::Ptr > sendMediaGroup(boost::variant< std::int64_t, std::string > chatId, const std::vector< InputMedia::Ptr > &media, bool disableNotification=false, std::int32_t replyToMessageId=0, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send a group of photos, videos, documents or audios as an album.
std::vector< ChatMember::Ptr > getChatAdministrators(boost::variant< std::int64_t, std::string > chatId) const
Use this method to get a list of administrators in a chat, which aren't bots.
ChatInviteLink::Ptr revokeChatInviteLink(boost::variant< std::int64_t, std::string > chatId, const std::string &inviteLink) const
Use this method to revoke an invite link created by the bot.
Message::Ptr stopMessageLiveLocation(boost::variant< std::int64_t, std::string > chatId="", std::int32_t messageId=0, const std::string &inlineMessageId="", InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >()) const
Use this method to stop updating a live location message before livePeriod expires.
bool setWebhook(const std::string &url, InputFile::Ptr certificate=nullptr, std::int32_t maxConnections=40, const StringArrayPtr &allowedUpdates=nullptr, const std::string &ipAddress="", bool dropPendingUpdates=false, const std::string &secretToken="") const
Use this method to specify a URL and receive incoming updates via an outgoing webhook.
Message::Ptr sendVideoNote(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > videoNote, std::int64_t replyToMessageId=0, bool disableNotification=false, std::int32_t duration=0, std::int32_t length=0, boost::variant< InputFile::Ptr, std::string > thumb="", GenericReply::Ptr replyMarkup=nullptr, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send video messages.
std::vector< GameHighScore::Ptr > 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.
Message::Ptr editMessageMedia(InputMedia::Ptr media, boost::variant< std::int64_t, std::string > chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", GenericReply::Ptr replyMarkup=nullptr) const
Use this method to edit animation, audio, document, photo, or video messages.
WebhookInfo::Ptr getWebhookInfo() const
Use this method to get current webhook status.
Chat::Ptr getChat(boost::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...
bool setMyDefaultAdministratorRights(ChatAdministratorRights::Ptr 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...
Message::Ptr sendDocument(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > document, boost::variant< InputFile::Ptr, std::string > thumb="", const std::string &caption="", std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool disableContentTypeDetection=false, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send general files.
bool restrictChatMember(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId, ChatPermissions::Ptr permissions, std::int64_t untilDate=0, bool useIndependentChatPermissions=false) const
Use this method to restrict a user in a supergroup.
bool editGeneralForumTopic(boost::variant< std::int64_t, std::string > chatId, std::string name) const
Use this method to edit the name of the 'General' topic in a forum supergroup chat.
const HttpClient & _httpClient
std::vector< Sticker::Ptr > getForumTopicIconStickers() const
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
MenuButton::Ptr getChatMenuButton(std::int64_t chatId=0) const
Use this method to get the current value of the bot's menu button in a private chat,...
User::Ptr getMe() const
A simple method for testing your bot's authentication token.
Message::Ptr sendVenue(boost::variant< std::int64_t, std::string > chatId, float latitude, float longitude, const std::string &title, const std::string &address, const std::string &foursquareId="", const std::string &foursquareType="", bool disableNotification=false, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &googlePlaceId="", const std::string &googlePlaceType="", bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send information about a venue.
bool setChatStickerSet(boost::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.
Message::Ptr sendAnimation(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > animation, std::int32_t duration=0, std::int32_t width=0, std::int32_t height=0, boost::variant< InputFile::Ptr, std::string > thumb="", const std::string &caption="", std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0, bool hasSpoiler=false) const
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
Message::Ptr sendAudio(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > audio, const std::string &caption="", std::int32_t duration=0, const std::string &performer="", const std::string &title="", boost::variant< InputFile::Ptr, std::string > thumb="", std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send audio files, if you want Telegram clients to display them in the music player...
bool deleteForumTopic(boost::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.
Message::Ptr sendPhoto(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > photo, const std::string &caption="", std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0, bool hasSpoiler=false) const
Use this method to send photos.
std::vector< BotCommand::Ptr > getMyCommands(BotCommandScope::Ptr 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 setStickerSetThumb(const std::string &name, std::int64_t userId, boost::variant< InputFile::Ptr, std::string > thumb="") const
Use this method to set the thumbnail of a sticker set.
bool editForumTopic(boost::variant< std::int64_t, std::string > chatId, std::int32_t messageThreadId, const std::string &name="", boost::variant< std::int8_t, std::string > iconCustomEmojiId=0) const
Use this method to edit name and icon of a topic in a forum supergroup chat.
Message::Ptr editMessageText(const std::string &text, boost::variant< std::int64_t, std::string > chatId=0, std::int32_t messageId=0, const std::string &inlineMessageId="", const std::string &parseMode="", bool disableWebPagePreview=false, GenericReply::Ptr replyMarkup=nullptr, const std::vector< MessageEntity::Ptr > &entities=std::vector< MessageEntity::Ptr >()) const
Use this method to edit text and game messages.
std::vector< Update::Ptr > getUpdates(std::int32_t offset=0, std::int32_t limit=100, std::int32_t timeout=0, const StringArrayPtr &allowedUpdates=nullptr) const
Use this method to receive incoming updates using long polling (https://en.wikipedia....
Message::Ptr sendGame(std::int64_t chatId, const std::string &gameShortName, std::int32_t replyToMessageId=0, InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >(), bool disableNotification=false, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send a game.
SentWebAppMessage::Ptr answerWebAppQuery(const std::string &webAppQueryId, InlineQueryResult::Ptr result) const
Use this method to set the result of an interaction with a Web App and send a corresponding message o...
bool addStickerToSet(std::int64_t userId, const std::string &name, const std::string &emojis, MaskPosition::Ptr maskPosition=nullptr, boost::variant< InputFile::Ptr, std::string > pngSticker="", InputFile::Ptr tgsSticker=nullptr, InputFile::Ptr webmSticker=nullptr) const
Use this method to add a new sticker to a set created by the bot.
bool logOut() const
Use this method to log out from the cloud Bot API server before launching the bot locally.
Message::Ptr sendVoice(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > voice, const std::string &caption="", std::int32_t duration=0, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send audio files, if you want Telegram clients to display the file as a playable v...
ChatMember::Ptr getChatMember(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId) const
Use this method to get information about a member of a chat.
bool answerInlineQuery(const std::string &inlineQueryId, const std::vector< InlineQueryResult::Ptr > &results, std::int32_t cacheTime=300, bool isPersonal=false, const std::string &nextOffset="", const std::string &switchPmText="", const std::string &switchPmParameter="") const
Use this method to send answers to an inline query.
bool pinChatMessage(boost::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.
bool reopenGeneralForumTopic(boost::variant< std::int64_t, std::string > chatId) const
Use this method to reopen a closed 'General' topic in a forum supergroup chat.
bool setChatDescription(boost::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.
bool unpinChatMessage(boost::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.
bool deleteStickerFromSet(const std::string &sticker) const
Use this method to delete a sticker from a set created by the bot.
File::Ptr uploadStickerFile(std::int64_t userId, InputFile::Ptr pngSticker) const
Use this method to upload a .PNG file with a sticker for later use in Api::createNewStickerSet and Ap...
UserProfilePhotos::Ptr 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 reopenForumTopic(boost::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.
bool setMyCommands(const std::vector< BotCommand::Ptr > &commands, BotCommandScope::Ptr scope=nullptr, const std::string &languageCode="") const
Use this method to change the list of the bot's commands.
ChatInviteLink::Ptr createChatInviteLink(boost::variant< std::int64_t, std::string > chatId, std::int32_t expireDate=0, std::int32_t memberLimit=0, const std::string &name="", bool createsJoinRequest=false) const
Use this method to create an additional invite link for a chat.
Message::Ptr sendMessage(boost::variant< std::int64_t, std::string > chatId, const std::string &text, bool disableWebPagePreview=false, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", bool disableNotification=false, const std::vector< MessageEntity::Ptr > &entities=std::vector< MessageEntity::Ptr >(), bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send text messages.
std::int32_t getChatMemberCount(boost::variant< std::int64_t, std::string > chatId) const
Use this method to get the number of members in a chat.
bool setPassportDataErrors(std::int64_t userId, const std::vector< PassportElementError::Ptr > &errors) const
Informs a user that some of the Telegram Passport elements they provided contains errors.
ForumTopic::Ptr createForumTopic(boost::variant< std::int64_t, std::string > chatId, const std::string &name, std::int32_t iconColor=0, const std::string &iconCustomEmojiId="") const
Use this method to create a topic in a forum supergroup chat.
bool setChatTitle(boost::variant< std::int64_t, std::string > chatId, const std::string &title) const
Use this method to change the title of a chat.
bool setChatAdministratorCustomTitle(boost::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.
std::string downloadFile(const std::string &filePath, const std::vector< HttpReqArg > &args=std::vector< HttpReqArg >()) const
Download a file from Telegram and save it in memory.
Api(std::string token, const HttpClient &httpClient, const std::string &url)
bool unbanChatMember(boost::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.
Message::Ptr editMessageCaption(boost::variant< std::int64_t, std::string > chatId=0, std::int32_t messageId=0, const std::string &caption="", const std::string &inlineMessageId="", GenericReply::Ptr replyMarkup=nullptr, const std::string &parseMode="", const std::vector< MessageEntity::Ptr > &captionEntities=std::vector< MessageEntity::Ptr >()) const
Use this method to edit captions of messages.
bool setChatPermissions(boost::variant< std::int64_t, std::string > chatId, ChatPermissions::Ptr permissions, bool useIndependentChatPermissions=false) const
Use this method to set default chat permissions for all members.
bool banChatMember(boost::variant< std::int64_t, std::string > chatId, std::int64_t userId, std::int32_t untilDate=0, bool revokeMessages=true) const
Use this method to ban a user in a group, a supergroup or a channel.
ChatInviteLink::Ptr editChatInviteLink(boost::variant< std::int64_t, std::string > chatId, const std::string &inviteLink, std::int32_t expireDate=0, std::int32_t memberLimit=0, const std::string &name="", bool createsJoinRequest=false) const
Use this method to edit a non-primary invite link created by the bot.
bool blockedByUser(std::int64_t chatId) const
Check if user has blocked the bot.
bool closeForumTopic(boost::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.
bool deleteChatPhoto(boost::variant< std::int64_t, std::string > chatId) const
Use this method to delete a chat photo.
bool answerPreCheckoutQuery(const std::string &preCheckoutQueryId, bool ok, const std::string &errorMessage="") const
Use this method to respond to such pre-checkout queries.
std::vector< Sticker::Ptr > getCustomEmojiStickers(const std::vector< std::string > &customEmojiIds) const
Use this method to get information about custom emoji stickers by their identifiers.
bool unpinAllForumTopicMessages(boost::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.
ChatAdministratorRights::Ptr getMyDefaultAdministratorRights(bool forChannels=false) const
Use this method to get the current default administrator rights of the bot.
bool leaveChat(boost::variant< std::int64_t, std::string > chatId) const
Use this method for your bot to leave a group, supergroup or channel.
Message::Ptr editMessageLiveLocation(float latitude, float longitude, boost::variant< std::int64_t, std::string > chatId="", std::int32_t messageId=0, const std::string &inlineMessageId="", InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >(), float horizontalAccuracy=0, std::int32_t heading=0, std::int32_t proximityAlertRadius=0) const
Use this method to edit live location messages.
File::Ptr getFile(const std::string &fileId) const
Use this method to get basic information about a file and prepare it for downloading.
Poll::Ptr stopPoll(boost::variant< std::int64_t, std::string > chatId, std::int64_t messageId, InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >()) const
Use this method to stop a poll which was sent by the bot.
bool unpinAllChatMessages(boost::variant< std::int64_t, std::string > chatId) const
Use this method to clear the list of pinned messages in a chat.
Message::Ptr 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.
Message::Ptr sendPoll(boost::variant< std::int64_t, std::string > chatId, const std::string &question, const std::vector< std::string > &options, bool disableNotification=false, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, bool isAnonymous=true, const std::string &type="", bool allowsMultipleAnswers=false, std::int32_t correctOptionId=-1, const std::string &explanation="", const std::string &explanationParseMode="", const std::vector< MessageEntity::Ptr > &explanationEntities=std::vector< MessageEntity::Ptr >(), std::int32_t openPeriod=0, std::int32_t closeDate=0, bool isClosed=false, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send a native poll.
bool hideGeneralForumTopic(boost::variant< std::int64_t, std::string > chatId) const
Use this method to hide the 'General' topic in a forum supergroup chat.
Message::Ptr sendSticker(boost::variant< std::int64_t, std::string > chatId, boost::variant< InputFile::Ptr, std::string > sticker, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, bool disableNotification=false, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
Message::Ptr sendContact(boost::variant< std::int64_t, std::string > chatId, const std::string &phoneNumber, const std::string &firstName, const std::string &lastName="", const std::string &vcard="", bool disableNotification=false, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send phone contacts.
bool deleteMessage(boost::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 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.
boost::property_tree::ptree sendRequest(const std::string &method, const std::vector< HttpReqArg > &args=std::vector< HttpReqArg >()) const
bool setChatMenuButton(std::int64_t chatId=0, MenuButton::Ptr menuButton=nullptr) const
Use this method to change the bot's menu button in a private chat, or the default menu button.
bool deleteChatStickerSet(boost::variant< std::int64_t, std::string > chatId) const
Use this method to delete a group sticker set from a supergroup.
bool close() const
Use this method to close the bot instance before moving it from one local server to another.
Message::Ptr sendInvoice(boost::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< LabeledPrice::Ptr > &prices, 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, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, bool disableNotification=false, bool allowSendingWithoutReply=false, std::int32_t maxTipAmount=0, const std::vector< std::int32_t > &suggestedTipAmounts=std::vector< std::int32_t >(), const std::string &startParameter="", bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send invoices.
Message::Ptr sendDice(boost::variant< std::int64_t, std::string > chatId, bool disableNotification=false, std::int32_t replyToMessageId=0, GenericReply::Ptr replyMarkup=nullptr, const std::string &emoji="", bool allowSendingWithoutReply=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to send an animated emoji that will display a random value.
bool banChatSenderChat(boost::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.
bool createNewStickerSet(std::int64_t userId, const std::string &name, const std::string &title, const std::string &emojis, MaskPosition::Ptr maskPosition=nullptr, boost::variant< InputFile::Ptr, std::string > pngSticker="", InputFile::Ptr tgsSticker=nullptr, InputFile::Ptr webmSticker=nullptr, const std::string &stickerType="") const
Use this method to create a new sticker set owned by a user.
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< LabeledPrice::Ptr > &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.
Message::Ptr forwardMessage(boost::variant< std::int64_t, std::string > chatId, boost::variant< std::int64_t, std::string > fromChatId, std::int32_t messageId, bool disableNotification=false, bool protectContent=false, std::int32_t messageThreadId=0) const
Use this method to forward messages of any kind.
std::shared_ptr< BotCommandScope > Ptr
This object holds other objects specific for this bot instance.
std::shared_ptr< ChatAdministratorRights > Ptr
std::shared_ptr< Chat > Ptr
std::shared_ptr< ChatInviteLink > Ptr
std::shared_ptr< ChatMember > Ptr
std::shared_ptr< ChatPermissions > Ptr
std::shared_ptr< File > Ptr
std::shared_ptr< ForumTopic > Ptr
std::shared_ptr< GenericReply > Ptr
This class makes http requests.
std::shared_ptr< InlineKeyboardMarkup > Ptr
std::shared_ptr< InlineQueryResult > Ptr
std::shared_ptr< MaskPosition > Ptr
std::shared_ptr< Message > Ptr
std::shared_ptr< MessageId > Ptr
std::shared_ptr< Poll > Ptr
std::shared_ptr< SentWebAppMessage > Ptr
std::shared_ptr< StickerSet > Ptr
std::shared_ptr< User > Ptr
std::shared_ptr< UserProfilePhotos > Ptr
std::shared_ptr< WebhookInfo > Ptr