EmoteParser

EmoteParser

new EmoteParser(fetcher, optionsopt)

Description:
  • A parser to replace text with emotes.

Source:
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

Description:
  • The emote fetcher being used.

Source:

The emote fetcher being used.

Type:

options :object

Description:
  • The parser options.

Source:

The parser options.

Type:
  • object

Methods

parse(text, size) → {string}

Description:
  • Parses text.

Source:
Parameters:
Name Type Default Description
text string

Text to parse.

size number 0

Size for emotes.

Returns:
Type
string