summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/tgbot/Api.h819
-rw-r--r--include/tgbot/TgTypeParser.h27
-rw-r--r--include/tgbot/types/Audio.h5
-rw-r--r--include/tgbot/types/Chat.h42
-rw-r--r--include/tgbot/types/ChatLocation.h33
-rw-r--r--include/tgbot/types/ChatMember.h9
-rw-r--r--include/tgbot/types/Dice.h4
-rw-r--r--include/tgbot/types/InlineQueryResult.h27
-rw-r--r--include/tgbot/types/InlineQueryResultArticle.h22
-rw-r--r--include/tgbot/types/InlineQueryResultAudio.h33
-rw-r--r--include/tgbot/types/InlineQueryResultCachedAudio.h27
-rw-r--r--include/tgbot/types/InlineQueryResultCachedDocument.h31
-rw-r--r--include/tgbot/types/InlineQueryResultCachedGif.h30
-rw-r--r--include/tgbot/types/InlineQueryResultCachedMpeg4Gif.h30
-rw-r--r--include/tgbot/types/InlineQueryResultCachedPhoto.h31
-rw-r--r--include/tgbot/types/InlineQueryResultCachedSticker.h8
-rw-r--r--include/tgbot/types/InlineQueryResultCachedVideo.h33
-rw-r--r--include/tgbot/types/InlineQueryResultCachedVoice.h33
-rw-r--r--include/tgbot/types/InlineQueryResultContact.h14
-rw-r--r--include/tgbot/types/InlineQueryResultDocument.h40
-rw-r--r--include/tgbot/types/InlineQueryResultGif.h36
-rw-r--r--include/tgbot/types/InlineQueryResultLocation.h39
-rw-r--r--include/tgbot/types/InlineQueryResultMpeg4Gif.h35
-rw-r--r--include/tgbot/types/InlineQueryResultPhoto.h41
-rw-r--r--include/tgbot/types/InlineQueryResultVenue.h31
-rw-r--r--include/tgbot/types/InlineQueryResultVideo.h52
-rw-r--r--include/tgbot/types/InlineQueryResultVoice.h36
-rw-r--r--include/tgbot/types/InputContactMessageContent.h12
-rw-r--r--include/tgbot/types/InputLocationMessageContent.h32
-rw-r--r--include/tgbot/types/InputMedia.h67
-rw-r--r--include/tgbot/types/InputMediaAnimation.h33
-rw-r--r--include/tgbot/types/InputMediaAudio.h33
-rw-r--r--include/tgbot/types/InputMediaDocument.h24
-rw-r--r--include/tgbot/types/InputMediaPhoto.h5
-rw-r--r--include/tgbot/types/InputMediaVideo.h36
-rw-r--r--include/tgbot/types/InputMessageContent.h19
-rw-r--r--include/tgbot/types/InputTextMessageContent.h22
-rw-r--r--include/tgbot/types/InputVenueMessageContent.h22
-rw-r--r--include/tgbot/types/Location.h27
-rw-r--r--include/tgbot/types/Message.h63
-rw-r--r--include/tgbot/types/MessageId.h25
-rw-r--r--include/tgbot/types/ProximityAlertTriggered.h37
-rw-r--r--include/tgbot/types/Venue.h13
-rw-r--r--include/tgbot/types/Video.h5
-rw-r--r--include/tgbot/types/WebhookInfo.h9
45 files changed, 1582 insertions, 470 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index bb9aa26..2241e1d 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -6,6 +6,7 @@
#include "tgbot/net/HttpReqArg.h"
#include "tgbot/types/User.h"
#include "tgbot/types/Message.h"
+#include "tgbot/types/MessageId.h"
#include "tgbot/types/GenericReply.h"
#include "tgbot/types/InputFile.h"
#include "tgbot/types/UserProfilePhotos.h"
@@ -63,25 +64,42 @@ public:
std::vector<Update::Ptr> getUpdates(std::int32_t offset = 0, std::int32_t limit = 100, std::int32_t timeout = 0, const StringArrayPtr& allowedUpdates = nullptr) const;
/**
- * @brief Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
+ * @brief Use this method to specify a url and receive incoming updates via an outgoing webhook.
+ * Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized @ref Update.
+ * In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
*
- * If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. www.example.com/<token>. Since nobody else knows your bot‘s token, you can be pretty sure it’s us.
- * You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
- * We currently do not support self-signed certificates.
+ * If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>.
+ * Since nobody else knows your bot's token, you can be pretty sure it's us.
+ *
+ * You will not be able to receive updates using @ref Api::getUpdates for as long as an outgoing webhook is set up.
+ *
+ * To use a self-signed certificate, you need to upload your public key certificate using certificate parameter.
+ * Please upload as InputFile, sending a String will not work.
+ *
* Ports currently supported for Webhooks: 443, 80, 88, 8443.
+ *
+ * If you're having any trouble setting up webhooks, please check out https://core.telegram.org/bots/webhooks.
*
- * @param url Optional. HTTPS url to send updates to. Use an empty string to remove webhook integration.
+ * @param url HTTPS url to send updates to. Use an empty string to remove webhook integration
+ * @param certificate Optional. Upload your public key certificate so that the root certificate in use can be checked. See https://core.telegram.org/bots/self-signed for details.
+ * @param ipAddress Optional. The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
+ * @param maxConnection Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
+ * @param allowedUpdates Optional. A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
+ * @param dropPendingUpdates Optional. Pass True to drop all pending updates
+ *
+ * @return True on success.
*/
- void setWebhook(const std::string& url = "", InputFile::Ptr certificate = nullptr, std::int32_t maxConnection = 40, const StringArrayPtr& allowedUpdates = nullptr) const;
+ bool setWebhook(const std::string& url, InputFile::Ptr certificate = nullptr, const std::string& ipAddress = "",
+ std::int32_t maxConnection = 40, const StringArrayPtr& allowedUpdates = nullptr, bool dropPendingUpdates = false) const;
/**
- * @brief Use this method to remove webhook integration if you decide to switch back to getUpdates.
+ * @brief Use this method to remove webhook integration if you decide to switch back to @ref Api::getUpdates.
*
- * Requires no parameters.
+ * @param dropPendingUpdates Optional. Pass True to drop all pending updates
*
- * @return Returns True on success.
+ * @return True on success.
*/
- bool deleteWebhook() const;
+ bool deleteWebhook(bool dropPendingUpdates = false) const;
/**
* @brief Use this method to get current webhook status.
@@ -103,18 +121,20 @@ public:
* @brief Use this method to send text messages.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- * @param text Text of the message to be sent
+ * @param text Text of the message to be sent, 1-4096 characters after entities parsing
+ * @param parseMode Optional. Mode for parsing entities in the message text. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param entities Optional. List of special entities that appear in message text, which can be specified instead of parseMode
* @param disableWebPagePreview Optional. Disables link previews for links in this message
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
* @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 parseMode Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
*
- * @return On success, the sent @ref Message is returned.
+ * @return On success, the sent Message is returned.
*/
- Message::Ptr sendMessage(boost::variant<std::int64_t, 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;
+ Message::Ptr sendMessage(boost::variant<std::int64_t, const std::string&> chatId, const std::string& text, const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& entities = std::vector<MessageEntity::Ptr>(), bool disableWebPagePreview = false, bool disableNotification = false,
+ std::int32_t replyToMessageId = 0, bool allowSendingWithoutReply = false, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to forward messages of any kind.
@@ -127,160 +147,304 @@ public:
Message::Ptr forwardMessage(std::int64_t chatId, std::int64_t fromChatId, std::int32_t messageId, bool disableNotification = false) const;
/**
+ * @brief Use this method to copy messages of any kind.
+ * The method is analogous to the method Api::forwardMessages, but the copied message doesn't have a link to the original message.
+ *
+ * @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 message was sent (or channel username in the format @channelusername)
+ * @param messageId Message identifier in the chat specified in fromChatId
+ * @param caption Optional. New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
+ * @param parseMode Optional. Mode for parsing entities in the new caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the new caption, which can be specified instead of parseMode
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 the MessageId of the sent message on success.
+ */
+ MessageId::Ptr copyMessage(std::int64_t chatId, std::int64_t fromChatId, std::int32_t messageId,
+ const std::string& caption = "", const std::string& parseMode = "", const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ bool disableNotification = false, std::int32_t replyToMessageId = 0, bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+
+ /**
* @brief Use this method to send photos.
- * @param chatId Unique identifier for the target chat.
- * @param photo Photo to send.
- * @param caption Optional. Photo caption.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @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. 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 parseMode Optional. Mode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendPhoto(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> photo, const std::string& caption = "", std::int32_t replyToMessageId = 0,
- GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendPhoto(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> photo, const std::string& caption = "",
+ const std::string& parseMode = "", const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(), bool disableNotification = false,
+ std::int32_t replyToMessageId = 0, bool allowSendingWithoutReply = false, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
- * @brief Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Document).
- * @param chatId Unique identifier for the target chat.
- * @param audio Audio to send.
- * @param caption Audio caption, 0-200 characters
- * @param duration Duration of sent audio in seconds.
- * @param performer Performer
- * @param title Track name
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * @brief Use this method to send audio files, if you want Telegram clients to display them in the music player.
+ * Your audio must be in the .MP3 or .M4A format.
+ * Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
+ *
+ * For sending voice messages, use the Api::sendVoice method instead.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param audio Audio file to send. Pass a fileId as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. https://core.telegram.org/bots/api#sending-files
+ * @param caption Optional. Audio caption, 0-1024 characters after entities parsing
+ * @param parseMode Optional. Mode for parsing entities in the audio caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @param duration Optional. Duration of the audio in seconds
+ * @param performer Optional. Performer
+ * @param title Optional. Track name
+ * @param thumb 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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendAudio(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> audio, const std::string& caption = "", std::int32_t duration = 0,
- const std::string& performer = "", const std::string& title = "", boost::variant<InputFile::Ptr, std::string> thumb = "", std::int32_t replyToMessageId = 0,
- GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendAudio(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> audio,
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ std::int32_t duration = 0,
+ const std::string& performer = "",
+ const std::string& title = "",
+ boost::variant<InputFile::Ptr, std::string> thumb = "",
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to send general files.
- * @param chatId Unique identifier for the target chat.
- * @param document Document to send.
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
- * @param caption Document caption (may also be used when resending documents by file_id), 0-200 characters
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param document File 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 file from the Internet, or upload a new one using multipart/form-data. https://core.telegram.org/bots/api#sending-files
+ * @param thumb 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 parseMode Optional. Mode for parsing entities in the document caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. 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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendDocument(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> document, boost::variant<InputFile::Ptr, std::string> thumb = "", const std::string& caption = "", std::int32_t replyToMessageId = 0,
- GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendDocument(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> document,
+ boost::variant<InputFile::Ptr, std::string> thumb = "",
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ bool disableContentTypeDetection = false,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) 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.
- * @param supportsStreaming Optional. Pass True, if the uploaded video is suitable for streaming.
+ * Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param video Video to send. Pass a fileId as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. https://core.telegram.org/bots/api#sending-files
* @param duration Optional. Duration of sent video in seconds
* @param width Optional. Video width
* @param height Optional. Video height
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
- * @param caption Optional. Video caption (may also be used when resending videos by file_id), 0-200 characters
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * @param thumb 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 parseMode Optional. Mode for parsing entities in the video caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @param supportsStreaming Optional. Pass True, if the uploaded video is suitable for streaming
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendVideo(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> video, bool supportsStreaming = false, std::int32_t duration = 0, std::int32_t width = 0, std::int32_t height = 0, boost::variant<InputFile::Ptr, std::string> thumb = "", const std::string& caption = "",
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendVideo(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> video,
+ std::int32_t duration = 0,
+ std::int32_t width = 0,
+ std::int32_t height = 0,
+ boost::variant<InputFile::Ptr, std::string> thumb = "",
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ bool supportsStreaming = false,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
- *
* Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
*
- * @param chatId Unique identifier for the target chat.
- * @param animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data.
- * @param duration Optional. Duration of sent animation in seconds.
- * @param width Optional. Animation width.
- * @param height Optional. Animation height.
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
- * @param caption Optional. Animation caption (may also be used when resending animation by file_id), 0-200 characters
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param animation Animation to send. Pass a fileId as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. https://core.telegram.org/bots/api#sending-files
+ * @param duration Optional. Duration of sent animation in seconds
+ * @param width Optional. Animation width
+ * @param height Optional. Animation height
+ * @param thumb 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 parseMode Optional. Mode for parsing entities in the animation caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendAnimation(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> animation, std::int32_t duration = 0, std::int32_t width = 0, std::int32_t height = 0, boost::variant<InputFile::Ptr, std::string> thumb = "", const std::string& caption = "",
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendAnimation(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> animation,
+ std::int32_t duration = 0,
+ std::int32_t width = 0,
+ std::int32_t height = 0,
+ boost::variant<InputFile::Ptr, std::string> thumb = "",
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
- * @param chatId Unique identifier for the target chat.
- * @param voice Audio file to send.
- * @param caption Voice message caption, 0-200 characters
- * @param duration Duration of send audio in seconds.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param parseMode Optional. Set it to "Markdown" or "HTML" if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
+ * Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param voice Audio file 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 file from the Internet, or upload a new one using multipart/form-data. https://core.telegram.org/bots/api#sending-files
+ * @param caption Optional. Voice message caption, 0-1024 characters after entities parsing
+ * @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 captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @param duration Optional. Duration of the voice message in seconds
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendVoice(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> voice, const std::string& caption = "", int duration = 0, std::int32_t replyToMessageId = 0,
- GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), const std::string& parseMode = "", bool disableNotification = false) const;
+ Message::Ptr sendVoice(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> voice,
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ std::int32_t duration = 0,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
- * @brief Use this method to send video messages. On success, the sent Message is returned.
- * @param chatId Unique identifier for the target chat.
- * @param videoNote Video note to send.
- * @param replyToMessageId If the message is a reply, ID of the original message.
- * @param disableNotification Sends the message silently. Users will receive a notification with no sound.
- * @param duration Duration of sent video in seconds.
- * @param length Video width and height.
- * @param thumb Thumbnail of the file sent. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
- * @param replyMarkup Additional interface options. A object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.
+ * @brief As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
+ * Use this method to send video messages.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param videoNote Video note to send. Pass a fileId as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. Sending video notes by a URL is currently unsupported. https://core.telegram.org/bots/api#sending-files
+ * @param duration Optional. Duration of sent video in seconds
+ * @param length Optional. Video width and height, i.e. diameter of the video message
+ * @param thumb 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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendVideoNote(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> videoNote, std::int64_t replyToMessageId = 0, bool disableNotification = false,
- std::int32_t duration = 0, std::int32_t length = 0, boost::variant<InputFile::Ptr, std::string> thumb = "", GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ Message::Ptr sendVideoNote(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> videoNote,
+ std::int32_t duration = 0,
+ std::int32_t length = 0,
+ boost::variant<InputFile::Ptr, std::string> thumb = "",
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
- * @brief Use this method to send a group of photos or videos as an album.
- * @param chatId Unique identifier for the target chat of the target channel.
- * @param media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items.
- * @param disableNotification Optional. Sends the messages silently. Users will receive a notification with no sound.
- * @param replyToMessageId Optional. If the messages are a reply, ID of the original message.
- * @return On success, an array of the sent Messages is returned.
+ * @brief Use this method to send a group of photos, videos, documents or audios as an album.
+ * Documents and audio files can be only group in an album with messages of the same type.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param media A JSON-serialized array describing messages to be sent, must include 2-10 items
+ * @param disableNotification Optional. Sends messages silently. Users will receive a notification with no sound.
+ * @param replyToMessageId Optional. If the messages are a reply, ID of the original message
+ * @param allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ *
+ * @return On success, an array of Messages that were sent is returned.
*/
- std::vector<Message::Ptr> sendMediaGroup(std::int64_t chatId, const std::vector<InputMedia::Ptr>& media,
- bool disableNotification = false, std::int32_t replyToMessageId = 0) const;
+ std::vector<Message::Ptr> sendMediaGroup(std::int64_t chatId,
+ const std::vector<InputMedia::Ptr>& media,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false) const;
/**
* @brief Use this method to send point on the map.
- * @param chatId Unique identifier for the target chat.
- * @param latitude Latitude of location.
- * @param longitude Longitude of location.
- * @param livePeriod Optional. Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400).
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param latitude Latitude of the location
+ * @param longitude Longitude of the location
+ * @param horizontalAccuracy Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+ * @param livePeriod Optional. Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
+ * @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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendLocation(std::int64_t chatId, float latitude, float longitude, std::uint32_t livePeriod = 0,
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), bool disableNotification = false) const;
-
- /**
- * @brief Use this method to edit live location messages sent by the bot or via the bot (for inline bots).
- * @param latitude Latitude of new location.
- * @param longitude Longitude of new location.
- * @param chatId Optional. Required if inlineMessageId is not specified. Unique identifier for the target chat of the target channel.
- * @param messageId Optional. Required if inlineMessageId is not specified. Identifier of the sent message.
- * @param inlineMessageId Optional. Required if chatId and messageId are not specified. Identifier of the inline message.
+ Message::Ptr sendLocation(std::int64_t chatId,
+ float latitude,
+ float longitude,
+ float horizontalAccuracy = 0,
+ std::uint32_t livePeriod = 0,
+ std::uint32_t heading = 0,
+ std::uint32_t proximityAlertRadius = 0,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+
+ /**
+ * @brief Use this method to edit live location messages.
+ * A location can be edited until its livePeriod expires or editing is explicitly disabled by a call to Api::stopMessageLiveLocation.
+ *
+ * @param latitude Latitude of new location
+ * @param longitude Longitude of new location
+ * @param chatId Optional. Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param messageId Optional. Required if inlineMessageId is not specified. Identifier of the message to edit
+ * @param inlineMessageId Optional. Required if chatId and messageId are not specified. Identifier of the inline message
+ * @param horizontalAccuracy Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+ * @param heading Optional. Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
+ * @param proximityAlertRadius Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
* @param replyMarkup Optional. A JSON-serialized object for a new inline keyboard.
- * @return On success, if the edited message was sent by the bot, the edited Message is returned, otherwise nullptr is returned.
+ *
+ * @return On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
*/
- Message::Ptr editMessageLiveLocation(float latitude, float longitude, std::int64_t chatId = 0, std::int32_t messageId = 0,
- std::int32_t inlineMessageId = 0, InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>()) const;
+ Message::Ptr editMessageLiveLocation(float latitude, float longitude, std::int64_t chatId = 0,
+ std::int32_t messageId = 0, std::int32_t inlineMessageId = 0, float horizontalAccuracy = 0,
+ std::int32_t heading = 0, std::int32_t proximityAlertRadius = 0, InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>()) const;
/**
* @brief Use this method to edit live location messages sent by the bot or via the bot (for inline bots).
@@ -294,42 +458,68 @@ public:
InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>()) const;
/**
- * @brief Use this method to send information about a venue. On success, the sent Message is returned.
- * @param chatId Unique identifier for the target chat.
- * @param latitude Latitude of location.
- * @param longitude Longitude of location.
- * @param title Name of the venue.
- * @param address Address of the venue.
- * @param foursquareId Foursquare identifier of the venue.
- * @param foursquareType Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * @brief Use this method to send information about a venue.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param latitude Latitude of the venue
+ * @param longitude Longitude of the venue
+ * @param title Name of the venue
+ * @param address Address of the venue
+ * @param foursquareId Optional. Foursquare identifier of the venue
+ * @param foursquareType Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+ * @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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendVenue(std::int64_t chatId, float latitude, float longitude, const std::string& title, const std::string& address, const std::string& foursquareId = "", const std::string& foursquareType = "",
- bool disableNotification = false, std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
-
- /**
- * @brief Use this method to send phone contacts. On success, the sent Message is returned.
- * @param chatId Unique identifier for the target chat.
- * @param phoneNumber Contact's phone number.
- * @param firstName Contact's first name.
- * @param lastName Contact's last name.
- * @param vcard Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes.
- * @param disableNotification Optional. Sends the message silenty.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. A object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @return On success, the sent message is returned.
+ Message::Ptr sendVenue(std::int64_t chatId,
+ float latitude,
+ float longitude,
+ const std::string& title,
+ const std::string& address,
+ const std::string& foursquareId = "",
+ const std::string& foursquareType = "",
+ const std::string& googlePlaceId = "",
+ const std::string& googlePlaceType = "",
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+
+ /**
+ * @brief Use this method to send phone contacts.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param phoneNumber Contact's phone number
+ * @param firstName Contact's first name
+ * @param lastName Optional. Contact's last name
+ * @param vcard Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
+ * @param disableNotification Optional. Sends the message silently. Users will receive a notification with no sound.
+ * @param replyToMessageId Optional. If the message is a reply, ID of the original message
+ * @param allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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.
+ *
+ * @return On success, the sent Message is returned.
*/
- Message::Ptr sendContact(std::int64_t chatId, const std::string& phoneNumber, const std::string& firstName, const std::string& lastName = "", const std::string& vcard = "", bool disableNotification = false,
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ Message::Ptr sendContact(std::int64_t chatId,
+ const std::string& phoneNumber,
+ const std::string& firstName,
+ const std::string& lastName = "",
+ const std::string& vcard = "",
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @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 question Poll question, 1-300 characters
* @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
* @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”
@@ -337,34 +527,53 @@ public:
* @param correctOptionId Optional. 0-based identifier of the correct answer option, required for polls in quiz mode
* @param explanation Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
* @param explanationParseMode Optional. Mode for parsing entities in the explanation. See https://core.telegram.org/bots/api#formatting-options for more details.
- * @param openPeriod Optional. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
- * @param closeDate Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.
+ * @param explanationEntities Optional. List of special entities that appear in the poll explanation, which can be specified instead of parseMode
+ * @param openPeriod Optional. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with closeDate.
+ * @param closeDate Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with openPeriod.
* @param isClosed Optional. Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
* @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
* @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 @ref Message is returned.
+ * @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 isAnonymous = true, const std::string& type = "", bool allowsMultipleAnswers = false,
- std::int32_t correctOptionId = 0, const std::string& explanation = "", const std::string& explanationParseMode = "",
- std::int32_t openPeriod = 0, std::int64_t closeDate = 0, bool isClosed = false,
- bool disableNotification = false, std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
-
- /**
- * @brief Use this method to send a dice, which will have a random value from 1 to 6.
+ Message::Ptr sendPoll(std::int64_t chatId,
+ const std::string& question,
+ const std::vector<std::string>& options,
+ bool isAnonymous = true,
+ const std::string& type = "",
+ bool allowsMultipleAnswers = false,
+ std::int32_t correctOptionId = 0,
+ const std::string& explanation = "",
+ const std::string& explanationParseMode = "",
+ const std::vector<MessageEntity::Ptr>& explanationEntities = std::vector<MessageEntity::Ptr>(),
+ std::int32_t openPeriod = 0,
+ std::int32_t closeDate = 0,
+ bool isClosed = false,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+
+ /**
+ * @brief Use this method to send an animated emoji that will display a random value.
*
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- * @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 “🎯”, and values 1-5 for “🏀”. Defaults to “🎲”
+ * @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 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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
* @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 @ref Message is returned.
+ * @return On success, the sent Message is returned.
*/
- Message::Ptr sendDice(std::int64_t chatId, const std::string& emoji = "", bool disableNotification = false,
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ Message::Ptr sendDice(std::int64_t chatId,
+ const std::string& emoji = "",
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @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).
@@ -411,12 +620,21 @@ public:
bool kickChatMember(std::int64_t chatId, std::int64_t userId, std::uint64_t untilDate = 0) const;
/**
- * @brief Use this method to unban a previously kicked user in a supergroup.
- * @param chatId Unique identifier for the target group.
- * @param userId Unique identifier of the target user.
+ * @brief Use this method to unban a previously kicked user in a supergroup or channel.
+ *
+ * The user will not return to the group or channel automatically, but will be able to join via link, etc.
+ * The bot must be an administrator for this to work.
+ * By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
+ * So if the user is a member of the chat they will also be removed from the chat.
+ * If you don't want this, use the parameter only_if_banned.
+ *
+ * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
+ * @param userId Unique identifier of the target user
+ * @param onlyIfBanned Optional. True = Do nothing if the user is not banned
+ *
* @return True on success
*/
- bool unbanChatMember(std::int64_t chatId, std::int64_t userId) const;
+ bool unbanChatMember(std::int64_t chatId, std::int64_t userId, bool onlyIfBanned = false) const;
/**
* @brief Use this method to restrict a user in a supergroup.
@@ -433,20 +651,27 @@ public:
/**
* @brief Use this method to promote or demote a user in a supergroup or a channel.
- * @param chatId Unique identifier for the target chat of the target supergroup or channal.
- * @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 create channel posts, channels only.
- * @param canEditMessages Optional. Pass True, if the administrator can edit messages of other users and can pin messages, 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 canRestrictMembers Optional. Pass True, if the administrator can restrict, ban or unban chat members.
- * @param canPinMessages Optional. Pass True, if the administrator can pin messages, supergroups only.
- * @param canPromoteMembers Optional. Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him).
- * @return True on success
+ * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
+ * Pass False for all boolean parameters to demote a user.
+ *
+ * @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 isAnonymous Optional. Pass True, if the administrator's presence in the chat is hidden
+ * @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 create channel posts, channels only
+ * @param canEditMessages Optional. Pass True, if the administrator can edit messages of other users and can pin messages, 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 canRestrictMembers Optional. Pass True, if the administrator can restrict, ban or unban chat members
+ * @param canPinMessages Optional. Pass True, if the administrator can pin messages, 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 he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
+ *
+ * @return True on success.
*/
- bool promoteChatMember(std::int64_t chatId, std::int64_t userId, bool canChangeInfo = false, bool canPostMessages = false,
- bool canEditMessages = false, bool canDeleteMessages = false, bool canInviteUsers = false, bool canPinMessages = false, bool canPromoteMembers = false) const;
+ bool promoteChatMember(std::int64_t chatId, std::int64_t userId, bool isAnonymous = false,
+ bool canChangeInfo = false, bool canPostMessages = false, bool canEditMessages = false,
+ bool canDeleteMessages = false, bool canInviteUsers = false, bool canRestrictMembers = false,
+ bool canPinMessages = false, bool canPromoteMembers = false) const;
/**
* @brief Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
@@ -524,11 +749,25 @@ public:
bool pinChatMessage(std::int64_t chatId, std::int32_t messageId, bool disableNotification = false) const;
/**
- * @brief Use this method to unpin a message in a group, a supergroup, or a channel.
- * @param chatId Unique identifier for the target chat or username of the target channel.
- * @return True on success
+ * @brief Use this method to remove a message from the list of pinned messages in a chat.
+ * If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param messageId Optional. Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
+ *
+ * @return True on success.
*/
- bool unpinChatMessage(std::int64_t chatId) const;
+ bool unpinChatMessage(std::int64_t chatId, std::int32_t messageId = 0) const;
+
+ /**
+ * @brief Use this method to clear the list of pinned messages in a chat.
+ * If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.
+ *
+ * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ *
+ * @return True on success.
+ */
+ bool unpinAllChatMessages(std::int64_t chatId) const;
/**
* @brief Use this method for your bot to leave a group, supergroup or channel.
@@ -538,9 +777,11 @@ public:
bool leaveChat(std::int64_t chatId) const;
/**
- * @brief Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
- * @param chatId Unique identifier for the target chat of the target supergroup or channel.
- * @return Chat object.
+ * @brief Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
+ *
+ * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
+ *
+ * @return @ref Chat object on success.
*/
Chat::Ptr getChat(std::int64_t chatId) const;
@@ -606,30 +847,48 @@ public:
std::vector<BotCommand::Ptr> getMyCommands() const;
/**
- * @brief Use this method to edit text and game messages sent by the bot or via the bot (for inline bots)
- * @param text New text of the message
- * @param chatId Optional Required if inline_message_id is not specified. Unique identifier for the target chat of the target channel.
- * @param messageId Optional Required if inline_message_id is not specified. Identifier of the sent message
- * @param inlineMessageId Optional Required if chat_id and message_id are not specified. Identifier of the inline message
- * @param parseMode Optional Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
- * @param disableWebPagePreview Optional Disables link previews for links in this message
- * @param replyMarkup Optional A JSON-serialized object for an inline keyboard.
- * @return Message object on success, otherwise nullptr
+ * @brief Use this method to edit text and game messages.
+ *
+ * @param text New text of the message, 1-4096 characters after entities parsing
+ * @param chatId Optional. Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param messageId Optional. Required if inlineMessageId is not specified. Identifier of the message to edit
+ * @param inlineMessageId Optional. Required if chatId and messageId are not specified. Identifier of the inline message
+ * @param parseMode Optional. Mode for parsing entities in the message text. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param entities Optional. List of special entities that appear in message text, which can be specified instead of parseMode
+ * @param disableWebPagePreview Optional. Disables link previews for links in this message
+ * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard.
+ *
+ * @return On success, the edited Message is returned.
*/
- Message::Ptr editMessageText(const std::string& text, std::int64_t chatId = 0, std::int32_t messageId = 0, const std::string& inlineMessageId = "",
- const std::string& parseMode = "", bool disableWebPagePreview = false, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ Message::Ptr editMessageText(const std::string& text,
+ std::int64_t chatId = 0,
+ std::int32_t messageId = 0,
+ const std::string& inlineMessageId = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& entities = std::vector<MessageEntity::Ptr>(),
+ bool disableWebPagePreview = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
- * @brief Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
- * @param chatId Optional Required if inline_message_id is not specified. Unique identifier for the target chat of the target channel.
- * @param messageId Optional Required if inline_message_id is not specified. Identifier of the sent message
- * @param caption Optional New caption of the message
- * @param inlineMessageId Optional Required if chat_id and message_id are not specified. Identifier of the inline message
- * @param replyMarkup Optional A JSON-serialized object for an inline keyboard.
- * @return Message object on success, otherwise nullptr
- */
- Message::Ptr editMessageCaption(std::int64_t chatId = 0, std::int32_t messageId = 0, const std::string& caption = "",
- const std::string& inlineMessageId = "", GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
+ * @brief Use this method to edit captions of messages.
+ *
+ * @param chatId Optional. Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
+ * @param messageId Optional. Required if inlineMessageId is not specified. Identifier of the message to edit
+ * @param inlineMessageId Optional. Required if chatId and messageId are not specified. Identifier of the inline message
+ * @param caption Optional. New caption of the message, 0-1024 characters after entities parsing
+ * @param parseMode Optional. Mode for parsing entities in the message caption. See https://core.telegram.org/bots/api#formatting-options for more details.
+ * @param captionEntities Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard.
+ *
+ * @return On success, the edited Message is returned.
+ */
+ Message::Ptr editMessageCaption(std::int64_t chatId = 0,
+ std::int32_t messageId = 0,
+ const std::string& inlineMessageId = "",
+ const std::string& caption = "",
+ const std::string& parseMode = "",
+ const std::vector<MessageEntity::Ptr>& captionEntities = std::vector<MessageEntity::Ptr>(),
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to edit audio, document, photo, or video messages.
@@ -637,7 +896,7 @@ public:
*
* If a message is a part of a message album, then it can be edited only to a photo or a video.
* Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
- * Use previously uploaded file via its file_id or specify a URL.
+ * Use previously uploaded file via its fileId or specify a URL.
*
* @param media A JSON-serialized object for a new media content of the message.
* @param chatId Optional Required if inline_message_id is not specified. Unique identifier for the target chat of the target channel.
@@ -679,16 +938,23 @@ public:
void deleteMessage(std::int64_t chatId, std::int32_t messageId) const;
/**
- * @brief Use this method to send .webp stickers.
- * @param chatId Unique identifier for the target chat.
- * @param sticker Sticker to send.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. Additional interface options. An object for a custom reply keyboard, instructions to hide keyboard or to force a reply from the user.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * @brief Use this method to send static .WEBP or animated .TGS 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 file from the Internet, or upload a new one using multipart/form-data. https://core.telegram.org/bots/api#sending-files
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @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 sendSticker(std::int64_t chatId, boost::variant<InputFile::Ptr, std::string> sticker, std::int32_t replyToMessageId = 0,
- GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), bool disableNotification = false) const;
+ Message::Ptr sendSticker(std::int64_t chatId,
+ boost::variant<InputFile::Ptr, std::string> sticker,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to get a sticker set.
@@ -712,7 +978,7 @@ public:
* @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 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 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 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.
* @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
@@ -729,7 +995,7 @@ public:
* @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 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 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.
* @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
*
@@ -758,7 +1024,7 @@ public:
*
* @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.
+ * @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 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. Animated sticker set thumbnail can't be uploaded via HTTP URL.
*
* @return Returns True on success.
*/
@@ -781,38 +1047,58 @@ public:
/**
* @brief Use this method to send invoices.
- * @param chatId Unique identifier for the target private chat.
- * @param title Product name, 1-32 characters.
- * @param description Product description, 1-255 characters.
+ *
+ * @param chatId Unique identifier for the target private chat
+ * @param title Product name, 1-32 characters
+ * @param description Product description, 1-255 characters
* @param payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
- * @param providerToken Payments provider token, obtained via Botfather.
- * @param startParameter Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter.
- * @param currency Three-letter ISO 4217 currency code.
- * @param prices Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
- * @param providerData Optional. JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
+ * @param providerToken Payments provider token, obtained via Botfather
+ * @param startParameter Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter
+ * @param currency Three-letter ISO 4217 currency code, see https://core.telegram.org/bots/payments#supported-currencies
+ * @param prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
+ * @param providerData Optional. A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.
* @param photoUrl Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
* @param photoSize Optional. Photo size
* @param photoWidth Optional. Photo width
* @param photoHeight Optional. Photo height
- * @param needName Optional. Pass True, if you require the user's full name to complete the order.
- * @param needPhoneNumber Optional. Pass True, if you require the user's phone number to complete the order.
- * @param needEmail Optional. Pass True, if you require the user's email address to complete the order.
- * @param needShippingAddress Optional. Pass True, if you require the user's shipping address to complete the order.
- * @param sendPhoneNumberToProvider Optional. Pass True, if user's phone number should be sent to provider.
+ * @param needName Optional. Pass True, if you require the user's full name to complete the order
+ * @param needPhoneNumber Optional. Pass True, if you require the user's phone number to complete the order
+ * @param needEmail Optional. Pass True, if you require the user's email address to complete the order
+ * @param needShippingAddress Optional. Pass True, if you require the user's shipping address to complete the order
+ * @param sendPhoneNumberToProvider Optional. Pass True, if user's phone number should be sent to provider
* @param sendEmailToProvider Optional. Pass True, if user's email address should be sent to provider
- * @param isFlexible Optional. Pass True, if the final price depends on the shipping method.
- * @param replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
+ * @param isFlexible Optional. Pass True, if the final price depends on the shipping method
* @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
+ *
* @return On success, the sent Message is returned.
*/
- Message::Ptr sendInvoice(std::int64_t chatId, const std::string& title, const std::string& description, const std::string& payload,
- const std::string& providerToken, const std::string& startParameter, const std::string& currency, const std::vector<LabeledPrice::Ptr>& prices,
- const std::string& providerData = "", const std::string& photoUrl = "", std::int32_t photoSize = 0,
- std::int32_t photoWidth = 0, std::int32_t photoHeight = 0, bool needName = false,
- bool needPhoneNumber = false, bool needEmail = false, bool needShippingAddress = false,
- bool sendPhoneNumberToProvider = false, bool sendEmailToProvider = false, bool isFlexible = false,
- std::int32_t replyToMessageId = 0, GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>(), bool disableNotification = false) const;
+ Message::Ptr sendInvoice(std::int64_t chatId,
+ const std::string& title,
+ const std::string& description,
+ const std::string& payload,
+ const std::string& providerToken,
+ const std::string& startParameter,
+ const std::string& currency,
+ const std::vector<LabeledPrice::Ptr>& prices,
+ const std::string& providerData = "",
+ const std::string& photoUrl = "",
+ std::int32_t photoSize = 0,
+ std::int32_t photoWidth = 0,
+ std::int32_t photoHeight = 0,
+ bool needName = false,
+ bool needPhoneNumber = false,
+ bool needEmail = false,
+ bool needShippingAddress = false,
+ bool sendPhoneNumberToProvider = false,
+ bool sendEmailToProvider = false,
+ bool isFlexible = false,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ GenericReply::Ptr replyMarkup = std::make_shared<GenericReply>()) const;
/**
* @brief Use this method to reply to shipping queries.
@@ -857,15 +1143,22 @@ public:
/**
* @brief Use this method to send a game.
- * @param chatId Unique identifier for the target chat.
+ *
+ * @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 replyToMessageId Optional. If the message is a reply, ID of the original message.
- * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game.
- * @param disableNotification Optional. Sends the message silenty.
- * @return On success, the sent message is returned.
+ * @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 allowSendingWithoutReply Optional. Pass True, if the message should be sent even if the specified replied-to message is not found
+ * @param replyMarkup Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.
+ *
+ * @return On success, the sent Message is returned.
*/
- Message::Ptr sendGame(std::int64_t chatId, const std::string& gameShortName, std::int32_t replyToMessageId = 0,
- InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>(), bool disableNotification = false) const;
+ Message::Ptr sendGame(std::int64_t chatId,
+ const std::string& gameShortName,
+ bool disableNotification = false,
+ std::int32_t replyToMessageId = 0,
+ bool allowSendingWithoutReply = false,
+ InlineKeyboardMarkup::Ptr replyMarkup = std::make_shared<InlineKeyboardMarkup>()) const;
/**
* @brief Use this method to set the score of the specified user in a game.
diff --git a/include/tgbot/TgTypeParser.h b/include/tgbot/TgTypeParser.h
index 15a29d6..7009f6e 100644
--- a/include/tgbot/TgTypeParser.h
+++ b/include/tgbot/TgTypeParser.h
@@ -5,6 +5,7 @@
#include "tgbot/types/User.h"
#include "tgbot/types/Chat.h"
#include "tgbot/types/Message.h"
+#include "tgbot/types/MessageId.h"
#include "tgbot/types/PhotoSize.h"
#include "tgbot/types/Audio.h"
#include "tgbot/types/Document.h"
@@ -15,12 +16,14 @@
#include "tgbot/types/PollAnswer.h"
#include "tgbot/types/PollOption.h"
#include "tgbot/types/ChatPermissions.h"
+#include "tgbot/types/ChatLocation.h"
#include "tgbot/types/MaskPosition.h"
#include "tgbot/types/Video.h"
#include "tgbot/types/Voice.h"
#include "tgbot/types/VideoNote.h"
#include "tgbot/types/Contact.h"
#include "tgbot/types/Location.h"
+#include "tgbot/types/ProximityAlertTriggered.h"
#include "tgbot/types/Update.h"
#include "tgbot/types/UserProfilePhotos.h"
#include "tgbot/types/File.h"
@@ -129,6 +132,9 @@ public:
Message::Ptr parseJsonAndGetMessage(const boost::property_tree::ptree& data) const;
std::string parseMessage(const Message::Ptr& object) const;
+ MessageId::Ptr parseJsonAndGetMessageId(const boost::property_tree::ptree& data) const;
+ std::string parseMessageId(const MessageId::Ptr& object) const;
+
PhotoSize::Ptr parseJsonAndGetPhotoSize(const boost::property_tree::ptree& data) const;
std::string parsePhotoSize(const PhotoSize::Ptr& object) const;
@@ -162,6 +168,9 @@ public:
ChatPermissions::Ptr parseJsonAndGetChatPermissions(const boost::property_tree::ptree& data) const;
std::string parseChatPermissions(const ChatPermissions::Ptr& object) const;
+ ChatLocation::Ptr parseJsonAndGetChatLocation(const boost::property_tree::ptree& data) const;
+ std::string parseChatLocation(const ChatLocation::Ptr& object) const;
+
Video::Ptr parseJsonAndGetVideo(const boost::property_tree::ptree& data) const;
std::string parseVideo(const Video::Ptr& object) const;
@@ -189,6 +198,9 @@ public:
Venue::Ptr parseJsonAndGetVenue(const boost::property_tree::ptree& data) const;
std::string parseVenue(const Venue::Ptr& object) const;
+ ProximityAlertTriggered::Ptr parseJsonAndGetProximityAlertTriggered(const boost::property_tree::ptree& data) const;
+ std::string parseProximityAlertTriggered(const ProximityAlertTriggered::Ptr& object) const;
+
Update::Ptr parseJsonAndGetUpdate(const boost::property_tree::ptree& data) const;
std::string parseUpdate(const Update::Ptr& object) const;
@@ -198,6 +210,21 @@ public:
InputMedia::Ptr parseJsonAndGetInputMedia(const boost::property_tree::ptree& data) const;
std::string parseInputMedia(const InputMedia::Ptr& object) const;
+ InputMediaPhoto::Ptr parseJsonAndGetInputMediaPhoto(const boost::property_tree::ptree& data) const;
+ std::string parseInputMediaPhoto(const InputMediaPhoto::Ptr& object) const;
+
+ InputMediaVideo::Ptr parseJsonAndGetInputMediaVideo(const boost::property_tree::ptree& data) const;
+ std::string parseInputMediaVideo(const InputMediaVideo::Ptr& object) const;
+
+ InputMediaAnimation::Ptr parseJsonAndGetInputMediaAnimation(const boost::property_tree::ptree& data) const;
+ std::string parseInputMediaAnimation(const InputMediaAnimation::Ptr& object) const;
+
+ InputMediaAudio::Ptr parseJsonAndGetInputMediaAudio(const boost::property_tree::ptree& data) const;
+ std::string parseInputMediaAudio(const InputMediaAudio::Ptr& object) const;
+
+ InputMediaDocument::Ptr parseJsonAndGetInputMediaDocument(const boost::property_tree::ptree& data) const;
+ std::string parseInputMediaDocument(const InputMediaDocument::Ptr& object) const;
+
File::Ptr parseJsonAndGetFile(const boost::property_tree::ptree& data) const;
std::string parseFile(const File::Ptr& object) const;
diff --git a/include/tgbot/types/Audio.h b/include/tgbot/types/Audio.h
index a4b8c94..50611ca 100644
--- a/include/tgbot/types/Audio.h
+++ b/include/tgbot/types/Audio.h
@@ -46,6 +46,11 @@ public:
std::string title;
/**
+ * @brief Optional. Original filename as defined by sender
+ */
+ std::string fileName;
+
+ /**
* @brief Optional. MIME type of the file as defined by sender
*/
std::string mimeType;
diff --git a/include/tgbot/types/Chat.h b/include/tgbot/types/Chat.h
index ad2329e..2b74447 100644
--- a/include/tgbot/types/Chat.h
+++ b/include/tgbot/types/Chat.h
@@ -3,6 +3,7 @@
#include "tgbot/types/ChatPhoto.h"
#include "tgbot/types/ChatPermissions.h"
+#include "tgbot/types/ChatLocation.h"
#include <cstdint>
#include <string>
@@ -63,52 +64,75 @@ public:
/**
* @brief Optional. Chat photo.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
ChatPhoto::Ptr photo;
/**
+ * @brief Optional. Bio of the other party in a private chat.
+ * Returned only in Api::getChat.
+ */
+ std::string bio;
+
+ /**
* @brief Optional. Description, for groups, supergroups and channel chats.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
std::string description;
/**
* @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 @ref Api::exportChatInviteLink.
- * Returned only in @ref Api::getChat.
+ * Each administrator in a chat generates their own invite links, so the bot must first generate the link using Api::exportChatInviteLink.
+ * Returned only in Api::getChat.
*/
std::string inviteLink;
/**
* @brief Optional. Pinned message, for groups, supergroups and channels.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
std::shared_ptr<Message> pinnedMessage;
/**
* @brief Optional. Default chat member permissions, for groups and supergroups.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
ChatPermissions::Ptr permissions;
/**
* @brief Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
std::int32_t slowModeDelay;
/**
* @brief Optional. For supergroups, name of group sticker set.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
std::string stickerSetName;
/**
* @brief Optional. True, if the bot can change the group sticker set.
- * Returned only in @ref Api::getChat.
+ * Returned only in Api::getChat.
*/
bool canSetStickerSet;
+
+ /**
+ * @brief Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats.
+ *
+ * This identifier 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.
+ *
+ * Returned only in Api::getChat.
+ */
+ std::int64_t linkedChatId;
+
+ /**
+ * @brief Optional. For supergroups, the location to which the supergroup is connected.
+ *
+ * Returned only in Api::getChat.
+ */
+ ChatLocation::Ptr location;
};
}
diff --git a/include/tgbot/types/ChatLocation.h b/include/tgbot/types/ChatLocation.h
new file mode 100644
index 0000000..0abbba0
--- /dev/null
+++ b/include/tgbot/types/ChatLocation.h
@@ -0,0 +1,33 @@
+#ifndef TGBOT_CPP_CHATLOCATION_H
+#define TGBOT_CPP_CHATLOCATION_H
+
+#include "tgbot/types/Location.h"
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief Represents a location to which a chat is connected.
+ *
+ * @ingroup types
+ */
+class ChatLocation {
+
+public:
+ typedef std::shared_ptr<ChatLocation> Ptr;
+
+ /**
+ * @brief The location to which the supergroup is connected.
+ * Can't be a live location.
+ */
+ Location::Ptr location;
+
+ /**
+ * @brief Location address; 1-64 characters, as defined by the chat owner
+ */
+ std::string address;
+};
+}
+
+#endif //TGBOT_CPP_CHATLOCATION_H
diff --git a/include/tgbot/types/ChatMember.h b/include/tgbot/types/ChatMember.h
index 5ec07a5..dd033fd 100644
--- a/include/tgbot/types/ChatMember.h
+++ b/include/tgbot/types/ChatMember.h
@@ -36,9 +36,9 @@ public:
std::string customTitle;
/**
- * @brief Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time
+ * @brief Optional. Owner and administrators only. True, if the user's presence in the chat is hidden
*/
- std::uint64_t untilDate;
+ bool isAnonymous;
/**
* @brief Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
@@ -114,6 +114,11 @@ public:
* @brief Optional. Restricted only. True, if the user is allowed to add web page previews to their messages
*/
bool canAddWebPagePreviews;
+
+ /**
+ * @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/Dice.h b/include/tgbot/types/Dice.h
index 4c2a68e..55ded96 100644
--- a/include/tgbot/types/Dice.h
+++ b/include/tgbot/types/Dice.h
@@ -21,9 +21,9 @@ public:
std::string emoji;
/**
- * @brief Value of the dice, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” base emoji
+ * @brief Value of the dice, 1-6 for “🎲” and “🎯” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
*/
- std::int8_t value;
+ std::int32_t value;
};
}
diff --git a/include/tgbot/types/InlineQueryResult.h b/include/tgbot/types/InlineQueryResult.h
index 5674015..dec086e 100644
--- a/include/tgbot/types/InlineQueryResult.h
+++ b/include/tgbot/types/InlineQueryResult.h
@@ -2,7 +2,6 @@
#define TGBOT_INLINEQUERYRESULT_H
#include "tgbot/types/InlineKeyboardMarkup.h"
-#include "tgbot/types/InputMessageContent.h"
#include <memory>
#include <string>
@@ -11,6 +10,8 @@ namespace TgBot {
/**
* @brief This abstract class is base of all inline query results.
+ *
+ * This object represents one result of an inline query.
*
* @ingroup types
*/
@@ -33,33 +34,9 @@ public:
std::string id;
/**
- * @brief Requred, optional or missing. See description of derived classes.
- * Title for the result
- */
- std::string title;
-
- /**
- * @brief Optional or missing. See description of derived classes.
- * Caption of the file to be sent, 0-1024 characters after entities parsing
- */
- std::string caption;
-
- /**
- * @brief Optional or missing. See description of derived classes.
- * Mode for parsing entities in the caption.
- */
- std::string parseMode;
-
- /**
* @brief Optional. Inline keyboard attached to the message
*/
InlineKeyboardMarkup::Ptr replyMarkup;
-
- /**
- * @brief Requred, optional or missing. See description of derived classes.
- * Content of the message to be sent
- */
- InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultArticle.h b/include/tgbot/types/InlineQueryResultArticle.h
index 5c51f3d..509a8d2 100644
--- a/include/tgbot/types/InlineQueryResultArticle.h
+++ b/include/tgbot/types/InlineQueryResultArticle.h
@@ -2,6 +2,7 @@
#define TGBOT_INLINEQUERYRESULTARTICLE_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
@@ -22,13 +23,20 @@ public:
InlineQueryResultArticle() {
this->type = TYPE;
- this->hideUrl = false;
- this->thumbHeight = 0;
- this->thumbWidth = 0;
}
/**
- * @brief Optional. URL of the result.
+ * @brief Title of the result
+ */
+ std::string title;
+
+ /**
+ * @brief Content of the message to be sent
+ */
+ InputMessageContent::Ptr inputMessageContent;
+
+ /**
+ * @brief Optional. URL of the result
*/
std::string url;
@@ -38,7 +46,7 @@ public:
bool hideUrl;
/**
- * @brief Optional. Short description of the result.
+ * @brief Optional. Short description of the result
*/
std::string description;
@@ -48,12 +56,12 @@ public:
std::string thumbUrl;
/**
- * @brief Optional. Thumbnail width.
+ * @brief Optional. Thumbnail width
*/
std::int32_t thumbWidth;
/**
- * @brief Optinal. Thumbnail height
+ * @brief Optional. Thumbnail height
*/
std::int32_t thumbHeight;
};
diff --git a/include/tgbot/types/InlineQueryResultAudio.h b/include/tgbot/types/InlineQueryResultAudio.h
index dfee389..7925c28 100644
--- a/include/tgbot/types/InlineQueryResultAudio.h
+++ b/include/tgbot/types/InlineQueryResultAudio.h
@@ -2,6 +2,8 @@
#define TGBOT_INLINEQUERYRESULTAUDIO_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
@@ -10,7 +12,9 @@
namespace TgBot {
/**
- * @brief Represents a link to an mp3 audio file.
+ * @brief Represents a link to an MP3 audio file.
+ * By default, this audio file will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the audio.
*
* @ingroup types
*/
@@ -22,7 +26,6 @@ public:
InlineQueryResultAudio() {
this->type = TYPE;
- this->audioDuration = 0;
}
/**
@@ -31,6 +34,27 @@ public:
std::string audioUrl;
/**
+ * @brief Title
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the audio caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
* @brief Optional. Performer
*/
std::string performer;
@@ -39,6 +63,11 @@ public:
* @brief Optional. Audio duration in seconds
*/
std::int32_t audioDuration;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the audio
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedAudio.h b/include/tgbot/types/InlineQueryResultCachedAudio.h
index c157226..d26534b 100644
--- a/include/tgbot/types/InlineQueryResultCachedAudio.h
+++ b/include/tgbot/types/InlineQueryResultCachedAudio.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDAUDIO_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
- * @brief Represents a link to an mp3 audio file stored on the Telegram servers.
+ * @brief Represents a link to an MP3 audio file stored on the Telegram servers.
+ * By default, this audio file will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the audio.
*
* @ingroup types
*/
@@ -28,6 +33,26 @@ public:
*/
std::string audioFileId;
+ /**
+ * @brief Optional. Caption, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the audio caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the audio
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedDocument.h b/include/tgbot/types/InlineQueryResultCachedDocument.h
index 24bb2f3..4b3b42f 100644
--- a/include/tgbot/types/InlineQueryResultCachedDocument.h
+++ b/include/tgbot/types/InlineQueryResultCachedDocument.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDDOCUMENT_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a file stored on the Telegram servers.
+ * By default, this file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the file.
*
* @ingroup types
*/
@@ -24,6 +29,11 @@ public:
}
/**
+ * @brief Title for the result
+ */
+ std::string title;
+
+ /**
* @brief A valid file identifier for the file
*/
std::string documentFileId;
@@ -32,6 +42,27 @@ public:
* @brief Optional. Short description of the result
*/
std::string description;
+
+ /**
+ * @brief Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the document caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the file
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedGif.h b/include/tgbot/types/InlineQueryResultCachedGif.h
index 23ec84a..b75ca39 100644
--- a/include/tgbot/types/InlineQueryResultCachedGif.h
+++ b/include/tgbot/types/InlineQueryResultCachedGif.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDGIF_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to an animated GIF file stored on the Telegram servers.
+ * By default, this animated GIF file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with specified content instead of the animation.
*
* @ingroup types
*/
@@ -28,6 +33,31 @@ public:
*/
std::string gifFileId;
+ /**
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the GIF animation
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedMpeg4Gif.h b/include/tgbot/types/InlineQueryResultCachedMpeg4Gif.h
index 19a63a8..91bc4ae 100644
--- a/include/tgbot/types/InlineQueryResultCachedMpeg4Gif.h
+++ b/include/tgbot/types/InlineQueryResultCachedMpeg4Gif.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDMPEG4GIF_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers.
+ * By default, this animated MPEG-4 file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the animation.
*
* @ingroup types
*/
@@ -28,6 +33,31 @@ public:
*/
std::string mpeg4FileId;
+ /**
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the video animation
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedPhoto.h b/include/tgbot/types/InlineQueryResultCachedPhoto.h
index ba32314..8ab23e8 100644
--- a/include/tgbot/types/InlineQueryResultCachedPhoto.h
+++ b/include/tgbot/types/InlineQueryResultCachedPhoto.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDPHOTO_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a photo stored on the Telegram servers.
+ * By default, this photo will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the photo.
*
* @ingroup types
*/
@@ -29,9 +34,35 @@ public:
std::string photoFileId;
/**
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
* @brief Optional. Short description of the result
*/
std::string description;
+
+ /**
+ * @brief Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the photo caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the photo
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedSticker.h b/include/tgbot/types/InlineQueryResultCachedSticker.h
index 29290fc..40d82f6 100644
--- a/include/tgbot/types/InlineQueryResultCachedSticker.h
+++ b/include/tgbot/types/InlineQueryResultCachedSticker.h
@@ -2,6 +2,7 @@
#define TGBOT_INLINEQUERYRESULTCACHEDSTICKER_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
@@ -10,6 +11,8 @@ namespace TgBot {
/**
* @brief Represents a link to a sticker stored on the Telegram servers.
+ * By default, this sticker will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the sticker.
*
* @ingroup types
*/
@@ -27,6 +30,11 @@ public:
* @brief A valid file identifier of the sticker
*/
std::string stickerFileId;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the sticker
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedVideo.h b/include/tgbot/types/InlineQueryResultCachedVideo.h
index f7b700a..b82cf34 100644
--- a/include/tgbot/types/InlineQueryResultCachedVideo.h
+++ b/include/tgbot/types/InlineQueryResultCachedVideo.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDVIDEO_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a video file stored on the Telegram servers.
+ * By default, this video file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the video.
*
* @ingroup types
*/
@@ -24,14 +29,40 @@ public:
}
/**
- * @brief A valid file identifier of the video
+ * @brief A valid file identifier for the video file
*/
std::string videoFileId;
/**
+ * @brief Title for the result
+ */
+ std::string title;
+
+ /**
* @brief Optional. Short description of the result
*/
std::string description;
+
+ /**
+ * @brief Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the video caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the video
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultCachedVoice.h b/include/tgbot/types/InlineQueryResultCachedVoice.h
index ef08fca..ec21f43 100644
--- a/include/tgbot/types/InlineQueryResultCachedVoice.h
+++ b/include/tgbot/types/InlineQueryResultCachedVoice.h
@@ -2,14 +2,19 @@
#define TGBOT_INLINEQUERYRESULTCACHEDVOICE_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a voice message stored on the Telegram servers.
+ * By default, this voice message will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the voice message.
*
* @ingroup types
*/
@@ -24,9 +29,35 @@ public:
}
/**
- * @brief A valid file identifier of the voice message
+ * @brief A valid file identifier for the voice message
*/
std::string voiceFileId;
+
+ /**
+ * @brief Voice message title
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the voice message caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the voice message
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultContact.h b/include/tgbot/types/InlineQueryResultContact.h
index 83ae223..32894c9 100644
--- a/include/tgbot/types/InlineQueryResultContact.h
+++ b/include/tgbot/types/InlineQueryResultContact.h
@@ -2,6 +2,7 @@
#define TGBOT_INLINEQUERYRESULTCONTACT_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
@@ -10,7 +11,9 @@
namespace TgBot {
/**
- * @brief Represents a contact with a phone number
+ * @brief Represents a contact with a phone number.
+ * By default, this contact will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the contact.
*
* @ingroup types
*/
@@ -22,8 +25,6 @@ public:
InlineQueryResultContact() {
this->type = TYPE;
- this->thumbHeight = 0;
- this->thumbWidth = 0;
}
/**
@@ -47,12 +48,17 @@ public:
std::string vcard;
/**
+ * @brief Optional. Content of the message to be sent instead of the contact
+ */
+ InputMessageContent::Ptr inputMessageContent;
+
+ /**
* @brief Optional. Url of the thumbnail for the result
*/
std::string thumbUrl;
/**
- * @brief Optional. Thumbnail width.
+ * @brief Optional. Thumbnail width
*/
std::int32_t thumbWidth;
diff --git a/include/tgbot/types/InlineQueryResultDocument.h b/include/tgbot/types/InlineQueryResultDocument.h
index 88a8ae1..9e6758c 100644
--- a/include/tgbot/types/InlineQueryResultDocument.h
+++ b/include/tgbot/types/InlineQueryResultDocument.h
@@ -2,15 +2,21 @@
#define TGBOT_INLINEQUERYRESULTDOCUMENT_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a file.
+ * By default, this file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the file.
+ * Currently, only .PDF and .ZIP files can be sent using this method.
*
* @ingroup types
*/
@@ -22,17 +28,36 @@ public:
InlineQueryResultDocument() {
this->type = TYPE;
- this->thumbHeight = 0;
- this->thumbWidth = 0;
}
/**
+ * @brief Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the document caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
* @brief A valid URL for the file
*/
std::string documentUrl;
/**
- * @brief Mime type of the content of the file, either 'application/pdf' or 'application/zip'
+ * @brief Mime type of the content of the file, either “application/pdf” or “application/zip”
*/
std::string mimeType;
@@ -42,12 +67,17 @@ public:
std::string description;
/**
- * @brief Optional. Url of the thumbnail for the result
+ * @brief Optional. Content of the message to be sent instead of the file
+ */
+ InputMessageContent::Ptr inputMessageContent;
+
+ /**
+ * @brief Optional. URL of the thumbnail (jpeg only) for the file
*/
std::string thumbUrl;
/**
- * @brief Optional. Thumbnail width.
+ * @brief Optional. Thumbnail width
*/
std::int32_t thumbWidth;
diff --git a/include/tgbot/types/InlineQueryResultGif.h b/include/tgbot/types/InlineQueryResultGif.h
index 118da7b..05abe36 100644
--- a/include/tgbot/types/InlineQueryResultGif.h
+++ b/include/tgbot/types/InlineQueryResultGif.h
@@ -2,17 +2,20 @@
#define TGBOT_INLINEQUERYRESULTGIF_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to an animated GIF file.
* By default, this animated GIF file will be sent by the user with optional caption.
- * Alternatively, you can use @ref InlineQueryResult::inputMessageContent to send a message with the specified content instead of the animation.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the animation.
*
* @ingroup types
*/
@@ -24,12 +27,11 @@ public:
InlineQueryResultGif() {
this->type = TYPE;
- this->gifWidth = 0;
- this->gifHeight = 0;
}
/**
- * @brief A valid URL for the GIF file. File size must not exceed 1MB
+ * @brief A valid URL for the GIF file.
+ * File size must not exceed 1MB
*/
std::string gifUrl;
@@ -58,6 +60,32 @@ public:
* Defaults to “image/jpeg”
*/
std::string thumbMimeType;
+
+ /**
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the GIF animation
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultLocation.h b/include/tgbot/types/InlineQueryResultLocation.h
index 31c27cc..a72350a 100644
--- a/include/tgbot/types/InlineQueryResultLocation.h
+++ b/include/tgbot/types/InlineQueryResultLocation.h
@@ -2,6 +2,7 @@
#define TGBOT_INLINEQUERYRESULTLOCATION_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
@@ -11,6 +12,8 @@ namespace TgBot {
/**
* @brief Represents a location on a map.
+ * By default, the location will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the location.
*
* @ingroup types
*/
@@ -22,8 +25,6 @@ public:
InlineQueryResultLocation() {
this->type = TYPE;
- this->thumbHeight = 0;
- this->thumbWidth = 0;
}
/**
@@ -37,12 +38,44 @@ public:
float longitude;
/**
+ * @brief Location title
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+ */
+ float horizontalAccuracy;
+
+ /**
+ * @brief Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
+ */
+ std::int32_t livePeriod;
+
+ /**
+ * @brief Optional. For live locations, a direction in which the user is moving, in degrees.
+ * Must be between 1 and 360 if specified.
+ */
+ std::int32_t heading;
+
+ /**
+ * @brief 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.
+ */
+ std::int32_t proximityAlertRadius;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the location
+ */
+ InputMessageContent::Ptr inputMessageContent;
+
+ /**
* @brief Optional. Url of the thumbnail for the result
*/
std::string thumbUrl;
/**
- * @brief Optional. Thumbnail width.
+ * @brief Optional. Thumbnail width
*/
std::int32_t thumbWidth;
diff --git a/include/tgbot/types/InlineQueryResultMpeg4Gif.h b/include/tgbot/types/InlineQueryResultMpeg4Gif.h
index f6319a9..7543c00 100644
--- a/include/tgbot/types/InlineQueryResultMpeg4Gif.h
+++ b/include/tgbot/types/InlineQueryResultMpeg4Gif.h
@@ -1,16 +1,21 @@
#ifndef TGBOT_INLINEQUERYRESULTMPEG4GIF_H
#define TGBOT_INLINEQUERYRESULTMPEG4GIF_H
+#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
+
#include <cstdint>
#include <memory>
#include <string>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a video animation (H.264/MPEG-4 AVC video without sound).
* By default, this animated MPEG-4 file will be sent by the user with optional caption.
- * Alternatively, you can use @ref InlineQueryResult::inputMessageContent to send a message with the specified content instead of the animation.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the animation.
*
* @ingroup types
*/
@@ -22,8 +27,6 @@ public:
InlineQueryResultMpeg4Gif() {
this->type = TYPE;
- this->mpeg4Width = 0;
- this->mpeg4Height = 0;
}
/**
@@ -57,6 +60,32 @@ public:
* Defaults to “image/jpeg”
*/
std::string thumbMimeType;
+
+ /**
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the video animation
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultPhoto.h b/include/tgbot/types/InlineQueryResultPhoto.h
index 4e03de6..b6ecd76 100644
--- a/include/tgbot/types/InlineQueryResultPhoto.h
+++ b/include/tgbot/types/InlineQueryResultPhoto.h
@@ -2,15 +2,20 @@
#define TGBOT_INLINEQUERYRESULTPHOTO_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
#include <memory>
+#include <vector>
namespace TgBot {
/**
* @brief Represents a link to a photo.
+ * By default, this photo will be sent by the user with optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the photo.
*
* @ingroup types
*/
@@ -22,12 +27,12 @@ public:
InlineQueryResultPhoto() {
this->type = TYPE;
- this->photoWidth = 0;
- this->photoHeight = 0;
}
/**
* @brief A valid URL of the photo.
+ * Photo must be in jpeg format.
+ * Photo size must not exceed 5MB
*/
std::string photoUrl;
@@ -37,19 +42,45 @@ public:
std::string thumbUrl;
/**
- * @brief Optional. Width of the photo.
+ * @brief Optional. Width of the photo
*/
std::int32_t photoWidth;
/**
- * @brief Optional. Height of the photo.
+ * @brief Optional. Height of the photo
*/
std::int32_t photoHeight;
/**
- * @brief Optional. Short description of the result.
+ * @brief Optional. Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Short description of the result
*/
std::string description;
+
+ /**
+ * @brief Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the photo caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the photo
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultVenue.h b/include/tgbot/types/InlineQueryResultVenue.h
index d5edfd4..7a93591 100644
--- a/include/tgbot/types/InlineQueryResultVenue.h
+++ b/include/tgbot/types/InlineQueryResultVenue.h
@@ -2,6 +2,7 @@
#define TGBOT_INLINEQUERYRESULTVENUE_H
#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/InputMessageContent.h"
#include <cstdint>
#include <string>
@@ -11,6 +12,8 @@ namespace TgBot {
/**
* @brief Represents a venue.
+ * By default, the venue will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the venue.
*
* @ingroup types
*/
@@ -22,8 +25,6 @@ public:
InlineQueryResultVenue() {
this->type = TYPE;
- this->thumbHeight = 0;
- this->thumbWidth = 0;
}
/**
@@ -37,6 +38,11 @@ public:
float longitude;
/**
+ * @brief Title of the venue
+ */
+ std::string title;
+
+ /**
* @brief Address of the venue
*/
std::string address;
@@ -47,17 +53,34 @@ public:
std::string foursquareId;
/**
- * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+ * @brief Optional. Foursquare type of the venue, if known.
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
*/
std::string foursquareType;
/**
+ * @brief Optional. Google Places identifier of the venue
+ */
+ std::string googlePlaceId;
+
+ /**
+ * @brief Optional. Google Places type of the venue.
+ * (See https://developers.google.com/places/web-service/supported_types.)
+ */
+ std::string googlePlaceType;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the venue
+ */
+ InputMessageContent::Ptr inputMessageContent;
+
+ /**
* @brief Optional. Url of the thumbnail for the result
*/
std::string thumbUrl;
/**
- * @brief Optional. Thumbnail width.
+ * @brief Optional. Thumbnail width
*/
std::int32_t thumbWidth;
diff --git a/include/tgbot/types/InlineQueryResultVideo.h b/include/tgbot/types/InlineQueryResultVideo.h
index 88c4910..ead6303 100644
--- a/include/tgbot/types/InlineQueryResultVideo.h
+++ b/include/tgbot/types/InlineQueryResultVideo.h
@@ -1,14 +1,23 @@
#ifndef TGBOT_INLINEQUERYRESULTVIDEO_H
#define TGBOT_INLINEQUERYRESULTVIDEO_H
+#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
+
#include <cstdint>
#include <memory>
#include <string>
+#include <vector>
namespace TgBot {
/**
- * @brief Represents link to a page containing an embedded video player or a video file.
+ * @brief Represents a link to a page containing an embedded video player or a video file.
+ * By default, this video file will be sent by the user with an optional caption.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the video.
+ *
+ * If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using inputMessageContent.
*
* @ingroup types
*/
@@ -20,18 +29,15 @@ public:
InlineQueryResultVideo() {
this->type = TYPE;
- this->videoWidth = 0;
- this->videoHeight = 0;
- this->videoDuration = 0;
};
/**
- * @brief A valid URL for the embedded video player or video file.
+ * @brief A valid URL for the embedded video player or video file
*/
std::string videoUrl;
/**
- * @brief Mime type of the content of video url, "text/html" or "video/mp4".
+ * @brief Mime type of the content of video url, “text/html” or “video/mp4”
*/
std::string mimeType;
@@ -41,25 +47,51 @@ public:
std::string thumbUrl;
/**
- * @brief Optional. Video width.
+ * @brief Title for the result
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the video caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
+ * @brief Optional. Video width
*/
std::int32_t videoWidth;
/**
- * @brief Optional. Video height.
+ * @brief Optional. Video height
*/
std::int32_t videoHeight;
/**
- * @brief Optional. Video duration.
+ * @brief Optional. Video duration in seconds
*/
std::int32_t videoDuration;
/**
- * @brief Optional. Short description of the result.
+ * @brief Optional. Short description of the result
*/
std::string description;
+ /**
+ * @brief Optional. Content of the message to be sent instead of the video.
+ * This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InlineQueryResultVoice.h b/include/tgbot/types/InlineQueryResultVoice.h
index 2cfdfad..335c2a7 100644
--- a/include/tgbot/types/InlineQueryResultVoice.h
+++ b/include/tgbot/types/InlineQueryResultVoice.h
@@ -1,14 +1,21 @@
#ifndef TGBOT_INLINEQUERYRESULTVOICE_H
#define TGBOT_INLINEQUERYRESULTVOICE_H
+#include "tgbot/types/InlineQueryResult.h"
+#include "tgbot/types/MessageEntity.h"
+#include "tgbot/types/InputMessageContent.h"
+
#include <cstdint>
#include <memory>
#include <string>
+#include <vector>
namespace TgBot {
/**
- * @brief Represents link to a page containing an embedded video player or a video file.
+ * @brief Represents a link to a voice recording in an .OGG container encoded with OPUS.
+ * By default, this voice recording will be sent by the user.
+ * Alternatively, you can use inputMessageContent to send a message with the specified content instead of the the voice message.
*
* @ingroup types
*/
@@ -20,7 +27,6 @@ public:
InlineQueryResultVoice() {
this->type = TYPE;
- this->voiceDuration = 0;
};
/**
@@ -29,9 +35,35 @@ public:
std::string voiceUrl;
/**
+ * @brief Recording title
+ */
+ std::string title;
+
+ /**
+ * @brief Optional. Caption, 0-1024 characters after entities parsing
+ */
+ std::string caption;
+
+ /**
+ * @brief Optional. Mode for parsing entities in the voice message caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
+ */
+ std::string parseMode;
+
+ /**
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of parseMode
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
+
+ /**
* @brief Optional. Recording duration in seconds
*/
std::int32_t voiceDuration;
+
+ /**
+ * @brief Optional. Content of the message to be sent instead of the voice recording
+ */
+ InputMessageContent::Ptr inputMessageContent;
};
}
diff --git a/include/tgbot/types/InputContactMessageContent.h b/include/tgbot/types/InputContactMessageContent.h
index f46b704..44e8324 100644
--- a/include/tgbot/types/InputContactMessageContent.h
+++ b/include/tgbot/types/InputContactMessageContent.h
@@ -1,6 +1,8 @@
#ifndef TGBOT_INPUTCONTACTMESSAGECONTENT_H
#define TGBOT_INPUTCONTACTMESSAGECONTENT_H
+#include "tgbot/types/InputMessageContent.h"
+
#include <memory>
#include <string>
@@ -13,11 +15,13 @@ namespace TgBot {
*/
class InputContactMessageContent : public InputMessageContent {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputContactMessageContent> Ptr;
- InputContactMessageContent() :
- InputMessageContent("InputContactMessageContent")
- {}
+ InputContactMessageContent() {
+ this->type = TYPE;
+ }
/**
* @brief Contact's phone number
@@ -38,8 +42,6 @@ public:
* @brief Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
*/
std::string vcard;
-
- virtual ~InputContactMessageContent() { }
};
}
diff --git a/include/tgbot/types/InputLocationMessageContent.h b/include/tgbot/types/InputLocationMessageContent.h
index 6d46c41..8b9c22f 100644
--- a/include/tgbot/types/InputLocationMessageContent.h
+++ b/include/tgbot/types/InputLocationMessageContent.h
@@ -1,6 +1,8 @@
#ifndef TGBOT_INPUTLOCATIONMESSAGECONTENT_H
#define TGBOT_INPUTLOCATIONMESSAGECONTENT_H
+#include "tgbot/types/InputMessageContent.h"
+
#include <memory>
namespace TgBot {
@@ -12,11 +14,13 @@ namespace TgBot {
*/
class InputLocationMessageContent : public InputMessageContent {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputLocationMessageContent> Ptr;
- InputLocationMessageContent() :
- InputMessageContent("InputLocationMessageContent")
- {}
+ InputLocationMessageContent() {
+ this->type = TYPE;
+ }
/**
* @brief Latitude of the location in degrees
@@ -28,7 +32,27 @@ public:
*/
float longitude;
- virtual ~InputLocationMessageContent() { }
+ /**
+ * @brief Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+ */
+ float horizontalAccuracy;
+
+ /**
+ * @brief Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
+ */
+ std::int32_t livePeriod;
+
+ /**
+ * @brief Optional. For live locations, a direction in which the user is moving, in degrees.
+ * Must be between 1 and 360 if specified.
+ */
+ std::int32_t heading;
+
+ /**
+ * @brief 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.
+ */
+ std::int32_t proximityAlertRadius;
};
}
diff --git a/include/tgbot/types/InputMedia.h b/include/tgbot/types/InputMedia.h
index 7740595..c7ff6c0 100644
--- a/include/tgbot/types/InputMedia.h
+++ b/include/tgbot/types/InputMedia.h
@@ -1,14 +1,18 @@
#ifndef TGBOT_INPUTMEDIA_H
#define TGBOT_INPUTMEDIA_H
-#include <cstdint>
+#include "tgbot/types/MessageEntity.h"
+
#include <memory>
#include <string>
+#include <vector>
namespace TgBot {
/**
- * @brief This object represents the content of a media message to be sent.
+ * @brief This abstract class is base of all input media.
+ *
+ * This object represents the content of a media message to be sent.
*
* @ingroup types
*/
@@ -16,70 +20,37 @@ class InputMedia {
public:
typedef std::shared_ptr<InputMedia> Ptr;
- enum class TYPE : std::uint8_t {
- PHOTO,
- VIDEO,
- ANIMATION,
- DOCUMENT,
- AUDIO
- };
+ InputMedia() {}
- /**
- * @brief Type of the result, It should be one of TYPE::*
- */
- TYPE type;
+ virtual ~InputMedia() {}
/**
- * @brief File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name.
+ * @brief Type of the result
*/
- std::string media;
+ std::string type;
/**
- * @brief Optional. Thumbnail of the file sent.
- *
- * The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 90. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
+ * @brief File to send.
+ * Pass a fileId to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
+ * https://core.telegram.org/bots/api#sending-files
*/
- std::string thumb;
+ std::string media;
/**
- * @brief Optional. Caption of the media to be sent, 0-200 characters
+ * @brief Optional. Caption of the media to to be sent, 0-1024 characters after entities parsing
*/
std::string caption;
/**
- * @brief Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
+ * @brief Optional. Mode for parsing entities in the media caption.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
*/
std::string parseMode;
/**
- * @brief Optional. Media width
- */
- std::int32_t width = 0;
-
- /**
- * @brief Optional. Media height
- */
- std::int32_t height = 0;
-
- /**
- * @brief Optional. Media duration
- */
- std::int32_t duration = 0;
-
- /**
- * @brief Optional. Performer of the audio.
- */
- std::int32_t performer = 0;
-
- /**
- * @brief Optional. Title of the audio.
- */
- std::int32_t title = 0;
-
- /**
- * @brief Optional. Pass True, if the uploaded video is suitable for streaming
+ * @brief Optional. List of special entities that appear in the caption, which can be specified instead of InputMedia::parseMode
*/
- bool supportsStreaming = false;
+ std::vector<MessageEntity::Ptr> captionEntities;
};
}
diff --git a/include/tgbot/types/InputMediaAnimation.h b/include/tgbot/types/InputMediaAnimation.h
index 8bfb85b..b6109a0 100644
--- a/include/tgbot/types/InputMediaAnimation.h
+++ b/include/tgbot/types/InputMediaAnimation.h
@@ -9,16 +9,45 @@
namespace TgBot {
/**
- * @brief Represents a video to be sent.
+ * @brief Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
+ *
* @ingroup types
*/
class InputMediaAnimation : public InputMedia {
+
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputMediaAnimation> Ptr;
InputMediaAnimation() {
- this->type = TYPE::ANIMATION;
+ this->type = TYPE;
}
+
+ /**
+ * @brief 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
+ */
+ std::string thumb;
+
+ /**
+ * @brief Optional. Animation width
+ */
+ std::int32_t width;
+
+ /**
+ * @brief Optional. Animation height
+ */
+ std::int32_t height;
+
+ /**
+ * @brief Optional. Animation duration
+ */
+ std::int32_t duration;
};
}
diff --git a/include/tgbot/types/InputMediaAudio.h b/include/tgbot/types/InputMediaAudio.h
index 6a4b653..b46936e 100644
--- a/include/tgbot/types/InputMediaAudio.h
+++ b/include/tgbot/types/InputMediaAudio.h
@@ -9,16 +9,45 @@
namespace TgBot {
/**
- * @brief Represents a video to be sent.
+ * @brief Represents an audio file to be treated as music to be sent.
+ *
* @ingroup types
*/
class InputMediaAudio : public InputMedia {
+
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputMediaAudio> Ptr;
InputMediaAudio() {
- this->type = TYPE::AUDIO;
+ this->type = TYPE;
}
+
+ /**
+ * @brief 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
+ */
+ std::string thumb;
+
+ /**
+ * @brief Optional. Duration of the audio in seconds
+ */
+ std::int32_t duration;
+
+ /**
+ * @brief Optional. Performer of the audio
+ */
+ std::string performer;
+
+ /**
+ * @brief Optional. Title of the audio
+ */
+ std::string title;
};
}
diff --git a/include/tgbot/types/InputMediaDocument.h b/include/tgbot/types/InputMediaDocument.h
index a496d3b..9a6ab10 100644
--- a/include/tgbot/types/InputMediaDocument.h
+++ b/include/tgbot/types/InputMediaDocument.h
@@ -9,16 +9,36 @@
namespace TgBot {
/**
- * @brief Represents a video to be sent.
+ * @brief Represents a general file to be sent.
+ *
* @ingroup types
*/
class InputMediaDocument : public InputMedia {
+
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputMediaDocument> Ptr;
InputMediaDocument() {
- this->type = TYPE::DOCUMENT;
+ this->type = TYPE;
}
+
+ /**
+ * @brief 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
+ */
+ std::string thumb;
+
+ /**
+ * @brief Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data.
+ * Always true, if the document is sent as part of an album.
+ */
+ bool disableContentTypeDetection;
};
}
diff --git a/include/tgbot/types/InputMediaPhoto.h b/include/tgbot/types/InputMediaPhoto.h
index 6ef0c32..998981d 100644
--- a/include/tgbot/types/InputMediaPhoto.h
+++ b/include/tgbot/types/InputMediaPhoto.h
@@ -10,14 +10,17 @@ namespace TgBot {
/**
* @brief Represents a photo to be sent.
+ *
* @ingroup types
*/
class InputMediaPhoto : public InputMedia {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputMediaPhoto> Ptr;
InputMediaPhoto() {
- this->type = TYPE::PHOTO;
+ this->type = TYPE;
}
};
}
diff --git a/include/tgbot/types/InputMediaVideo.h b/include/tgbot/types/InputMediaVideo.h
index 1aeaa6b..348d973 100644
--- a/include/tgbot/types/InputMediaVideo.h
+++ b/include/tgbot/types/InputMediaVideo.h
@@ -2,6 +2,7 @@
#define TGBOT_INPUTMEDIAVIDEO_H
#include "tgbot/types/InputMedia.h"
+#include "tgbot/types/InputFile.h"
#include <memory>
#include <string>
@@ -10,15 +11,48 @@ namespace TgBot {
/**
* @brief Represents a video to be sent.
+ *
* @ingroup types
*/
class InputMediaVideo : public InputMedia {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputMediaVideo> Ptr;
InputMediaVideo() {
- this->type = TYPE::VIDEO;
+ this->type = TYPE;
}
+
+ /**
+ * @brief 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
+ */
+ std::string thumb;
+
+ /**
+ * @brief Optional. Video width
+ */
+ std::int32_t width;
+
+ /**
+ * @brief Optional. Video height
+ */
+ std::int32_t height;
+
+ /**
+ * @brief Optional. Video duration
+ */
+ std::int32_t duration;
+
+ /**
+ * @brief Optional. Pass True, if the uploaded video is suitable for streaming
+ */
+ bool supportsStreaming;
};
}
diff --git a/include/tgbot/types/InputMessageContent.h b/include/tgbot/types/InputMessageContent.h
index 5ecdd92..01bcf77 100644
--- a/include/tgbot/types/InputMessageContent.h
+++ b/include/tgbot/types/InputMessageContent.h
@@ -7,27 +7,24 @@
namespace TgBot {
/**
- * @brief This object represents the content of a message to be sent as a result of an inline query.
+ * @brief This abstract class is base of all message contents.
+ *
+ * This object represents the content of a message to be sent as a result of an inline query.
+ *
* @ingroup types
*/
class InputMessageContent {
public:
typedef std::shared_ptr<InputMessageContent> Ptr;
- InputMessageContent(const std::string &tType):
- type(tType)
- {}
+ InputMessageContent() {}
+
+ virtual ~InputMessageContent() {}
/**
- * May be
- * InputTextMessageContent
- * InputLocationMessageContent
- * InputVenueMessageContent
- * InputContactMessageContent
+ * @brief Type of the content
*/
std::string type;
-
- virtual ~InputMessageContent() { }
};
}
diff --git a/include/tgbot/types/InputTextMessageContent.h b/include/tgbot/types/InputTextMessageContent.h
index 88cb718..de2a88a 100644
--- a/include/tgbot/types/InputTextMessageContent.h
+++ b/include/tgbot/types/InputTextMessageContent.h
@@ -1,8 +1,12 @@
#ifndef TGBOT_INPUTTEXTMESSAGECONTENT_H
#define TGBOT_INPUTTEXTMESSAGECONTENT_H
+#include "tgbot/types/InputMessageContent.h"
+#include "tgbot/types/MessageEntity.h"
+
#include <memory>
#include <string>
+#include <vector>
namespace TgBot {
@@ -13,11 +17,13 @@ namespace TgBot {
*/
class InputTextMessageContent : public InputMessageContent {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputTextMessageContent> Ptr;
- InputTextMessageContent():
- InputMessageContent("InputTextMessageContent")
- {}
+ InputTextMessageContent() {
+ this->type = TYPE;
+ }
/**
* @brief Text of the message to be sent, 1-4096 characters
@@ -25,16 +31,20 @@ public:
std::string messageText;
/**
- * @brief Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
+ * @brief Optional. Mode for parsing entities in the message text.
+ * See https://core.telegram.org/bots/api#formatting-options for more details.
*/
std::string parseMode;
/**
+ * @brief Optional. List of special entities that appear in message text, which can be specified instead of InputTextMessageContent::parseMode
+ */
+ std::vector<MessageEntity::Ptr> entities;
+
+ /**
* @brief Optional. Disables link previews for links in the sent message
*/
bool disableWebPagePreview;
-
- virtual ~InputTextMessageContent() { }
};
}
diff --git a/include/tgbot/types/InputVenueMessageContent.h b/include/tgbot/types/InputVenueMessageContent.h
index 360a345..41ac5e0 100644
--- a/include/tgbot/types/InputVenueMessageContent.h
+++ b/include/tgbot/types/InputVenueMessageContent.h
@@ -1,6 +1,8 @@
#ifndef TGBOT_INPUTVENUEMESSAGECONTENT_H
#define TGBOT_INPUTVENUEMESSAGECONTENT_H
+#include "tgbot/types/InputMessageContent.h"
+
#include <memory>
#include <string>
@@ -13,11 +15,13 @@ namespace TgBot {
*/
class InputVenueMessageContent : public InputMessageContent {
public:
+ static const std::string TYPE;
+
typedef std::shared_ptr<InputVenueMessageContent> Ptr;
- InputVenueMessageContent() :
- InputMessageContent("InputVenueMessageContent")
- {}
+ InputVenueMessageContent() {
+ this->type = TYPE;
+ }
/**
* @brief Latitude of the location in degrees
@@ -45,15 +49,21 @@ public:
std::string foursquareId;
/**
- * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+ * @brief Optional. Foursquare type of the venue, if known.
+ * (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
*/
std::string foursquareType;
/**
- * @brief Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
+ * @brief Optional. Google Places identifier of the venue
*/
+ std::string googlePlaceId;
- virtual ~InputVenueMessageContent() { }
+ /**
+ * @brief Optional. Google Places type of the venue.
+ * (See https://developers.google.com/places/web-service/supported_types)
+ */
+ std::string googlePlaceType;
};
}
diff --git a/include/tgbot/types/Location.h b/include/tgbot/types/Location.h
index 1487762..9454272 100644
--- a/include/tgbot/types/Location.h
+++ b/include/tgbot/types/Location.h
@@ -16,14 +16,37 @@ public:
typedef std::shared_ptr<Location> Ptr;
/**
- * @brief Longitude as defined by sender.
+ * @brief Longitude as defined by sender
*/
float longitude;
/**
- * @brief Latitude as defined by sender.
+ * @brief Latitude as defined by sender
*/
float latitude;
+
+ /**
+ * @brief Optional. The radius of uncertainty for the location, measured in meters; 0-1500
+ */
+ float horizontalAccuracy;
+
+ /**
+ * @brief Optional. Time relative to the message sending date, during which the location can be updated, in seconds.
+ * For active live locations only.
+ */
+ std::int32_t livePeriod;
+
+ /**
+ * @brief Optional. The direction in which user is moving, in degrees; 1-360.
+ * For active live locations only.
+ */
+ std::int32_t heading;
+
+ /**
+ * @brief Optional. Maximum distance for proximity alerts about approaching another chat member, in meters.
+ * For sent live locations only.
+ */
+ std::int32_t proximityAlertRadius;
};
}
diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h
index f8f1b13..7eb28d7 100644
--- a/include/tgbot/types/Message.h
+++ b/include/tgbot/types/Message.h
@@ -22,6 +22,7 @@
#include "tgbot/types/Invoice.h"
#include "tgbot/types/SuccessfulPayment.h"
#include "tgbot/types/PassportData.h"
+#include "tgbot/types/ProximityAlertTriggered.h"
#include "tgbot/types/InlineKeyboardMarkup.h"
#include <cstdint>
@@ -51,6 +52,14 @@ public:
User::Ptr from;
/**
+ * @brief Optional. Sender of the message, sent on behalf of a chat.
+ * The channel itself for channel messages.
+ * The supergroup itself for messages from anonymous group administrators.
+ * The linked channel for messages automatically forwarded to the discussion group
+ */
+ Chat::Ptr senderChat;
+
+ /**
* @brief Date the message was sent in Unix time
*/
std::int32_t date;
@@ -112,7 +121,7 @@ public:
std::string mediaGroupId;
/**
- * @brief Optional. Signature of the post author for messages in channels
+ * @brief Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
*/
std::string authorSignature;
@@ -127,9 +136,10 @@ public:
std::vector<MessageEntity::Ptr> entities;
/**
- * @brief Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
+ * @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
*/
- std::vector<MessageEntity::Ptr> captionEntities;
+ Animation::Ptr animation;
/**
* @brief Optional. Message is an audio file, information about the file
@@ -142,17 +152,6 @@ public:
Document::Ptr document;
/**
- * @brief Optional. Message is an animation, information about the animation.
- * For backward compatibility, when this field is set, the document field will also be set
- */
- Animation::Ptr animation;
-
- /**
- * @brief Optional. Message is a game, information about the game
- */
- Game::Ptr game;
-
- /**
* @brief Optional. Message is a photo, available sizes of the photo
*/
std::vector<PhotoSize::Ptr> photo;
@@ -168,19 +167,24 @@ public:
Video::Ptr video;
/**
- * @brief Optional. Message is a voice message, information about the file
+ * @brief Optional. Message is a video note, information about the video message
*/
- Voice::Ptr voice;
+ VideoNote::Ptr videoNote;
/**
- * @brief Optional. Message is a video note, information about the video message
+ * @brief Optional. Message is a voice message, information about the file
*/
- VideoNote::Ptr videoNote;
+ Voice::Ptr voice;
/**
* @brief Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
*/
std::string caption;
+
+ /**
+ * @brief Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
+ */
+ std::vector<MessageEntity::Ptr> captionEntities;
/**
* @brief Optional. Message is a shared contact, information about the contact
@@ -188,14 +192,14 @@ public:
Contact::Ptr contact;
/**
- * @brief Optional. Message is a shared location, information about the location
+ * @brief Optional. Message is a dice with random value from 1 to 6
*/
- Location::Ptr location;
+ Dice::Ptr dice;
/**
- * @brief Optional. Message is a venue, information about the venue
+ * @brief Optional. Message is a game, information about the game
*/
- Venue::Ptr venue;
+ Game::Ptr game;
/**
* @brief Optional. Message is a native poll, information about the poll
@@ -203,9 +207,14 @@ public:
Poll::Ptr poll;
/**
- * @brief Optional. Message is a dice with random value from 1 to 6
+ * @brief Optional. Message is a venue, information about the venue
*/
- Dice::Ptr dice;
+ Venue::Ptr venue;
+
+ /**
+ * @brief Optional. Message is a shared location, information about the location
+ */
+ Location::Ptr location;
/**
* @brief Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
@@ -290,6 +299,12 @@ public:
PassportData::Ptr passportData;
/**
+ * @brief Optional. Service message.
+ * A user in the chat triggered another user's proximity alert while sharing Live Location.
+ */
+ ProximityAlertTriggered::Ptr proximityAlertTriggered;
+
+ /**
* @brief Optional. Inline keyboard attached to the message.
* @ref InlineKeyboardButton::loginUrl buttons are represented as ordinary @ref InlineKeyboardButton::url buttons.
*/
diff --git a/include/tgbot/types/MessageId.h b/include/tgbot/types/MessageId.h
new file mode 100644
index 0000000..77feaf2
--- /dev/null
+++ b/include/tgbot/types/MessageId.h
@@ -0,0 +1,25 @@
+#ifndef TGBOT_CPP_MESSAGEID_H
+#define TGBOT_CPP_MESSAGEID_H
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents a unique message identifier.
+ *
+ * @ingroup types
+ */
+class MessageId {
+
+public:
+ typedef std::shared_ptr<MessageId> Ptr;
+
+ /**
+ * @brief Unique message identifier
+ */
+ std::int32_t messageId;
+};
+}
+
+#endif //TGBOT_CPP_MESSAGEID_H
diff --git a/include/tgbot/types/ProximityAlertTriggered.h b/include/tgbot/types/ProximityAlertTriggered.h
new file mode 100644
index 0000000..1a31bc1
--- /dev/null
+++ b/include/tgbot/types/ProximityAlertTriggered.h
@@ -0,0 +1,37 @@
+#ifndef TGBOT_CPP_PROXIMITYALERTTRIGGERED_H
+#define TGBOT_CPP_PROXIMITYALERTTRIGGERED_H
+
+#include "tgbot/types/User.h"
+
+#include <memory>
+
+namespace TgBot {
+
+/**
+ * @brief This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
+ *
+ * @ingroup types
+ */
+class ProximityAlertTriggered {
+
+public:
+ typedef std::shared_ptr<ProximityAlertTriggered> Ptr;
+
+ /**
+ * @brief User that triggered the alert
+ */
+ User::Ptr traveler;
+
+ /**
+ * @brief User that set the alert
+ */
+ User::Ptr watcher;
+
+ /**
+ * @brief The distance between the users
+ */
+ std::int32_t distance;
+};
+}
+
+#endif //TGBOT_CPP_PROXIMITYALERTTRIGGERED_H
diff --git a/include/tgbot/types/Venue.h b/include/tgbot/types/Venue.h
index accce16..ccc4773 100644
--- a/include/tgbot/types/Venue.h
+++ b/include/tgbot/types/Venue.h
@@ -18,7 +18,7 @@ public:
typedef std::shared_ptr<Venue> Ptr;
/**
- * @brief Venue location
+ * @brief Venue location. Can't be a live location
*/
Location::Ptr location;
@@ -42,6 +42,17 @@ public:
* (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
*/
std::string foursquareType;
+
+ /**
+ * @brief Optional. Google Places identifier of the venue
+ */
+ std::string googlePlaceId;
+
+ /**
+ * @brief Optional. Google Places type of the venue.
+ * (See https://developers.google.com/places/web-service/supported_types)
+ */
+ std::string googlePlaceType;
};
}
diff --git a/include/tgbot/types/Video.h b/include/tgbot/types/Video.h
index fac8de5..c1328b5 100644
--- a/include/tgbot/types/Video.h
+++ b/include/tgbot/types/Video.h
@@ -51,6 +51,11 @@ public:
PhotoSize::Ptr thumb;
/**
+ * @brief Optional. Original filename as defined by sender
+ */
+ std::string fileName;
+
+ /**
* @brief Optional. Mime type of a file as defined by sender
*/
std::string mimeType;
diff --git a/include/tgbot/types/WebhookInfo.h b/include/tgbot/types/WebhookInfo.h
index 5252409..8139edc 100644
--- a/include/tgbot/types/WebhookInfo.h
+++ b/include/tgbot/types/WebhookInfo.h
@@ -18,7 +18,7 @@ public:
typedef std::shared_ptr<WebhookInfo> Ptr;
/**
- * @brief Webhook URL, may be empty if webhook is not set up.
+ * @brief Webhook URL, may be empty if webhook is not set up
*/
std::string url;
@@ -33,12 +33,17 @@ public:
std::int32_t pendingUpdateCount;
/**
+ * @brief Optional. Currently used webhook IP address
+ */
+ std::string ipAddress;
+
+ /**
* @brief Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
*/
std::int32_t lastErrorDate;
/**
- * @brief Optional. Error message in human - readable format for the most recent error that happened when trying to deliver an update via webhook
+ * @brief Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
*/
std::string lastErrorMessage;