twitch-emoticons-fork
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

twitch-emoticons

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

Install

npm install @mkody/twitch-emoticons
# or 
yarn add @mkody/twitch-emoticons

Example

const { EmoteFetcher, EmoteParser } = require('twitch-emoticons');
 
const fetcher = new EmoteFetcher();
const parser = new EmoteParser(fetcher, {
    type: 'markdown',
    match: /:(.+?):/g
});
 
fetcher.fetchTwitchEmotes(null).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:

Package Sidebar

Install

npm i twitch-emoticons-fork

Weekly Downloads

6

Version

2.2.0

License

MIT

Unpacked Size

1.4 MB

Total Files

64

Last publish

Collaborators

  • colyn_