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

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

#include <MessageEntity.h>

Public Types

enum class  Type {
  Mention , Hashtag , Cashtag , BotCommand ,
  Url , Email , PhoneNumber , Bold ,
  Italic , Underline , Strikethrough , Spoiler ,
  Code , Pre , TextLink , TextMention ,
  CustomEmoji
}
 Enum of possible types. More...
 
typedef std::shared_ptr< MessageEntityPtr
 

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.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), “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)
 
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::string url
 Optional. For “text_link” only, URL that will be opened after user taps on the text.
 
User::Ptr user
 Optional. For “text_mention” only, the mentioned user.
 
std::string language
 Optional. For “pre” only, the programming language of the entity text.
 
std::string customEmojiId
 Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use Api::getCustomEmojiStickers to get full information about the sticker.
 

Detailed Description

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

Definition at line 18 of file MessageEntity.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<MessageEntity> TgBot::MessageEntity::Ptr

Definition at line 20 of file MessageEntity.h.

Member Enumeration Documentation

◆ Type

enum class TgBot::MessageEntity::Type
strong

Enum of possible types.

Enumerator
Mention 
Hashtag 
Cashtag 
BotCommand 
Url 
Email 
PhoneNumber 
Bold 
Italic 
Underline 
Strikethrough 
Spoiler 
Code 
Pre 
TextLink 
TextMention 
CustomEmoji 

Definition at line 25 of file MessageEntity.h.

Member Data Documentation

◆ customEmojiId

std::string TgBot::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 64 of file MessageEntity.h.

◆ language

std::string TgBot::MessageEntity::language

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

Definition at line 58 of file MessageEntity.h.

◆ length

std::int32_t TgBot::MessageEntity::length

Length of the entity in UTF-16 code units.

Definition at line 43 of file MessageEntity.h.

◆ offset

std::int32_t TgBot::MessageEntity::offset

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

Definition at line 38 of file MessageEntity.h.

◆ type

Type TgBot::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.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), “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)

Definition at line 33 of file MessageEntity.h.

◆ url

std::string TgBot::MessageEntity::url

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

Definition at line 48 of file MessageEntity.h.

◆ user

User::Ptr TgBot::MessageEntity::user

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

Definition at line 53 of file MessageEntity.h.


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