summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Giove <andreagiove@outlook.com>2016-04-16 22:23:38 +0200
committerAndrea Giove <andreagiove@outlook.com>2016-04-16 22:23:38 +0200
commitabbd611b34ccb5f77c1c28160294f1481c9479c2 (patch)
tree7cbfe9b18d657116ac908ab987790e2218fee6ee
parent45f46c60f6253a4b7c0cebf047983dd7cfce1683 (diff)
Added the disable_method parameter to all methods
-rw-r--r--include/tgbot/Api.h51
-rw-r--r--src/Api.cpp65
2 files changed, 90 insertions, 26 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index 68b8462..0670ea0 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -65,18 +65,21 @@ public:
* @param disableWebPagePreview Optional. Disables link previews for links in this message.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendMessage(int64_t chatId, const std::string& text, bool disableWebPagePreview = false, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendMessage(int64_t chatId, const std::string& text, bool disableWebPagePreview = false,
+ int32_t replyToMessageId = 0,const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to forward messages of any kind.
* @param chatId Unique identifier for the target chat.
* @param fromChatId Unique identifier for the chat where the original message was sent — User or GroupChat id.
* @param messageId Unique message identifier.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr forwardMessage(int64_t chatId, int64_t fromChatId, int32_t messageId) const;
+ Message::Ptr forwardMessage(int64_t chatId, int64_t fromChatId, int32_t messageId, bool disableNotification = false) const;
/**
* Use this method to send photos.
@@ -85,9 +88,11 @@ public:
* @param caption Optional. Photo caption.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendPhoto(int64_t chatId, const InputFile::Ptr& photo, const std::string& caption = "", int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendPhoto(int64_t chatId, const InputFile::Ptr& photo, const std::string& caption = "", int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send photos.
@@ -96,9 +101,11 @@ public:
* @param caption Optional. Photo caption.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendPhoto(int64_t chatId, const std::string& photoId, const std::string& caption = "", int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendPhoto(int64_t chatId, const std::string& photoId, const std::string& caption = "", int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Document).
@@ -107,9 +114,11 @@ public:
* @param duration Duration of sent audio in seconds.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendAudio(int64_t chatId, const InputFile::Ptr& audio, int32_t duration = 0, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendAudio(int64_t chatId, const InputFile::Ptr& audio, int32_t duration = 0, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Document).
@@ -118,9 +127,11 @@ public:
* @param duration Duration of sent audio in seconds.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendAudio(int64_t chatId, const std::string& audioId, int32_t duration = 0, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendAudio(int64_t chatId, const std::string& audioId, int32_t duration = 0, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send general files.
@@ -128,9 +139,11 @@ public:
* @param document Document to send.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendDocument(int64_t chatId, const InputFile::Ptr& document, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendDocument(int64_t chatId, const InputFile::Ptr& document, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send general files.
@@ -138,9 +151,11 @@ public:
* @param document Id of the document that is already on the Telegram servers.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendDocument(int64_t chatId, const std::string& documentId, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendDocument(int64_t chatId, const std::string& documentId, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send .webp stickers.
@@ -148,9 +163,11 @@ public:
* @param sticker Sticker to send.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendSticker(int64_t chatId, const InputFile::Ptr& sticker, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendSticker(int64_t chatId, const InputFile::Ptr& sticker, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send .webp stickers.
@@ -158,9 +175,11 @@ public:
* @param sticker Id of the sticker that is already on the Telegram servers.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendSticker(int64_t chatId, const std::string& stickerId, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendSticker(int64_t chatId, const std::string& stickerId, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
@@ -168,9 +187,11 @@ public:
* @param video Video to send.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendVideo(int64_t chatId, const InputFile::Ptr& video, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendVideo(int64_t chatId, const InputFile::Ptr& video, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
@@ -178,9 +199,11 @@ public:
* @param video Id of the video that is already on the Telegram servers.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendVideo(int64_t chatId, const std::string& videoId, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendVideo(int64_t chatId, const std::string& videoId, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method to send point on the map.
@@ -189,9 +212,11 @@ public:
* @param longitude Longitude of location.
* @param replyToMessageId Optional. If the message is a reply, ID of the original message.
* @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
+ * @param disableNotification Optional. Sends the message silenty.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendLocation(int64_t chatId, float latitude, float longitude, int32_t replyToMessageId = 0, const GenericReply::Ptr& replyMarkup = GenericReply::Ptr()) const;
+ Message::Ptr sendLocation(int64_t chatId, float latitude, float longitude, int32_t replyToMessageId = 0,
+ const GenericReply::Ptr& replyMarkup = GenericReply::Ptr(), bool disableNotification = false) const;
/**
* Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
diff --git a/src/Api.cpp b/src/Api.cpp
index 4070230..087b742 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -38,13 +38,16 @@ 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, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("text", text));
if (disableWebPagePreview) {
args.push_back(HttpReqArg("disable_web_page_preview", disableWebPagePreview));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
if (replyToMessageId) {
args.push_back(HttpReqArg("reply_to_message_id", replyToMessageId));
}
@@ -54,15 +57,18 @@ Message::Ptr Api::sendMessage(int64_t chatId, const string& text, bool disableWe
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendMessage", args));
}
-Message::Ptr Api::forwardMessage(int64_t chatId, int64_t fromChatId, int32_t messageId) const {
+Message::Ptr Api::forwardMessage(int64_t chatId, int64_t fromChatId, int32_t messageId, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("from_chat_id", fromChatId));
args.push_back(HttpReqArg("message_id", messageId));
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("forwardMessage", args));
}
-Message::Ptr Api::sendPhoto(int64_t chatId, const InputFile::Ptr& photo, const string& caption, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendPhoto(int64_t chatId, const InputFile::Ptr& photo, const string& caption, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("photo", photo->data, true, photo->mimeType, photo->fileName));
@@ -75,10 +81,13 @@ Message::Ptr Api::sendPhoto(int64_t chatId, const InputFile::Ptr& photo, const s
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendPhoto", args));
}
-Message::Ptr Api::sendPhoto(int64_t chatId, const string& photoId, const string& caption, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendPhoto(int64_t chatId, const string& photoId, const string& caption, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("photo", photoId));
@@ -91,10 +100,13 @@ Message::Ptr Api::sendPhoto(int64_t chatId, const string& photoId, const string&
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendPhoto", args));
}
-Message::Ptr Api::sendAudio(int64_t chatId, const InputFile::Ptr& audio, int32_t duration, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendAudio(int64_t chatId, const InputFile::Ptr& audio, int32_t duration, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("audio", audio->data, true, audio->mimeType, audio->fileName));
@@ -107,10 +119,13 @@ Message::Ptr Api::sendAudio(int64_t chatId, const InputFile::Ptr& audio, int32_t
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendAudio", args));
}
-Message::Ptr Api::sendAudio(int64_t chatId, const string& audioId, int32_t duration, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendAudio(int64_t chatId, const string& audioId, int32_t duration, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("audio", audioId));
@@ -123,10 +138,13 @@ Message::Ptr Api::sendAudio(int64_t chatId, const string& audioId, int32_t durat
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendAudio", args));
}
-Message::Ptr Api::sendDocument(int64_t chatId, const InputFile::Ptr& document, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendDocument(int64_t chatId, const InputFile::Ptr& document, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("document", document->data, true, document->mimeType, document->fileName));
@@ -136,10 +154,13 @@ Message::Ptr Api::sendDocument(int64_t chatId, const InputFile::Ptr& document, i
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendDocument", args));
}
-Message::Ptr Api::sendDocument(int64_t chatId, const string& document, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendDocument(int64_t chatId, const string& document, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("document", document));
@@ -149,10 +170,13 @@ Message::Ptr Api::sendDocument(int64_t chatId, const string& document, int32_t r
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendDocument", args));
}
-Message::Ptr Api::sendSticker(int64_t chatId, const InputFile::Ptr& sticker, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendSticker(int64_t chatId, const InputFile::Ptr& sticker, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("sticker", sticker->data, true, sticker->mimeType, sticker->fileName));
@@ -162,10 +186,13 @@ Message::Ptr Api::sendSticker(int64_t chatId, const InputFile::Ptr& sticker, int
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendSticker", args));
}
-Message::Ptr Api::sendSticker(int64_t chatId, const string& stickerId, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendSticker(int64_t chatId, const string& stickerId, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("sticker", stickerId));
@@ -175,10 +202,13 @@ Message::Ptr Api::sendSticker(int64_t chatId, const string& stickerId, int32_t r
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendSticker", args));
}
-Message::Ptr Api::sendVideo(int64_t chatId, const InputFile::Ptr& video, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendVideo(int64_t chatId, const InputFile::Ptr& video, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("video", video->data, true, video->mimeType, video->fileName));
@@ -188,10 +218,13 @@ Message::Ptr Api::sendVideo(int64_t chatId, const InputFile::Ptr& video, int32_t
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendVideo", args));
}
-Message::Ptr Api::sendVideo(int64_t chatId, const string& videoId, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendVideo(int64_t chatId, const string& videoId, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("video", videoId));
@@ -201,10 +234,13 @@ Message::Ptr Api::sendVideo(int64_t chatId, const string& videoId, int32_t reply
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendVideo", args));
}
-Message::Ptr Api::sendLocation(int64_t chatId, float latitude, float longitude, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup) const {
+Message::Ptr Api::sendLocation(int64_t chatId, float latitude, float longitude, int32_t replyToMessageId, const GenericReply::Ptr& replyMarkup, bool disableNotification) const {
vector<HttpReqArg> args;
args.push_back(HttpReqArg("chat_id", chatId));
args.push_back(HttpReqArg("latitude", latitude));
@@ -215,6 +251,9 @@ Message::Ptr Api::sendLocation(int64_t chatId, float latitude, float longitude,
if (replyMarkup) {
args.push_back(HttpReqArg("reply_markup", TgTypeParser::getInstance().parseGenericReply(replyMarkup)));
}
+ if (disableNotification){
+ args.push_back(HttpReqArg("disable_notification", disableNotification));
+ }
return TgTypeParser::getInstance().parseJsonAndGetMessage(sendRequest("sendLocation", args));
}