mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
Use jsbot ignore instead of having it build into the modules
This commit is contained in:
parent
4c72bd327c
commit
5677cad1fa
@ -11,8 +11,6 @@ var autoshorten = function(dbot) {
|
||||
|
||||
return {
|
||||
'listener': function(event) {
|
||||
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
||||
dbot.db.ignores[event.user].include(name)) == false) {
|
||||
var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
|
||||
var urlMatches = event.message.match(urlRegex);
|
||||
|
||||
@ -33,7 +31,6 @@ var autoshorten = function(dbot) {
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'on': 'PRIVMSG',
|
||||
|
@ -5,9 +5,6 @@ var puns = function(dbot) {
|
||||
return {
|
||||
'listener': function(event) {
|
||||
event.user = dbot.cleanNick(event.user);
|
||||
|
||||
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
||||
dbot.db.ignores[event.user].include(name)) == false) {
|
||||
if(dbot.moduleNames.include('quotes') &&
|
||||
dbot.db.quoteArrs.hasOwnProperty(event.user)) {
|
||||
event.message = '~q ' + event.user;
|
||||
@ -15,7 +12,6 @@ var puns = function(dbot) {
|
||||
event.params = event.message.split(' ');
|
||||
dbot.instance.emit(event)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'on': 'JOIN',
|
||||
|
@ -39,8 +39,6 @@ var spelling = function(dbot) {
|
||||
|
||||
return {
|
||||
'listener': function(event) {
|
||||
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
||||
dbot.db.ignores[event.user].include(name)) == false) {
|
||||
var q = event.message.valMatch(/^(?:\*\*?([\d\w\s']*)|([\d\w\s']*)\*\*?)$/, 3);
|
||||
var otherQ = event.message.valMatch(/^([\d\w\s]*): (?:\*\*?([\d\w\s']*)|([\d\w\s']*)\*\*?)$/, 4);
|
||||
if(q) {
|
||||
@ -59,7 +57,6 @@ var spelling = function(dbot) {
|
||||
last[event.channel][event.user] = event.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'on': 'PRIVMSG',
|
||||
|
@ -3,14 +3,11 @@ var youAre = function(dbot) {
|
||||
|
||||
return {
|
||||
'listener': function(event) {
|
||||
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
||||
dbot.db.ignores[event.user].include(name)) == false) {
|
||||
var key = event.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
|
||||
|
||||
if(key && key[2] != "" && Number.prototype.chanceIn(1, 100) && event.user != 'aisbot') {
|
||||
event.reply(event.user + ': You\'re ' + key[2] + '.');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'on': 'PRIVMSG',
|
||||
|
2
run.js
2
run.js
@ -53,7 +53,7 @@ var DBot = function(timers) {
|
||||
// Populate bot properties with config data
|
||||
this.name = this.config.name || 'dbox';
|
||||
this.admin = this.config.admin || [ 'reality' ];
|
||||
this.moduleNames = this.config.modules || [ 'admin', 'command', 'dice', 'js', 'kick', 'puns', 'quotes', 'spelling', 'youare' ];
|
||||
this.moduleNames = this.config.modules || [ 'ignore', 'admin', 'command', 'dice', 'js', 'kick', 'puns', 'quotes', 'spelling', 'youare' ];
|
||||
this.language = this.config.language || 'english';
|
||||
|
||||
// It's the user's responsibility to fill this data structure up properly in
|
||||
|
Loading…
Reference in New Issue
Block a user