EmoteParser

EmoteParser

new EmoteParser(fetcher, optionsopt)

Source:

A parser to replace text with emotes.

Parameters:
Name Type Attributes Default Description
fetcher EmoteFetcher

The fetcher to use the cache of.

options Object <optional>
{}

Options for the parser.

Properties
Name Type Attributes Default Description
template string <optional>

The template to be used.
The strings that can be interpolated are:

  • {link} The link of the emote.
  • {name} The name of the emote.
  • {size} The size of the image.
  • {creator} The channel/owner name of the emote.
type string <optional>
'markdown'

The type of the parser.
Can be one of markdown, html, bbcode, or plain.
If the template option is provided, this is ignored.

match RegExp <optional>
/:(.+?):/g

The regular expression that matches an emote.
Must be a global regex, with one capture group for the emote code.

Members

fetcher :EmoteFetcher

Source:

The emote fetcher being used.

Type:

options :Object

Source:

The parser options.

Type:
  • Object

Methods

parse(text, size) → {string}

Source:

Parses text.

Parameters:
Name Type Default Description
text string

Text to parse.

size number 0

Size for emotes.

Returns:
Type
string