From 6c2dc4d2eb84e7ba98f73332ccf95ffa5a7adf3f Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 16:03:48 +0900 Subject: Bot API 4.0 - Part 1 --- include/tgbot/Api.h | 34 +++++++++++++++++++----- include/tgbot/types/Audio.h | 7 +++++ include/tgbot/types/Contact.h | 5 ++++ include/tgbot/types/InlineQueryResultContact.h | 5 ++++ include/tgbot/types/InlineQueryResultVenue.h | 5 ++++ include/tgbot/types/InputContactMessageContent.h | 5 ++++ include/tgbot/types/InputVenueMessageContent.h | 4 +++ include/tgbot/types/Message.h | 8 ++++++ include/tgbot/types/MessageEntity.h | 4 ++- include/tgbot/types/Venue.h | 7 ++++- 10 files changed, 76 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 0a781e6..2af7be2 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -27,6 +27,7 @@ #include #include +#include #include "tgbot/TgTypeParser.h" #include "tgbot/net/HttpClient.h" @@ -177,7 +178,7 @@ public: /** * @brief Use this method to send general files. * @param chatId Unique identifier for the target chat. - * @param document Id of the document that is already on the Telegram servers. + * @param documentId of the document that is already on the Telegram servers. * @param caption Document caption (may also be used when resending documents by file_id), 0-200 characters * @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. @@ -393,6 +394,25 @@ public: Message::Ptr sendVideo(int64_t chatId, const std::string& videoId, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string& caption = "", int32_t replyToMessageId = 0, const GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; + /** + * @brief Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). + * + * Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. + * + * @param chatId Unique identifier for the target chat. + * @param animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. + * @param duration Optional. Duration of sent animation in seconds. + * @param width Optional. Animation width. + * @param height Optional. Animation height. + * @param caption Optional. Animation caption (may also be used when resending animation by file_id), 0-200 characters + * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. + * @param disableNotification Optional. Sends the message silenty. + * @return On success, the sent Message is returned. + */ + Message::Ptr sendAnimation(int64_t chatId, boost::variant animation, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string &caption = "", + int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** * @brief Use this method to send video messages. On success, the sent Message is returned. * @param chatId Unique identifier for the target chat. @@ -405,7 +425,7 @@ public: * @return On success, the sent Message is returned. */ Message::Ptr sendVideoNote(int64_t chatId, InputFile::Ptr videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, - int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()); + int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()) const; /** * @brief Use this method to send video messages. On success, the sent Message is returned. @@ -419,7 +439,7 @@ public: * @return On success, the sent Message is returned. */ Message::Ptr sendVideoNote(int64_t chatId, const std::string& videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, - int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()); + int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()) const; /** * @brief Use this method to send a group of photos or videos as an album. @@ -520,13 +540,14 @@ public: * @param longitude Longitude of location. * @param title Name of the venue. * @param address Address of the venue. - * @param foursquare_id Foursquare identifier of the venue. + * @param foursquareId Foursquare identifier of the venue. + * @param foursquareType Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) * @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 sendVenue(int64_t chatId, float latitude, float longitude, const std::string& title, const std::string& address, const std::string& foursquareId = "", + Message::Ptr sendVenue(int64_t chatId, float latitude, float longitude, const std::string& title, const std::string& address, const std::string& foursquareId = "", const std::string& foursquareType = "", bool disableNotification = false, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared()) const; /** @@ -535,12 +556,13 @@ public: * @param phoneNumber Contact's phone number. * @param firstName Contact's first name. * @param lastName Contact's last name. + * @param vcard Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes. * @param disableNotification Optional. Sends the message silenty. * @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. * @return On success, the sent message is returned. */ - Message::Ptr sendContact(int64_t chatId, const std::string& phoneNumber, const std::string& firstName, const std::string& lastName = "", bool disableNotification = false, + Message::Ptr sendContact(int64_t chatId, const std::string& phoneNumber, const std::string& firstName, const std::string& lastName = "", const std::string& vcard = "", bool disableNotification = false, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared()) const; /** diff --git a/include/tgbot/types/Audio.h b/include/tgbot/types/Audio.h index 3b8b3e3..b77a106 100644 --- a/include/tgbot/types/Audio.h +++ b/include/tgbot/types/Audio.h @@ -26,6 +26,8 @@ #include #include +#include "tgbot/types/PhotoSize.h" + namespace TgBot { /** @@ -69,6 +71,11 @@ public: * @brief Optional. File size. */ int32_t fileSize; + + /** + * @brief Optional. Thumbnail of the album cover to which the music file belongs + */ + PhotoSize::Ptr thumb; }; } diff --git a/include/tgbot/types/Contact.h b/include/tgbot/types/Contact.h index eb17e5a..9cfc477 100644 --- a/include/tgbot/types/Contact.h +++ b/include/tgbot/types/Contact.h @@ -57,6 +57,11 @@ public: * @brief Optional. Contact's user identifier in Telegram. */ std::string userId; + + /** + * @brief Optional. Additional data about the contact in the form of a vCard. + */ + std::string vcard; }; } diff --git a/include/tgbot/types/InlineQueryResultContact.h b/include/tgbot/types/InlineQueryResultContact.h index 39bd570..3f18a2a 100644 --- a/include/tgbot/types/InlineQueryResultContact.h +++ b/include/tgbot/types/InlineQueryResultContact.h @@ -44,6 +44,11 @@ public: */ std::string lastName; + /** + * @brief Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes + */ + std::string vcard; + /** * @brief Optional. Url of the thumbnail for the result */ diff --git a/include/tgbot/types/InlineQueryResultVenue.h b/include/tgbot/types/InlineQueryResultVenue.h index d012463..3f58e19 100644 --- a/include/tgbot/types/InlineQueryResultVenue.h +++ b/include/tgbot/types/InlineQueryResultVenue.h @@ -49,6 +49,11 @@ public: */ std::string foursquareId; + /** + * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) + */ + std::string foursquareType; + /** * @brief Optional. Url of the thumbnail for the result */ diff --git a/include/tgbot/types/InputContactMessageContent.h b/include/tgbot/types/InputContactMessageContent.h index 865dbba..799fa64 100644 --- a/include/tgbot/types/InputContactMessageContent.h +++ b/include/tgbot/types/InputContactMessageContent.h @@ -38,6 +38,11 @@ public: */ std::string lastName; + /** + * @brief Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes + */ + std::string vcard; + virtual ~InputContactMessageContent() { } }; } diff --git a/include/tgbot/types/InputVenueMessageContent.h b/include/tgbot/types/InputVenueMessageContent.h index 115e7d0..254a0a0 100644 --- a/include/tgbot/types/InputVenueMessageContent.h +++ b/include/tgbot/types/InputVenueMessageContent.h @@ -49,6 +49,10 @@ public: */ std::string foursquareId; + /** + * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) + */ + virtual ~InputVenueMessageContent() { } }; } diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h index 1f5c75a..f92eeaf 100644 --- a/include/tgbot/types/Message.h +++ b/include/tgbot/types/Message.h @@ -32,6 +32,7 @@ #include "tgbot/types/Message.h" #include "tgbot/types/Audio.h" #include "tgbot/types/Document.h" +#include "tgbot/types/Animation.h" #include "tgbot/types/Sticker.h" #include "tgbot/types/Video.h" #include "tgbot/types/Contact.h" @@ -140,6 +141,13 @@ public: */ Document::Ptr document; + /** + * @brief Optional. Message is an animation, information about the animation. + * + * For backward compatibility, when this field is set, the document field will also be set. + */ + Animation::Ptr animation; + /** * @brief Optional. Message is a game, information about the game. */ diff --git a/include/tgbot/types/MessageEntity.h b/include/tgbot/types/MessageEntity.h index ca495ee..530011b 100644 --- a/include/tgbot/types/MessageEntity.h +++ b/include/tgbot/types/MessageEntity.h @@ -21,7 +21,9 @@ public: typedef std::shared_ptr Ptr; /** - * @brief Type of the entity. One of mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs). + * @brief Type of the entity. + * + * Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames) */ std::string type; diff --git a/include/tgbot/types/Venue.h b/include/tgbot/types/Venue.h index 657d951..cc52314 100644 --- a/include/tgbot/types/Venue.h +++ b/include/tgbot/types/Venue.h @@ -39,7 +39,12 @@ public: /** * @brief Optional. Foursquare identifier of the venue. */ - std::string foursquare_id; + std::string foursquareId; + + /** + * @brief Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) + */ + std::string foursquareType; }; } -- cgit v1.2.3 From 941c97706cb5b81d5a2e44a827e8f6bf76a2c6bd Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 17:40:44 +0900 Subject: Bot API 4.0 - Part 2 --- include/tgbot/Api.h | 18 ++++++++++ include/tgbot/types/InputMedia.h | 34 ++++++++++++++---- include/tgbot/types/InputMediaAnimation.h | 49 ++++++++++++++++++++++++++ include/tgbot/types/InputMediaAudio.h | 49 ++++++++++++++++++++++++++ include/tgbot/types/InputMediaDocument.h | 49 ++++++++++++++++++++++++++ include/tgbot/types/InputVenueMessageContent.h | 5 +++ 6 files changed, 198 insertions(+), 6 deletions(-) create mode 100644 include/tgbot/types/InputMediaAnimation.h create mode 100644 include/tgbot/types/InputMediaAudio.h create mode 100644 include/tgbot/types/InputMediaDocument.h (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 2af7be2..480949e 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -681,6 +681,24 @@ public: Message::Ptr editMessageCaption(int64_t chatId = 0, int32_t messageId = 0, const std::string& caption = "", const std::string& inlineMessageId = "", GenericReply::Ptr replyMarkup = std::make_shared()) const; + /** + * @brief Use this method to edit audio, document, photo, or video messages. + * + * + * If a message is a part of a message album, then it can be edited only to a photo or a video. + * Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. + * Use previously uploaded file via its file_id or specify a URL. + * + * @param media A JSON-serialized object for a new media content of the message. + * @param chatId Optional Required if inline_message_id is not specified. Unique identifier for the target chat of the target channel. + * @param messageId Optional Required if inline_message_id is not specified. Identifier of the sent message + * @param inlineMessageId Optional Required if chat_id and message_id are not specified. Identifier of the inline message + * @param replyMarkup Optional A JSON-serialized object for an inline keyboard. + * @return On success, if the edited message was sent by the bot, the edited Message is returned, otherwise nullptr is returned. + */ + Message::Ptr editMessageMedia(InputMedia::Ptr media, int64_t chatId = 0, int32_t messageId = 0, const std::string& inlineMessageId = "", + GenericReply::Ptr replyMarkup = std::make_shared()) const; + /** * @brief Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). * @param chatId Optional Required if inline_message_id is not specified. Unique identifier for the target chat of the target channel. diff --git a/include/tgbot/types/InputMedia.h b/include/tgbot/types/InputMedia.h index a4610ad..c8cd4ae 100644 --- a/include/tgbot/types/InputMedia.h +++ b/include/tgbot/types/InputMedia.h @@ -28,6 +28,8 @@ #include #include +#include + namespace TgBot { /** @@ -41,11 +43,14 @@ public: enum class TYPE : uint8_t { PHOTO, - VIDEO + VIDEO, + ANIMATION, + DOCUMENT, + AUDIO }; /** - * @brief Type of the result, It should be one of TYPE::PHOTO/TYPE::VIDEO + * @brief Type of the result, It should be one of TYPE::* */ TYPE type; @@ -55,7 +60,14 @@ public: std::string media; /** - * @brief Optional. Caption of the photo to be sent, 0-200 characters + * @brief Optional. Thumbnail of the file sent. + * + * The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . + */ + std::string thumb; + + /** + * @brief Optional. Caption of the media to be sent, 0-200 characters */ std::string caption; @@ -65,20 +77,30 @@ public: std::string parseMode; /** - * @brief Optional. Video width + * @brief Optional. Media width */ int32_t width = 0; /** - * @brief Optional. Video height + * @brief Optional. Media height */ int32_t height = 0; /** - * @brief Optional. Video duration + * @brief Optional. Media duration */ int32_t duration = 0; + /** + * @brief Optional. Performer of the audio. + */ + int32_t performer = 0; + + /** + * @brief Optional. Title of the audio. + */ + int32_t title = 0; + /** * @brief Optional. Pass True, if the uploaded video is suitable for streaming */ diff --git a/include/tgbot/types/InputMediaAnimation.h b/include/tgbot/types/InputMediaAnimation.h new file mode 100644 index 0000000..8b3b976 --- /dev/null +++ b/include/tgbot/types/InputMediaAnimation.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Oleg Morozenkov + * Copyright (c) 2016 Konstantin Kukin + * Copyright (c) 2018 JellyBrick + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef TGBOT_INPUTMEDIAANIMATION_H +#define TGBOT_INPUTMEDIAANIMATION_H + +#include +#include + +#include "tgbot/types/InputMedia.h" + +namespace TgBot { + +/** + * @brief Represents a video to be sent. + * @ingroup types + */ +class InputMediaAnimation : public InputMedia { +public: + typedef std::shared_ptr Ptr; + + InputMediaAnimation() { + this->type = TYPE::ANIMATION; + } +}; +} + +#endif //TGBOT_INPUTMEDIAANIMATION_H diff --git a/include/tgbot/types/InputMediaAudio.h b/include/tgbot/types/InputMediaAudio.h new file mode 100644 index 0000000..08b21ab --- /dev/null +++ b/include/tgbot/types/InputMediaAudio.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Oleg Morozenkov + * Copyright (c) 2016 Konstantin Kukin + * Copyright (c) 2018 JellyBrick + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef TGBOT_INPUTMEDIAAUDIO_H +#define TGBOT_INPUTMEDIAAUDIO_H + +#include +#include + +#include "tgbot/types/InputMedia.h" + +namespace TgBot { + +/** + * @brief Represents a video to be sent. + * @ingroup types + */ +class InputMediaAudio : public InputMedia { +public: + typedef std::shared_ptr Ptr; + + InputMediaAudio() { + this->type = TYPE::AUDIO; + } +}; +} + +#endif //TGBOT_INPUTMEDIAAUDIO_H diff --git a/include/tgbot/types/InputMediaDocument.h b/include/tgbot/types/InputMediaDocument.h new file mode 100644 index 0000000..a00eabb --- /dev/null +++ b/include/tgbot/types/InputMediaDocument.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2015 Oleg Morozenkov + * Copyright (c) 2016 Konstantin Kukin + * Copyright (c) 2018 JellyBrick + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef TGBOT_INPUTMEDIADOCUMENT_H +#define TGBOT_INPUTMEDIADOCUMENT_H + +#include +#include + +#include "tgbot/types/InputMedia.h" + +namespace TgBot { + +/** + * @brief Represents a video to be sent. + * @ingroup types + */ +class InputMediaDocument : public InputMedia { +public: + typedef std::shared_ptr Ptr; + + InputMediaDocument() { + this->type = TYPE::DOCUMENT; + } +}; +} + +#endif //TGBOT_INPUTMEDIADOCUMENT_H diff --git a/include/tgbot/types/InputVenueMessageContent.h b/include/tgbot/types/InputVenueMessageContent.h index 254a0a0..1f0bea7 100644 --- a/include/tgbot/types/InputVenueMessageContent.h +++ b/include/tgbot/types/InputVenueMessageContent.h @@ -48,6 +48,11 @@ public: * @brief Optional. Foursquare identifier of the venue, if known */ std::string foursquareId; + + /** + * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) + */ + std::string foursquareType; /** * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) -- cgit v1.2.3 From d4ebf6dc65bc97cab3aa147a8bfe398338c618da Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 17:44:07 +0900 Subject: Fix missing include --- include/tgbot/TgTypeParser.h | 3 +++ include/tgbot/types/InputMedia.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h index 656007b..06e7890 100644 --- a/include/tgbot/TgTypeParser.h +++ b/include/tgbot/TgTypeParser.h @@ -99,6 +99,9 @@ #include "tgbot/types/InputMedia.h" #include "tgbot/types/InputMediaPhoto.h" #include "tgbot/types/InputMediaVideo.h" +#include "tgbot/types/InputMediaAudio.h" +#include "tgbot/types/InputMediaDocument.h" +#include "tgbot/types/InputMediaAnimation.h" namespace TgBot { diff --git a/include/tgbot/types/InputMedia.h b/include/tgbot/types/InputMedia.h index c8cd4ae..f9e37ff 100644 --- a/include/tgbot/types/InputMedia.h +++ b/include/tgbot/types/InputMedia.h @@ -28,8 +28,6 @@ #include #include -#include - namespace TgBot { /** -- cgit v1.2.3 From 85104c6a24a28d5a5eca05de4a5e59dd0059232d Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 18:08:10 +0900 Subject: Bot API 4.0 - Part 3 --- include/tgbot/Api.h | 150 ++++------------------------------------------------ 1 file changed, 9 insertions(+), 141 deletions(-) (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 480949e..b10a87a 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -108,21 +108,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendPhoto(int64_t chatId, InputFile::Ptr photo, const std::string& caption = "", int32_t replyToMessageId = 0, - GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - - /** - * @brief Use this method to send photos. - * @param chatId Unique identifier for the target chat. - * @param photo Photo to send. Id of the photo that is already on the Telegram servers. - * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. - * @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, + Message::Ptr sendPhoto(int64_t chatId, boost::variant photo, const std::string& caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** @@ -139,25 +125,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendAudio(int64_t chatId, InputFile::Ptr audio, const std::string &caption = "", int32_t duration = 0, - const std::string& performer = "", const std::string& title = "", int32_t replyToMessageId = 0, - GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - - /** - * @brief 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). - * @param chatId Unique identifier for the target chat. - * @param audio Id of the audio that is already on the Telegram servers. - * @param caption Audio caption, 0-200 characters - * @param duration Duration of sent audio in seconds. - * @param performer Performer - * @param title Track name - * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. - * @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, const std::string &caption = "", int32_t duration = 0, + Message::Ptr sendAudio(int64_t chatId, boost::variant audio, const std::string &caption = "", int32_t duration = 0, const std::string& performer = "", const std::string& title = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; @@ -172,21 +140,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendDocument(int64_t chatId, InputFile::Ptr document, const std::string &caption = "", int32_t replyToMessageId = 0, - GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - - /** - * @brief Use this method to send general files. - * @param chatId Unique identifier for the target chat. - * @param documentId of the document that is already on the Telegram servers. - * @param caption Document caption (may also be used when resending documents by file_id), 0-200 characters - * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. - * @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, const std::string &caption = "", int32_t replyToMessageId = 0, + Message::Ptr sendDocument(int64_t chatId, boost::variant document, const std::string &caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** @@ -259,19 +213,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendSticker(int64_t chatId, InputFile::Ptr sticker, int32_t replyToMessageId = 0, - GenericReply::Ptr replyMarkup = std::make_shared(), bool disableNotification = false) const; - - /** - * @brief Use this method to send .webp stickers. - * @param chatId Unique identifier for the target chat. - * @param stickerId 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, + Message::Ptr sendSticker(int64_t chatId, boost::variant sticker, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), bool disableNotification = false) const; /** @@ -301,21 +243,7 @@ public: * @return Returns True on success. */ bool createNewStickerSet(int32_t userId, const std::string& name, const std::string& title, - InputFile::Ptr pngSticker, const std::string& emojis, bool containsMasks = false, MaskPosition::Ptr maskPosition = nullptr) const; - - /** - * @brief Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. - * @param userId User identifier of created sticker set owner. - * @param name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_”. is case insensitive. 1-64 characters. - * @param title Sticker set title, 1-64 characters. - * @param pngSticker Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet. - * @param emojis One or more emoji corresponding to the sticker. - * @param containsMasks Optional. Pass True, if a set of mask stickers should be created. - * @param maskPosition Optional. A JSON-serialized object for position where the mask should be placed on faces. - * @return Returns True on success. - */ - bool createNewStickerSet(int32_t userId, const std::string& name, const std::string& title, - const std::string& pngSticker, const std::string& emojis, bool containsMasks = false, MaskPosition::Ptr maskPosition = nullptr) const; + boost::variant pngSticker, const std::string& emojis, bool containsMasks = false, MaskPosition::Ptr maskPosition = nullptr) const; /** * @brief Use this method to add a new sticker to a set created by the bot. @@ -328,20 +256,7 @@ public: * @return Returns True on success. */ bool addStickerToSet(int32_t userId, const std::string& name, const std::string& title, - InputFile::Ptr pngSticker, const std::string& emojis, MaskPosition::Ptr maskPosition = nullptr) const; - - /** - * @brief Use this method to add a new sticker to a set created by the bot. - * @param userId User identifier of created sticker set owner. - * @param name Sticker set name. - * @param title Sticker set title, 1-64 characters. - * @param pngSticker Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet. - * @param emojis One or more emoji corresponding to the sticker. - * @param maskPosition Optional. A JSON-serialized object for position where the mask should be placed on faces. - * @return Returns True on success. - */ - bool addStickerToSet(int32_t userId, const std::string& name, const std::string& title, - const std::string& pngSticker, const std::string& emojis, MaskPosition::Ptr maskPosition = nullptr) const; + boost::variant pngSticker, const std::string& emojis, MaskPosition::Ptr maskPosition = nullptr) const; /** * @brief Use this method to move a sticker in a set created by the bot to a specific position. @@ -373,27 +288,9 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendVideo(int64_t chatId, InputFile::Ptr video, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string& caption = "", + Message::Ptr sendVideo(int64_t chatId, boost::variant video, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string& caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - /** - * @brief Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). - * @param chatId Unique identifier for the target chat. - * @param videoId Id of the video that is already on the Telegram servers. - * @param supportsStreaming Optional. Pass True, if the uploaded video is suitable for streaming. - * @param duration Optional. Duration of sent video in seconds - * @param width Optional. Video width - * @param height Optional. Video height - * @param caption Optional. Video caption (may also be used when resending videos by file_id), 0-200 characters - * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. - * @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, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string& caption = "", - int32_t replyToMessageId = 0, const GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - /** * @brief Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). * @@ -424,22 +321,8 @@ public: * @param replyMarkup Additional interface options. A object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. * @return On success, the sent Message is returned. */ - Message::Ptr sendVideoNote(int64_t chatId, InputFile::Ptr videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, - int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()) const; - - /** - * @brief Use this method to send video messages. On success, the sent Message is returned. - * @param chatId Unique identifier for the target chat. - * @param videoNote Id of the video note that exists on the Telegram servers. - * @param replyToMessageId If the message is a reply, ID of the original message. - * @param disableNotification Sends the message silently. Users will receive a notification with no sound. - * @param duration Duration of sent video in seconds. - * @param length Video width and height. - * @param replyMarkup Additional interface options. A object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. - * @return On success, the sent Message is returned. - */ - Message::Ptr sendVideoNote(int64_t chatId, const std::string& videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, - int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = GenericReply::Ptr()) const; + Message::Ptr sendVideoNote(int64_t chatId, boost::variant videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, + int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = std::make_shared()) const; /** * @brief Use this method to send a group of photos or videos as an album. @@ -467,21 +350,6 @@ public: Message::Ptr sendVoice(int64_t chatId, InputFile::Ptr voice, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - /** - * @brief Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. - * @param chatId Unique identifier for the target chat. - * @param voiceId Id of the voice that is already on the Telegram servers. - * @param caption Voice message caption, 0-200 characters - * @param duration Duration of send audio in seconds. - * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. - * @param disableNotification Optional. Sends the message silenty. - * @return On success, the sent message is returned. - */ - Message::Ptr sendVoice(int64_t chatId, const std::string& voiceId, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, - GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; - /** * @brief Use this method to send a game. * @param chatId Unique identifier for the target chat. -- cgit v1.2.3 From 9966efd8a5e006f5ba548c34ae3072000a150193 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 18:14:23 +0900 Subject: Fix build error --- include/tgbot/Api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index b10a87a..e926732 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -347,7 +347,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendVoice(int64_t chatId, InputFile::Ptr voice, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, + Message::Ptr sendVoice(int64_t chatId, boost::variant voice, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** -- cgit v1.2.3 From e6c475bd21df4dfd083d09ff0074758aec340e89 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 18:39:57 +0900 Subject: Bot API 4.0 - Part 4 --- include/tgbot/Api.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index e926732..0966b29 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -108,7 +108,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendPhoto(int64_t chatId, boost::variant photo, const std::string& caption = "", int32_t replyToMessageId = 0, + Message::Ptr sendPhoto(int64_t chatId, const boost::variant photo, const std::string& caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** @@ -119,20 +119,22 @@ public: * @param duration Duration of sent audio in seconds. * @param performer Performer * @param title Track name + * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . * @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 parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendAudio(int64_t chatId, boost::variant audio, const std::string &caption = "", int32_t duration = 0, - const std::string& performer = "", const std::string& title = "", int32_t replyToMessageId = 0, + Message::Ptr sendAudio(int64_t chatId, const boost::variant audio, const std::string &caption = "", int32_t duration = 0, + const std::string& performer = "", const std::string& title = "", const boost::variant thumb = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** * @brief Use this method to send general files. * @param chatId Unique identifier for the target chat. * @param document Document to send. + * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . * @param caption Document caption (may also be used when resending documents by file_id), 0-200 characters * @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. @@ -140,7 +142,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendDocument(int64_t chatId, boost::variant document, const std::string &caption = "", int32_t replyToMessageId = 0, + Message::Ptr sendDocument(int64_t chatId, const boost::variant document, const boost::variant thumb = "", const std::string &caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** @@ -213,7 +215,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendSticker(int64_t chatId, boost::variant sticker, int32_t replyToMessageId = 0, + Message::Ptr sendSticker(int64_t chatId, const boost::variant sticker, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), bool disableNotification = false) const; /** @@ -281,6 +283,7 @@ public: * @param duration Optional. Duration of sent video in seconds * @param width Optional. Video width * @param height Optional. Video height + * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . * @param caption Optional. Video caption (may also be used when resending videos by file_id), 0-200 characters * @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. @@ -288,7 +291,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendVideo(int64_t chatId, boost::variant video, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string& caption = "", + Message::Ptr sendVideo(int64_t chatId, const boost::variant video, bool supportsStreaming = false, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const boost::variant thumb = "", const std::string& caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** @@ -301,6 +304,7 @@ public: * @param duration Optional. Duration of sent animation in seconds. * @param width Optional. Animation width. * @param height Optional. Animation height. + * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . * @param caption Optional. Animation caption (may also be used when resending animation by file_id), 0-200 characters * @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. @@ -308,7 +312,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent Message is returned. */ - Message::Ptr sendAnimation(int64_t chatId, boost::variant animation, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const std::string &caption = "", + Message::Ptr sendAnimation(int64_t chatId, const boost::variant animation, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const boost::variant thumb, const std::string &caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** * @brief Use this method to send video messages. On success, the sent Message is returned. @@ -318,11 +322,12 @@ public: * @param disableNotification Sends the message silently. Users will receive a notification with no sound. * @param duration Duration of sent video in seconds. * @param length Video width and height. + * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . * @param replyMarkup Additional interface options. A object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. * @return On success, the sent Message is returned. */ - Message::Ptr sendVideoNote(int64_t chatId, boost::variant videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, - int32_t duration = 0, int32_t length = 0, GenericReply::Ptr replyMarkup = std::make_shared()) const; + Message::Ptr sendVideoNote(int64_t chatId, const boost::variant videoNote, int64_t replyToMessageId = 0, bool disableNotification = false, + int32_t duration = 0, int32_t length = 0, const boost::variant thumb = "", GenericReply::Ptr replyMarkup = std::make_shared()) const; /** * @brief Use this method to send a group of photos or videos as an album. @@ -347,7 +352,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent message is returned. */ - Message::Ptr sendVoice(int64_t chatId, boost::variant voice, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, + Message::Ptr sendVoice(int64_t chatId, const boost::variant voice, const std::string& caption = "", int duration = 0, int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** -- cgit v1.2.3 From 6d1a96043c63f346b03df4c54d8200bc320ebe3e Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 27 Jul 2018 18:43:11 +0900 Subject: Fix 'default argument missing' --- include/tgbot/Api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h index 0966b29..84a6c9b 100644 --- a/include/tgbot/Api.h +++ b/include/tgbot/Api.h @@ -312,7 +312,7 @@ public: * @param disableNotification Optional. Sends the message silenty. * @return On success, the sent Message is returned. */ - Message::Ptr sendAnimation(int64_t chatId, const boost::variant animation, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const boost::variant thumb, const std::string &caption = "", + Message::Ptr sendAnimation(int64_t chatId, const boost::variant animation, int32_t duration = 0, int32_t width = 0, int32_t height = 0, const boost::variant thumb = "", const std::string &caption = "", int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared(), const std::string& parseMode = "", bool disableNotification = false) const; /** * @brief Use this method to send video messages. On success, the sent Message is returned. -- cgit v1.2.3