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

This object represents one special entity in a text message. More...

#include <MessageEntity.h>

Public Types

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

Public Attributes

Type type
 Type of the entity.
 
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 Type::TextLink only, URL that will be opened after user taps on the text.
 
User::Ptr user
 Optional. For Type::TextMention only, the mentioned user.
 
std::string language
 Optional. For Type::Pre only, the programming language of the entity text.
 
std::string customEmojiId
 Optional. For Type::CustomEmoji only, unique identifier of the custom emoji.
 

Detailed Description

This object represents one special entity in a text message.

For example, hashtags, usernames, URLs, etc.

Definition at line 19 of file MessageEntity.h.

Member Typedef Documentation

◆ Ptr

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

Definition at line 22 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 
Blockquote 
Code 
Pre 
TextLink 
TextMention 
CustomEmoji 

Definition at line 27 of file MessageEntity.h.

Member Data Documentation

◆ customEmojiId

std::string TgBot::MessageEntity::customEmojiId

Optional. For Type::CustomEmoji only, unique identifier of the custom emoji.

Use Api::getCustomEmojiStickers to get full information about the sticker

Definition at line 69 of file MessageEntity.h.

◆ language

std::string TgBot::MessageEntity::language

Optional. For Type::Pre only, the programming language of the entity text.

Definition at line 62 of file MessageEntity.h.

◆ length

std::int32_t TgBot::MessageEntity::length

Length of the entity in UTF-16 code units

Definition at line 47 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 42 of file MessageEntity.h.

◆ type

Type TgBot::MessageEntity::type

Type of the entity.

Currently, can be Type::Mention (@username), Type::Hashtag (#hashtag), Type::Cashtag ($USD), Type::BotCommand (/start@jobs_bot), Type::Url (https://telegram.org), Type::Email (do-no.nosp@m.t-re.nosp@m.ply@t.nosp@m.eleg.nosp@m.ram.o.nosp@m.rg), Type::PhoneNumber (+1-212-555-0123), Type::Bold (bold text), Type::Italic (italic text), Type::Underline (underlined text), Type::Strikethrough (strikethrough text), Type::Spoiler (spoiler message), Type::Blockquote (block quotation), Type::Code (monowidth string), Type::Pre (monowidth block), Type::TextLink (for clickable text URLs), Type::TextMention (for users without usernames), Type::CustomEmoji (for inline custom emoji stickers)

Definition at line 36 of file MessageEntity.h.

◆ url

std::string TgBot::MessageEntity::url

Optional. For Type::TextLink only, URL that will be opened after user taps on the text.

Definition at line 52 of file MessageEntity.h.

◆ user

User::Ptr TgBot::MessageEntity::user

Optional. For Type::TextMention only, the mentioned user.

Definition at line 57 of file MessageEntity.h.


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