sysmsgs as notice test

This commit is contained in:
Flummi 2017-01-11 00:45:54 +01:00
parent ff9a170988
commit 14466270fb

View File

@ -17,7 +17,7 @@ module.exports = (lib) => {
case "reset":
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 => {
e.reply("trigger resetted");
e.replyNotice("trigger resetted");
});
break;
default:
@ -26,21 +26,21 @@ module.exports = (lib) => {
if(triggerexists(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 => {
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
e.reply("trigger "+trigger+" not found D:");
e.replyNotice("trigger "+trigger+" not found D:");
}
break;
}
}
else {
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])
output += lib.bot.format.get(lib.cfg.trigger[e.network+e.channel][key]?'green':'red')+" "+key;
e.reply(output);
e.replyNotice(output);
}
},
desc: 'muh'