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
}
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), “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::int32_t offset { }
 Offset in UTF-16 code units to the start of the entity.
std::int32_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< Useruser { }
 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 9604 of file Types.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 9605 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 

Definition at line 9607 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 9672 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 9683 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 9666 of file Types.h.

◆ length

std::int32_t TgBot::MessageEntity::length { }

Length of the entity in UTF-16 code units.

Definition at line 9651 of file Types.h.

◆ offset

std::int32_t TgBot::MessageEntity::offset { }

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

Definition at line 9646 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), “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 9641 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 9677 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 9656 of file Types.h.

◆ user

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

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

Definition at line 9661 of file Types.h.


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