Revert "Revert "sysmsgs as notice test""

This reverts commit ad9db1df30
This commit is contained in:
Flummi 2017-01-13 21:50:07 +00:00
parent 73af845e48
commit e658e13d6a

View File

@ -17,7 +17,7 @@ module.exports = (lib) => {
case "reset": case "reset":
lib.cfg.trigger[e.network+e.channel] = lib.genStdTrigger(); lib.cfg.trigger[e.network+e.channel] = lib.genStdTrigger();
lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => { lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => {
e.reply("trigger resetted"); e.replyNotice("trigger resetted");
}); });
break; break;
default: default:
@ -26,21 +26,21 @@ module.exports = (lib) => {
if(triggerexists(trigger)) { if(triggerexists(trigger)) {
lib.cfg.trigger[e.network+e.channel][trigger] = !lib.cfg.trigger[e.network+e.channel][trigger]; lib.cfg.trigger[e.network+e.channel][trigger] = !lib.cfg.trigger[e.network+e.channel][trigger];
lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => { lib.config.write('trigger', e.network+e.channel, lib.cfg.trigger[e.network+e.channel], 'json', cbwc => {
e.reply(!cbwc?"trigger "+ trigger +" in channel "+e.channel.getName() + lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][trigger]?'green':'red')+" "+(lib.cfg.trigger[e.network+e.channel][trigger]?'activated':'deactivated'):cbwc); e.replyNotice(!cbwc?"trigger "+ trigger +" in channel "+e.channel.getName() + lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][trigger]?'green':'red')+" "+(lib.cfg.trigger[e.network+e.channel][trigger]?'activated':'deactivated'):cbwc);
}); });
} }
else else
e.reply("trigger "+trigger+" not found D:"); e.replyNotice("trigger "+trigger+" not found D:");
} }
break; break;
} }
} }
else { else {
var output = ""; var output = "";
e.reply("Trigger in "+e.channel.getName()+" (green: activated, red: deactivated):"); e.replyNotice("Trigger in "+e.channel.getName()+" (green: activated, red: deactivated):");
for(var key in lib.cfg.trigger[e.network+e.channel]) for(var key in lib.cfg.trigger[e.network+e.channel])
output += lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][key]?'green':'red')+" "+key; output += lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][key]?'green':'red')+" "+key;
e.reply(output); e.replyNotice(output);
} }
}, },
desc: 'muh' desc: 'muh'