1.0.2 • Published 1 year ago

emotettv v1.0.2

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

npm install size downloads snyk snyk

  • Supports Twitch, BTTV, FFZ and 7TV emotes and badges
  • Dead simple API — works seamlessly with TMI.js and Twurple
  • Works out of the box — no authentication needed
  • Flexible outputs to fit every need

Demo

Checkout this demo app to see emoteTTV in action! ⛹️

Basic usage

import { parseEmotes } from "emotettv";

const parsed = await parseEmotes("Hello emotettv! D:");
console.log(parsed.toHTML());
// > Hello emotettv! <figure><img src="..." alt="D:" /></figure>

If you're using TMI.js, you can pass your tags directly to emoteTTV:

import { parseBadges, parseEmotes } from "emotettv";
import tmi from "tmi.js";

const client = new tmi.Client({
  channels: ["doceazedo911"],
});

const options = {
  channelId: "98776633",
};

client.connect();
client.on("message", async (channel, tags, text, self) => {
  const badges = await parseBadges(tags.badges, tags.username, options);
  const message = await parseEmotes(text, tags.emotes, options);
  const htmlBadges = badges.toHTML();
  const htmlMessage = message.toHTML();
  const displayName = tags["display-name"];
  document.body.innerHTML = `${htmlBadges} ${displayName}: ${htmlMessage}`;
});

Docs

Check more examples and API reference on the emoteTTV docs.

License

The emoteTTV project is licensed under the GPLv3 License.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.0-next.1

1 year ago

1.0.0-next.2

1 year ago

1.0.0-next.3

1 year ago

1.0.0-next.4

1 year ago

1.0.0-next.5

1 year ago

1.0.0-next.6

1 year ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.16

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago