summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/tgbot/Api.h174
-rw-r--r--include/tgbot/TgTypeParser.h32
-rw-r--r--include/tgbot/types/Birthdate.h34
-rw-r--r--include/tgbot/types/BusinessConnection.h57
-rw-r--r--include/tgbot/types/BusinessIntro.h36
-rw-r--r--include/tgbot/types/BusinessLocation.h31
-rw-r--r--include/tgbot/types/BusinessMessagesDeleted.h42
-rw-r--r--include/tgbot/types/BusinessOpeningHours.h32
-rw-r--r--include/tgbot/types/BusinessOpeningHoursInterval.h29
-rw-r--r--include/tgbot/types/Chat.h40
-rw-r--r--include/tgbot/types/ChatAdministratorRights.h8
-rw-r--r--include/tgbot/types/ChatMemberAdministrator.h8
-rw-r--r--include/tgbot/types/ChatShared.h27
-rw-r--r--include/tgbot/types/EncryptedPassportElement.h50
-rw-r--r--include/tgbot/types/InputSticker.h18
-rw-r--r--include/tgbot/types/KeyboardButtonRequestChat.h39
-rw-r--r--include/tgbot/types/KeyboardButtonRequestUsers.h17
-rw-r--r--include/tgbot/types/Message.h19
-rw-r--r--include/tgbot/types/ReplyParameters.h9
-rw-r--r--include/tgbot/types/SharedUser.h54
-rw-r--r--include/tgbot/types/StickerSet.h15
-rw-r--r--include/tgbot/types/Update.h22
-rw-r--r--include/tgbot/types/User.h20
-rw-r--r--include/tgbot/types/UsersShared.h10
24 files changed, 689 insertions, 134 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index da8b4ed..2288f5c 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -17,6 +17,7 @@
#include "tgbot/types/Venue.h"
#include "tgbot/types/WebhookInfo.h"
#include "tgbot/types/ChatMember.h"
+#include "tgbot/types/Sticker.h"
#include "tgbot/types/StickerSet.h"
#include "tgbot/types/File.h"
#include "tgbot/types/InputMedia.h"
@@ -164,12 +165,13 @@ public:
* @param text Text of the message to be sent, 1-4096 characters after entities parsing
* @param linkPreviewOptions Optional. Link preview generation options for the message
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details.
* @param disableNotification Optional. Sends the message [silently](https://telegram.org/blog/channels-2-0#silent-messages). Users will receive a notification with no sound.
* @param entities Optional. A JSON-serialized list of special entities that appear in message text, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -182,7 +184,8 @@ public:
bool disableNotification = false,
const std::vector<MessageEntity::Ptr>& entities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to forward messages of any kind.
@@ -214,7 +217,7 @@ public:
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
- * @param messageIds Identifiers of 1-100 messages in the chat fromChatId to forward. The identifiers must be specified in a strictly increasing order.
+ * @param messageIds A JSON-serialized list of 1-100 identifiers of messages in the chat fromChatId to forward. The identifiers must be specified in a strictly increasing order.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param disableNotification Optional. Sends the messages [silently](https://telegram.org/blog/channels-2-0#silent-messages). Users will receive a notification with no sound.
* @param protectContent Optional. Protects the contents of the forwarded message from forwarding and saving
@@ -272,7 +275,7 @@ public:
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param fromChatId Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
- * @param messageIds Identifiers of 1-100 messages in the chat fromChatId to copy. The identifiers must be specified in a strictly increasing order.
+ * @param messageIds A JSON-serialized list of 1-100 identifiers of messages in the chat fromChatId to copy. The identifiers must be specified in a strictly increasing order.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param disableNotification Optional. Sends the messages [silently](https://telegram.org/blog/channels-2-0#silent-messages). Users will receive a notification with no sound.
* @param protectContent Optional. Protects the contents of the sent messages from forwarding and saving
@@ -295,13 +298,14 @@ public:
* @param photo Photo to send. Pass a fileId as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. https://core.telegram.org/bots/api#sending-files
* @param caption Optional. Photo caption (may also be used when resending photos by fileId), 0-1024 characters after entities parsing
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
* @param hasSpoiler Optional. Pass True if the photo needs to be covered with a spoiler animation
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -315,7 +319,8 @@ public:
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
bool protectContent = false,
- bool hasSpoiler = false) const;
+ bool hasSpoiler = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send audio files, if you want Telegram clients to display them in the music player.
@@ -333,12 +338,13 @@ public:
* @param title Optional. Track name
* @param thumbnail Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. https://core.telegram.org/bots/api#sending-files
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the audio caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -355,7 +361,8 @@ public:
bool disableNotification = false,
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send general files.
@@ -367,13 +374,14 @@ public:
* @param thumbnail Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. https://core.telegram.org/bots/api#sending-files
* @param caption Optional. Document caption (may also be used when resending documents by fileId), 0-1024 characters after entities parsing
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the document caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param disableContentTypeDetection Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -388,7 +396,8 @@ public:
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
bool disableContentTypeDetection = false,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document).
@@ -404,13 +413,14 @@ public:
* @param thumbnail Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. https://core.telegram.org/bots/api#sending-files
* @param caption Optional. Video caption (may also be used when resending videos by fileId), 0-1024 characters after entities parsing
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the video caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
* @param hasSpoiler Optional. Pass True if the video needs to be covered with a spoiler animation
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -429,7 +439,8 @@ public:
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
bool protectContent = false,
- bool hasSpoiler = false) const;
+ bool hasSpoiler = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
@@ -444,13 +455,14 @@ public:
* @param thumbnail Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. https://core.telegram.org/bots/api#sending-files
* @param caption Optional. Animation caption (may also be used when resending animation by fileId), 0-1024 characters after entities parsing
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the animation caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
* @param hasSpoiler Optional. Pass True if the animation needs to be covered with a spoiler animation
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -468,7 +480,8 @@ public:
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
bool protectContent = false,
- bool hasSpoiler = false) const;
+ bool hasSpoiler = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
@@ -481,12 +494,13 @@ public:
* @param caption Optional. Voice message caption, 0-1024 characters after entities parsing
* @param duration Optional. Duration of the voice message in seconds
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param parseMode Optional. Mode for parsing entities in the voice message caption. See https://core.telegram.org/bots/api#formatting-options for more details.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param captionEntities Optional. A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parseMode
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -500,7 +514,8 @@ public:
bool disableNotification = false,
const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send video messages.
@@ -514,9 +529,10 @@ public:
* @param duration Optional. Duration of sent video in seconds
* @param length Optional. Video width and height, i.e. diameter of the video message
* @param thumbnail Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. 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://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. https://core.telegram.org/bots/api#sending-files
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -529,7 +545,8 @@ public:
boost::variant<InputFile::Ptr, std::string> thumbnail = "",
GenericReply::Ptr replyMarkup = nullptr,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send a group of photos, videos, documents or audios as an album.
@@ -542,6 +559,7 @@ public:
* @param replyParameters Optional. Description of the message to reply to
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent messages from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, an array of Messages that were sent is returned.
*/
@@ -550,7 +568,8 @@ public:
bool disableNotification = false,
ReplyParameters::Ptr replyParameters = nullptr,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send point on the map.
@@ -560,13 +579,14 @@ public:
* @param longitude Longitude of the location
* @param livePeriod Optional. Period in seconds for which the location will be updated (see https://telegram.org/blog/live-locations, should be between 60 and 86400.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param horizontalAccuracy Optional. The radius of uncertainty for the location, measured in meters; 0-1500
* @param heading Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
* @param proximityAlertRadius Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -581,7 +601,8 @@ public:
std::int32_t heading = 0,
std::int32_t proximityAlertRadius = 0,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to edit live location messages.
@@ -637,11 +658,12 @@ public:
* @param foursquareType Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param googlePlaceId Optional. Google Places identifier of the venue
* @param googlePlaceType Optional. Google Places type of the venue. (See https://developers.google.com/places/web-service/supported_types)
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -658,7 +680,8 @@ public:
const std::string& googlePlaceId = "",
const std::string& googlePlaceType = "",
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send phone contacts.
@@ -670,9 +693,10 @@ public:
* @param vcard Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -685,7 +709,8 @@ public:
ReplyParameters::Ptr replyParameters = nullptr,
GenericReply::Ptr replyMarkup = nullptr,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send a native poll.
@@ -695,7 +720,7 @@ public:
* @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param isAnonymous Optional. True, if the poll needs to be anonymous, defaults to True
* @param type Optional. Poll type, “quiz” or “regular”, defaults to “regular”
* @param allowsMultipleAnswers Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
@@ -708,6 +733,7 @@ public:
* @param isClosed Optional. Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -728,7 +754,8 @@ public:
std::int32_t closeDate = 0,
bool isClosed = false,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to send an animated emoji that will display a random value.
@@ -736,10 +763,11 @@ public:
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param emoji Optional. Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, “🎳”, or “🎰”. Dice can have values 1-6 for “🎲”, “🎯” and “🎳”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲”
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -749,7 +777,8 @@ public:
GenericReply::Ptr replyMarkup = nullptr,
const std::string& emoji = "",
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to change the chosen reactions on a message.
@@ -759,7 +788,7 @@ public:
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param messageId Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
- * @param reaction Optional. New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
+ * @param reaction Optional. A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
* @param isBig Optional. Pass True to set the reaction with a big animation
*
* @return Returns True on success.
@@ -771,23 +800,26 @@ public:
/**
* @brief 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).
*
- * Example: The ImageBot needs some time to process a request and upload the image.
+ * Example: The [ImageBot](https://t.me/imagebot) needs some time to process a request and upload the image.
* Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use Api::sendChatAction with action = upload_photo.
* The user will see a “sending photo” status for the bot.
- *
+ *
* We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
- * @param messageThreadId Optional. Unique identifier for the target message thread; supergroups only
+ * @param messageThreadId Optional. Unique identifier for the target message thread; for supergroups only
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the action will be sent
*
* @return Returns True on success.
*/
bool sendChatAction(std::int64_t chatId,
const std::string& action,
- std::int32_t messageThreadId = 0) const;
+ std::int32_t messageThreadId = 0,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to get a list of profile pictures for a user.
@@ -885,17 +917,17 @@ public:
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
* @param userId Unique identifier of the target user
* @param canChangeInfo Optional. Pass True if the administrator can change chat title, photo and other settings
- * @param canPostMessages Optional. Pass True if the administrator can post messages in the channel, or access channel statistics; channels only
- * @param canEditMessages Optional. Pass True if the administrator can edit messages of other users and can pin messages; channels only
+ * @param canPostMessages Optional. Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only
+ * @param canEditMessages Optional. Pass True if the administrator can edit messages of other users and can pin messages; for channels only
* @param canDeleteMessages Optional. Pass True if the administrator can delete messages of other users
* @param canInviteUsers Optional. Pass True if the administrator can invite new users to the chat
- * @param canPinMessages Optional. Pass True if the administrator can pin messages, supergroups only
+ * @param canPinMessages Optional. Pass True if the administrator can pin messages; for supergroups only
* @param canPromoteMembers Optional. Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
* @param isAnonymous Optional. Pass True if the administrator's presence in the chat is hidden
* @param canManageChat Optional. Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.
* @param canManageVideoChats Optional. Pass True if the administrator can manage video chats
* @param canRestrictMembers Optional. Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics
- * @param canManageTopics Optional. Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
+ * @param canManageTopics Optional. Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
* @param canPostStories Optional. Pass True if the administrator can post stories to the chat
* @param canEditStories Optional. Pass True if the administrator can edit stories posted by other users
* @param canDeleteStories Optional. Pass True if the administrator can delete stories posted by other users
@@ -1439,6 +1471,15 @@ public:
std::int32_t userId) const;
/**
+ * @brief Use this method to get information about the connection of the bot with a business account.
+ *
+ * @param businessConnectionId Unique identifier of the business connection
+ *
+ * @return Returns a BusinessConnection object on success.
+ */
+ BusinessConnection::Ptr getBusinessConnection(const std::string& businessConnectionId) const;
+
+ /**
* @brief Use this method to change the list of the bot's commands.
*
* See https://core.telegram.org/bots#commands for more details about bot commands.
@@ -1697,7 +1738,7 @@ public:
* If some of the specified messages can't be found, they are skipped.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- * @param messageIds Identifiers of 1-100 messages to delete. See Api::deleteMessage for limitations on which messages can be deleted
+ * @param messageIds A JSON-serialized list of 1-100 identifiers of messages to delete. See Api::deleteMessage for limitations on which messages can be deleted
*
* @return Returns True on success.
*/
@@ -1708,13 +1749,14 @@ public:
* @brief Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS, or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- * @param sticker Sticker to send. Pass a fileId as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. https://core.telegram.org/bots/api#sending-files. Video stickers can only be sent by a fileId. Animated stickers can't be sent via an HTTP URL.
+ * @param sticker Sticker to send. Pass a fileId as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files). Video and animated stickers can't be sent via an HTTP URL.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @param replyMarkup Optional. Additional interface options. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards), [custom reply keyboard](https://core.telegram.org/bots/features#keyboards), instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
* @param emoji Optional. Emoji associated with the sticker; only for just uploaded stickers
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -1725,7 +1767,8 @@ public:
bool disableNotification = false,
std::int32_t messageThreadId = 0,
bool protectContent = false,
- const std::string& emoji = "") const;
+ const std::string& emoji = "",
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to get a sticker set.
@@ -1739,19 +1782,19 @@ public:
/**
* @brief Use this method to get information about custom emoji stickers by their identifiers.
*
- * @param customEmojiIds List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
+ * @param customEmojiIds A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
*
* @return Returns an Array of Sticker objects.
*/
std::vector<Sticker::Ptr> getCustomEmojiStickers(const std::vector<std::string>& customEmojiIds) const;
/**
- * @brief Use this method to upload a file with a sticker for later use in the Api::createNewStickerSet and Api::addStickerToSet methods (the file can be used multiple times).
- *
+ * @brief Use this method to upload a file with a sticker for later use in the Api::createNewStickerSet, Api::addStickerToSet, or Api::replaceStickerInSet methods (the file can be used multiple times).
+ *
* @param userId User identifier of sticker file owner
* @param sticker A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. https://core.telegram.org/bots/api#sending-files
* @param stickerFormat Format of the sticker, must be one of “static”, “animated”, “video”
- *
+ *
* @return Returns the uploaded File on success.
*/
File::Ptr uploadStickerFile(std::int64_t userId,
@@ -1760,14 +1803,13 @@ public:
/**
* @brief Use this method to create a new sticker set owned by a user.
- *
+ *
* The bot will be able to edit the sticker set thus created.
*
* @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_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
* @param title Sticker set title, 1-64 characters
* @param stickers A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
- * @param stickerFormat Format of stickers in the set, must be one of “static”, “animated”, “video”
* @param stickerType Optional. Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
* @param needsRepainting Optional. Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
*
@@ -1777,17 +1819,14 @@ public:
const std::string& name,
const std::string& title,
const std::vector<InputSticker::Ptr>& stickers,
- const std::string& stickerFormat,
- const std::string& stickerType = "",
+ Sticker::Type stickerType = Sticker::Type::Regular,
bool needsRepainting = false) const;
/**
* @brief Use this method to add a new sticker to a set created by the bot.
- *
- * The format of the added sticker must match the format of the other stickers in the set.
+ *
* Emoji sticker sets can have up to 200 stickers.
- * Animated and video sticker sets can have up to 50 stickers.
- * Static sticker sets can have up to 120 stickers.
+ * Other sticker sets can have up to 120 stickers.
*
* @param userId User identifier of sticker set owner
* @param name Sticker set name
@@ -1820,6 +1859,23 @@ public:
bool deleteStickerFromSet(const std::string& sticker) const;
/**
+ * @brief Use this method to replace an existing sticker in a sticker set with a new one.
+ *
+ * The method is equivalent to calling Api::deleteStickerFromSet, then Api::addStickerToSet, then Api::setStickerPositionInSet.
+ *
+ * @param userId User identifier of the sticker set owner
+ * @param name Sticker set name
+ * @param oldSticker File identifier of the replaced sticker
+ * @param sticker A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.
+ *
+ * @return Returns True on success.
+ */
+ bool replaceStickerInSet(std::int64_t userId,
+ const std::string& name,
+ const std::string& oldSticker,
+ InputSticker::Ptr sticker) const;
+
+ /**
* @brief Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
*
* The sticker must belong to a sticker set created by the bot.
@@ -1871,17 +1927,19 @@ public:
/**
* @brief Use this method to set the thumbnail of a regular or mask sticker set.
- *
+ *
* The format of the thumbnail file must match the format of the stickers in the set.
*
* @param name Sticker set name
* @param userId User identifier of the sticker set owner
+ * @param format Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video
* @param thumbnail Optional. A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a fileId 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, or upload a new one using multipart/form-data. https://core.telegram.org/bots/api#sending-files. Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
*
* @return Returns True on success.
*/
bool setStickerSetThumbnail(const std::string& name,
std::int64_t userId,
+ const std::string& format,
boost::variant<InputFile::Ptr, std::string> thumbnail = "") const;
/**
@@ -2099,10 +2157,11 @@ public:
* @param chatId Unique identifier for the target chat
* @param gameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
* @param replyParameters Optional. Description of the message to reply to
- * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Play gameTitle' button will be shown. If not empty, the first button must launch the game.
+ * @param replyMarkup Optional. A JSON-serialized object for an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards). If empty, one 'Play gameTitle' button will be shown. If not empty, the first button must launch the game. Not supported for messages sent on behalf of a business account.
* @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
* @param messageThreadId Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
* @param protectContent Optional. Protects the contents of the sent message from forwarding and saving
+ * @param businessConnectionId Optional. Unique identifier of the business connection on behalf of which the message will be sent
*
* @return On success, the sent Message is returned.
*/
@@ -2112,7 +2171,8 @@ public:
InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>(),
bool disableNotification = false,
std::int32_t messageThreadId = 0,
- bool protectContent = false) const;
+ bool protectContent = false,
+ const std::string& businessConnectionId = "") const;
/**
* @brief Use this method to set the score of the specified user in a game message.
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h
index f79b9c6..661930e 100644
--- a/include/tgbot/TgTypeParser.h
+++ b/include/tgbot/TgTypeParser.h
@@ -43,6 +43,7 @@
#include "tgbot/types/ForumTopicReopened.h"
#include "tgbot/types/GeneralForumTopicHidden.h"
#include "tgbot/types/GeneralForumTopicUnhidden.h"
+#include "tgbot/types/SharedUser.h"
#include "tgbot/types/UsersShared.h"
#include "tgbot/types/ChatShared.h"
#include "tgbot/types/WriteAccessAllowed.h"
@@ -83,6 +84,11 @@
#include "tgbot/types/ChatMemberBanned.h"
#include "tgbot/types/ChatJoinRequest.h"
#include "tgbot/types/ChatPermissions.h"
+#include "tgbot/types/Birthdate.h"
+#include "tgbot/types/BusinessIntro.h"
+#include "tgbot/types/BusinessLocation.h"
+#include "tgbot/types/BusinessOpeningHoursInterval.h"
+#include "tgbot/types/BusinessOpeningHours.h"
#include "tgbot/types/ChatLocation.h"
#include "tgbot/types/ReactionType.h"
#include "tgbot/types/ReactionTypeEmoji.h"
@@ -115,6 +121,8 @@
#include "tgbot/types/ChatBoostUpdated.h"
#include "tgbot/types/ChatBoostRemoved.h"
#include "tgbot/types/UserChatBoosts.h"
+#include "tgbot/types/BusinessConnection.h"
+#include "tgbot/types/BusinessMessagesDeleted.h"
#include "tgbot/types/ResponseParameters.h"
#include "tgbot/types/InputMedia.h"
#include "tgbot/types/InputMediaPhoto.h"
@@ -327,6 +335,9 @@ public:
GeneralForumTopicUnhidden::Ptr parseJsonAndGetGeneralForumTopicUnhidden(const boost::property_tree::ptree& data) const;
std::string parseGeneralForumTopicUnhidden(const GeneralForumTopicUnhidden::Ptr& object) const;
+ SharedUser::Ptr parseJsonAndGetSharedUser(const boost::property_tree::ptree& data) const;
+ std::string parseSharedUser(const SharedUser::Ptr& object) const;
+
UsersShared::Ptr parseJsonAndGetUsersShared(const boost::property_tree::ptree& data) const;
std::string parseUsersShared(const UsersShared::Ptr& object) const;
@@ -447,6 +458,21 @@ public:
ChatPermissions::Ptr parseJsonAndGetChatPermissions(const boost::property_tree::ptree& data) const;
std::string parseChatPermissions(const ChatPermissions::Ptr& object) const;
+ Birthdate::Ptr parseJsonAndGetBirthdate(const boost::property_tree::ptree& data) const;
+ std::string parseBirthdate(const Birthdate::Ptr& object) const;
+
+ BusinessIntro::Ptr parseJsonAndGetBusinessIntro(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessIntro(const BusinessIntro::Ptr& object) const;
+
+ BusinessLocation::Ptr parseJsonAndGetBusinessLocation(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessLocation(const BusinessLocation::Ptr& object) const;
+
+ BusinessOpeningHoursInterval::Ptr parseJsonAndGetBusinessOpeningHoursInterval(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessOpeningHoursInterval(const BusinessOpeningHoursInterval::Ptr& object) const;
+
+ BusinessOpeningHours::Ptr parseJsonAndGetBusinessOpeningHours(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessOpeningHours(const BusinessOpeningHours::Ptr& object) const;
+
ChatLocation::Ptr parseJsonAndGetChatLocation(const boost::property_tree::ptree& data) const;
std::string parseChatLocation(const ChatLocation::Ptr& object) const;
@@ -543,6 +569,12 @@ public:
UserChatBoosts::Ptr parseJsonAndGetUserChatBoosts(const boost::property_tree::ptree& data) const;
std::string parseUserChatBoosts(const UserChatBoosts::Ptr& object) const;
+ BusinessConnection::Ptr parseJsonAndGetBusinessConnection(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessConnection(const BusinessConnection::Ptr& object) const;
+
+ BusinessMessagesDeleted::Ptr parseJsonAndGetBusinessMessagesDeleted(const boost::property_tree::ptree& data) const;
+ std::string parseBusinessMessagesDeleted(const BusinessMessagesDeleted::Ptr& object) const;
+
ResponseParameters::Ptr parseJsonAndGetResponseParameters(const boost::property_tree::ptree& data) const;
std::string parseResponseParameters(const ResponseParameters::Ptr& object) const;
diff --git a/include/tgbot/types/Birthdate.h b/include/tgbot/types/Birthdate.h
new file mode 100644
index 0000000..af481cc
--- /dev/null
+++ b/include/tgbot/types/Birthdate.h
@@ -0,0 +1,34 @@
+#ifndef TGBOT_BIRTHDATE_H
+#define TGBOT_BIRTHDATE_H
+
+#include <cstdint>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @ingroup types
+ */
+class Birthdate {
+
+public:
+ typedef std::shared_ptr<Birthdate> Ptr;
+
+ /**
+ * @brief Day of the user's birth; 1-31
+ */
+ std::uint8_t day;
+
+ /**
+ * @brief Month of the user's birth; 1-12
+ */
+ std::uint8_t month;
+
+ /**
+ * @brief Optional. Year of the user's birth
+ */
+ std::uint16_t year;
+};
+}
+
+#endif //TGBOT_BIRTHDATE_H
diff --git a/include/tgbot/types/BusinessConnection.h b/include/tgbot/types/BusinessConnection.h
new file mode 100644
index 0000000..349590b
--- /dev/null
+++ b/include/tgbot/types/BusinessConnection.h
@@ -0,0 +1,57 @@
+#ifndef TGBOT_BUSINESSCONNECTION_H
+#define TGBOT_BUSINESSCONNECTION_H
+
+#include "tgbot/types/User.h"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+
+namespace TgBot {
+
+/**
+ * @brief Describes the connection of the bot with a business account.
+ *
+ * @ingroup types
+ */
+class BusinessConnection {
+
+public:
+ typedef std::shared_ptr<BusinessConnection> Ptr;
+
+ /**
+ * @brief Unique identifier of the business connection
+ */
+ std::string id;
+
+ /**
+ * @brief Business account user that created the business connection
+ */
+ User::Ptr user;
+
+ /**
+ * @brief Identifier of a private chat with the user who created the business connection.
+ *
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
+ * But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
+ */
+ std::int64_t userChatId;
+
+ /**
+ * @brief Date the connection was established in Unix time
+ */
+ std::uint32_t date;
+
+ /**
+ * @brief True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours
+ */
+ bool canReply;
+
+ /**
+ * @brief True, if the connection is active
+ */
+ bool isEnabled;
+};
+}
+
+#endif //TGBOT_BUSINESSCONNECTION_H
diff --git a/include/tgbot/types/BusinessIntro.h b/include/tgbot/types/BusinessIntro.h
new file mode 100644
index 0000000..7631870
--- /dev/null
+++ b/include/tgbot/types/BusinessIntro.h
@@ -0,0 +1,36 @@
+#ifndef TGBOT_BUSINESSINTRO_H
+#define TGBOT_BUSINESSINTRO_H
+
+#include "tgbot/types/Sticker.h"
+
+#include <memory>
+#include <string>
+
+namespace TgBot {
+
+/**
+ * @ingroup types
+ */
+class BusinessIntro {
+
+public:
+ typedef std::shared_ptr<BusinessIntro> Ptr;
+
+ /**
+ * @brief Optional. Title text of the business intro
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Message text of the business intro
+ */
+ std::string message;
+
+ /**
+ * @brief Optional. Sticker of the business intro
+ */
+ Sticker::Ptr sticker;
+};
+}
+
+#endif //TGBOT_BUSINESSINTRO_H
diff --git a/include/tgbot/types/BusinessLocation.h b/include/tgbot/types/BusinessLocation.h
new file mode 100644
index 0000000..09137a5
--- /dev/null
+++ b/include/tgbot/types/BusinessLocation.h
@@ -0,0 +1,31 @@
+#ifndef TGBOT_BUSINESSLOCATION_H
+#define TGBOT_BUSINESSLOCATION_H
+
+#include "tgbot/types/Location.h"
+
+#include <memory>
+#include <string>
+
+namespace TgBot {
+
+/**
+ * @ingroup types
+ */
+class BusinessLocation {
+
+public:
+ typedef std::shared_ptr<BusinessLocation> Ptr;
+
+ /**
+ * @brief Address of the business
+ */
+ std::string address;
+
+ /**
+ * @brief Optional. Location of the business
+ */
+ Location::Ptr location;
+};
+}
+
+#endif //TGBOT_BUSINESSLOCATION_H
diff --git a/include/tgbot/types/BusinessMessagesDeleted.h b/include/tgbot/types/BusinessMessagesDeleted.h
new file mode 100644
index 0000000..ee22639
--- /dev/null
+++ b/include/tgbot/types/BusinessMessagesDeleted.h
@@ -0,0 +1,42 @@
+#ifndef TGBOT_BUSINESSMESSAGESDELETED_H
+#define TGBOT_BUSINESSMESSAGESDELETED_H
+
+#include "tgbot/types/Chat.h"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace TgBot {
+
+/**
+ * @brief This object is received when messages are deleted from a connected business account.
+ *
+ * @ingroup types
+ */
+class BusinessMessagesDeleted {
+
+public:
+ typedef std::shared_ptr<BusinessMessagesDeleted> Ptr;
+
+ /**
+ * @brief Unique identifier of the business connection
+ */
+ std::string businessConnectionId;
+
+ /**
+ * @brief Information about a chat in the business account.
+ *
+ * The bot may not have access to the chat or the corresponding user.
+ */
+ Chat::Ptr chat;
+
+ /**
+ * @brief A JSON-serialized list of identifiers of deleted messages in the chat of the business account
+ */
+ std::vector<std::int32_t> messageIds;
+};
+}
+
+#endif //TGBOT_BUSINESSMESSAGESDELETED_H
diff --git a/include/tgbot/types/BusinessOpeningHours.h b/include/tgbot/types/BusinessOpeningHours.h
new file mode 100644
index 0000000..94d7457
--- /dev/null
+++ b/include/tgbot/types/BusinessOpeningHours.h
@@ -0,0 +1,32 @@
+#ifndef TGBOT_BUSINESSOPENINGHOURS_H
+#define TGBOT_BUSINESSOPENINGHOURS_H
+
+#include "tgbot/types/BusinessOpeningHoursInterval.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace TgBot {
+
+/**
+ * @ingroup types
+ */
+class BusinessOpeningHours {
+
+public:
+ typedef std::shared_ptr<BusinessOpeningHours> Ptr;
+
+ /**
+ * @brief Unique name of the time zone for which the opening hours are defined
+ */
+ std::string timeZoneName;
+
+ /**
+ * @brief List of time intervals describing business opening hours
+ */
+ std::vector<BusinessOpeningHoursInterval::Ptr> openingHours;
+};
+}
+
+#endif //TGBOT_BUSINESSOPENINGHOURS_H
diff --git a/include/tgbot/types/BusinessOpeningHoursInterval.h b/include/tgbot/types/BusinessOpeningHoursInterval.h
new file mode 100644
index 0000000..500e46d
--- /dev/null
+++ b/include/tgbot/types/BusinessOpeningHoursInterval.h
@@ -0,0 +1,29 @@
+#ifndef TGBOT_BUSINESSOPENINGHOURSINTERVAL_H
+#define TGBOT_BUSINESSOPENINGHOURSINTERVAL_H
+
+#include <cstdint>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @ingroup types
+ */
+class BusinessOpeningHoursInterval {
+
+public:
+ typedef std::shared_ptr<BusinessOpeningHoursInterval> Ptr;
+
+ /**
+ * @brief The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60
+ */
+ std::int32_t openingMinute;
+
+ /**
+ * @brief The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
+ */
+ std::int32_t closingMinute;
+};
+}
+
+#endif //TGBOT_BUSINESSOPENINGHOURSINTERVAL_H
diff --git a/include/tgbot/types/Chat.h b/include/tgbot/types/Chat.h
index e96009e..411c01d 100644
--- a/include/tgbot/types/Chat.h
+++ b/include/tgbot/types/Chat.h
@@ -2,6 +2,11 @@
#define TGBOT_CHAT_H
#include "tgbot/types/ChatPhoto.h"
+#include "tgbot/types/Birthdate.h"
+#include "tgbot/types/BusinessIntro.h"
+#include "tgbot/types/BusinessLocation.h"
+#include "tgbot/types/BusinessOpeningHours.h"
+#include "tgbot/types/Chat.h"
#include "tgbot/types/ReactionType.h"
#include "tgbot/types/ChatPermissions.h"
#include "tgbot/types/ChatLocation.h"
@@ -85,6 +90,41 @@ public:
std::vector<std::string> activeUsernames;
/**
+ * @brief Optional. For private chats, the date of birth of the user.
+ *
+ * Returned only in Api::getChat.
+ */
+ Birthdate::Ptr birthdate;
+
+ /**
+ * @brief Optional. For private chats with business accounts, the intro of the business.
+ *
+ * Returned only in Api::getChat.
+ */
+ BusinessIntro::Ptr businessIntro;
+
+ /**
+ * @brief Optional. For private chats with business accounts, the location of the business.
+ *
+ * Returned only in Api::getChat.
+ */
+ BusinessLocation::Ptr businessLocation;
+
+ /**
+ * @brief Optional. For private chats with business accounts, the opening hours of the business.
+ *
+ * Returned only in Api::getChat.
+ */
+ BusinessOpeningHours::Ptr businessOpeningHours;
+
+ /**
+ * @brief Optional. For private chats, the personal channel of the user.
+ *
+ * Returned only in Api::getChat.
+ */
+ Chat::Ptr personalChat;
+
+ /**
* @brief Optional. List of available reactions allowed in the chat.
*
* If omitted, then all [emoji reactions](https://core.telegram.org/bots/api#reactiontypeemoji) are allowed.
diff --git a/include/tgbot/types/ChatAdministratorRights.h b/include/tgbot/types/ChatAdministratorRights.h
index aba0d90..3836070 100644
--- a/include/tgbot/types/ChatAdministratorRights.h
+++ b/include/tgbot/types/ChatAdministratorRights.h
@@ -73,22 +73,22 @@ public:
bool canDeleteStories;
/**
- * @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
+ * @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only
*/
bool canPostMessages;
/**
- * @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
+ * @brief Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
*/
bool canEditMessages;
/**
- * @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
+ * @brief Optional. True, if the user is allowed to pin messages; for groups and supergroups only
*/
bool canPinMessages;
/**
- * @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+ * @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
*/
bool canManageTopics;
};
diff --git a/include/tgbot/types/ChatMemberAdministrator.h b/include/tgbot/types/ChatMemberAdministrator.h
index 121c238..d9f7a45 100644
--- a/include/tgbot/types/ChatMemberAdministrator.h
+++ b/include/tgbot/types/ChatMemberAdministrator.h
@@ -87,22 +87,22 @@ public:
bool canDeleteStories;
/**
- * @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only
+ * @brief Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only
*/
bool canPostMessages;
/**
- * @brief Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
+ * @brief Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only
*/
bool canEditMessages;
/**
- * @brief Optional. True, if the user is allowed to pin messages; groups and supergroups only
+ * @brief Optional. True, if the user is allowed to pin messages; for groups and supergroups only
*/
bool canPinMessages;
/**
- * @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
+ * @brief Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
*/
bool canManageTopics;
diff --git a/include/tgbot/types/ChatShared.h b/include/tgbot/types/ChatShared.h
index ffb41b3..6d410d3 100644
--- a/include/tgbot/types/ChatShared.h
+++ b/include/tgbot/types/ChatShared.h
@@ -1,17 +1,21 @@
#ifndef TGBOT_CHATSHARED_H
#define TGBOT_CHATSHARED_H
+#include "tgbot/types/PhotoSize.h"
+
#include <cstdint>
#include <memory>
+#include <string>
+#include <vector>
namespace TgBot {
/**
- * @brief This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
+ * @brief This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
*
* @ingroup types
*/
-class ChatShared {
+class ChatShared {
public:
typedef std::shared_ptr<ChatShared> Ptr;
@@ -23,13 +27,28 @@ public:
/**
* @brief Identifier of the shared chat.
- *
+ *
* The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
- *
+ *
* This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
* But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
*/
std::int64_t chatId;
+
+ /**
+ * @brief Optional. Title of the chat, if the title was requested by the bot.
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Username of the chat, if the username was requested by the bot and available.
+ */
+ std::string username;
+
+ /**
+ * @brief Optional. Available sizes of the chat photo, if the photo was requested by the bot
+ */
+ std::vector<PhotoSize::Ptr> photo;
};
}
diff --git a/include/tgbot/types/EncryptedPassportElement.h b/include/tgbot/types/EncryptedPassportElement.h
index 3557f27..4547fd5 100644
--- a/include/tgbot/types/EncryptedPassportElement.h
+++ b/include/tgbot/types/EncryptedPassportElement.h
@@ -1,5 +1,5 @@
-#ifndef TGBOT_CPP_ENCRYPTEDPASSPORTELEMENT_H
-#define TGBOT_CPP_ENCRYPTEDPASSPORTELEMENT_H
+#ifndef TGBOT_ENCRYPTEDPASSPORTELEMENT_H
+#define TGBOT_ENCRYPTEDPASSPORTELEMENT_H
#include "tgbot/types/PassportFile.h"
@@ -10,7 +10,7 @@
namespace TgBot {
/**
- * @brief Contains information about documents or other Telegram Passport elements shared with the bot by the user.
+ * @brief Describes documents or other Telegram Passport elements shared with the bot by the user.
*
* @ingroup types
*/
@@ -20,65 +20,67 @@ public:
typedef std::shared_ptr<EncryptedPassportElement> Ptr;
/**
- * @brief Element type.
- * One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
+ * @brief Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
*/
std::string type;
/**
- * @brief Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types.
- * Can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types.
+ *
+ * Can be decrypted and verified using the accompanying EncryptedCredentials.
*/
std::string data;
/**
- * @brief Optional. User's verified phone number, available only for “phone_number” type
+ * @brief Optional. User's verified phone number; available only for “phone_number” type
*/
std::string phoneNumber;
/**
- * @brief Optional. User's verified email address, available only for “email” type
+ * @brief Optional. User's verified email address; available only for “email” type
*/
std::string email;
/**
- * @brief Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
- * Files can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
+ *
+ * Files can be decrypted and verified using the accompanying EncryptedCredentials.
*/
std::vector<PassportFile::Ptr> files;
/**
- * @brief Optional. Encrypted file with the front side of the document, provided by the user.
- * Available for “passport”, “driver_license”, “identity_card” and “internal_passport”.
- * The file can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”.
+ *
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials.
*/
PassportFile::Ptr frontSide;
/**
- * @brief Optional. Encrypted file with the reverse side of the document, provided by the user.
- * Available for “driver_license” and “identity_card”.
- * The file can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”.
+ *
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials.
*/
PassportFile::Ptr reverseSide;
/**
- * @brief Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”.
- * The file can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”.
+ *
+ * The file can be decrypted and verified using the accompanying EncryptedCredentials.
*/
PassportFile::Ptr selfie;
/**
- * @brief Optional. Array of encrypted files with translated versions of documents provided by the user.
- * Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
- * Files can be decrypted and verified using the accompanying @ref EncryptedCredentials.
+ * @brief Optional. Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
+ *
+ * Files can be decrypted and verified using the accompanying EncryptedCredentials.
*/
std::vector<PassportFile::Ptr> translation;
/**
- * @brief Base64-encoded element hash for using in @ref PassportElementErrorUnspecified
+ * @brief Base64-encoded element hash for using in PassportElementErrorUnspecified
*/
std::string hash;
};
}
-#endif //TGBOT_CPP_ENCRYPTEDPASSPORTELEMENT_H
+#endif //TGBOT_ENCRYPTEDPASSPORTELEMENT_H
diff --git a/include/tgbot/types/InputSticker.h b/include/tgbot/types/InputSticker.h
index 06dafd2..e636ba6 100644
--- a/include/tgbot/types/InputSticker.h
+++ b/include/tgbot/types/InputSticker.h
@@ -15,28 +15,40 @@ namespace TgBot {
* @ingroup types
*/
class InputSticker {
+
public:
typedef std::shared_ptr<InputSticker> Ptr;
/**
* @brief The added sticker.
+ *
* Pass a fileId 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, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
- * Animated and video stickers can't be uploaded via HTTP URL. https://core.telegram.org/bots/api#sending-files
+ * Animated and video stickers can't be uploaded via HTTP URL.
+ * [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files)
*/
std::string sticker;
/**
+ * @brief Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video
+ */
+ std::string format;
+
+ /**
* @brief List of 1-20 emoji associated with the sticker
*/
std::vector<std::string> emojiList;
/**
- * @brief Optional. Position where the mask should be placed on faces. For “mask” stickers only.
+ * @brief Optional. Position where the mask should be placed on faces.
+ *
+ * For “mask” stickers only.
*/
MaskPosition::Ptr maskPosition;
/**
- * @brief Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
+ * @brief Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters.
+ *
+ * For “regular” and “custom_emoji” stickers only.
*/
std::vector<std::string> keywords;
};
diff --git a/include/tgbot/types/KeyboardButtonRequestChat.h b/include/tgbot/types/KeyboardButtonRequestChat.h
index 92e858d..0b3d9ea 100644
--- a/include/tgbot/types/KeyboardButtonRequestChat.h
+++ b/include/tgbot/types/KeyboardButtonRequestChat.h
@@ -10,9 +10,9 @@ namespace TgBot {
/**
* @brief This object defines the criteria used to request a suitable chat.
- *
- * The identifier of the selected chat will be shared with the bot when the corresponding button is pressed.
- * https://core.telegram.org/bots/features#chat-and-user-selection
+ *
+ * Information about the selected chat will be shared with the bot when the corresponding button is pressed.
+ * The bot will be granted requested rights in the сhat if appropriate [More about requesting chats »](https://core.telegram.org/bots/features#chat-and-user-selection)
*
* @ingroup types
*/
@@ -23,7 +23,7 @@ public:
/**
* @brief Signed 32-bit identifier of the request, which will be received back in the ChatShared object.
- *
+ *
* Must be unique within the message
*/
std::int32_t requestId;
@@ -35,47 +35,62 @@ public:
/**
* @brief Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat.
- *
+ *
* If not specified, no additional restrictions are applied.
*/
bool chatIsForum;
/**
* @brief Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username.
- *
+ *
* If not specified, no additional restrictions are applied.
*/
bool chatHasUsername;
/**
* @brief Optional. Pass True to request a chat owned by the user.
- *
+ *
* Otherwise, no additional restrictions are applied.
*/
bool chatIsCreated;
/**
* @brief Optional. A JSON-serialized object listing the required administrator rights of the user in the chat.
- *
- * The rights must be a superset of bot_administrator_rights.
+ *
+ * The rights must be a superset of botAdministratorRights.
* If not specified, no additional restrictions are applied.
*/
ChatAdministratorRights::Ptr userAdministratorRights;
/**
* @brief Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat.
- *
- * The rights must be a subset of user_administrator_rights.
+ *
+ * The rights must be a subset of userAdministratorRights.
* If not specified, no additional restrictions are applied.
*/
ChatAdministratorRights::Ptr botAdministratorRights;
/**
* @brief Optional. Pass True to request a chat with the bot as a member.
- *
+ *
* Otherwise, no additional restrictions are applied.
*/
bool botIsMember;
+
+ /**
+ * @brief Optional. Pass True to request the chat's title
+ */
+ bool requestTitle;
+
+ /**
+ * @brief Optional. Pass True to request the chat's username
+ */
+ bool requestUsername;
+
+ /**
+ * @brief Optional. Pass True to request the chat's photo
+ */
+ bool requestPhoto;
};
}
diff --git a/include/tgbot/types/KeyboardButtonRequestUsers.h b/include/tgbot/types/KeyboardButtonRequestUsers.h
index 612bd2d..c124c6a 100644
--- a/include/tgbot/types/KeyboardButtonRequestUsers.h
+++ b/include/tgbot/types/KeyboardButtonRequestUsers.h
@@ -9,7 +9,7 @@ namespace TgBot {
/**
* @brief This object defines the criteria used to request suitable users.
*
- * The identifiers of the selected users will be shared with the bot when the corresponding button is pressed.
+ * Information about the selected users will be shared with the bot when the corresponding button is pressed.
* [More about requesting users »](https://core.telegram.org/bots/features#chat-and-user-selection)
*
* @ingroup types
@@ -46,6 +46,21 @@ public:
* Defaults to 1.
*/
std::uint8_t maxQuantity;
+
+ /**
+ * @brief Optional. Pass True to request the users' first and last name
+ */
+ bool requestName;
+
+ /**
+ * @brief Optional. Pass True to request the users' username
+ */
+ bool requestUsername;
+
+ /**
+ * @brief Optional. Pass True to request the users' photo
+ */
+ bool requestPhoto;
};
}
diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h
index a6fb3aa..d56f7c4 100644
--- a/include/tgbot/types/Message.h
+++ b/include/tgbot/types/Message.h
@@ -98,6 +98,13 @@ public:
std::int32_t senderBoostCount;
/**
+ * @brief Optional. The bot that actually sent the message on behalf of the business account.
+ *
+ * Available only for outgoing messages sent on behalf of the connected business account.
+ */
+ User::Ptr senderBusinessBot;
+
+ /**
* @brief Date the message was sent in Unix time.
*
* It is always a positive number, representing a valid date.
@@ -105,6 +112,13 @@ public:
std::uint32_t date;
/**
+ * @brief Optional. Unique identifier of the business connection from which the message was received.
+ *
+ * If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
+ */
+ std::string businessConnectionId;
+
+ /**
* @brief Chat the message belongs to
*/
Chat::Ptr chat;
@@ -162,6 +176,11 @@ public:
bool hasProtectedContent;
/**
+ * @brief Optional. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
+ */
+ bool isFromOffline;
+
+ /**
* @brief Optional. The unique identifier of a media message group this message belongs to
*/
std::string mediaGroupId;
diff --git a/include/tgbot/types/ReplyParameters.h b/include/tgbot/types/ReplyParameters.h
index 72b314f..537de07 100644
--- a/include/tgbot/types/ReplyParameters.h
+++ b/include/tgbot/types/ReplyParameters.h
@@ -26,12 +26,17 @@ public:
std::int32_t messageId;
/**
- * @brief Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername)
+ * @brief Optional. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername).
+ *
+ * Not supported for messages sent on behalf of a business account.
*/
std::int64_t chatId;
/**
- * @brief Optional. Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic.
+ * @brief Optional. Pass True if the message should be sent even if the specified message to be replied to is not found.
+ *
+ * Always False for replies in another chat or forum topic.
+ * Always True for messages sent on behalf of a business account.
*/
bool allowSendingWithoutReply;
diff --git a/include/tgbot/types/SharedUser.h b/include/tgbot/types/SharedUser.h
new file mode 100644
index 0000000..680b38b
--- /dev/null
+++ b/include/tgbot/types/SharedUser.h
@@ -0,0 +1,54 @@
+#ifndef TGBOT_SHAREDUSER_H
+#define TGBOT_SHAREDUSER_H
+
+#include "tgbot/types/PhotoSize.h"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace TgBot {
+
+/**
+ * @brief This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button.
+ *
+ * @ingroup types
+ */
+class SharedUser {
+
+public:
+ typedef std::shared_ptr<SharedUser> Ptr;
+
+ /**
+ * @brief Identifier of the shared user.
+ *
+ * This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
+ * But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers.
+ * The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.
+ */
+ std::int64_t userId;
+
+ /**
+ * @brief Optional. First name of the user, if the name was requested by the bot
+ */
+ std::string firstName;
+
+ /**
+ * @brief Optional. Last name of the user, if the name was requested by the bot
+ */
+ std::string lastName;
+
+ /**
+ * @brief Optional. Username of the user, if the username was requested by the bot
+ */
+ std::string username;
+
+ /**
+ * @brief Optional. Available sizes of the chat photo, if the photo was requested by the bot
+ */
+ std::vector<PhotoSize::Ptr> photo;
+};
+}
+
+#endif //TGBOT_SHAREDUSER_H
diff --git a/include/tgbot/types/StickerSet.h b/include/tgbot/types/StickerSet.h
index c55b577..db424dc 100644
--- a/include/tgbot/types/StickerSet.h
+++ b/include/tgbot/types/StickerSet.h
@@ -16,6 +16,7 @@ namespace TgBot {
* @ingroup types
*/
class StickerSet {
+
public:
typedef std::shared_ptr<StickerSet> Ptr;
@@ -37,19 +38,9 @@ public:
std::string title;
/**
- * @brief Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
- */
- Type type;
-
- /**
- * @brief True, if the sticker set contains animated stickers
- */
- bool isAnimated;
-
- /**
- * @brief True, if the sticker set contains video stickers
+ * @brief Type of stickers in the set, currently one of Type::Regular, Type::Mask, Type::CustomEmoji”
*/
- bool isVideo;
+ Type stickerType;
/**
* @brief List of all set stickers
diff --git a/include/tgbot/types/Update.h b/include/tgbot/types/Update.h
index 3ac17ba..a7ad470 100644
--- a/include/tgbot/types/Update.h
+++ b/include/tgbot/types/Update.h
@@ -2,6 +2,8 @@
#define TGBOT_UPDATE_H
#include "tgbot/types/Message.h"
+#include "tgbot/types/BusinessConnection.h"
+#include "tgbot/types/BusinessMessagesDeleted.h"
#include "tgbot/types/MessageReactionUpdated.h"
#include "tgbot/types/MessageReactionCountUpdated.h"
#include "tgbot/types/InlineQuery.h"
@@ -67,6 +69,26 @@ public:
Message::Ptr editedChannelPost;
/**
+ * @brief Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
+ */
+ BusinessConnection::Ptr businessConnection;
+
+ /**
+ * @brief Optional. New non-service message from a connected business account
+ */
+ Message::Ptr businessMessage;
+
+ /**
+ * @brief Optional. New version of a message from a connected business account
+ */
+ Message::Ptr editedBusinessMessage;
+
+ /**
+ * @brief Optional. Messages were deleted from a connected business account
+ */
+ BusinessMessagesDeleted::Ptr deletedBusinessMessages;
+
+ /**
* @brief Optional. A reaction to a message was changed by a user.
*
* The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowedUpdates to receive these updates.
diff --git a/include/tgbot/types/User.h b/include/tgbot/types/User.h
index 328c0a2..6b28e1d 100644
--- a/include/tgbot/types/User.h
+++ b/include/tgbot/types/User.h
@@ -2,8 +2,8 @@
#define TGBOT_USER_H
#include <cstdint>
-#include <string>
#include <memory>
+#include <string>
namespace TgBot {
@@ -12,14 +12,14 @@ namespace TgBot {
*
* @ingroup types
*/
-class User {
+class User {
public:
typedef std::shared_ptr<User> Ptr;
/**
* @brief Unique identifier for this user or bot.
- *
+ *
* This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
* But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
*/
@@ -46,7 +46,7 @@ public:
std::string username;
/**
- * @brief Optional. IETF language tag of the user's language
+ * @brief Optional. [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language
*/
std::string languageCode;
@@ -62,21 +62,31 @@ public:
/**
* @brief Optional. True, if the bot can be invited to groups.
+ *
* Returned only in Api::getMe.
*/
bool canJoinGroups;
/**
- * @brief Optional. True, if privacy mode is disabled for the bot.
+ * @brief Optional. True, if [privacy mode](https://core.telegram.org/bots/features#privacy-mode) is disabled for the bot.
+ *
* Returned only in Api::getMe.
*/
bool canReadAllGroupMessages;
/**
* @brief Optional. True, if the bot supports inline queries.
+ *
* Returned only in Api::getMe.
*/
bool supportsInlineQueries;
+
+ /**
+ * @brief Optional. True, if the bot can be connected to a Telegram Business account to receive its messages.
+ *
+ * Returned only in Api::getMe.
+ */
+ bool canConnectToBusiness;
};
}
diff --git a/include/tgbot/types/UsersShared.h b/include/tgbot/types/UsersShared.h
index 82a63e5..343ac82 100644
--- a/include/tgbot/types/UsersShared.h
+++ b/include/tgbot/types/UsersShared.h
@@ -1,6 +1,8 @@
#ifndef TGBOT_USERSSHARED_H
#define TGBOT_USERSSHARED_H
+#include "tgbot/types/SharedUser.h"
+
#include <cstdint>
#include <memory>
#include <vector>
@@ -23,13 +25,9 @@ public:
std::int32_t requestId;
/**
- * @brief Identifiers of the shared users.
- *
- * These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them.
- * But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers.
- * The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.
+ * @brief Information about users shared with the bot.
*/
- std::vector<std::int64_t> userIds;
+ std::vector<SharedUser::Ptr> users;
};
}