tgbot-cpp
|
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 webApp, requestUser, requestChat, requestContact, requestLocation, and requestPoll are mutually exclusive. More...
#include <KeyboardButton.h>
Public Types | |
typedef std::shared_ptr< KeyboardButton > | Ptr |
Public Attributes | |
std::string | text |
Text of the button. | |
KeyboardButtonRequestUser::Ptr | requestUser |
Optional. If specified, pressing the button will open a list of suitable users. | |
KeyboardButtonRequestChat::Ptr | requestChat |
Optional. If specified, pressing the button will open a list of suitable chats. | |
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. | |
KeyboardButtonPollType::Ptr | requestPoll |
Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. | |
WebAppInfo::Ptr | webApp |
Optional. If specified, the described Web App will be launched when the button is pressed. | |
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 webApp, requestUser, requestChat, requestContact, requestLocation, and requestPoll are mutually exclusive.
Definition at line 21 of file KeyboardButton.h.
typedef std::shared_ptr<KeyboardButton> TgBot::KeyboardButton::Ptr |
Definition at line 24 of file KeyboardButton.h.
KeyboardButtonRequestChat::Ptr TgBot::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. Available in private chats only.
Definition at line 47 of file KeyboardButton.h.
bool TgBot::KeyboardButton::requestContact |
Optional. If True, the user's phone number will be sent as a contact when the button is pressed.
Available in private chats only.
Definition at line 54 of file KeyboardButton.h.
bool TgBot::KeyboardButton::requestLocation |
Optional. If True, the user's current location will be sent when the button is pressed.
Available in private chats only.
Definition at line 61 of file KeyboardButton.h.
KeyboardButtonPollType::Ptr TgBot::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.
Available in private chats only.
Definition at line 68 of file KeyboardButton.h.
KeyboardButtonRequestUser::Ptr TgBot::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. Available in private chats only.
Definition at line 39 of file KeyboardButton.h.
std::string TgBot::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 31 of file KeyboardButton.h.
WebAppInfo::Ptr TgBot::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. Available in private chats only.
Definition at line 76 of file KeyboardButton.h.