2014-07-02 22:00:11 +00:00
|
|
|
module.exports = function(network, chan, cmd, args) {
|
2014-07-03 22:49:15 +00:00
|
|
|
if (cmd != "mode" && cmd != "op" && cmd != "voice" && cmd != "deop" && cmd != "devoice") {
|
|
|
|
return;
|
|
|
|
} else if (args.length === 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var mode;
|
|
|
|
var user;
|
|
|
|
if (cmd != "mode") {
|
|
|
|
user = args[0];
|
|
|
|
mode = {
|
|
|
|
"op": "+o",
|
|
|
|
"voice": "+v",
|
|
|
|
"deop": "-o",
|
|
|
|
"devoice": "-v"
|
|
|
|
}[cmd];
|
|
|
|
} else if (args.length === 1) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
mode = args[0];
|
|
|
|
user = args[1];
|
|
|
|
}
|
|
|
|
var irc = network.irc;
|
|
|
|
irc.mode(
|
|
|
|
chan.name,
|
|
|
|
mode,
|
|
|
|
user
|
|
|
|
);
|
2014-06-26 23:05:47 +00:00
|
|
|
};
|