mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
Fix puns by faking an event and calling it straight in jsbot
This commit is contained in:
parent
979399de46
commit
d6b56db06e
@ -4,15 +4,16 @@ var puns = function(dbot) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'listener': function(event) {
|
'listener': function(event) {
|
||||||
event.user = dbot.cleanNick(data.user);
|
event.user = dbot.cleanNick(event.user);
|
||||||
|
|
||||||
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
if((dbot.db.ignores.hasOwnProperty(event.user) &&
|
||||||
dbot.db.ignores[event.user].include(name)) == false) {
|
dbot.db.ignores[event.user].include(name)) == false) {
|
||||||
if(dbot.moduleNames.include('quotes') &&
|
if(dbot.moduleNames.include('quotes') &&
|
||||||
dbot.db.quoteArrs.hasOwnProperty(data.user)) {
|
dbot.db.quoteArrs.hasOwnProperty(event.user)) {
|
||||||
data.message = '~q ' + data.user.toLowerCase();
|
event.message = '~q ' + event.user;
|
||||||
var params = data.message.split(' ');
|
event.action = 'PRIVMSG';
|
||||||
dbot.commands[params[0]](data, params);
|
event.params = event.message.split(' ');
|
||||||
|
dbot.instance.emit(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
2
run.js
2
run.js
@ -53,7 +53,7 @@ var DBot = function(timers) {
|
|||||||
// Populate bot properties with config data
|
// Populate bot properties with config data
|
||||||
this.name = this.config.name || 'dbox';
|
this.name = this.config.name || 'dbox';
|
||||||
this.admin = this.config.admin || [ 'reality' ];
|
this.admin = this.config.admin || [ 'reality' ];
|
||||||
this.moduleNames = this.config.modules || [ 'command', 'js', 'quotes', 'admin' ];
|
this.moduleNames = this.config.modules || [ 'admin', 'command', 'dice', 'js', 'kick', 'puns', 'quotes', 'spelling', 'youare' ];
|
||||||
this.language = this.config.language || 'english';
|
this.language = this.config.language || 'english';
|
||||||
|
|
||||||
// It's the user's responsibility to fill this data structure up properly in
|
// It's the user's responsibility to fill this data structure up properly in
|
||||||
|
Loading…
Reference in New Issue
Block a user