Documentation - v0.27.1
    Preparing search index...

    One special entity in a text message (like mention, hashtag, URL, etc.)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _text?: string

    Accessors

    • get kind(): | "url"
      | "bold"
      | "email"
      | "code"
      | "spoiler"
      | "emoji"
      | "hashtag"
      | "mention"
      | "cashtag"
      | "bot_command"
      | "phone_number"
      | "italic"
      | "underline"
      | "strikethrough"
      | "bank_card"
      | "unknown"
      | "blockquote"
      | "pre"
      | "text_link"
      | "text_mention"

      Kind of the entity (see MessageEntityParams)

      Returns
          | "url"
          | "bold"
          | "email"
          | "code"
          | "spoiler"
          | "emoji"
          | "hashtag"
          | "mention"
          | "cashtag"
          | "bot_command"
          | "phone_number"
          | "italic"
          | "underline"
          | "strikethrough"
          | "bank_card"
          | "unknown"
          | "blockquote"
          | "pre"
          | "text_link"
          | "text_mention"

    Methods

    • Checks if this entity is of the given type, and adjusts the type accordingly.

      Type Parameters

      • const T extends
            | "url"
            | "bold"
            | "email"
            | "code"
            | "spoiler"
            | "emoji"
            | "hashtag"
            | "mention"
            | "cashtag"
            | "bot_command"
            | "phone_number"
            | "italic"
            | "underline"
            | "strikethrough"
            | "bank_card"
            | "unknown"
            | "blockquote"
            | "pre"
            | "text_link"
            | "text_mention"

      Parameters

      • kind: T

      Returns this is MessageEntity & {
          kind: T;
          params:
              | Extract<
                  {
                      kind: | "url"
                      | "bold"
                      | "email"
                      | "code"
                      | "spoiler"
                      | "hashtag"
                      | "mention"
                      | "cashtag"
                      | "bot_command"
                      | "phone_number"
                      | "italic"
                      | "underline"
                      | "strikethrough"
                      | "bank_card"
                      | "unknown";
                  },
                  { kind: T },
              >
              | Extract<{ collapsible: boolean; kind: "blockquote" }, { kind: T }>
              | Extract<{ kind: "pre"; language?: string }, { kind: T }>
              | Extract<{ kind: "text_link"; url: string }, { kind: T }>
              | Extract<{ kind: "text_mention"; userId: number }, { kind: T }>
              | Extract<{ emojiId: Long; kind: "emoji" }, { kind: T }>;
      }