From eb10c8705be495cc9d663dd48672eb9e174f0e4c Mon Sep 17 00:00:00 2001 From: nitanmarcel Date: Tue, 19 Nov 2019 21:59:22 +0200 Subject: API 4.3 --- include/tgbot/types/InlineKeyboardButton.h | 6 ++++ include/tgbot/types/LoginUrl.h | 45 ++++++++++++++++++++++++++++++ include/tgbot/types/Message.h | 6 ++++ 3 files changed, 57 insertions(+) create mode 100644 include/tgbot/types/LoginUrl.h (limited to 'include/tgbot') diff --git a/include/tgbot/types/InlineKeyboardButton.h b/include/tgbot/types/InlineKeyboardButton.h index 4b83087..f02d788 100644 --- a/include/tgbot/types/InlineKeyboardButton.h +++ b/include/tgbot/types/InlineKeyboardButton.h @@ -9,6 +9,7 @@ #include #include "tgbot/types/CallbackGame.h" +#include "tgbot/types/LoginUrl.h" namespace TgBot { @@ -31,6 +32,11 @@ public: */ std::string url; + /** + * @brief Optional. An HTTP URL used to automatically authorize the user. + */ + LoginUrl::Ptr loginUrl; + /** * @brief Optional. Data to be sent in a callback query to the bot when button is pressed. */ diff --git a/include/tgbot/types/LoginUrl.h b/include/tgbot/types/LoginUrl.h new file mode 100644 index 0000000..1627399 --- /dev/null +++ b/include/tgbot/types/LoginUrl.h @@ -0,0 +1,45 @@ +// +// Created by alexandrumarcel on 19.11.2019. +// + +#ifndef TGBOT_CPP_LOGINURL_H +#define TGBOT_CPP_LOGINURL_H + +#include +#include +#include + + +namespace TgBot{ + /** + * @brief This object represents a Poll. + * + * @ingroup types + */ + class LoginUrl{ + public: + typedef std::shared_ptr Ptr; + + /** + * @brief UAn HTTP URL to be opened with user authorization data added to the query string when the button is pressed.. + */ + std::string url; + + /** + * @brief Optional. New text of the button in forwarded messages. + */ + std::string forward_text; + + /** + * @brief Optional. Username of a bot, which will be used for user authorization. + */ + std::string bot_username; + + /** + * @brief Optional. Pass True to request the permission for your bot to send messages to the user. + */ + bool request_write_access; + }; +} + +#endif //TGBOT_CPP_LOGINURL_H diff --git a/include/tgbot/types/Message.h b/include/tgbot/types/Message.h index 4b7ce59..9e831bc 100644 --- a/include/tgbot/types/Message.h +++ b/include/tgbot/types/Message.h @@ -45,6 +45,7 @@ #include "tgbot/types/Voice.h" #include "tgbot/types/Invoice.h" #include "tgbot/types/SuccessfulPayment.h" +#include "tgbot/types/InlineKeyboardMarkup.h" namespace TgBot { @@ -278,6 +279,11 @@ public: * @brief Optional. The domain name of the website on which the user has logged in. */ std::string connectedWebsite; + + /** + * @brief Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. + */ + InlineKeyboardMarkup::Ptr replyMarkup; }; } -- cgit v1.2.3