From edb32270990eb194459622701ebba1b64192303c Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Wed, 31 Aug 2022 17:50:50 +0200 Subject: Add Telegram Passport --- src/Api.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'src/Api.cpp') diff --git a/src/Api.cpp b/src/Api.cpp index 77e8c0b..070d72e 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -570,12 +570,6 @@ Message::Ptr Api::sendPoll(std::int64_t chatId, const std::string& question, con return _tgTypeParser.parseJsonAndGetMessage(sendRequest("sendPoll", args)); } -Message::Ptr Api::sendPoll(std::int64_t chatId, const std::string& question, const std::vector& options, - bool disableNotification, std::int32_t replyToMessageId, GenericReply::Ptr replyMarkup) const { - - return sendPoll(chatId, question, options, true, "", false, 0, "", "", 0, 0, false, false, 0); -} - Message::Ptr Api::sendDice(std::int64_t chatId, const std::string& emoji, bool disableNotification, std::int32_t replyToMessageId, GenericReply::Ptr replyMarkup) const { vector args; @@ -1053,13 +1047,6 @@ bool Api::createNewStickerSet(std::int64_t userId, const std::string& name, cons return sendRequest("createNewStickerSet", args).get("", false); } -bool Api::createNewStickerSet(std::int64_t userId, const std::string& name, const std::string& title, - boost::variant pngSticker, const std::string& emojis, bool containsMasks, - MaskPosition::Ptr maskPosition) const { - - return createNewStickerSet(userId, name, title, emojis, pngSticker, "", containsMasks, maskPosition); -} - bool Api::addStickerToSet(std::int64_t userId, const std::string& name, const std::string& emojis, boost::variant pngSticker, boost::variant tgsSticker, MaskPosition::Ptr maskPosition) const { vector args; @@ -1087,12 +1074,6 @@ bool Api::addStickerToSet(std::int64_t userId, const std::string& name, const st return sendRequest("addStickerToSet", args).get("", false); } -bool Api::addStickerToSet(std::int64_t userId, const std::string& name, boost::variant pngSticker, - const std::string& emojis, MaskPosition::Ptr maskPosition) const { - - return addStickerToSet(userId, name, emojis, pngSticker, "", maskPosition); -} - bool Api::setStickerPositionInSet(const string& sticker, std::uint32_t position) const { vector args; args.reserve(2); @@ -1239,6 +1220,16 @@ bool Api::answerPreCheckoutQuery(const std::string& preCheckoutQueryId, bool ok, return sendRequest("answerPreCheckoutQuery", args).get("", false); } +bool Api::setPassportDataErrors(std::int64_t userId, const std::vector& errors) const { + vector args; + args.reserve(2); + + args.emplace_back("user_id", userId); + args.emplace_back("errors", _tgTypeParser.parseArray(&TgTypeParser::parsePassportElementError, errors)); + + return sendRequest("setPassportDataErrors", args).get("", false); +} + Message::Ptr Api::sendGame(std::int64_t chatId, const std::string& gameShortName, std::int32_t replyToMessageId, const InlineKeyboardMarkup::Ptr replyMarkup, bool disableNotification) const { vector args; args.reserve(5); -- cgit v1.2.3