MessageEntity

Message entities, representing styled text in a message

Constructors

Constructor Description
messageEntityUnknown Unknown message entity
messageEntityMention Message entity mentioning a user by @username; messageEntityMentionName can also be used to mention users by their ID.
messageEntityHashtag #hashtag message entity
messageEntityBotCommand Message entity representing a bot /command
messageEntityUrl Message entity representing an in-text url: https://google.com; for text urls, use messageEntityTextUrl.
messageEntityEmail Message entity representing an email@example.com.
messageEntityBold Message entity representing bold text.
messageEntityItalic Message entity representing italic text.
messageEntityCode Message entity representing a codeblock.
messageEntityPre Message entity representing a preformatted codeblock, allowing the user to specify a programming language for the codeblock.
messageEntityTextUrl Message entity representing a text url: for in-text urls like https://google.com use messageEntityUrl.

Note that an additional confirmation popup with the full URL must be displayed to the user before opening this link, unless the domain satisfies the conditions specified in the domain whitelist documentation ยป.
messageEntityMentionName Message entity representing a user mention: for creating a mention use inputMessageEntityMentionName.
inputMessageEntityMentionName Message entity that can be used to create a user user mention: received mentions use the messageEntityMentionName constructor, instead.
messageEntityPhone Message entity representing a phone number.
messageEntityCashtag Message entity representing a $cashtag.
messageEntityUnderline Message entity representing underlined text.
messageEntityStrike Message entity representing strikethrough text.
messageEntityBankCard Indicates a credit card number
messageEntitySpoiler Message entity representing a spoiler
messageEntityCustomEmoji Represents a custom emoji.
Note that this entity must wrap exactly one regular emoji (the one contained in documentAttributeCustomEmoji.alt) in the related text, otherwise the server will ignore it.
messageEntityBlockquote Message entity representing a block quote.