|
7 years ago | |
---|---|---|
lib | 7 years ago | |
node_modules | 7 years ago | |
users | 7 years ago | |
web | 7 years ago | |
.gitattributes | 7 years ago | |
.gitignore | 7 years ago | |
Commands.md | 7 years ago | |
README.md | 7 years ago |
A TwitchTV viewer reward system
Written in JavaScript and Node
LoyaltyBot is a chat bot that allows you to reward viewers with loyalty points for hanging out on your stream. It's main purpose is to allow you, the broadcaster, to reward the viewers that are dedicated to watching your stream as opposed to the viewers that just stop by for a quick giveaway and leave.
####Features
####Extras
####Future Features/Extras
example.js
var loyaltybot = require('./../lib/initialize.js');
loyaltybot.initialize({
// twitch info
twitch : {
channel : 'loyalty',
bot : {name: 'LoyaltyBot', password: 'loyalty!loyalty!loyalty!'},
subscribers : 'https://spreadsheets.google.com/feeds/list/****/od6/public/basic?alt=json'
},
// currency info
currency : {
name : 'Points',
payrate : 15,
host : '127.0.0.1',
user : 'mysql_user',
password : 'mysql_password',
database : 'mysql_database',
website : 'http://www.loyaltypoints.com'
},
// optional features
commands: true
});
Twitch
channel
: the channel name (in lower case)bot.name
: the account name of the botbot.password
: the password for the botsubscribers
: a google doc that contains subscriber names (more info on this later)Currency
name
: custom name for the loyalty pointspayrate
: how often to hand out loyalty points (in minutes)host
: mysql database hostname/ipuser
: username for the mysql databasepassword
: password for the mysql databasedatabase
: mysql database namewebsite
: provides loyalty bot with an offsite location for checking currency. can also be and be an empty string
Optional
commands
: enable/disable the ability to use moderator commands. boolean: accepts true
or false
####Create a new bot account
In order to use LoyaltyBot's features you will need to create a new TwitchTV Account. You can name it anything
you wish, all you need to do is pass the username/password to bot.name
and bot.password
####Create the subscriber/loyal viewer list on Google Docs
Since TwitchTV does not have subscriber information in their api, LoyaltyBot needs a way to obtain that information. That's where Google Docs comes in.
In the following order:
Side Notes:
Figure 1:
Figure 2:
####Setting up MySQL tables
LoyaltyBot stores all of the viewer info and moderator commands in a MySQL database and requires specifc table/field names.
LoyaltyBot takes care of all table creation, however if by some chance you need to manually setup the tables the following contains information about them:
Viewer
viewers
user
[primary key, not null, varchar], points
[not null, integer]Commands
commands
id
[primary key, autoincrement, not null, integer], command
[not null, text], text
[not null, longtext], auth
[default: 1, integer]ArcherBot - Chiffre2435
CookieMonsterBot - Minerva_dh
InternetBot - Izlsnizzt
KarmaBot - itsfabiotime
Knowledge_Bot - Illicitmedia
XBucksBot - Linexnick
If you're using LoyaltyBot send me a twitch message so I can add you to this list!