# twitch-emote-parser

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

Latest version **1.0.3** (published 2022-02-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install twitch-emote-parser
pnpm add twitch-emote-parser
yarn add twitch-emote-parser
bun add twitch-emote-parser
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-02-12 |
| First published | 2022-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 30.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | mahcks |

## Links

- npm: https://www.npmjs.com/package/twitch-emote-parser
- Repository: https://github.com/Mahcks/twitch-emote-parser
- Homepage: https://github.com/Mahcks/twitch-emote-parser#readme
- Issues: https://github.com/Mahcks/twitch-emote-parser/issues
- npm.io page: https://npm.io/package/twitch-emote-parser

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [tmi.js](https://npm.io/package/tmi.js.md) ^1.8.5
- [@types/tmi.js](https://npm.io/package/@types/tmi.js.md) ^1.8.1

## Recent versions

- 1.0.3 (latest) — 2022-02-12
- 1.0.2 — 2022-02-12
- 1.0.1 — 2022-02-12
- 1.0.0 — 2022-02-12

## README

# 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);
});
```
| Property                      | Type    | Description                                                                                                       |
|-------------------------------|---------|-------------------------------------------------------------------------------------------------------------------|
| `channel`                     | string  | Channel name string that you want to connect to chat with.                                                        |
| `duplicateEmoteLimit`         | number  | Maxium number of emotes permitted for a single message.                                                           |
| `duplicateEmoteLimitPleb`     | number  | Maximum number of emotes permitted for a single message from an unsubscribed user, defaults to maximumEmoteLimit. |
| `maxEmoteLimit`               | number  | Max limit of emotes per message                                                                                   |
| `emoteSettings`               | object  | Enable/disable certain category of emotes.                                                                        |
| `emoteSettings.channelEmotes` | boolean | Channel sub/bits emotes.                                                                                          |
| `emoteSettings.bttv`          | boolean | BTTV channel emotes.                                                                                              |
| `emoteSettings.bttvGlobal`    | boolean | BTTV global emotes.                                                                                               |
| `emoteSettings.ffz`           | boolean | FFZ channel emotes.                                                                                               |
| `emoteSettings.ffzGlobal`     | boolean | FFZ global emotes                                                                                                 |
| `emoteSettings.sevenTV`       | boolean | 7tv channel emotes.                                                                                               |
| `emoteSettings.sevenTVGlboal` | boolean | 7tv global emotes.                                                                                                |

**Listening for Emotes**
`ChatInstance.on(event, callback)` <br />
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
    }
  ]
}
```

---
_Source: https://npm.io/package/twitch-emote-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
