diff options
author | Xiaodong Qi <qxd@bupt.edu.cn> | 2016-04-13 18:33:57 +0800 |
---|---|---|
committer | Xiaodong Qi <qxd@bupt.edu.cn> | 2016-04-13 18:33:57 +0800 |
commit | 136ad5d2d870239204859bae2500292c2657ef78 (patch) | |
tree | f3cf3cd372005efec492160130a339ebd0174d61 /src | |
parent | b2e4048cf9ce6d4dc4969a52cffc2ad36ec19f21 (diff) |
Add parseMode parameter to sendMessage
Diffstat (limited to 'src')
-rw-r--r-- | src/Api.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index ed06d27..6419780 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -38,7 +38,7 @@ User::Ptr Api::getMe() const { return TgTypeParser::getInstance().parseJsonAndGetUser(sendRequest("getMe")); } -Message::Ptr Api::sendMessage(int64_t chatId, const string& text, bool disableWebPagePreview, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const { +Message::Ptr Api::sendMessage(int64_t chatId, const string& text, bool disableWebPagePreview, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, const string& parseMode) const { vector<HttpReqArg> args; args.push_back(HttpReqArg("chat_id", chatId)); args.push_back(HttpReqArg("text", text)); @@ -51,6 +51,9 @@ Message::Ptr Api::sendMessage(int64_t chatId, const string& text, bool disableWe if (replyMarkup) { args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup))); } + if (!parseMode.empty()) { + args.push_back(HttpReqArg("parse_mode", parseMode)); + } return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendMessage", args)); } |