tgbot-cpp
Loading...
Searching...
No Matches
TgBot::RichMessageButton Struct Reference

This object represents a button in a RichMessage. Exactly one of the fields other than text and style must be used to specify the type of the button. More...

#include <Types.h>

Public Types

using Ptr = std::shared_ptr<RichMessageButton>

Public Attributes

std::shared_ptr< RichText > text { }
 Text of the button. May contain only plain text, RichTextCustomEmoji and RichTextDateTime entities.
std::optional< std::string > style { }
 Optional. Style of the button. Must be one of “danger”, “success”, “primary”, or “link” (the button is shown as a regular link without borders). Apps may use theme-specific colors for the button background and text based on the style. The style “link” is allowed only for callback buttons.
std::optional< std::string > url { }
 Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
std::optional< std::string > callbackData { }
 Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes.
std::shared_ptr< WebAppInfo > webApp { }
 Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account.
std::shared_ptr< LoginUrl > loginUrl { }
 Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages.
std::optional< std::string > switchInlineQuery { }
 Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
std::optional< std::string > switchInlineQueryCurrentChat { }
 Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account.
std::shared_ptr< SwitchInlineQueryChosenChat > switchInlineQueryChosenChat { }
 Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.
std::shared_ptr< CopyTextButton > copyText { }
 Optional. A button that copies the specified text to the clipboard.
std::shared_ptr< DisabledButton > disabled { }
 Optional. If set, then the button is disabled and does nothing.

Detailed Description

This object represents a button in a RichMessage. Exactly one of the fields other than text and style must be used to specify the type of the button.

Definition at line 11483 of file Types.h.

Member Typedef Documentation

◆ Ptr

Definition at line 11484 of file Types.h.

Member Data Documentation

◆ callbackData

std::optional<std::string> TgBot::RichMessageButton::callbackData { }

Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes.

Definition at line 11508 of file Types.h.

◆ copyText

std::shared_ptr<CopyTextButton> TgBot::RichMessageButton::copyText { }

Optional. A button that copies the specified text to the clipboard.

Definition at line 11546 of file Types.h.

◆ disabled

std::shared_ptr<DisabledButton> TgBot::RichMessageButton::disabled { }

Optional. If set, then the button is disabled and does nothing.

Definition at line 11550 of file Types.h.

◆ loginUrl

std::shared_ptr<LoginUrl> TgBot::RichMessageButton::loginUrl { }

Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages.

Definition at line 11520 of file Types.h.

◆ style

std::optional<std::string> TgBot::RichMessageButton::style { }

Optional. Style of the button. Must be one of “danger”, “success”, “primary”, or “link” (the button is shown as a regular link without borders). Apps may use theme-specific colors for the button background and text based on the style. The style “link” is allowed only for callback buttons.

Definition at line 11497 of file Types.h.

◆ switchInlineQuery

std::optional<std::string> TgBot::RichMessageButton::switchInlineQuery { }

Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account.

Definition at line 11528 of file Types.h.

◆ switchInlineQueryChosenChat

std::shared_ptr<SwitchInlineQueryChosenChat> TgBot::RichMessageButton::switchInlineQueryChosenChat { }

Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account.

Definition at line 11542 of file Types.h.

◆ switchInlineQueryCurrentChat

std::optional<std::string> TgBot::RichMessageButton::switchInlineQueryCurrentChat { }

Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account.

Definition at line 11535 of file Types.h.

◆ text

std::shared_ptr<RichText> TgBot::RichMessageButton::text { }

Text of the button. May contain only plain text, RichTextCustomEmoji and RichTextDateTime entities.

Definition at line 11490 of file Types.h.

◆ url

std::optional<std::string> TgBot::RichMessageButton::url { }

Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.

Definition at line 11503 of file Types.h.

◆ webApp

std::shared_ptr<WebAppInfo> TgBot::RichMessageButton::webApp { }

Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account.

Definition at line 11515 of file Types.h.


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