3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

removed badwords module

This commit is contained in:
Luke Slater 2012-05-23 19:39:10 +01:00
parent 464e0f11e3
commit 9a9f9a662b

View File

@ -1,56 +0,0 @@
// Find which badwords are currently enacted in the current channel
var badwords = function(dbot) {
var name = 'badwords';
var dbot = dbot;
var badWordLock = false;
var commands = {
'~badwords': function(data, params) {
if(badWordLock == true) {
dbot.say('reality', 'Another badwords query is in action. Try again in a few seconds.');
} else {
data.channel = '#42';
badWordLock = true;
dbot.sessionData.badwords.waiting = true;
dbot.say('bots', 'badwords ' + data.channel + ' list');
dbot.instance.addListener('PRIVMSG',
dbot.sessionData.badwords = {};
badWordLock = false;
}
}
};
return {
'onLoad': function() {
if(!dbot.sessionData.hasOwnProperty('badwords')) {
dbot.sessionData.badwords = {};
}
return commands;
},
'listener': function(data) {
if(data.channel === 'bots') {
if(data.message.indexOf('bad words list is empty') != -1) {
dbot.sessionData.badwords.count = 0;
dbot.sessionData.badwords.finished = true;
} else {
var wordMatch = data.message.valMatch(/\w([1-10])\w(.*)/, 2);
dbot.say('reality', wordMatch[1]);
}
}
},
'on': 'PRIVMSG',
'name': name,
'ignorable': true
};
};
exports.fetch = function(dbot) {
return badwords(dbot);
};