Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Commit

Permalink
Actaully fix config saving issue. Also remove extra stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
AKPWebDesign committed Jul 19, 2016
1 parent e0acf3c commit 91f2bc0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ IRCJoinMsg.prototype.setMessage = function (ctx) {
}
confChan.msg = msg;
confChan.excludeNicks = [];
this._AKP48.saveConfig(this._config, 'irc-join-msg');
this._AKP48.saveConfig(this._config, 'IRCJoinMsg');
return ctx.reply(`Join message for ${chan} has been set to "${msg}"`);
};

Expand All @@ -102,7 +102,7 @@ IRCJoinMsg.prototype.clearMessage = function (ctx) {
if(this._config.channels[`${id}:${chan}`]) {
delete this._config.channels[`${id}:${chan}`];
}
this._AKP48.saveConfig(this._config, 'irc-join-msg');
this._AKP48.saveConfig(this._config, 'IRCJoinMsg');
return ctx.reply(`Join message for ${chan} has been cleared.`);
};

Expand Down Expand Up @@ -144,7 +144,7 @@ IRCJoinMsg.prototype.exclude = function (ctx) {
confChan.excludeNicks.push(nicks[i].toLowerCase());
}

this._AKP48.saveConfig(this._config, 'irc-join-msg');
this._AKP48.saveConfig(this._config, 'IRCJoinMsg');

var has = (nicks.length === 1) ? 'has' : 'have';
return ctx.reply(`${nicks.join(', ')} ${has} been added to the exclude list for ${chan}.`);
Expand Down Expand Up @@ -183,7 +183,7 @@ IRCJoinMsg.prototype.include = function (ctx) {
removedNicks.push(nicks[i]);
}

this._AKP48.saveConfig(this._config, 'irc-join-msg');
this._AKP48.saveConfig(this._config, 'IRCJoinMsg');

var extra = false;
if(removedNicks.length === 0) {removedNicks = ['nobody']; extra = true;}
Expand All @@ -193,5 +193,3 @@ IRCJoinMsg.prototype.include = function (ctx) {
};

module.exports = IRCJoinMsg;
module.exports.type = 'MessageHandler';
module.exports.pluginName = 'irc-join-msg';

0 comments on commit 91f2bc0

Please sign in to comment.