tgbotxx
1.1.6.9
Telegram Bot C++ Library
|
This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive. 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. More... | |
void | fromJson (const nl::json &json) |
Deserializes this object from JSON. More... | |
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. More... | |
Ptr< KeyboardButtonRequestUser > | requestUser |
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. More... | |
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. More... | |
bool | requestContact {} |
Optional. If True, the user's phone number will be sent as a contact when the button is pressed. More... | |
bool | requestLocation {} |
Optional. If True, the user's current location will be sent when the button is pressed. More... | |
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. More... | |
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. More... | |
This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive. https://core.telegram.org/bots/api#keyboardbutton.
Definition at line 17 of file KeyboardButton.hpp.
|
default |
|
inlineexplicit |
Definition at line 19 of file KeyboardButton.hpp.
|
inline |
Deserializes this object from JSON.
Definition at line 69 of file KeyboardButton.hpp.
|
inline |
Serializes this object to JSON.
Definition at line 56 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 34 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 38 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 42 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 46 of file KeyboardButton.hpp.
Ptr<KeyboardButtonRequestUser> tgbotxx::KeyboardButton::requestUser |
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 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 24 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 51 of file KeyboardButton.hpp.