1.0.3 • Published 2 years ago

twitch-emote-parser v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

twitch-emote-parser

NPM package that parses Twitch chat for 3rd party, and channel emotes.

import Chat from 'twitch-emote-parser'

// Channel you want to connect and listen to.
let channel = 'mahcksimus';

// Creating the chat instance.
const ChatInstance = new Chat({
  channel: channel,
  duplicateEmoteLimit: 5,
  duplicateEmoteLimitPleb: null,
  emoteSettings: {
    bttv: true,
    bttvGlobal: true,
    channelEmotes: true,
    ffz: true,
    ffzGlobal: true,
    sevenTV: true,
    sevenTVGlobal: true
  },
  maxEmoteLimit: 10
});

// Listening to emotes 
ChatInstance.on("emotes", (emotes) => {
  console.log(emotes);
});
PropertyTypeDescription
channelstringChannel name string that you want to connect to chat with.
duplicateEmoteLimitnumberMaxium number of emotes permitted for a single message.
duplicateEmoteLimitPlebnumberMaximum number of emotes permitted for a single message from an unsubscribed user, defaults to maximumEmoteLimit.
maxEmoteLimitnumberMax limit of emotes per message
emoteSettingsobjectEnable/disable certain category of emotes.
emoteSettings.channelEmotesbooleanChannel sub/bits emotes.
emoteSettings.bttvbooleanBTTV channel emotes.
emoteSettings.bttvGlobalbooleanBTTV global emotes.
emoteSettings.ffzbooleanFFZ channel emotes.
emoteSettings.ffzGlobalbooleanFFZ global emotes
emoteSettings.sevenTVboolean7tv channel emotes.
emoteSettings.sevenTVGlboalboolean7tv global emotes.

Listening for Emotes ChatInstance.on(event, callback) On callback it will return an object like so:

{
  count: 3,
  emote: [
    {
      name: 'pajaDank',
      url: 'https://cdn.7tv.app/emote/60ae3a6c259ac5a73e3a3ca2/3x',
      service: '7tv',
      scope: 'channel',
      zeroWidth: false
    }
  ]
}
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago