This commit is contained in:
Luke Slater 2014-10-03 20:45:51 +00:00
commit 9ed4c582e2
4 changed files with 62 additions and 43 deletions

View File

@ -76,6 +76,7 @@ var atheme = function(dbot) {
this.commands['~chanmode'].regex = [/^chanmode (\+.)/, 2]; this.commands['~chanmode'].regex = [/^chanmode (\+.)/, 2];
this.listener = function(event) { this.listener = function(event) {
if(event.action === 'NOTICE') {
if(event.user === 'ChanServ') { if(event.user === 'ChanServ') {
var flags = event.params.match(/(\d+)\s+([^ ]+)\s+(\+\w+)\s+\((\#[\w\.]+)\)/), var flags = event.params.match(/(\d+)\s+([^ ]+)\s+(\+\w+)\s+\((\#[\w\.]+)\)/),
end = event.params.match(/end of \u0002(\#[\w\.]+)\u0002 flags listing/i); end = event.params.match(/end of \u0002(\#[\w\.]+)\u0002 flags listing/i);
@ -102,9 +103,12 @@ var atheme = function(dbot) {
}); });
done(); done();
}); });
done();
});
}.bind(this), function() {
_.each(this.flagStack[event.server][end[1]].callbacks, function(callback) {
callback(null, this.flagStack[event.server][end[1]].flags);
}.bind(this), function() { }.bind(this), function() {
console.log('DONE');
console.log(allFlags);
_.each(this.flagStack[event.server][end[1]].callbacks, function(callback) { _.each(this.flagStack[event.server][end[1]].callbacks, function(callback) {
callback(null, this.flagStack[event.server][end[1]].flags); callback(null, this.flagStack[event.server][end[1]].flags);
}.bind(this)); }.bind(this));
@ -129,8 +133,19 @@ console.log(allFlags);
} }
}, this); }, this);
} }
} else { // PRIVMSG
var akill = event.message.match(/([^ ]+) AKILL:ADD: ([^ ]+) \(reason: (.+)(\) )\(duration: ([^,)]+)/);
if(event.channel === '#services' && akill) {
var channel = dbot.config.servers[server].admin_channel;
dbot.api.report.notify('ban', 'tripsit', akill[1], channel, dbot.t('akill', {
'host': akill[2],
'reason': akill[3],
'duration': akill[4]
}));
}
}
}.bind(this); }.bind(this);
this.on = 'NOTICE'; this.on = ['NOTICE', 'PRIVMSG'];
}; };
exports.fetch = function(dbot) { exports.fetch = function(dbot) {

View File

@ -1,5 +1,5 @@
{ {
"stream": "http://tripsit.fm:8000", "stream": "http://radio.tripsit.me:8000/tripradio",
"announce": [ { "server": "tripsit", "name": "#tripbot" } ], "announce": [ { "server": "tripsit", "name": "#drugs" } ],
"outputPrefix": "\u00033radio\u000f" "outputPrefix": "\u00033radio\u000f"
} }

View File

@ -35,11 +35,14 @@ var api = function(dbot) {
return k; return k;
} }
}.bind(this)); }.bind(this));
ops = _.without(ops, undefined);
console.log(ops);
this.db.read('nunsubs', cName + '.' + server, function(err, nunsubs) { this.db.read('nunsubs', cName + '.' + server, function(err, nunsubs) {
if(nunsubs) { if(nunsubs) {
_.each(nunsubs.users, function(user) { _.each(nunsubs.users, function(user) {
var uPart = user.split('.')[0]; var uPart = user.split('.')[0];
if(_.include(ops, uPart)) { if(_.include(ops, uPart)) {
console.log('removing ' + uPart);
ops = _.without(ops, uPart); ops = _.without(ops, uPart);
} }
}); });

View File

@ -10,6 +10,7 @@ var report = function(dbot) {
this.internalAPI = { this.internalAPI = {
'notify': function(server, users, message) { 'notify': function(server, users, message) {
async.eachSeries(users, function(nick, next) { async.eachSeries(users, function(nick, next) {
console.log('sending msg to ' + nick);
setTimeout(function() { setTimeout(function() {
dbot.say(server, nick, message); dbot.say(server, nick, message);
next(); next();