WeetBot is yet another chatbot for twitch.tv
- Static commands
- NodeJS based module commands
- Redis commands
- Rate limiting
- Some pre-built command modules
- Sub only and/or Mod only commands
- Command module install manager
$ git clone git@github.com:TimothyCole/WeetBot-Twitch-Chatbot.git
$ cd WeetBot-Twitch-Chatbot
$ npm install
$ cp config.sample.js config.js
$ cp .env.sample .env
$ vim config.js
$ vim .env
Fill out config.js
with your information and commands.
credentials
: (Required | Object)
username
(Required | String)oauth
(Required | String)client_id
(Optional | Required for some modules | String)
channels
: (Required | Array of Strings | Start with #)
commands
: (Required | Array of Objects)
command
(Required | String) - Use * for every messageresponse
(Optional | String) - Use{{ user }}
for usernamemodule
(Optional | String)
$ npm start
Command modules must be ran inside modules/commands/
.
const log = require('../log.js');
log.pass("Green Plus!");
log.warn("Yellow Tilde!");
log.error("Red Hyphen!");
log.critical("Red Exclamation Mark!"); // KILLS PROCESS
Production modules shouldn't use console.log()
Command modules must incude a trigger
export with a data
param that will be called on a command.
data.client
: (Object | tmi.js connecton)
data.channel
: (String)
data.userstate
: (String | Chatter Infomation)
data.message
: (String)
const log = require('../log.js');
const color = require("colors/safe");
var exports = module.exports = {};
exports.trigger = (data) => {
data.client.say(data.channel, `Hey there @${data.userstate.name}!`);
log.pass(`Said ${color.cyan("hello")} to ${color.cyan(data.userstate.name)}.`);
};
{
"command": "!hello",
"module": "example"
}
{
command: "*",
method: "checkCommand",
module: "redis"
},
{
command: "!addcom",
method: "addCommand",
module: "redis"
},
{
command: "!delcom",
method: "removeCommand",
module: "redis"
},
{
command: "!commands",
method: "getCommands",
module: "redis"
}
Required: client_id
{
command: "!uptime",
module: "uptime"
}