summaryrefslogtreecommitdiff
path: root/src/Api.cpp
diff options
context:
space:
mode:
authorllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-08-31 17:50:50 +0200
committerllnulldisk <48621230+llnulldisk@users.noreply.github.com>2022-08-31 17:50:50 +0200
commitedb32270990eb194459622701ebba1b64192303c (patch)
tree7307143f471263e9a0f9a052670f4a84d2f73c93 /src/Api.cpp
parent416db4c79203f56d8a4c58014371c49309339018 (diff)
Add Telegram Passport
Diffstat (limited to 'src/Api.cpp')
-rw-r--r--src/Api.cpp29
1 files changed, 10 insertions, 19 deletions
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<std::string>& 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<HttpReqArg> args;
@@ -1053,13 +1047,6 @@ bool Api::createNewStickerSet(std::int64_t userId, const std::string& name, cons
return sendRequest("createNewStickerSet", args).get<bool>("", false);
}
-bool Api::createNewStickerSet(std::int64_t userId, const std::string& name, const std::string& title,
- boost::variant<InputFile::Ptr, std::string> 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<InputFile::Ptr, std::string> pngSticker, boost::variant<InputFile::Ptr, std::string> tgsSticker, MaskPosition::Ptr maskPosition) const {
vector<HttpReqArg> args;
@@ -1087,12 +1074,6 @@ bool Api::addStickerToSet(std::int64_t userId, const std::string& name, const st
return sendRequest("addStickerToSet", args).get<bool>("", false);
}
-bool Api::addStickerToSet(std::int64_t userId, const std::string& name, boost::variant<InputFile::Ptr, std::string> 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<HttpReqArg> args;
args.reserve(2);
@@ -1239,6 +1220,16 @@ bool Api::answerPreCheckoutQuery(const std::string& preCheckoutQueryId, bool ok,
return sendRequest("answerPreCheckoutQuery", args).get<bool>("", false);
}
+bool Api::setPassportDataErrors(std::int64_t userId, const std::vector<PassportElementError::Ptr>& errors) const {
+ vector<HttpReqArg> args;
+ args.reserve(2);
+
+ args.emplace_back("user_id", userId);
+ args.emplace_back("errors", _tgTypeParser.parseArray<PassportElementError>(&TgTypeParser::parsePassportElementError, errors));
+
+ return sendRequest("setPassportDataErrors", args).get<bool>("", 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<HttpReqArg> args;
args.reserve(5);