MessageEntity#

class pyrogram.types.MessageEntity#

One special entity in a text message.

For example, hashtags, usernames, URLs, etc.

Parameters:
  • type (MessageEntityType) – Type of the entity.

  • offset (int) – Offset in UTF-16 code units to the start of the entity.

  • length (int) – Length of the entity in UTF-16 code units.

  • url (str, optional) – For TEXT_LINK only, url that will be opened after user taps on the text.

  • user (User, optional) – For TEXT_MENTION only, the mentioned user.

  • language (str, optional) – For “pre” only, the programming language of the entity text.

  • custom_emoji_id (int, optional) – For CUSTOM_EMOJI only, unique identifier of the custom emoji. Use get_custom_emoji_stickers() to get full information about the sticker.