Browse Source

Add a customizable ty message to new subscribers.

doobs
Brandon Cornejo 11 years ago
parent
commit
7f84716b59
  1. 9
      lib/currency.js
  2. 3
      lib/initialize.js

9
lib/currency.js

@ -152,6 +152,9 @@ function Currency(irc, db, commands, options) {
// commands add/rem settings // commands add/rem settings
__self.command_add_string = options.add_command || 'addcmd'; __self.command_add_string = options.add_command || 'addcmd';
__self.command_remove_string = options.remove_command || 'removecmd'; __self.command_remove_string = options.remove_command || 'removecmd';
// message to new subscribers
__self.sub_ty_msg = options.sub_ty_msg || '';
} }
//-------- Methods --------- //-------- Methods ---------
@ -907,6 +910,12 @@ Currency.prototype.handout_coins = function () {
console.log("[*ADD NAME*] "+viewer+" from CHAT"); console.log("[*ADD NAME*] "+viewer+" from CHAT");
} }
// is this a new subscription notice?
if(viewer == 'twitchnotify') {
var subscriber = data_split[5].slice(1);
__self.irc.emit('message', {message:'> SUBHYPE: Thank you ' + subscriber + '. ' + __self.sub_ty_msg});
}
// log chat if enabled // log chat if enabled
if (__self.irc.store_chat && __self.config.ignorelist.indexOf(viewer) < 0) { if (__self.irc.store_chat && __self.config.ignorelist.indexOf(viewer) < 0) {
file.exists(__self.irc.chat_log, function (exists) { file.exists(__self.irc.chat_log, function (exists) {

3
lib/initialize.js

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

Loading…
Cancel
Save