summaryrefslogtreecommitdiff
path: root/src/TgTypeParser.cpp
diff options
context:
space:
mode:
authorYJBeetle <yjbeetle@gmail.com>2019-11-29 05:01:03 +0800
committerYJBeetle <yjbeetle@gmail.com>2019-11-29 05:01:03 +0800
commit2318c534d4286436a668c5a33220dfc8d5b85686 (patch)
tree4d95639486124e093c6795c0355969f64712a564 /src/TgTypeParser.cpp
parentb3cc5149f8337a43fe7f5174e35c739cd5e6b229 (diff)
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.
Diffstat (limited to 'src/TgTypeParser.cpp')
-rw-r--r--src/TgTypeParser.cpp3
1 files changed, 2 insertions, 1 deletions
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;