diff options
author | JellyBrick <shlee1503@naver.com> | 2018-05-27 02:27:44 +0900 |
---|---|---|
committer | JellyBrick <shlee1503@naver.com> | 2018-05-27 02:27:44 +0900 |
commit | 66cbca3b206567ce62af42cab950696ef6f80adb (patch) | |
tree | 9a69b16523de4c083540e4d092942a15cf12ef42 /src/Api.cpp | |
parent | b538f1fb43c790c9043630e6bfad42f037dbe03a (diff) |
Bot API 3.0 (Maks Mazurov (fox.cpp))
Diffstat (limited to 'src/Api.cpp')
-rw-r--r-- | src/Api.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/Api.cpp b/src/Api.cpp index 31e08f3..5e39a9a 100644 --- a/src/Api.cpp +++ b/src/Api.cpp @@ -291,6 +291,50 @@ Message::Ptr Api::sendVideo(int64_t chatId, const string& videoId, int32_t durat return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendVideo", args)); } +Message::Ptr Api::sendVideoNote(int64_t chatId, const InputFile::Ptr videoNote, int64_t replyToMessageId, bool disableNotification, int32_t duration, int32_t length, const GenericReply::Ptr replyMarkup) { + vector<HttpReqArg> args; + args.push_back(HttpReqArg("chat_id", chatId)); + args.push_back(HttpReqArg("video_note", videoNote)); + if (disableNotification) { + args.push_back(HttpReqArg("disable_notification", disableNotification)); + } + if (duration) { + args.push_back(HttpReqArg("duration", duration)); + } + if (length) { + args.push_back(HttpReqArg("length", length)); + } + if (replyMarkup) { + args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup))); + } + if (replyToMessageId) { + args.push_back(HttpReqArg("reply_to_message_id", replyToMessageId)); + } + return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendVoiceNote", args)); +} + +Message::Ptr Api::sendVideoNote(int64_t chatId, const std::string &videoNote, int64_t replyToMessageId, bool disableNotification, int32_t duration, int32_t length, const GenericReply::Ptr replyMarkup) { + vector<HttpReqArg> args; + args.push_back(HttpReqArg("chat_id", chatId)); + args.push_back(HttpReqArg("video_note", videoNote)); + if (disableNotification) { + args.push_back(HttpReqArg("disable_notification", disableNotification)); + } + if (duration) { + args.push_back(HttpReqArg("duration", duration)); + } + if (length) { + args.push_back(HttpReqArg("length", length)); + } + if (replyMarkup) { + args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup))); + } + if (replyToMessageId) { + args.push_back(HttpReqArg("reply_to_message_id", replyToMessageId)); + } + return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendVoiceNote", args)); +} + Message::Ptr Api::sendVoice(int64_t chatId, const InputFile::Ptr voice, const std::string &caption, int duration, int32_t replyToMessageId, const GenericReply::Ptr replyMarkup, bool disableNotification) const { vector<HttpReqArg> args; args.push_back(HttpReqArg("chat_id", chatId)); |