23 #ifndef TGBOT_CPP_API_H 24 #define TGBOT_CPP_API_H 29 #include <boost/property_tree/ptree.hpp> 56 typedef std::shared_ptr<std::vector<std::string>> StringArrayPtr;
61 Api(
const std::string& token);
80 Message::Ptr sendMessage(int64_t chatId,
const std::string& text,
bool disableWebPagePreview =
false, int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
const std::string& parseMode =
"",
bool disableNotification =
false)
const;
103 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
115 Message::Ptr sendPhoto(int64_t chatId,
const std::string& photoId,
const std::string& caption =
"", int32_t replyToMessageId = 0,
116 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
132 const std::string& performer =
"",
const std::string& title =
"", int32_t replyToMessageId = 0,
133 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
148 Message::Ptr sendAudio(int64_t chatId,
const std::string& audioId,
const std::string &caption =
"", int32_t duration = 0,
149 const std::string& performer =
"",
const std::string& title =
"", int32_t replyToMessageId = 0,
150 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
163 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
175 Message::Ptr sendDocument(int64_t chatId,
const std::string& documentId,
const std::string &caption =
"", int32_t replyToMessageId = 0,
176 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
188 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
200 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
228 bool createNewStickerSet(int32_t userId,
const std::string& name,
const std::string& title,
242 bool createNewStickerSet(int32_t userId,
const std::string& name,
const std::string& title,
243 const std::string& pngSticker,
const std::string& emojis,
bool containsMasks =
false,
MaskPosition::Ptr maskPosition =
nullptr)
const;
255 bool addStickerToSet(int32_t userId,
const std::string& name,
const std::string& title,
268 bool addStickerToSet(int32_t userId,
const std::string& name,
const std::string& title,
269 const std::string& pngSticker,
const std::string& emojis,
MaskPosition::Ptr maskPosition =
nullptr)
const;
300 int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
315 Message::Ptr sendVideo(int64_t chatId,
const std::string& videoId, int32_t duration = 0, int32_t width = 0, int32_t height = 0,
const std::string& caption =
"",
316 int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
343 Message::Ptr sendVideoNote(int64_t chatId,
const std::string& videoNote, int64_t replyToMessageId = 0,
bool disableNotification =
false,
354 std::vector<Message::Ptr>
sendMediaGroup(int64_t chatId,
const std::vector<InputMedia::Ptr>& media,
355 bool disableNotification =
false, int32_t replyToMessageId = 0)
const;
369 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
382 Message::Ptr sendVoice(int64_t chatId,
const std::string& voiceId,
const std::string& caption =
"",
int duration = 0, int32_t replyToMessageId = 0,
383 const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
397 int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(),
bool disableNotification =
false)
const;
410 int32_t inlineMessageId = 0,
const InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>())
const;
437 Message::Ptr sendVenue(int64_t chatId,
float latitude,
float longitude,
const std::string& title,
const std::string& address,
const std::string& foursquareId =
"",
438 bool disableNotification =
false, int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>())
const;
451 Message::Ptr sendContact(int64_t chatId,
const std::string& phoneNumber,
const std::string& firstName,
const std::string& lastName =
"",
bool disableNotification =
false,
452 int32_t replyToMessageId = 0,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>())
const;
461 void sendChatAction(int64_t chatId,
const std::string& action)
const;
540 bool answerCallbackQuery(
const std::string & callbackQueryId,
const std::string & text=
"",
bool showAlert=
false,
const std::string &url=
"", int32_t cacheTime=0)
const;
553 Message::Ptr editMessageText(
const std::string& text, int64_t chatId=0, int32_t messageId=0,
const std::string& inlineMessageId=
"",
554 const std::string& parseMode =
"",
bool disableWebPagePreview =
false,
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>())
const;
566 const std::string& inlineMessageId =
"",
const GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>())
const;
596 std::vector<Update::Ptr>
getUpdates(int32_t offset = 0, int32_t limit = 100, int32_t timeout = 0,
const StringArrayPtr &allowedUpdates =
nullptr)
const;
606 void setWebhook(
const std::string& url =
"",
const InputFile::Ptr certificate =
nullptr, int32_t maxConnection = 40,
const StringArrayPtr &allowedUpdates =
nullptr)
const;
633 bool answerInlineQuery(
const std::string& inlineQueryId,
const std::vector<InlineQueryResult::Ptr>& results,
634 int32_t cacheTime = 300,
bool isPersonal =
false,
const std::string& nextOffset =
"",
const std::string& switchPmText =
"",
const std::string& switchPmParameter =
"")
const;
643 bool kickChatMember(int64_t chatId, int32_t userId, uint64_t untilDate = 0)
const;
664 bool restrictChatMember(int64_t chatId, int32_t userId, uint64_t untilDate = 0,
bool canSendMessages =
false,
665 bool canSendMediaMessages =
false,
bool canSendOtherMessages =
false,
bool canAddWebPagePreviews =
false)
const;
681 bool promoteChatMember(int64_t chatId, int32_t userId,
bool canChangeInfo =
false,
bool canPostMessages =
false,
682 bool canEditMessages =
false,
bool canDeleteMessages =
false,
bool canInviteUsers =
false,
bool canPinMessages =
false,
bool canPromoteMembers =
false)
const;
715 bool setChatTitle(int64_t chatId,
const std::string& title)
const;
732 bool pinChatMessage(int64_t chatId, int32_t messageId,
bool disableNotification =
false)
const;
748 std::string
downloadFile(
const std::string& filePath,
const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>())
const;
751 boost::property_tree::ptree sendRequest(
const std::string& method,
const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>())
const;
753 const std::string _token;
758 #endif //TGBOT_CPP_API_H Chat::Ptr getChat(int64_t chatId) const
Message::Ptr sendVideo(int64_t chatId, const InputFile::Ptr video, int32_t duration=0, int32_t width=0, int32_t height=0, const std::string &caption="", int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
std::shared_ptr< StickerSet > Ptr
std::shared_ptr< File > Ptr
Message::Ptr sendPhoto(int64_t chatId, const InputFile::Ptr photo, const std::string &caption="", int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
bool promoteChatMember(int64_t chatId, int32_t userId, bool canChangeInfo=false, bool canPostMessages=false, bool canEditMessages=false, bool canDeleteMessages=false, bool canInviteUsers=false, bool canPinMessages=false, bool canPromoteMembers=false) const
bool unpinChatMessage(int64_t chatId) const
std::string downloadFile(const std::string &filePath, const std::vector< HttpReqArg > &args=std::vector< HttpReqArg >()) const
std::vector< Update::Ptr > getUpdates(int32_t offset=0, int32_t limit=100, int32_t timeout=0, const StringArrayPtr &allowedUpdates=nullptr) const
File::Ptr getFile(const std::string &fileId) const
bool setChatDescription(int64_t chatId, const std::string &description) const
bool setChatTitle(int64_t chatId, const std::string &title) const
bool kickChatMember(int64_t chatId, int32_t userId, uint64_t untilDate=0) const
bool createNewStickerSet(int32_t userId, const std::string &name, const std::string &title, InputFile::Ptr pngSticker, const std::string &emojis, bool containsMasks=false, MaskPosition::Ptr maskPosition=nullptr) const
Message::Ptr sendContact(int64_t chatId, const std::string &phoneNumber, const std::string &firstName, const std::string &lastName="", bool disableNotification=false, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >()) const
bool addStickerToSet(int32_t userId, const std::string &name, const std::string &title, InputFile::Ptr pngSticker, const std::string &emojis, MaskPosition::Ptr maskPosition=nullptr) const
bool answerCallbackQuery(const std::string &callbackQueryId, const std::string &text="", bool showAlert=false, const std::string &url="", int32_t cacheTime=0) const
std::shared_ptr< InlineKeyboardMarkup > Ptr
Message::Ptr sendSticker(int64_t chatId, const InputFile::Ptr sticker, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
bool setChatStickerSet(int64_t chatId, const std::string &stickerSetName) const
std::shared_ptr< Message > Ptr
bool pinChatMessage(int64_t chatId, int32_t messageId, bool disableNotification=false) const
bool deleteStickerPositionInSet(const std::string &sticker) const
void deleteMessage(int64_t chatId, int32_t messageId) const
bool deleteChatStickerSet(int64_t chatId) const
std::shared_ptr< UserProfilePhotos > Ptr
std::shared_ptr< WebhookInfo > Ptr
WebhookInfo::Ptr getWebhookInfo() const
bool unbanChatMember(int64_t chatId, int32_t userId) const
int32_t getChatMembersCount(int64_t chatId) const
std::shared_ptr< GenericReply > Ptr
Message::Ptr editMessageReplyMarkup(int64_t chatId=0, int32_t messageId=0, const std::string &inlineMessageId="", const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >()) const
Message::Ptr forwardMessage(int64_t chatId, int64_t fromChatId, int32_t messageId, bool disableNotification=false) const
Message::Ptr sendLocation(int64_t chatId, float latitude, float longitude, uint32_t livePeriod=0, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
Message::Ptr sendAudio(int64_t chatId, const InputFile::Ptr audio, const std::string &caption="", int32_t duration=0, const std::string &performer="", const std::string &title="", int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
std::shared_ptr< Chat > Ptr
Message::Ptr sendVideoNote(int64_t chatId, const InputFile::Ptr videoNote, int64_t replyToMessageId=0, bool disableNotification=false, int32_t duration=0, int32_t length=0, const GenericReply::Ptr replyMarkup=GenericReply::Ptr())
Message::Ptr editMessageLiveLocation(float latitude, float longitude, int64_t chatId=0, int32_t messageId=0, int32_t inlineMessageId=0, const InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >()) const
bool leaveChat(int64_t chatId) const
Message::Ptr sendDocument(int64_t chatId, const InputFile::Ptr document, const std::string &caption="", int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
void sendChatAction(int64_t chatId, const std::string &action) const
File::Ptr uploadStickerFile(int32_t userId, const InputFile::Ptr pngSticker) const
bool answerInlineQuery(const std::string &inlineQueryId, const std::vector< InlineQueryResult::Ptr > &results, int32_t cacheTime=300, bool isPersonal=false, const std::string &nextOffset="", const std::string &switchPmText="", const std::string &switchPmParameter="") const
ChatMember::Ptr getChatMember(int64_t chatId, int32_t userId) const
bool setChatPhoto(int64_t chatId, const InputFile::Ptr photo) const
std::vector< Message::Ptr > sendMediaGroup(int64_t chatId, const std::vector< InputMedia::Ptr > &media, bool disableNotification=false, int32_t replyToMessageId=0) const
bool deleteWebhook() const
std::shared_ptr< MaskPosition > Ptr
bool deleteChatPhoto(int64_t chatId) const
Api(const std::string &token)
StickerSet::Ptr getStickerSet(const std::string &name) const
Message::Ptr sendVenue(int64_t chatId, float latitude, float longitude, const std::string &title, const std::string &address, const std::string &foursquareId="", bool disableNotification=false, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >()) const
Message::Ptr sendVoice(int64_t chatId, const InputFile::Ptr voice, const std::string &caption="", int duration=0, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), bool disableNotification=false) const
Message::Ptr sendMessage(int64_t chatId, const std::string &text, bool disableWebPagePreview=false, int32_t replyToMessageId=0, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >(), const std::string &parseMode="", bool disableNotification=false) const
std::vector< ChatMember::Ptr > getChatAdministrators(int64_t chatId) const
Message::Ptr stopMessageLiveLocation(int64_t chatId=0, int32_t messageId=0, int32_t inlineMessageId=0, const InlineKeyboardMarkup::Ptr replyMarkup=std::make_shared< InlineKeyboardMarkup >()) const
Message::Ptr editMessageCaption(int64_t chatId=0, int32_t messageId=0, const std::string &caption="", const std::string &inlineMessageId="", const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >()) const
bool restrictChatMember(int64_t chatId, int32_t userId, uint64_t untilDate=0, bool canSendMessages=false, bool canSendMediaMessages=false, bool canSendOtherMessages=false, bool canAddWebPagePreviews=false) const
UserProfilePhotos::Ptr getUserProfilePhotos(int32_t userId, int32_t offset=0, int32_t limit=100) const
std::string exportChatInviteLink(int64_t chatId) const
std::shared_ptr< ChatMember > Ptr
void setWebhook(const std::string &url="", const InputFile::Ptr certificate=nullptr, int32_t maxConnection=40, const StringArrayPtr &allowedUpdates=nullptr) const
Message::Ptr editMessageText(const std::string &text, int64_t chatId=0, int32_t messageId=0, const std::string &inlineMessageId="", const std::string &parseMode="", bool disableWebPagePreview=false, const GenericReply::Ptr replyMarkup=std::make_shared< GenericReply >()) const
bool setStickerPositionInSet(const std::string &sticker, uint32_t position) const
std::shared_ptr< User > Ptr