Twitch chat-bot written in Typescript.
Command | Description | Required Permission |
---|---|---|
!debug printlog | Print the chat-log. | Streamer or Mod |
!debug clear | Clear the chat-log. | Streamer or Mod |
!debug printconfig | Print the config. | Streamer or Mod |
!debug banbots | Ban bots specified in ./config/twitch_bots.txt . |
Streamer or Mod |
!nuke <word> <minutes> | Ban users who used a specified word in the specified number of minutes. | Streamer or Mod |
This bot only stores the last hour of chat-logs.
Requires: Node JS
- Open a terminal in the bot's path.
- Run the following command:
npm install
- Create
.env
in your bot's path. - Configure the bot.
- Run using the desired Run Command(s):
Run Command | Description |
---|---|
npm start | Compile and Run Bot |
npm run compile | Compile |
npm run bot | Run without Compiling |
npm run dev | Compile and Run Bot |
npm run dev-host | Compile and Run Bot and Run Webserver |
npm run host | Run Bot and Run Webserver without Compiling |
./config/blacklisted_phrases.txt
- Line separated phrases to blacklist.
./config/whitelisted_symbols.txt
- No separator needed, symbols to whitelist.
./config/twitch_bots.txt
- Line separated usernames to ban.
Navigate to the root folder of the project, and create a file called .env
Inside this file, insert the following:
bot_username = "my_bot_username"
bot_oauth_token = "oauth_token_no_prefix"
channels = "channel1 channel2 channel3"
Next, replace and populate the placeholder values.
Note:
- The OAuth Token does not need the
oauth:
prefix. - The channels list should be space separated.
- Navigate to
./src/commands/
- Create a Typescript file
command.ts
- Implement the
ICommand
interface:
import tmi = require('tmi.js');
export class command implements ICommand {
name: string = "command";
hasPermission(channel: string, tags: tmi.ChatUserstate): boolean {
return true;
}
run(channel: string, tags: tmi.ChatUserstate, message: string, commandArgs: string[]): void {
console.log(tags.username + " used the new command!");
}
}
- Register the command in the command registry:
./src/commandRegistry.ts
import { command } from "./commands/command";
...
registerCommand(new command());
- Done! Your command is now registered.
ITS_CHAD_BOT is licensed under the MIT License. Dependencies are under their respective licenses.