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

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. More...

#include <Types.h>

Public Types

enum class  Type {
  Mention , Hashtag , Cashtag , BotCommand ,
  Url , Email , PhoneNumber , Bold ,
  Italic , Underline , Strikethrough , Spoiler ,
  Blockquote , ExpandableBlockquote , Code , Pre ,
  TextLink , TextMention , CustomEmoji , DateTime ,
  TonAddress , BankCardNumber
}
using Ptr = std::shared_ptr<MessageEntity>

Public Attributes

Type type { }
 Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-no.nosp@m.t-re.nosp@m.ply@t.nosp@m.eleg.nosp@m.ram.o.nosp@m.rg), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “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), or “date_time” (for formatted date and time).
std::uint32_t offset { }
 Offset in UTF-16 code units to the start of the entity.
std::uint32_t length { }
 Length of the entity in UTF-16 code units.
std::optional< std::string > url { }
 Optional. For “text_link” only, URL that will be opened after user taps on the text.
std::shared_ptr< User > user { }
 Optional. For “text_mention” only, the mentioned user.
std::optional< std::string > language { }
 Optional. For “pre” only, the programming language of the entity text.
std::optional< std::string > customEmojiId { }
 Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.
std::optional< std::int32_t > unixTime { }
 Optional. For “date_time” only, the Unix time associated with the entity.
std::optional< std::string > dateTimeFormat { }
 Optional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.

Detailed Description

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Definition at line 9177 of file Types.h.

Member Typedef Documentation

◆ Ptr

using TgBot::MessageEntity::Ptr = std::shared_ptr<MessageEntity>

Definition at line 9178 of file Types.h.

Member Enumeration Documentation

◆ Type

enum class TgBot::MessageEntity::Type
strong
Enumerator
Mention 
Hashtag 
Cashtag 
BotCommand 
Url 
Email 
PhoneNumber 
Bold 
Italic 
Underline 
Strikethrough 
Spoiler 
Blockquote 
ExpandableBlockquote 
Code 
Pre 
TextLink 
TextMention 
CustomEmoji 
DateTime 
TonAddress 
BankCardNumber 

Definition at line 9180 of file Types.h.

Member Data Documentation

◆ customEmojiId

std::optional<std::string> TgBot::MessageEntity::customEmojiId { }

Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.

Definition at line 9242 of file Types.h.

◆ dateTimeFormat

std::optional<std::string> TgBot::MessageEntity::dateTimeFormat { }

Optional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.

Definition at line 9251 of file Types.h.

◆ language

std::optional<std::string> TgBot::MessageEntity::language { }

Optional. For “pre” only, the programming language of the entity text.

Definition at line 9237 of file Types.h.

◆ length

std::uint32_t TgBot::MessageEntity::length { }

Length of the entity in UTF-16 code units.

Definition at line 9225 of file Types.h.

◆ offset

std::uint32_t TgBot::MessageEntity::offset { }

Offset in UTF-16 code units to the start of the entity.

Definition at line 9221 of file Types.h.

◆ type

Type TgBot::MessageEntity::type { }

Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-no.nosp@m.t-re.nosp@m.ply@t.nosp@m.eleg.nosp@m.ram.o.nosp@m.rg), “phone_number” (+1-212-555-0123), “bank_card_number” (bank card number), “ton_address” (address in the TON blockchain), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “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), or “date_time” (for formatted date and time).

Definition at line 9217 of file Types.h.

◆ unixTime

std::optional<std::int32_t> TgBot::MessageEntity::unixTime { }

Optional. For “date_time” only, the Unix time associated with the entity.

Definition at line 9246 of file Types.h.

◆ url

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

Optional. For “text_link” only, URL that will be opened after user taps on the text.

Definition at line 9229 of file Types.h.

◆ user

std::shared_ptr<User> TgBot::MessageEntity::user { }

Optional. For “text_mention” only, the mentioned user.

Definition at line 9233 of file Types.h.


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