From 2318c534d4286436a668c5a33220dfc8d5b85686 Mon Sep 17 00:00:00 2001 From: YJBeetle Date: Fri, 29 Nov 2019 05:01:03 +0800 Subject: fix: answerInlineQuery BUTTON_TYPE_INVALID error https://core.telegram.org/bots/api#inlinekeyboardbutton pay: NOTE: This type of button must always be the first button in the first row. --- src/TgTypeParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/TgTypeParser.cpp') 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; -- cgit v1.2.3