项目介绍

doceazedo/emotettv 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,目前获得 29 个 Star、1 次 Fork。

仓库全名
doceazedo/emotettv
Star 数
29
Fork 数
1
未关闭 Issue
4

README 摘要

emoteTTV 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 If you're using TMI.js, you can pass your tags directly to emoteTTV: Docs Check more examples and API reference on the emoteTTV docs. License The emoteTTV project is licensed under the GPLv3 License

完整内容见 GitHub 原始 README 或本页 。

常见问题

emotettv 用什么语言开发?

主要使用 TypeScript 编写,目前有 29 个 Star。

如何获取 emotettv 的源码?

可以直接克隆仓库:git clone https://github.com/doceazedo/emotettv.git,默认分支为 main;安装与运行步骤见仓库 README。

emotettv 最近还在维护吗?

仓库最近一次更新为 2024年1月30日,当前有 4 个未关闭 Issue;Star 数为 29,可作为社区活跃度的参考。

关于

💬 A Twitch (BTTV, FFZ & 7TV) emotes and badges parser - built with TMI.js in mind

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
33
价值分
17
活跃状态
活跃

语言占比

HTML
TypeScript

README

emoteTTV

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.

评论

暂无评论