|
tgbotxx 1.1.9.2
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. | |
| 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.
|
inline |
Deserializes this object from JSON.
Definition at line 65 of file KeyboardButton.hpp.
|
inline |
Serializes this object to JSON.
Definition at line 52 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 30 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 34 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 38 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 42 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 25 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 47 of file KeyboardButton.hpp.