summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Api.cpp7
-rw-r--r--src/TgTypeParser.cpp3
-rw-r--r--src/types/InlineQueryResult.cpp16
3 files changed, 13 insertions, 13 deletions
diff --git a/src/Api.cpp b/src/Api.cpp
index 6b41947..9996108 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -335,12 +335,11 @@ bool Api::createNewStickerSet(int32_t userId, const string& name, const string&
return sendRequest("createNewStickerSet", args).get<bool>("", false);
}
-bool Api::addStickerToSet(int32_t userId, const string& name, const string& title, const boost::variant<InputFile::Ptr, std::string> pngSticker, const string& emojis, MaskPosition::Ptr maskPosition) const {
+bool Api::addStickerToSet(int32_t userId, const string& name, const boost::variant<InputFile::Ptr, std::string> pngSticker, const string& emojis, MaskPosition::Ptr maskPosition) const {
vector<HttpReqArg> args;
args.reserve(6);
args.emplace_back("user_id", userId);
args.emplace_back("name", name);
- args.emplace_back("title", title);
if (pngSticker.which() == 0 /* InputFile::Ptr */) {
auto file = boost::get<InputFile::Ptr>(pngSticker);
args.emplace_back("png_sticker", file->data, true, file->mimeType, file->fileName);
@@ -362,11 +361,11 @@ bool Api::setStickerPositionInSet(const string& sticker, uint32_t position) cons
return sendRequest("setStickerPositionInSet", args).get<bool>("", false);
}
-bool Api::deleteStickerPositionInSet(const string& sticker) const {
+bool Api::deleteStickerFromSet(const string& sticker) const {
vector<HttpReqArg> args;
args.reserve(1);
args.emplace_back("sticker", sticker);
- return sendRequest("setStickerPositionInSet", args).get<bool>("", false);
+ return sendRequest("deleteStickerFromSet", args).get<bool>("", false);
}
Message::Ptr Api::sendVideo(int64_t chatId, const boost::variant<InputFile::Ptr, std::string> video, bool supportsStreaming, int32_t duration, int32_t width, int32_t height, const boost::variant<InputFile::Ptr, std::string> thumb, const string &caption, int32_t replyToMessageId, const GenericReply::Ptr replyMarkup, const string& parseMode, bool disableNotification) const {
diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp
index 4e31c94..daa7b4b 100644
--- a/src/TgTypeParser.cpp
+++ b/src/TgTypeParser.cpp
@@ -1723,12 +1723,13 @@ std::string TgTypeParser::parseInlineKeyboardButton(const InlineKeyboardButton::
}
string result;
result += '{';
+ if(object->pay)
+ appendToJson(result, "pay", object->pay);
appendToJson(result, "text", object->text);
appendToJson(result, "url", object->url);
appendToJson(result, "callback_data", object->callbackData);
appendToJson(result, "switch_inline_query", object->switchInlineQuery);
appendToJson(result, "switch_inline_query_current_chat", object->switchInlineQueryCurrentChat);
- appendToJson(result, "pay", object->pay);
removeLastComma(result);
result += '}';
return result;
diff --git a/src/types/InlineQueryResult.cpp b/src/types/InlineQueryResult.cpp
index 9f90e19..79debe0 100644
--- a/src/types/InlineQueryResult.cpp
+++ b/src/types/InlineQueryResult.cpp
@@ -25,14 +25,14 @@
using namespace TgBot;
-const std::string InlineQueryResultCachedAudio::TYPE = "cached_audio";
-const std::string InlineQueryResultCachedDocument::TYPE = "cached_document";
-const std::string InlineQueryResultCachedGif::TYPE = "cached_gif";
-const std::string InlineQueryResultCachedMpeg4Gif::TYPE = "cached_mpeg4gif";
-const std::string InlineQueryResultCachedPhoto::TYPE = "cached_photo";
-const std::string InlineQueryResultCachedSticker::TYPE = "cached_sticker";
-const std::string InlineQueryResultCachedVideo::TYPE = "cached_video";
-const std::string InlineQueryResultCachedVoice::TYPE = "cached_voice";
+const std::string InlineQueryResultCachedAudio::TYPE = "audio";
+const std::string InlineQueryResultCachedDocument::TYPE = "document";
+const std::string InlineQueryResultCachedGif::TYPE = "gif";
+const std::string InlineQueryResultCachedMpeg4Gif::TYPE = "mpeg4_gif";
+const std::string InlineQueryResultCachedPhoto::TYPE = "photo";
+const std::string InlineQueryResultCachedSticker::TYPE = "sticker";
+const std::string InlineQueryResultCachedVideo::TYPE = "video";
+const std::string InlineQueryResultCachedVoice::TYPE = "voice";
const std::string InlineQueryResultArticle::TYPE = "article";
const std::string InlineQueryResultAudio::TYPE = "audio";