Class MessageEntities

Constructors

  • Creates an instance of the MessageEntities class.

    Parameters

    • searchText: string

      The text to search within.

    • entities: MessageEntity[]

      The array of message entities.

    Returns MessageEntities

Properties

searchText: string

The text to search within.

Accessors

Methods

  • Enables iteration over the message entities.

    Returns Generator<(SearchResult & {
        type:
            | "bold"
            | "code"
            | "email"
            | "mention"
            | "hashtag"
            | "cashtag"
            | "url"
            | "italic"
            | "underline"
            | "strikethrough"
            | "spoiler"
            | "blockquote"
            | "botCommand"
            | "phoneNumber";
    })[], any, unknown>

    An iterator over the message entities.

  • Searches for a specific type of entity in the message.

    Parameters

    • searchType:
          | "bold"
          | "code"
          | "phone_number"
          | "email"
          | "mention"
          | "hashtag"
          | "cashtag"
          | "bot_command"
          | "url"
          | "italic"
          | "underline"
          | "strikethrough"
          | "spoiler"
          | "blockquote"

      The type of entity to search for.

    Returns SearchResult[]

    An array of objects representing the found entities.