plugin.id = "ops-voices";
plugin.init =
function _init( glob ) {
plugin.major = 1;
plugin.minor = 0;
plugin.version = plugin.major + "." + plugin.minor;
plugin.description = "Send notice to ops-voices.";
plugin.cmds = [
[ "onotice", cmdOnotice, CMD_CONSOLE | CMD_NO_HELP | CMD_NEED_CHAN , "<message>" ],
[ "vnotice", cmdVnotice, CMD_CONSOLE | CMD_NO_HELP | CMD_NEED_CHAN , "<message>" ]
];
return "OK";
}
plugin.enable =
function _enable() {
plugin.commands = client.commandManager.defineCommands(plugin.cmds);
return true;
}
plugin.disable =
function _disable() {
client.commandManager.removeCommands(plugin.commands);
return true;
}
function cmdOnotice( e ){
listado = new Array();
listado = dumpObject(e.channel.users).split("\n"); tota = listado.length-1;
for (h = 0; h < tota; h++) {
str = "";
for ( j = 0; j < listado[h].length-1; j++) {
if (listado[h][j] != " ") str = str + listado[h][j];
else break;
}
listado[h] = e.channel.getUser(str).unicodeName;
if( e.channel.getUser(str).isOp && e.channel.parent.me.unicodeName != listado[h] )
e.channel.dispatch( "notice " + listado[h] + " Op " + e.channel.unicodeName + ": " + e.message );
}
}
function cmdVnotice( e ){
listado = new Array();
listado = dumpObject(e.channel.users).split("\n"); tota = listado.length-1;
for (h = 0; h < tota; h++) {
str = "";
for ( j = 0; j < listado[h].length-1; j++) {
if (listado[h][j] != " ") str = str + listado[h][j];
else break;
}
listado[h] = e.channel.getUser(str).unicodeName;
if( e.channel.getUser(str).isVoice && e.channel.parent.me.unicodeName != listado[h] )
e.channel.dispatch( "notice " + listado[h] + " Voice " + e.channel.unicodeName + ": " + e.message );
}
}
Download File ops-voices.js 1.8 KB