|
tgbotxx 1.2.9.5
Telegram Bot C++ Library
|
This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text. https://core.telegram.org/bots/api#keyboardbutton. More...
#include <KeyboardButton.hpp>
Public Member Functions | |
| KeyboardButton ()=default | |
| KeyboardButton (const nl::json &json) | |
| nl::json | toJson () const |
| Serializes this object to JSON. | |
| void | fromJson (const nl::json &json) |
| Deserializes this object from JSON. | |
Public Attributes | |
| std::string | text |
| Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed. | |
| std::string | iconCustomEmojiId |
| Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. | |
| std::string | style |
| Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. | |
| Ptr< KeyboardButtonRequestUsers > | requestUsers |
| Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. | |
| Ptr< KeyboardButtonRequestChat > | requestChat |
| Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. | |
| bool | requestContact {} |
| Optional. If True, the user's phone number will be sent as a contact when the button is pressed. | |
| bool | requestLocation {} |
| Optional. If True, the user's current location will be sent when the button is pressed. | |
| Ptr< KeyboardButtonPollType > | requestPoll |
| Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. | |
| Ptr< WebAppInfo > | webApp |
| Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. | |
This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text. https://core.telegram.org/bots/api#keyboardbutton.
Definition at line 13 of file KeyboardButton.hpp.
|
default |
|
inlineexplicit |
Definition at line 15 of file KeyboardButton.hpp.
Deserializes this object from JSON.
Definition at line 77 of file KeyboardButton.hpp.
|
inline |
Serializes this object to JSON.
Definition at line 61 of file KeyboardButton.hpp.
| std::string tgbotxx::KeyboardButton::iconCustomEmojiId |
Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
Definition at line 25 of file KeyboardButton.hpp.
| Ptr<KeyboardButtonRequestChat> tgbotxx::KeyboardButton::requestChat |
Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message.
Definition at line 39 of file KeyboardButton.hpp.
| bool tgbotxx::KeyboardButton::requestContact {} |
Optional. If True, the user's phone number will be sent as a contact when the button is pressed.
Definition at line 43 of file KeyboardButton.hpp.
| bool tgbotxx::KeyboardButton::requestLocation {} |
Optional. If True, the user's current location will be sent when the button is pressed.
Definition at line 47 of file KeyboardButton.hpp.
| Ptr<KeyboardButtonPollType> tgbotxx::KeyboardButton::requestPoll |
Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed.
Definition at line 51 of file KeyboardButton.hpp.
| Ptr<KeyboardButtonRequestUsers> tgbotxx::KeyboardButton::requestUsers |
Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message.
Definition at line 34 of file KeyboardButton.hpp.
| std::string tgbotxx::KeyboardButton::style |
Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
Definition at line 29 of file KeyboardButton.hpp.
| std::string tgbotxx::KeyboardButton::text |
Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.
Definition at line 20 of file KeyboardButton.hpp.
| Ptr<WebAppInfo> tgbotxx::KeyboardButton::webApp |
Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message.
Definition at line 56 of file KeyboardButton.hpp.