Browse Source

Clean up.

master
Brandon Cornejo 11 years ago
parent
commit
6b1a8b893c
  1. 28
      lib/currency.js
  2. 1
      lib/initialize.js

28
lib/currency.js

@ -74,7 +74,6 @@ function Currency(irc, db, options) {
__self.config.subscribers_json = options.subscribers || '';
__self.config.website = options.website || '';
__self.config.modpowers = options.modpowers || false;
__self.config.chatterbonus = options.chatterbonus || false;
__self.config.ignorelist = options.ignorelist || ['jtv'];
// general settings
@ -110,7 +109,6 @@ function Currency(irc, db, options) {
__self.give_coins_timer = options.payrate || 30;//minutes
__self.subscriber_check = 4;//minutes
__self.subscribers = [];
__self.active_list = [];
// raffle settings
__self.raffle_status = false;
@ -155,26 +153,6 @@ Currency.prototype.commands = function (data) {
// broadcaster only commands
if (broadcaster_bot_initiated || (__self.config.modpowers && moderator_initiated)) {
//toggle chatter bonus
if (data[4] == 'chatterbonus') {
switch (data[5]) {
case 'on':
__self.config.chatterbonus = true;
__self.irc.emit('message', {message:__self.pre_text + 'Chatter bonus is on! Earn extra potatoes by being active in the chat.'});
break;
case 'off':
__self.config.chatterbonus = false;
__self.irc.emit('message', {message:__self.pre_text + 'Chatterbonus is now off. Potato deflation!'});
break;
case 'status':
if(!__self.config.chatterbonus) {
__self.irc.emit('message', {message:__self.pre_text + 'Chatterbonus is: Off'});
} else {
__self.irc.emit('message', {message:__self.pre_text + 'Chatterbonus is: On'});
}
break;
}
}
//open / close auction system
if (data[4] === 'auction') {
switch (data[5]) {
@ -745,9 +723,6 @@ Currency.prototype.handout_coins = function () {
var sql = '';
for (var i = 0; i < __self.viewer_list.length; i++) {
var currency_amount = __self.subscribers.indexOf(__self.viewer_list[i]) >= 0 ? 2 : 1;
if (__self.config.chatterbonus){
if(active_list.indexOf(__self.viewer_list[i])) currency_amount++;
}
if (__self.viewer_list[i] !== '') {
if (i != __self.viewer_list.length - 1) {
sql += 'INSERT INTO viewers (user, points) ';
@ -824,9 +799,6 @@ Currency.prototype.handout_coins = function () {
__self.viewer_list.push(viewer);
console.log("[*ADD NAME*] "+viewer+" from CHAT");
}
if (__self.active_list.indexOf(viewer) < 0) {
__self.active_list.push(viewer);
}
}
});

1
lib/initialize.js

@ -36,7 +36,6 @@ exports.initialize = function(options) {
subscribers : config.twitch.subscribers,
website : config.currency.website,
modpowers : config.currency.modpowers,
chatterbonus: config.currency.chatterbonus,
ignorelist : config.ignorelist
});
web = require('./web.js')(db, {

Loading…
Cancel
Save