myrqyry / twitch-emoticons

A JS module that gets Twitch emotes. https://www.npmjs.com/package/twitch-emoticons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twitch-emoticons

Get a Twitch channel's Twitch emotes, BTTV emotes, and FFZ emotes!

Example

const { EmoteFetcher, EmoteParser } = require('twitch-emoticons');

const fetcher = new EmoteFetcher();
const parser = new EmoteParser(fetcher, {
    type: 'markdown',
    match: /:(.+?):/g
});

fetcher.fetchTwitchEmotes().then(() => {
    const kappa = fetcher.emotes.get('Kappa').toLink();
    console.log(kappa);
    // https://static-cdn.jtvnw.net/emoticons/v1/25/1.0

    const text = 'Hello :PogChamp:!';
    const parsed = parser.parse(text);
    console.log(parsed);
    // Hello ![PogChamp](https://static-cdn.jtvnw.net/emoticons/v1/88/1.0 "PogChamp")!
});

Links

This library uses the following:

About

A JS module that gets Twitch emotes. https://www.npmjs.com/package/twitch-emoticons

License:MIT License


Languages

Language:JavaScript 96.9%Language:TypeScript 3.1%