tgbotxx
1.1.6.9
Telegram Bot C++ Library
|
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. https://core.telegram.org/bots/api#messageentity. More...
#include <MessageEntity.hpp>
Public Types | |
enum class | Type : std::uint8_t { Mention = 0 , Hashtag , Cashtag , BotCommand , Url , Email , PhoneNumber , Bold , Italic , Underline , Strikethrough , Spoiler , Code , Pre , TextLink , TextMention , CustomEmoji } |
Enum of possible types of MessageEntity. More... | |
Public Member Functions | |
MessageEntity ()=default | |
MessageEntity (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... | |
Static Public Member Functions | |
static constexpr Type | Str2Type (const std::string &str) |
Public Attributes | |
Type | type {} |
Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-no), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) t-re ply@t eleg ram.o rgMore... | |
std::int32_t | offset {} |
Offset in UTF-16 code units to the start of the entity. More... | |
std::int32_t | length {} |
Length of the entity in UTF-16 code units. More... | |
std::string | url |
Optional. For “text_link” only, URL that will be opened after user taps on the text. More... | |
Ptr< User > | user |
Optional. For “text_mention” only, the mentioned user. More... | |
std::string | language |
Optional. For “pre” only, the programming language of the entity text. More... | |
std::string | customEmojiId |
Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use Api::getCustomEmojiStickers to get full information about the sticker. More... | |
Static Public Attributes | |
static constexpr const char * | Type2Str [] |
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. https://core.telegram.org/bots/api#messageentity.
Definition at line 8 of file MessageEntity.hpp.
|
strong |
Enum of possible types of MessageEntity.
Enumerator | |
---|---|
Mention | “mention” (@username) |
Hashtag | “hashtag” (#hashtag) |
Cashtag | “cashtag” ($USD) |
BotCommand | “bot_command” (/start@jobs_bot) |
Url | “url” (https://telegram.org) |
“email” (do-no) t-re ply@t eleg ram.o rg | |
PhoneNumber | “phone_number” (+1-212-555-0123) |
Bold | “bold” (bold text) |
Italic | “italic” (italic text) |
Underline | “underline” (underlined text) |
Strikethrough | “strikethrough” (strikethrough text) |
Spoiler | “spoiler” (spoiler message) |
Code | “code” (monowidth string) |
Pre | “pre” (monowidth block) |
TextLink | “text_link” (for clickable text URLs) |
TextMention | “text_mention” (for users without usernames) |
CustomEmoji | “custom_emoji” (for inline custom emoji stickers) |
Definition at line 15 of file MessageEntity.hpp.
|
default |
|
inlineexplicit |
Definition at line 10 of file MessageEntity.hpp.
|
inline |
Deserializes this object from JSON.
Definition at line 123 of file MessageEntity.hpp.
|
inlinestaticconstexpr |
Definition at line 70 of file MessageEntity.hpp.
|
inline |
Serializes this object to JSON.
Definition at line 110 of file MessageEntity.hpp.
std::string tgbotxx::MessageEntity::customEmojiId |
Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use Api::getCustomEmojiStickers to get full information about the sticker.
Definition at line 106 of file MessageEntity.hpp.
std::string tgbotxx::MessageEntity::language |
Optional. For “pre” only, the programming language of the entity text.
Definition at line 102 of file MessageEntity.hpp.
std::int32_t tgbotxx::MessageEntity::length {} |
Length of the entity in UTF-16 code units.
Definition at line 93 of file MessageEntity.hpp.
std::int32_t tgbotxx::MessageEntity::offset {} |
Offset in UTF-16 code units to the start of the entity.
Definition at line 90 of file MessageEntity.hpp.
Type tgbotxx::MessageEntity::type {} |
Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-no), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) t-re ply@t eleg ram.o rg
Definition at line 87 of file MessageEntity.hpp.
|
inlinestaticconstexpr |
Definition at line 51 of file MessageEntity.hpp.
std::string tgbotxx::MessageEntity::url |
Optional. For “text_link” only, URL that will be opened after user taps on the text.
Definition at line 96 of file MessageEntity.hpp.
Optional. For “text_mention” only, the mentioned user.
Definition at line 99 of file MessageEntity.hpp.