node-twitchbot
Note: This package is not to be used for Twitch botting (inflating live viewer counts) and should only be used for chatbots. Attempting to 'bot' a Twitch channel can lead to your account being permanently banned.
Installation
$ npm install node-twitchbot
Example
const Bot = require('node-twitchbot')
Bot.run({
username: 'bot_username',
oauth: 'oauth:twitch_oauth_key',
channel: 'channel'
})
Bot.listenFor('Kappa', (err, chatter) => {
if(err) {
console.log(err)
} else {
console.log(chatter)
}
})
Bot.listenFor('*', (err, chatter) {
})
Bot.listen('PogChamp', (err, chatter) => {
console.log(chatter)
})
Bot.resub((err, chatter, sub) => {
console.log(sub)
})
Bot.msg(message)
Chatter : user object
{
user: 'KRITZWARE',
msg: 'Hello chat! Keepo',
channel: 'kritzware',
user_id: '44667418'
level: 'mod',
sub: '0',
turbo: '0'
}