# twitch-chat-bot

> an attempt to provide a generic, but highly-configurable platform for developers intending to create Twitch chat bots in Node.js

Latest version **0.4.1** (published 2023-05-06) · AGPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install twitch-chat-bot
pnpm add twitch-chat-bot
yarn add twitch-chat-bot
bun add twitch-chat-bot
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2023-05-06 |
| First published | 2023-04-08 |
| Weekly downloads | 0 |
| License | AGPL-3.0-only |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 187.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | WildcardSearch |
| Maintainers | wildcardsearch |
| Keywords | bot, twitch, node, nodebot, chatbot, twitchbot, twitchchatbot, nodechatbot, nodetwitchbot, nodetwitchchatbot, nodejsbot, nodejschatbot, nodejstwitchbot, nodejstwitchchatbot |

## Links

- npm: https://www.npmjs.com/package/twitch-chat-bot
- Repository: https://github.com/wildcardsearch/twitch-chat-bot
- Homepage: https://github.com/wildcardsearch/twitch-chat-bot#readme
- Issues: https://github.com/wildcardsearch/twitch-chat-bot/issues
- npm.io page: https://npm.io/package/twitch-chat-bot

## Dependencies (4)

- [mysql](https://npm.io/package/mysql.md) ^2.18.1
- [tmi.js](https://npm.io/package/tmi.js.md) ^1.8.5
- [node-polyglot](https://npm.io/package/node-polyglot.md) ^2.5.0
- [nodejs-streamelements](https://npm.io/package/nodejs-streamelements.md) ^0.0.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.4.1 (latest) — 2023-05-06
- 0.4.0 — 2023-05-06
- 0.3.0 — 2023-04-30
- 0.2.3 — 2023-04-29
- 0.2.2 — 2023-04-23
- 0.2.1 — 2023-04-23
- 0.2.0 — 2023-04-22
- 0.1.0 — 2023-04-20
- 0.0.6 — 2023-04-19
- 0.0.5 — 2023-04-18
- 0.0.4 — 2023-04-15
- 0.0.3 — 2023-04-13
- 0.0.2 — 2023-04-11
- 0.0.1 — 2023-04-08

## README

# twitch-chat-bot 0.4.1
*a highly customizable base Twitch chat bot to build on*

<p align="center">
  <a href="https://www.npmjs.com/package/twitch-chat-bot"><img alt="NPM Version" src="https://img.shields.io/npm/v/twitch-chat-bot?maxAge=43200"></a>
  <a href="https://www.npmjs.com/package/twitch-chat-bot"><img alt="npm downloads per month" src="https://img.shields.io/npm/dm/twitch-chat-bot?maxAge=43200"></a>
  <a href="https://www.npmjs.com/package/twitch-chat-bot"><img alt="NPM bundle size" src="https://img.shields.io/bundlephobia/min/twitch-chat-bot?maxAge=43200"></a>
  <a href="https://twitter.com/WildcardSearch"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/WildcardSearch?style=social&maxAge=43200"></a>
</p>

`npm install twitch-chat-bot`

```javascript
const {
	TwitchChatBot,
} = require("twitch-chat-bot");

function main()
{
	let myBot = new TwitchChatBot({
		credentials: {
			username: "bot_username",
			oauth: "oauth_string",
			channel: "twitch_channel",
		},
	});

	myBot.on("ready", ready);
}

function ready()
{
	this.sendMessage("is online", { action: true });
}

main();
```

See: [Getting Started](https://github.com/WildcardSearch/twitch-chat-bot/wiki#getting-started)

**Features:**

- Easy to get started.
- Many, many aspects of bot operation can be controlled at a very low level
- Event-driven operation allows a high level of customization
- i18n compliant (English & German translations available)

*Command Center*
- Add new chat commands by passing parameters
- Built-in, customizable chat cooldown with global and individual settings
- Commands are versatile and support aliases, shortcuts, plain text commands, and complex function-driven commands
- Commands can be added directly inside modules
- Built-in safe moderation helper
- Moderation helper can be customized to notify moderators of abuse (eg. spamming commands) or instructed to perform timeouts/bans without human approval
- Several commands built in to internal modules, pre-loaded
- Abilty to enable and disable any command programmatically, through chat commands, and manually, through the options object
- Override permissions for internal "default" commands

*Self-Documenting*
- Built-in `!helpfile` command that documents all commands, both internal and custom and produces documents for every permission level. Documents formatted for Discord Markdown.

*Block List*
- prevent users from accessing commands permanently
- prevent bots from cross-talking and/or participating in chat games

*Message Queue*
- Uses configurable limits for how quickly the bot can message chat.
- Manual override built-in to messaging system to allow exceptions.
- Messaging includes many configurable options include action messages, announcements, callbacks for after the message has beent sent, and skipping the message queue, entirely.

*Timer*
- Tracks live status of your stream, according to settings and/or chat commands.
- Fires an event that modules and direct code can monitor and react to.
- Supports custom events that are fired by the implementation, programmatically

*User Tracker*
- Tracks how often users send chat messages
- Tracks active/inactive users based on customizable cooldowns (last typed in chat)
- Provides a service to pick random users from either the active pool or all users that have participated in chat

*Loyalty Points/Chat Currency*
- Currently support StreamElements, to allow custom games to award loyalty points for chat activities, games, etc.
- Looking to add support for both StreamLabs and custom, internal currency systems

*Database*
- Built-in support for both MySQL and JSON file-based databases
- Tracks streams live status, detects and reacts to crashes and prevents the bot from "starting over" if timers are in use

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