2011-08-22 20:24:23 +02:00
|
|
|
var reality = function(dbot) {
|
|
|
|
var dbot = dbot;
|
|
|
|
|
|
|
|
return {
|
|
|
|
'listener': function(data, params) {
|
|
|
|
if(data.user == 'reality') {
|
2011-08-25 14:32:54 +02:00
|
|
|
var once = data.message.match(/^I ([\d\w\s,'-]* once)/);
|
2011-08-24 19:23:00 +02:00
|
|
|
} else {
|
2011-08-25 14:32:54 +02:00
|
|
|
var once = data.message.match(/^reality ([\d\w\s,'-]* once)/);
|
2011-08-24 19:23:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(once != null) {
|
|
|
|
dbot.db.realiPuns.push('reality ' + once[1] + '.');
|
|
|
|
dbot.instance.say(data.channel, '\'reality ' + once[1] + '.\' saved.');
|
|
|
|
dbot.save();
|
2011-08-22 20:24:23 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
'on': 'PRIVMSG'
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.fetch = function(dbot) {
|
|
|
|
return reality(dbot);
|
|
|
|
}
|