diff options
author | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-20 17:50:12 +0200 |
---|---|---|
committer | llnulldisk <48621230+llnulldisk@users.noreply.github.com> | 2022-09-20 17:50:12 +0200 |
commit | f9d24932cc960eeae32e049fc271fa6fa01327c3 (patch) | |
tree | ceb1a1f1d74c6d997d7c1add5429a00554917cf5 | |
parent | 39f1085f078865a6d3bc48a05b6ab923eb9ebcae (diff) |
Fix #230
-rw-r--r-- | include/tgbot/Api.h | 4 | ||||
-rw-r--r-- | src/Api.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 693eb21..a87435c 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -656,7 +656,7 @@ public: */ Message::Ptr sendPoll(boost::variant<std::int64_t, const std::string&> chatId, const std::string& question, - const StringArrayPtr& options, + const std::vector<std::string>& options, bool disableNotification = false, std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), @@ -1400,7 +1400,7 @@ public: * * @return Returns an Array of Sticker objects. */ - std::vector<Sticker::Ptr> getCustomEmojiStickers(const StringArrayPtr& customEmojiIds) const; + std::vector<Sticker::Ptr> getCustomEmojiStickers(const std::vector<std::string>& customEmojiIds) const; /** * @brief Use this method to upload a .PNG file with a sticker for later use in Api::createNewStickerSet and Api::addStickerToSet methods (can be used multiple times). diff --git a/src/Api.cpp b/src/Api.cpp index 875a79a..e13fa7c 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -880,7 +880,7 @@ Message::Ptr Api::sendContact(boost::variant<std::int64_t, const std::string&> c Message::Ptr Api::sendPoll(boost::variant<std::int64_t, const std::string&> chatId, const std::string& question, - const StringArrayPtr& options, + const std::vector<std::string>& options, bool disableNotification, std::int32_t replyToMessageId, GenericReply::Ptr replyMarkup, @@ -903,8 +903,8 @@ Message::Ptr Api::sendPoll(boost::variant<std::int64_t, const std::string&> chat args.emplace_back("question", question); args.emplace_back("options", _tgTypeParser.parseArray<std::string>( [](const std::string& option)->std::string { - return "\"" + StringTools::urlEncode(option) + "\""; - }, *options)); + return "\"" + option + "\""; + }, options)); if (!isAnonymous) { args.emplace_back("is_anonymous", isAnonymous); } @@ -1755,13 +1755,13 @@ StickerSet::Ptr Api::getStickerSet(const std::string& name) const { return _tgTypeParser.parseJsonAndGetStickerSet(sendRequest("getStickerSet", args)); } -std::vector<Sticker::Ptr> Api::getCustomEmojiStickers(const StringArrayPtr& customEmojiIds) const { +std::vector<Sticker::Ptr> Api::getCustomEmojiStickers(const std::vector<std::string>& customEmojiIds) const { std::vector<HttpReqArg> args; args.reserve(1); args.emplace_back("custom_emoji_ids", _tgTypeParser.parseArray<std::string>([] (const std::string& customEmojiId) -> std::string { - return "\"" + StringTools::urlEncode(customEmojiId) + "\""; - }, *customEmojiIds)); + return "\"" + customEmojiId + "\""; + }, customEmojiIds)); return _tgTypeParser.parseJsonAndGetArray<Sticker>(&TgTypeParser::parseJsonAndGetSticker, sendRequest("getCustomEmojiStickers", args)); } |