Function parseAutocomplete

  • Calculates autocomplete for the given input text in the given channel.

    Returns

    An AutocompleteResult with matched items.

    Parameters

    • channel: Channel

      The channel to use for calculation of channel/user mentions.

    • text: string

      The text to calculate against.

    • cursorPos: number

      The position of the cursor in the text.

    • Optional unique: {
          emojis?: boolean;
          users?: boolean;
      }

      If emojis is set, uses emoji's uniqueName instead of ID for autocomplete. If users is set, uses user's tag for autocomplete. (pairs nicely with Channel.send expandMentions/expandEmojis)

      • Optional emojis?: boolean
      • Optional users?: boolean

    Returns AutocompleteResult | null