From 3f7a10f82567a0be04a424e0ddc360a73670c9d7 Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Mon, 27 Jul 2015 20:59:09 +0300 Subject: Documentation --- src/tgbot/Api.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/tgbot/Api.cpp') diff --git a/src/tgbot/Api.cpp b/src/tgbot/Api.cpp index 8da88c8..913401b 100644 --- a/src/tgbot/Api.cpp +++ b/src/tgbot/Api.cpp @@ -94,10 +94,13 @@ Message::Ptr Api::sendPhoto(int32_t chatId, const string& photo, const string& c return TgTypeParser::getInstance().parseMessage(sendRequest("sendPhoto", args).find("result")->second); } -Message::Ptr Api::sendAudio(int32_t chatId, const InputFile::Ptr& audio, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const { +Message::Ptr Api::sendAudio(int32_t chatId, const InputFile::Ptr& audio, int32_t duration = 0, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const { vector args; args.push_back(HttpReqArg("chat_id", chatId)); args.push_back(HttpReqArg("audio", audio->data, true, audio->mimeType)); + if (duration) { + args.push_back(HttpReqArg("duration", duration)); + } if (replyToMessageId) { args.push_back(HttpReqArg("reply_to_message_id", replyToMessageId)); } @@ -107,10 +110,13 @@ Message::Ptr Api::sendAudio(int32_t chatId, const InputFile::Ptr& audio, int32_t return TgTypeParser::getInstance().parseMessage(sendRequest("sendAudio", args).find("result")->second); } -Message::Ptr Api::sendAudio(int32_t chatId, const string& audio, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const { +Message::Ptr Api::sendAudio(int32_t chatId, const string& audio, int32_t duration = 0, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const { vector args; args.push_back(HttpReqArg("chat_id", chatId)); args.push_back(HttpReqArg("audio", audio)); + if (duration) { + args.push_back(HttpReqArg("duration", duration)); + } if (replyToMessageId) { args.push_back(HttpReqArg("reply_to_message_id", replyToMessageId)); } -- cgit v1.2.3