tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::ReplyKeyboardMarkup Struct Reference

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). https://core.telegram.org/bots/api#replykeyboardmarkup. More...

#include <ReplyKeyboardMarkup.hpp>

Inheritance diagram for tgbotxx::ReplyKeyboardMarkup:
tgbotxx::IReplyMarkup

Public Member Functions

 ReplyKeyboardMarkup ()=default
 
 ReplyKeyboardMarkup (const nl::json &json)
 
nl::json toJson () const override
 Serializes this object to JSON. More...
 
void fromJson (const nl::json &json) override
 Deserializes this object from JSON. More...
 

Public Attributes

std::vector< std::vector< Ptr< KeyboardButton > > > keyboard
 Array of button rows, each represented by an Array of KeyboardButton objects @type Array of Array of KeyboardButton. More...
 
bool isPersistent {}
 Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. More...
 
bool resizeKeyboard {}
 Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. More...
 
bool oneTimeKeyboard {}
 Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false. More...
 
std::string inputFieldPlaceholder
 Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters. More...
 
bool selective {}
 Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: More...
 

Detailed Description

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). https://core.telegram.org/bots/api#replykeyboardmarkup.

Definition at line 9 of file ReplyKeyboardMarkup.hpp.

Constructor & Destructor Documentation

◆ ReplyKeyboardMarkup() [1/2]

tgbotxx::ReplyKeyboardMarkup::ReplyKeyboardMarkup ( )
default

◆ ReplyKeyboardMarkup() [2/2]

tgbotxx::ReplyKeyboardMarkup::ReplyKeyboardMarkup ( const nl::json &  json)
inlineexplicit

Definition at line 11 of file ReplyKeyboardMarkup.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::ReplyKeyboardMarkup::fromJson ( const nl::json &  json)
inlineoverridevirtual

Deserializes this object from JSON.

Implements tgbotxx::IReplyMarkup.

Definition at line 60 of file ReplyKeyboardMarkup.hpp.

◆ toJson()

nl::json tgbotxx::ReplyKeyboardMarkup::toJson ( ) const
inlineoverridevirtual

Serializes this object to JSON.

Returns
JSON representation of this object

Implements tgbotxx::IReplyMarkup.

Definition at line 48 of file ReplyKeyboardMarkup.hpp.

Member Data Documentation

◆ inputFieldPlaceholder

std::string tgbotxx::ReplyKeyboardMarkup::inputFieldPlaceholder

Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.

Definition at line 35 of file ReplyKeyboardMarkup.hpp.

◆ isPersistent

bool tgbotxx::ReplyKeyboardMarkup::isPersistent {}

Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.

Definition at line 21 of file ReplyKeyboardMarkup.hpp.

◆ keyboard

std::vector<std::vector<Ptr<KeyboardButton> > > tgbotxx::ReplyKeyboardMarkup::keyboard

Array of button rows, each represented by an Array of KeyboardButton objects @type Array of Array of KeyboardButton.

Definition at line 17 of file ReplyKeyboardMarkup.hpp.

◆ oneTimeKeyboard

bool tgbotxx::ReplyKeyboardMarkup::oneTimeKeyboard {}

Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.

Definition at line 32 of file ReplyKeyboardMarkup.hpp.

◆ resizeKeyboard

bool tgbotxx::ReplyKeyboardMarkup::resizeKeyboard {}

Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.

Definition at line 26 of file ReplyKeyboardMarkup.hpp.

◆ selective

bool tgbotxx::ReplyKeyboardMarkup::selective {}

Optional. Use this parameter if you want to show the keyboard to specific users only. Targets:

  • 1) users that are @mentioned in the text of the Message object;
  • 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.

Definition at line 44 of file ReplyKeyboardMarkup.hpp.


The documentation for this struct was generated from the following file: