class pyrogram.types.MessageEntity

One special entity in a text message. For example, hashtags, usernames, URLs, etc.

  • type (str) – Type of the entity. Can be “mention” (@username), “hashtag”, “cashtag”, “bot_command”, “url”, “email”, “phone_number”, “bold” (bold text), “italic” (italic text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for custom text mentions based on users’ identifiers).

  • 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.