summaryrefslogtreecommitdiff
path: root/include/tgbot
diff options
context:
space:
mode:
authorOleg Morozenkov <m@oleg.rocks>2022-08-30 02:04:15 +0300
committerGitHub <noreply@github.com>2022-08-30 02:04:15 +0300
commit8651e22a472a1b740aee5fd6c8b243425c9498c8 (patch)
treefb14421e54a844bb9b698b5049339323085de343 /include/tgbot
parent336a7c5c4243128afd54133b5e0dfeb9661fb7c2 (diff)
parent76a362631705d9adcc2709e6d8f9b327112ae306 (diff)
Merge pull request #220 from llnulldisk/master
Update to API 4.6
Diffstat (limited to 'include/tgbot')
-rw-r--r--include/tgbot/Api.h102
-rw-r--r--include/tgbot/TgTypeParser.h15
-rw-r--r--include/tgbot/types/Animation.h36
-rw-r--r--include/tgbot/types/Audio.h24
-rw-r--r--include/tgbot/types/Chat.h48
-rw-r--r--include/tgbot/types/ChatMember.h7
-rw-r--r--include/tgbot/types/ChatPhoto.h24
-rw-r--r--include/tgbot/types/Dice.h25
-rw-r--r--include/tgbot/types/Document.h20
-rw-r--r--include/tgbot/types/File.h10
-rw-r--r--include/tgbot/types/KeyboardButton.h20
-rw-r--r--include/tgbot/types/KeyboardButtonPollType.h28
-rw-r--r--include/tgbot/types/Message.h121
-rw-r--r--include/tgbot/types/MessageEntity.h9
-rw-r--r--include/tgbot/types/PhotoSize.h16
-rw-r--r--include/tgbot/types/Poll.h83
-rw-r--r--include/tgbot/types/PollAnswer.h39
-rw-r--r--include/tgbot/types/Sticker.h28
-rw-r--r--include/tgbot/types/StickerSet.h18
-rw-r--r--include/tgbot/types/Update.h19
-rw-r--r--include/tgbot/types/User.h25
-rw-r--r--include/tgbot/types/Venue.h8
-rw-r--r--include/tgbot/types/Video.h20
-rw-r--r--include/tgbot/types/VideoNote.h18
-rw-r--r--include/tgbot/types/Voice.h15
25 files changed, 570 insertions, 208 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index cc18807..18165d1 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -67,7 +67,7 @@ public:
*/
Message::Ptr sendMessage(std::int64_t chatId, const std::string& text, bool disableWebPagePreview = false, std::int32_t replyToMessageId = 0,
GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
-
+
Message::Ptr sendMessage(const std::string& chatId, const std::string& text, bool disableWebPagePreview = false, std::int32_t replyToMessageId = 0,
GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
@@ -218,30 +218,34 @@ public:
File::Ptr uploadStickerFile(std::int64_t userId, InputFile::Ptr pngSticker) 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.
+ * @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. You must use exactly one of the fields pngSticker or tgsSticker.
+ * @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 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.
- * @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.
+ * @param title Sticker set title, 1-64 characters
+ * @param emojis One or more emoji corresponding to the sticker
+ * @param pngSticker Optional. 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, or upload a new one using multipart/form-data.
+ * @param tgsSticker Optional. TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
+ * @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(std::int64_t userId, const std::string& name, const std::string& title,
- boost::variant<InputFile::Ptr, std::string> pngSticker, const std::string& emojis, bool containsMasks = false, MaskPosition::Ptr maskPosition = nullptr) const;
+ bool createNewStickerSet(std::int64_t userId, const std::string& name, const std::string& title, const std::string& emojis,
+ boost::variant<InputFile::Ptr, std::string> pngSticker = "", boost::variant<InputFile::Ptr, std::string> tgsSticker = "",
+ bool containsMasks = false, 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 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.
- * @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.
+ * @brief Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers.
+ * @param userId User identifier of sticker set owner
+ * @param name Sticker set name
+ * @param emojis One or more emoji corresponding to the sticker
+ * @param pngSticker Optional. 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, or upload a new one using multipart/form-data.
+ * @param tgsSticker Optional. TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
+ * @param maskPosition Optional. A JSON-serialized object for position where the mask should be placed on faces
* @return Returns True on success.
*/
- bool addStickerToSet(std::int64_t userId, const std::string& name,
- boost::variant<InputFile::Ptr, std::string> pngSticker, const std::string& emojis, MaskPosition::Ptr maskPosition = nullptr) const;
+ bool addStickerToSet(std::int64_t userId, const std::string& name, const std::string& emojis,
+ boost::variant<InputFile::Ptr, std::string> pngSticker = "", boost::variant<InputFile::Ptr, std::string> tgsSticker = "",
+ MaskPosition::Ptr maskPosition = nullptr) const;
/**
* @brief Use this method to move a sticker in a set created by the bot to a specific position.
@@ -259,6 +263,15 @@ public:
bool deleteStickerFromSet(const std::string& sticker) const;
/**
+ * @brief Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only.
+ * @param name Sticker set name
+ * @param userId User identifier of the sticker set owner
+ * @param thumb Optional. A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. 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, or upload a new one using multipart/form-data. Animated sticker set thumbnail can't be uploaded via HTTP URL.
+ * @return Returns True on success.
+ */
+ bool setStickerSetThumb(const std::string& name, std::int64_t userId, boost::variant<InputFile::Ptr, std::string> thumb = "") 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 video Video to send.
@@ -682,11 +695,20 @@ public:
bool canEditMessages = false, bool canDeleteMessages = false, bool canInviteUsers = false, bool canPinMessages = false, bool canPromoteMembers = false) const;
/**
- * @brief Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
- * @param chatId Unique identifier for the target chat of the target supergroup.
- * @param permissions New default chat permissions.
- * @return True on success
- */
+ * @brief Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
+ * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
+ * @param userId Unique identifier of the target user
+ * @param customTitle New custom title for the administrator; 0-16 characters, emoji are not allowed
+ * @return True on success
+ */
+ bool setChatAdministratorCustomTitle(std::int64_t chatId, std::int64_t userId, const std::string& customTitle) const;
+
+ /**
+ * @brief Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
+ * @param chatId Unique identifier for the target chat of the target supergroup.
+ * @param permissions New default chat permissions.
+ * @return True on success
+ */
bool setChatPermissions(std::int64_t chatId, ChatPermissions::Ptr permissions) const;
/**
@@ -792,17 +814,33 @@ public:
std::string downloadFile(const std::string& filePath, const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>()) const;
/**
- * @brief Use this method to send a poll.
- * @param chatId Unique identifier for the target chat or username of the target channel.
- * @param question Poll question, 1-255 characters.
- * @param options List of answer options, 2-10 strings 1-100 characters each.
- * @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. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- *
+ * @brief Use this method to send a native poll.
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param question Poll question, 1-255 characters
+ * @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 replyToMessageId Optional. If the message is a reply, ID of the original message
+ * @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 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
+ * @param correctOptionId Optional. 0-based identifier of the correct answer option, required for polls in quiz mode
+ * @param isClosed Optional. Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
+ * @return On success, the sent message is returned.
+ */
+ Message::Ptr sendPoll(std::int64_t chatId, const std::string& question, const std::vector<std::string>& options, bool disableNotification = false, std::int32_t replyToMessageId = 0,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), bool isAnonymous = true, const std::string& type = "", bool allowsMultipleAnswers = false,
+ std::int32_t correctOptionId = 0, bool isClosed = false) const;
+
+ /**
+ * @brief Use this method to send a dice, which will have a random value from 1 to 6.
+ * @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 replyToMessageId Optional. If the message is a reply, ID of the original message
+ * @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.
* @return On success, the sent message is returned.
*/
- Message::Ptr sendPoll(std::int64_t chatId, const std::string& question, const std::vector<std::string>& options, bool disableNotification = false, std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ Message::Ptr sendDice(std::int64_t chatId, bool disableNotification = false, std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to stop a poll which was sent by the bot.
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h
index 5961bbe..a5f1511 100644
--- a/include/tgbot/TgTypeParser.h
+++ b/include/tgbot/TgTypeParser.h
@@ -11,6 +11,8 @@
#include "tgbot/types/Sticker.h"
#include "tgbot/types/StickerSet.h"
#include "tgbot/types/Poll.h"
+#include "tgbot/types/Dice.h"
+#include "tgbot/types/PollAnswer.h"
#include "tgbot/types/PollOption.h"
#include "tgbot/types/ChatPermissions.h"
#include "tgbot/types/MaskPosition.h"
@@ -24,6 +26,7 @@
#include "tgbot/types/File.h"
#include "tgbot/types/ReplyKeyboardMarkup.h"
#include "tgbot/types/KeyboardButton.h"
+#include "tgbot/types/KeyboardButtonPollType.h"
#include "tgbot/types/ReplyKeyboardRemove.h"
#include "tgbot/types/ForceReply.h"
#include "tgbot/types/ChatMember.h"
@@ -135,6 +138,12 @@ public:
Poll::Ptr parseJsonAndGetPoll(const boost::property_tree::ptree& data) const;
std::string parsePoll(const Poll::Ptr& object) const;
+ Dice::Ptr parseJsonAndGetDice(const boost::property_tree::ptree& data) const;
+ std::string parseDice(const Dice::Ptr& object) const;
+
+ PollAnswer::Ptr parseJsonAndGetPollAnswer(const boost::property_tree::ptree& data) const;
+ std::string parsePollAnswer(const PollAnswer::Ptr& object) const;
+
PollOption::Ptr parseJsonAndGetPollOption(const boost::property_tree::ptree& data) const;
std::string parsePollOption(const PollOption::Ptr& object) const;
@@ -165,6 +174,9 @@ public:
Location::Ptr parseJsonAndGetLocation(const boost::property_tree::ptree& data) const;
std::string parseLocation(const Location::Ptr& object) const;
+ Venue::Ptr parseJsonAndGetVenue(const boost::property_tree::ptree& data) const;
+ std::string parseVenue(const Venue::Ptr& object) const;
+
Update::Ptr parseJsonAndGetUpdate(const boost::property_tree::ptree& data) const;
std::string parseUpdate(const Update::Ptr& object) const;
@@ -183,6 +195,9 @@ public:
KeyboardButton::Ptr parseJsonAndGetKeyboardButton(const boost::property_tree::ptree& data) const;
std::string parseKeyboardButton(const KeyboardButton::Ptr& object) const;
+ KeyboardButtonPollType::Ptr parseJsonAndGetKeyboardButtonPollType(const boost::property_tree::ptree& data) const;
+ std::string parseKeyboardButtonPollType(const KeyboardButtonPollType::Ptr& object) const;
+
ReplyKeyboardRemove::Ptr parseJsonAndGetReplyKeyboardRemove(const boost::property_tree::ptree& data) const;
std::string parseReplyKeyboardRemove(const ReplyKeyboardRemove::Ptr& object) const;
diff --git a/include/tgbot/types/Animation.h b/include/tgbot/types/Animation.h
index ac54b2c..f1f62af 100644
--- a/include/tgbot/types/Animation.h
+++ b/include/tgbot/types/Animation.h
@@ -10,9 +10,7 @@
namespace TgBot {
/**
- * @brief You can provide an animation for your game so that it looks stylish in chats (check out Lumberjack for an example).
- *
- * This object represents an animation file to be displayed in the message containing a game.
+ * @brief This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
*
* @ingroup types
*/
@@ -21,27 +19,49 @@ public:
typedef std::shared_ptr<Animation> Ptr;
/**
- * @brief Unique file identifier.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Optional. Animation thumbnail as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Video width as defined by sender
+ */
+ std::int32_t width;
+
+ /**
+ * @brief Video height as defined by sender
+ */
+ std::int32_t height;
+
+ /**
+ * @brief Duration of the video in seconds as defined by sender
+ */
+ std::int32_t duration;
+
+ /**
+ * @brief Optional. Animation thumbnail as defined by sender
*/
PhotoSize::Ptr thumb;
/**
- * @brief Optional. Original animation filename as defined by sender.
+ * @brief Optional. Original animation filename as defined by sender
*/
std::string fileName;
/**
- * @brief Optional. MIME type of the file as defined by sender.
+ * @brief Optional. MIME type of the file as defined by sender
*/
std::string mimeType;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
diff --git a/include/tgbot/types/Audio.h b/include/tgbot/types/Audio.h
index dae8729..0db0a36 100644
--- a/include/tgbot/types/Audio.h
+++ b/include/tgbot/types/Audio.h
@@ -10,7 +10,7 @@
namespace TgBot {
/**
- * @brief This object represents an audio file (voice note).
+ * @brief This object represents an audio file to be treated as music by the Telegram clients.
*
* @ingroup types
*/
@@ -20,34 +20,39 @@ public:
typedef std::shared_ptr<Audio> Ptr;
/**
- * @brief Unique identifier for this file.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Duration of the audio in seconds as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Duration of the audio in seconds as defined by sender
*/
std::int32_t duration;
/**
- * @brief Optional. Performer of the audio as defined by sender
- * or by audio tags
+ * @brief Optional. Performer of the audio as defined by sender or by audio tags
*/
std::string performer;
/**
- * @brief Optional. Title of the audio as defined by sender or
- * by audio tags
+ * @brief Optional. Title of the audio as defined by sender or by audio tags
*/
std::string title;
/**
- * @brief Optional. MIME type of the file as defined by sender.
+ * @brief Optional. MIME type of the file as defined by sender
*/
std::string mimeType;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
@@ -56,7 +61,6 @@ public:
*/
PhotoSize::Ptr thumb;
};
-
}
#endif //TGBOT_CPP_AUDIO_H
diff --git a/include/tgbot/types/Chat.h b/include/tgbot/types/Chat.h
index 5731abd..d70aa4b 100644
--- a/include/tgbot/types/Chat.h
+++ b/include/tgbot/types/Chat.h
@@ -12,7 +12,8 @@ namespace TgBot {
class Message;
/**
- * @brief This object represents a Telegram Chat
+ * @brief This object represents a chat.
+ *
* @ingroup types
*/
class Chat {
@@ -28,87 +29,102 @@ public:
};
/**
- * @brief Unique identifier for this chat, not exceeding 1e13 by absolute value
+ * @brief Unique identifier for this chat.
+ *
+ * This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it.
+ * But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
*/
std::int64_t id;
/**
- * @brief Type of chat: can be either "private", "group", "supergroup, or "channel".
+ * @brief Type of chat, can be either “private”, “group”, “supergroup” or “channel”
*/
Type type;
/**
- * @brief Optional. Title for channels and group chat
+ * @brief Optional. Title, for supergroups, channels and group chats
*/
std::string title;
/**
- * @brief Optional. Username for
- * private chats and channels
+ * @brief Optional. Username, for private chats, supergroups and channels if available
*/
std::string username;
/**
- * @brief Optional. First name of the
- * other party in private chat
+ * @brief Optional. First name of the other party in a private chat
*/
std::string firstName;
/**
- * @brief Optional. Last name of the
- * other party in private chat
+ * @brief Optional. Last name of the other party in a private chat
*/
std::string lastName;
/**
- * @brief Optional. True if a group
- * has ‘All Members Are Admins’ enabled.
+ * @brief Deprecated since Bot API 4.4. New bots should use the permissions field instead.
+ *
+ * Optional. True if a group has ‘All Members Are Admins’ enabled.
*/
bool allMembersAreAdministrators;
/**
* @brief Optional. Chat photo.
+ *
* Returned only in getChat.
*/
ChatPhoto::Ptr photo;
/**
- * @brief Optional. Description, for supergroups and channel chats.
+ * @brief Optional. Description, for groups, supergroups and channel chats.
+ *
* Returned only in getChat.
*/
std::string description;
/**
- * @brief Optional. Chat invite link, for supergroups and channel chats.
+ * @brief Optional. Chat invite link, for groups, supergroups and channel chats.
+ *
+ * Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink.
* Returned only in getChat.
*/
std::string inviteLink;
/**
- * @brief Optional. Pinned message, for supergroups and channel chats.
+ * @brief Optional. Pinned message, for groups, supergroups and channels.
+ *
* Returned only in getChat.
*/
std::shared_ptr<Message> pinnedMessage;
/**
* @brief Optional. Default chat member permissions, for groups and supergroups.
+ *
* Returned only in getChat.
*/
ChatPermissions::Ptr permissions;
/**
+ * @brief Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.
+ *
+ * Returned only in getChat.
+ */
+ std::int32_t slowModeDelay;
+
+ /**
* @brief Optional. For supergroups, name of group sticker set.
+ *
* Returned only in getChat.
*/
std::string stickerSetName;
/**
* @brief Optional. True, if the bot can change the group sticker set.
+ *
* Returned only in getChat.
*/
bool canSetStickerSet;
};
-
}
#endif //TGBOT_CPP_CHAT_H
diff --git a/include/tgbot/types/ChatMember.h b/include/tgbot/types/ChatMember.h
index 47e79a4..99be20a 100644
--- a/include/tgbot/types/ChatMember.h
+++ b/include/tgbot/types/ChatMember.h
@@ -11,9 +11,11 @@ namespace TgBot {
/**
* @brief This object contains information about one member of the chat.
+ *
* @ingroup types
*/
class ChatMember {
+
public:
typedef std::shared_ptr<ChatMember> Ptr;
@@ -28,6 +30,11 @@ public:
std::string status;
/**
+ * @brief Optional. Owner and administrators only. Custom title for this user
+ */
+ std::string customTitle;
+
+ /**
* @brief Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time.
*/
std::uint64_t untilDate;
diff --git a/include/tgbot/types/ChatPhoto.h b/include/tgbot/types/ChatPhoto.h
index f41d9b8..92275b2 100644
--- a/include/tgbot/types/ChatPhoto.h
+++ b/include/tgbot/types/ChatPhoto.h
@@ -8,21 +8,41 @@ namespace TgBot {
/**
* @brief This object represents a chat photo.
+ *
* @ingroup types
*/
class ChatPhoto {
+
public:
typedef std::shared_ptr<ChatPhoto> Ptr;
/**
- * @brief Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
+ * @brief File identifier of small (160x160) chat photo.
+ *
+ * This file_id can be used only for photo download and only for as long as the photo is not changed.
*/
std::string smallFileId;
/**
- * @brief Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
+ * @brief Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string smallFileUniqueId;
+
+ /**
+ * @brief File identifier of big (640x640) chat photo.
+ *
+ * This file_id can be used only for photo download and only for as long as the photo is not changed.
*/
std::string bigFileId;
+
+ /**
+ * @brief Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string bigFileUniqueId;
};
}
diff --git a/include/tgbot/types/Dice.h b/include/tgbot/types/Dice.h
new file mode 100644
index 0000000..ec874e0
--- /dev/null
+++ b/include/tgbot/types/Dice.h
@@ -0,0 +1,25 @@
+#ifndef TGBOT_CPP_DICE_H
+#define TGBOT_CPP_DICE_H
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents a dice with random value from 1 to 6.
+ *
+ * @ingroup types
+ */
+class Dice {
+
+public:
+ typedef std::shared_ptr<Dice> Ptr;
+
+ /**
+ * @brief Value of the dice, 1-6
+ */
+ std::int8_t value;
+};
+}
+
+#endif //TGBOT_CPP_DICE_H
diff --git a/include/tgbot/types/Document.h b/include/tgbot/types/Document.h
index b82895f..128b757 100644
--- a/include/tgbot/types/Document.h
+++ b/include/tgbot/types/Document.h
@@ -10,7 +10,7 @@
namespace TgBot {
/**
- * @brief This object represents a general file (as opposed to photos and audio files).
+ * @brief This object represents a general file (as opposed to photos, voice messages and audio files).
*
* @ingroup types
*/
@@ -20,31 +20,37 @@ public:
typedef std::shared_ptr<Document> Ptr;
/**
- * @brief Unique file identifier.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Optional. Document thumbnail as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Optional. Document thumbnail as defined by sender
*/
PhotoSize::Ptr thumb;
/**
- * @brief Optional. Original filename as defined by sender.
+ * @brief Optional. Original filename as defined by sender
*/
std::string fileName;
/**
- * @brief Optional. MIME type of the file as defined by sender.
+ * @brief Optional. MIME type of the file as defined by sender
*/
std::string mimeType;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
-
}
#endif //TGBOT_CPP_DOCUMENT_H
diff --git a/include/tgbot/types/File.h b/include/tgbot/types/File.h
index 3dee2bc..58aa6af 100644
--- a/include/tgbot/types/File.h
+++ b/include/tgbot/types/File.h
@@ -23,11 +23,18 @@ public:
typedef std::shared_ptr<File> Ptr;
/**
- * @brief Unique identifier for this file
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
* @brief Optional. File size, if known
*/
std::int32_t fileSize;
@@ -39,7 +46,6 @@ public:
*/
std::string filePath;
};
-
}
#endif //TGBOT_CPP_FILE_H
diff --git a/include/tgbot/types/KeyboardButton.h b/include/tgbot/types/KeyboardButton.h
index 867d014..f2b6791 100644
--- a/include/tgbot/types/KeyboardButton.h
+++ b/include/tgbot/types/KeyboardButton.h
@@ -1,6 +1,8 @@
#ifndef TGBOT_CPP_KEYBOARDBUTTON_H
#define TGBOT_CPP_KEYBOARDBUTTON_H
+#include "tgbot/types/KeyboardButtonPollType.h"
+
#include <string>
#include <memory>
@@ -9,8 +11,8 @@ namespace TgBot {
/**
* @brief This object represents one button of the reply keyboard.
*
- * For simple text buttons String can be used instead of this
- * object to specify text of the button. Optional fields are mutually exclusive.
+ * For simple text buttons String can be used instead of this object to specify text of the button.
+ * Optional fields request_contact, request_location, and request_poll are mutually exclusive.
*
* @ingroup types
*/
@@ -20,23 +22,25 @@ public:
typedef std::shared_ptr<KeyboardButton> Ptr;
/**
- * @brief Text of the button. If none of the optional fields are used,
- * it will be sent to the bot as a message when the button is pressed
+ * @brief Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
*/
std::string text;
/**
- * @brief Optional. If True, the user's phone number will be sent as a contact
- * when the button is pressed. Available in private chats only
+ * @brief Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
*/
bool requestContact = false;
/**
- * @brief Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
+ * @brief Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
*/
bool requestLocation = false;
-};
+ /**
+ * @brief Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only
+ */
+ KeyboardButtonPollType::Ptr requestPoll;
+};
}
#endif //TGBOT_CPP_KEYBOARDBUTTON_H
diff --git a/include/tgbot/types/KeyboardButtonPollType.h b/include/tgbot/types/KeyboardButtonPollType.h
new file mode 100644
index 0000000..1bead32
--- /dev/null
+++ b/include/tgbot/types/KeyboardButtonPollType.h
@@ -0,0 +1,28 @@
+#ifndef TGBOT_CPP_KEYBOARDBUTTONPOLLTYPE_H
+#define TGBOT_CPP_KEYBOARDBUTTONPOLLTYPE_H
+
+#include <string>
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
+ *
+ * @ingroup types
+ */
+class KeyboardButtonPollType {
+
+public:
+ typedef std::shared_ptr<KeyboardButtonPollType> Ptr;
+
+ /**
+ * @brief Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode.
+ *
+ * If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
+ */
+ std::string type;
+};
+}
+
+#endif //TGBOT_CPP_KEYBOARDBUTTONPOLLTYPE_H
diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h
index 700f5d1..d34fa0d 100644
--- a/include/tgbot/types/Message.h
+++ b/include/tgbot/types/Message.h
@@ -9,6 +9,7 @@
#include "tgbot/types/Animation.h"
#include "tgbot/types/Sticker.h"
#include "tgbot/types/Poll.h"
+#include "tgbot/types/Dice.h"
#include "tgbot/types/Video.h"
#include "tgbot/types/Contact.h"
#include "tgbot/types/Location.h"
@@ -17,6 +18,7 @@
#include "tgbot/types/MessageEntity.h"
#include "tgbot/types/Venue.h"
#include "tgbot/types/Voice.h"
+#include "tgbot/types/VideoNote.h"
#include "tgbot/types/Invoice.h"
#include "tgbot/types/SuccessfulPayment.h"
#include "tgbot/types/InlineKeyboardMarkup.h"
@@ -38,77 +40,84 @@ public:
typedef std::shared_ptr<Message> Ptr;
/**
- * @brief Unique message identifier.
+ * @brief Unique message identifier inside this chat
*/
std::int32_t messageId;
/**
- * @brief Optional. Sender, can be empty for messages sent to channels.
+ * @brief Optional. Sender, empty for messages sent to channels
*/
User::Ptr from;
/**
- * @brief Date the message was sent in Unix time.
+ * @brief Date the message was sent in Unix time
*/
std::int32_t date;
/**
- * @brief Conversation the message belongs to.
+ * @brief Conversation the message belongs to
*/
Chat::Ptr chat;
/**
- * @brief Optional. For forwarded messages, sender of the original message.
+ * @brief Optional. For forwarded messages, sender of the original message
*/
User::Ptr forwardFrom;
/**
- * @brief Optional. For messages forwarded from a channel, information about the original channel
+ * @brief Optional. For messages forwarded from channels, information about the original channel
*/
Chat::Ptr forwardFromChat;
/**
- * @brief Optional. For forwarded channel posts, identifier of the original message in the channel
+ * @brief Optional. For messages forwarded from channels, identifier of the original message in the channel
*/
std::int32_t forwardFromMessageId;
/**
- * @brief Optional. For messages forwarded from channels, signature of the post author if present.
+ * @brief Optional. For messages forwarded from channels, signature of the post author if present
*/
std::string forwardSignature;
/**
- * @brief Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
+ * @brief Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
*/
std::string forwardSenderName;
/**
- * @brief Optional. For forwarded messages, date the original message was sent in Unix time.
+ * @brief Optional. For forwarded messages, date the original message was sent in Unix time
*/
std::int32_t forwardDate;
/**
- * @brief Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
+ * @brief Optional. For replies, the original message.
+ *
+ * Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
*/
Message::Ptr replyToMessage;
/**
- * @brief Optional. Date the message was last edited in Unix time.
+ * @brief Optional. Date the message was last edited in Unix time
*/
std::int32_t editDate;
/**
- * @brief Optional. Signature of the post author for messages in channels.
+ * @brief Optional. The unique identifier of a media message group this message belongs to
+ */
+ std::string mediaGroupId;
+
+ /**
+ * @brief Optional. Signature of the post author for messages in channels
*/
std::string authorSignature;
/**
- * @brief Optional. For text messages, the actual UTF-8 text of the message.
+ * @brief Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
*/
std::string text;
/**
- * @brief Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text.
+ * @brief Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
*/
std::vector<MessageEntity::Ptr> entities;
@@ -118,74 +127,86 @@ public:
std::vector<MessageEntity::Ptr> captionEntities;
/**
- * @brief Optional. Message is an audio file, information about the file.
+ * @brief Optional. Message is an audio file, information about the file
*/
Audio::Ptr audio;
/**
- * @brief Optional. Message is a general file, information about the file.
+ * @brief Optional. Message is a general file, information about the file
*/
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.
+ * 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.
+ * @brief Optional. Message is a game, information about the game
*/
Game::Ptr game;
/**
- * @brief Optional. Message is a photo, available sizes of the photo.
+ * @brief Optional. Message is a photo, available sizes of the photo
*/
std::vector<PhotoSize::Ptr> photo;
/**
- * @brief Optional. Message is a sticker, information about the sticker.
+ * @brief Optional. Message is a sticker, information about the sticker
*/
Sticker::Ptr sticker;
/**
- * @brief Optional. Message is a video, information about the video.
+ * @brief Optional. Message is a video, information about the video
*/
Video::Ptr video;
/**
- * @brief Optional. Message is a voice message, information about the file.
+ * @brief Optional. Message is a voice message, information about the file
*/
Voice::Ptr voice;
/**
- * @brief Optional. Caption for the document, photo or video, 0-200 characters.
+ * @brief Optional. Message is a video note, information about the video message
+ */
+ VideoNote::Ptr videoNote;
+
+ /**
+ * @brief Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
*/
std::string caption;
/**
- * @brief Optional. Message is a shared contact, information about the contact.
+ * @brief Optional. Message is a shared contact, information about the contact
*/
Contact::Ptr contact;
/**
- * @brief Optional. Message is a shared location, information about the location.
+ * @brief Optional. Message is a shared location, information about the location
*/
Location::Ptr location;
/**
- * @brief Optional. Message is a venue, information about the venue.
+ * @brief Optional. Message is a venue, information about the venue
*/
Venue::Ptr venue;
/**
- * @brief Optional. Message is a poll, information about the poll.
+ * @brief Optional. Message is a native poll, information about the poll
*/
Poll::Ptr poll;
/**
- * @brief Optional. A new member was added to the group, information about them (this member may be bot itself).
+ * @brief Optional. Message is a dice with random value from 1 to 6
+ */
+ Dice::Ptr dice;
+
+ /**
+ * @brief Deprecated since Bot API 3.0. The field is replaced with newChatMembers.
+ *
+ * Optional. A new member was added to the group, information about them (this member may be the bot itself)
*/
User::Ptr newChatMember;
@@ -195,81 +216,93 @@ public:
std::vector<User::Ptr> newChatMembers;
/**
- * @brief Optional. A member was removed from the group, information about them (this member may be bot itself).
+ * @brief Optional. A member was removed from the group, information about them (this member may be the bot itself)
*/
User::Ptr leftChatMember;
/**
- * @brief Optional. A group title was changed to this value.
+ * @brief Optional. A chat title was changed to this value
*/
std::string newChatTitle;
/**
- * @brief Optional. A group photo was change to this value.
+ * @brief Optional. A chat photo was change to this value
*/
std::vector<PhotoSize::Ptr> newChatPhoto;
/**
- * @brief Optional. Informs that the group photo was deleted.
+ * @brief Optional. Service message: the chat photo was deleted
*/
bool deleteChatPhoto = false;
/**
- * @brief Optional. Informs that the group has been created.
+ * @brief Optional. Service message: the group has been created
*/
bool groupChatCreated = false;
/**
- * @brief Optional. Service message: the supergroup has been created.
+ * @brief Optional. Service message: the supergroup has been created
*/
bool supergroupChatCreated = false;
/**
- * @brief Optional. Service message: the channel has been created.
+ * @brief Optional. Service message: the channel has been created
*/
bool channelChatCreated = false;
/**
- * @brief Optional. The group has been migrated to a supergroup with the specified identifier, not exceeding 1e13 by absolute value.
+ * @brief Optional. The group has been migrated to a supergroup with the specified identifier.
+ *
+ * This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
*/
std::int64_t migrateToChatId = 0;
/**
- * @brief Optional. The supergroup has been migrated from a group with the specified identifier, not exceeding 1e13 by absolute value
+ * @brief Optional. The supergroup has been migrated from a group with the specified identifier.
+ *
+ * This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
*/
std::int64_t migrateFromChatId = 0;
/**
- * @brief Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
+ * @brief Optional. Specified message was pinned.
+ *
+ * Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
*/
Message::Ptr pinnedMessage;
/**
- * @brief Optional. Message is an invoice for a payment, information about the invoice.
+ * @brief Optional. Message is an invoice for a payment, information about the invoice
*/
Invoice::Ptr invoice;
/**
- * @brief Optional. Message is a service message about a successful payment, information about the payment.
+ * @brief Optional. Message is a service message about a successful payment, information about the payment
*/
SuccessfulPayment::Ptr successfulPayment;
/**
- * @brief Optional. The domain name of the website on which the user has logged in.
+ * @brief Optional. The domain name of the website on which the user has logged in
*/
std::string connectedWebsite;
/**
+ * @brief Optional. Telegram Passport data
+ */
+ // TODO PassportData::Ptr passportData;
+
+ /**
* @brief Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
*/
InlineKeyboardMarkup::Ptr replyMarkup;
/**
- * @brief Optional. Message is automatically forwarded from bounded channel.
+ * @brief Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
+ *
+ * Note: Added with Bot API 5.5
*/
bool automaticForward = false;
};
-
}
#endif //TGBOT_CPP_MESSAGE_H
diff --git a/include/tgbot/types/MessageEntity.h b/include/tgbot/types/MessageEntity.h
index f12d2a7..21d9b99 100644
--- a/include/tgbot/types/MessageEntity.h
+++ b/include/tgbot/types/MessageEntity.h
@@ -21,12 +21,12 @@ public:
/**
* @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)
+ * Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
*/
std::string type;
/**
- * @brief Offset in UTF-16 code units to the start of the entity.
+ * @brief Offset in UTF-16 code units to the start of the entity
*/
std::int32_t offset;
@@ -44,6 +44,11 @@ public:
* @brief Optional. For “text_mention” only, the mentioned user
*/
User::Ptr user;
+
+ /**
+ * @brief Optional. For “pre” only, the programming language of the entity text
+ */
+ std::string language;
};
}
diff --git a/include/tgbot/types/PhotoSize.h b/include/tgbot/types/PhotoSize.h
index 5d59e8a..a0cb5c5 100644
--- a/include/tgbot/types/PhotoSize.h
+++ b/include/tgbot/types/PhotoSize.h
@@ -18,26 +18,32 @@ public:
typedef std::shared_ptr<PhotoSize> Ptr;
/**
- * @brief Unique identifier for this file.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Photo width.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Photo width
*/
std::int32_t width;
/**
- * @brief Photo height.
+ * @brief Photo height
*/
std::int32_t height;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
-
}
#endif //TGBOT_CPP_PHOTOSIZE_H
diff --git a/include/tgbot/types/Poll.h b/include/tgbot/types/Poll.h
index 9f4b04d..9c81dc7 100644
--- a/include/tgbot/types/Poll.h
+++ b/include/tgbot/types/Poll.h
@@ -9,35 +9,64 @@
#include <vector>
namespace TgBot {
+
+/**
+ * @brief This object contains information about a poll.
+ *
+ * @ingroup types
+ */
+class Poll {
+
+public:
+ typedef std::shared_ptr<Poll> Ptr;
+
+ /**
+ * @brief Unique poll identifier
+ */
+ std::int64_t id;
+
+ /**
+ * @brief Poll question, 1-255 characters
+ */
+ std::string question;
+
+ /**
+ * @brief List of poll options
+ */
+ std::vector<PollOption::Ptr> options;
+
+ /**
+ * @brief Total number of users that voted in the poll
+ */
+ std::int32_t totalVoterCount;
+
+ /**
+ * @brief True, if the poll is closed
+ */
+ bool isClosed;
+
+ /**
+ * @brief True, if the poll is anonymous
+ */
+ bool isAnonymous;
+
/**
- * @brief This object represents a Poll.
+ * @brief Poll type, currently can be “regular” or “quiz”
+ */
+ std::string type;
+
+ /**
+ * @brief True, if the poll allows multiple answers
+ */
+ bool allowsMultipleAnswers;
+
+ /**
+ * @brief Optional. 0-based identifier of the correct answer option.
*
- * @ingroup types
- */
- class Poll {
- public:
- typedef std::shared_ptr<Poll> Ptr;
-
- /**
- * @brief Unique poll identifier.
- */
- std::int64_t id;
-
- /**
- * @brief Poll question, 1-255 characters.
- */
- std::string question;
-
- /**
- * @brief List of poll options.
- */
- std::vector<PollOption::Ptr> options;
-
- /**
- * @brief True, if the poll is closed.
- */
- bool isClosed;
- };
+ * Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
+ */
+ std::int32_t correctOptionId;
+};
}
#endif //TGBOT_POLL_H
diff --git a/include/tgbot/types/PollAnswer.h b/include/tgbot/types/PollAnswer.h
new file mode 100644
index 0000000..730248b
--- /dev/null
+++ b/include/tgbot/types/PollAnswer.h
@@ -0,0 +1,39 @@
+#ifndef TGBOT_CPP_POLLANSWER_H
+#define TGBOT_CPP_POLLANSWER_H
+
+#include "tgbot/types/User.h"
+
+#include <string>
+#include <memory>
+#include <vector>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents an answer of a user in a non-anonymous poll.
+ *
+ * @ingroup types
+ */
+class PollAnswer {
+
+public:
+ typedef std::shared_ptr<PollAnswer> Ptr;
+
+ /**
+ * @brief Unique poll identifier
+ */
+ std::string pollId;
+
+ /**
+ * @brief The user, who changed the answer to the poll
+ */
+ User::Ptr user;
+
+ /**
+ * @brief 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
+ */
+ std::vector<std::int32_t> optionIds;
+};
+}
+
+#endif //TGBOT_CPP_POLLANSWER_H
diff --git a/include/tgbot/types/Sticker.h b/include/tgbot/types/Sticker.h
index b1d5945..4986597 100644
--- a/include/tgbot/types/Sticker.h
+++ b/include/tgbot/types/Sticker.h
@@ -11,7 +11,7 @@
namespace TgBot {
/**
- * @brief This object represents a general file (as opposed to photos and audio files).
+ * @brief This object represents a sticker.
*
* @ingroup types
*/
@@ -21,27 +21,34 @@ public:
typedef std::shared_ptr<Sticker> Ptr;
/**
- * @brief Unique file identifier.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Optional. Sticker width.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Sticker width
*/
std::int32_t width;
/**
- * @brief Optional. Sticker height.
+ * @brief Sticker height
*/
std::int32_t height;
/**
- * @brief True, if the sticker is animated.
- */
+ * @brief True, if the sticker is animated
+ */
bool isAnimated = false;
/**
- * @brief Optional. Optional. Sticker thumbnail in .webp or .jpg format.
+ * @brief Optional. Sticker thumbnail in the .webp or .jpg format
*/
PhotoSize::Ptr thumb;
@@ -51,21 +58,20 @@ public:
std::string emoji;
/**
- * @brief Optional. Name of the sticker set to which the sticker belongs.
+ * @brief Optional. Name of the sticker set to which the sticker belongs
*/
std::string setName;
/**
- * @brief Optional. For mask stickers, the position where the mask should be placed.
+ * @brief Optional. For mask stickers, the position where the mask should be placed
*/
MaskPosition::Ptr maskPosition;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
-
}
#endif //TGBOT_CPP_STICKER_H
diff --git a/include/tgbot/types/StickerSet.h b/include/tgbot/types/StickerSet.h
index a5c6c53..4b11cf3 100644
--- a/include/tgbot/types/StickerSet.h
+++ b/include/tgbot/types/StickerSet.h
@@ -2,6 +2,7 @@
#define TGBOT_STICKERSET_H
#include "tgbot/types/Sticker.h"
+#include "tgbot/types/PhotoSize.h"
#include <memory>
#include <string>
@@ -19,29 +20,34 @@ public:
typedef std::shared_ptr<StickerSet> Ptr;
/**
- * @brief Sticker set name.
+ * @brief Sticker set name
*/
std::string name;
/**
- * @brief Sticker set title.
+ * @brief Sticker set title
*/
std::string title;
/**
- * @brief True, if the sticker set contains animated stickers.
- */
+ * @brief True, if the sticker set contains animated stickers
+ */
bool isAnimated = false;
/**
- * @brief True, if the sticker set contains masks.
+ * @brief True, if the sticker set contains masks
*/
bool containsMasks = false;
/**
- * @brief List of all set stickers.
+ * @brief List of all set stickers
*/
std::vector<Sticker::Ptr> stickers;
+
+ /**
+ * @brief Optional. Sticker set thumbnail in the .WEBP or .TGS format
+ */
+ PhotoSize::Ptr thumb;
};
}
diff --git a/include/tgbot/types/Update.h b/include/tgbot/types/Update.h
index fa5f8f3..a80bd4e 100644
--- a/include/tgbot/types/Update.h
+++ b/include/tgbot/types/Update.h
@@ -7,6 +7,8 @@
#include "tgbot/types/CallbackQuery.h"
#include "tgbot/types/ShippingQuery.h"
#include "tgbot/types/PreCheckoutQuery.h"
+#include "tgbot/types/Poll.h"
+#include "tgbot/types/PollAnswer.h"
#include <cstdint>
#include <memory>
@@ -14,7 +16,7 @@
namespace TgBot {
/**
- * @brief This object represents an incoming update.
+ * @brief This object represents an incoming update. At most one of the optional parameters can be present in any given update.
*
* @ingroup types
*/
@@ -76,8 +78,21 @@ public:
* Contains full information about checkout
*/
PreCheckoutQuery::Ptr preCheckoutQuery;
-};
+ /**
+ * @brief Optional. New poll state.
+ *
+ * Bots receive only updates about stopped polls and polls, which are sent by the bot
+ */
+ Poll::Ptr poll;
+
+ /**
+ * @brief Optional. A user changed their answer in a non-anonymous poll.
+ *
+ * Bots receive new votes only in polls that were sent by the bot itself.
+ */
+ PollAnswer::Ptr pollAnswer;
+};
}
#endif //TGBOT_CPP_UPDATE_H
diff --git a/include/tgbot/types/User.h b/include/tgbot/types/User.h
index da1024d..7c7ceaf 100644
--- a/include/tgbot/types/User.h
+++ b/include/tgbot/types/User.h
@@ -18,7 +18,7 @@ public:
typedef std::shared_ptr<User> Ptr;
/**
- * @brief Unique identifier for this user or bot.
+ * @brief Unique identifier for this user or bot
*/
std::int64_t id;
@@ -28,24 +28,39 @@ public:
bool isBot = false;
/**
- * @brief User‘s or bot’s first name.
+ * @brief User‘s or bot’s first name
*/
std::string firstName;
/**
- * @brief Optional. User‘s or bot’s last name.
+ * @brief Optional. User‘s or bot’s last name
*/
std::string lastName;
/**
- * @brief Optional. User‘s or bot’s username.
+ * @brief Optional. User‘s or bot’s username
*/
std::string username;
/**
- * @brief Optional. IETF language tag of the user's language.
+ * @brief Optional. IETF language tag of the user's language
*/
std::string languageCode;
+
+ /**
+ * @brief Optional. True, if the bot can be invited to groups. Returned only in getMe.
+ */
+ bool canJoinGroups;
+
+ /**
+ * @brief Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
+ */
+ bool canReadAllGroupMessages;
+
+ /**
+ * @brief Optional. True, if the bot supports inline queries. Returned only in getMe.
+ */
+ bool supportsInlineQueries;
};
}
diff --git a/include/tgbot/types/Venue.h b/include/tgbot/types/Venue.h
index 9e1ff81..589b5cf 100644
--- a/include/tgbot/types/Venue.h
+++ b/include/tgbot/types/Venue.h
@@ -18,22 +18,22 @@ public:
typedef std::shared_ptr<Venue> Ptr;
/**
- * @brief Venue location.
+ * @brief Venue location
*/
Location::Ptr location;
/**
- * @brief Name of the venue.
+ * @brief Name of the venue
*/
std::string title;
/**
- * @brief Address of the venue.
+ * @brief Address of the venue
*/
std::string address;
/**
- * @brief Optional. Foursquare identifier of the venue.
+ * @brief Optional. Foursquare identifier of the venue
*/
std::string foursquareId;
diff --git a/include/tgbot/types/Video.h b/include/tgbot/types/Video.h
index 1702c5b..f305891 100644
--- a/include/tgbot/types/Video.h
+++ b/include/tgbot/types/Video.h
@@ -20,27 +20,34 @@ public:
typedef std::shared_ptr<Video> Ptr;
/**
- * @brief Unique identifier for this file.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Video width as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Video width as defined by sender
*/
std::int32_t width;
/**
- * @brief Video height as defined by sender.
+ * @brief Video height as defined by sender
*/
std::int32_t height;
/**
- * @brief Duration of the video in seconds as defined by sender.
+ * @brief Duration of the video in seconds as defined by sender
*/
std::int32_t duration;
/**
- * @brief Optional. Video thumbnail.
+ * @brief Optional. Video thumbnail
*/
PhotoSize::Ptr thumb;
@@ -50,11 +57,10 @@ public:
std::string mimeType;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
-
}
#endif //TGBOT_CPP_VIDEO_H
diff --git a/include/tgbot/types/VideoNote.h b/include/tgbot/types/VideoNote.h
index ebdf0cb..64684a3 100644
--- a/include/tgbot/types/VideoNote.h
+++ b/include/tgbot/types/VideoNote.h
@@ -20,31 +20,37 @@ public:
typedef std::shared_ptr<VideoNote> Ptr;
/**
- * @brief Unique identifier for this file.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Video width and height as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Video width and height (diameter of the video message) as defined by sender
*/
std::int32_t length;
/**
- * @brief Duration of the video in seconds as defined by sender.
+ * @brief Duration of the video in seconds as defined by sender
*/
std::int32_t duration;
/**
- * @brief Optional. Video thumbnail.
+ * @brief Optional. Video thumbnail
*/
PhotoSize::Ptr thumb;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};
-
}
#endif //TGBOT_CPP_VIDEONOTE_H
diff --git a/include/tgbot/types/Voice.h b/include/tgbot/types/Voice.h
index 78b7282..34ab016 100644
--- a/include/tgbot/types/Voice.h
+++ b/include/tgbot/types/Voice.h
@@ -17,22 +17,29 @@ public:
typedef std::shared_ptr<Voice> Ptr;
/**
- * @brief Unique identifier for this file.
+ * @brief Identifier for this file, which can be used to download or reuse the file
*/
std::string fileId;
/**
- * @brief Duration of the audio in seconds as defined by sender.
+ * @brief Unique identifier for this file, which is supposed to be the same over time and for different bots.
+ *
+ * Can't be used to download or reuse the file.
+ */
+ std::string fileUniqueId;
+
+ /**
+ * @brief Duration of the audio in seconds as defined by sender
*/
std::int32_t duration;
/**
- * @brief Optional. MIME type of the file as defined by sender;
+ * @brief Optional. MIME type of the file as defined by sender
*/
std::string mimeType;
/**
- * @brief Optional. File size.
+ * @brief Optional. File size
*/
std::int32_t fileSize;
};