forked from GitHub/dbot
**
This commit is contained in:
parent
8a959a62b8
commit
e0dee27658
@ -1,17 +0,0 @@
|
|||||||
var getAJob = function(dbot) {
|
|
||||||
var dbot = dbot;
|
|
||||||
|
|
||||||
return {
|
|
||||||
'listener': function(data) {
|
|
||||||
if(Number.prototype.chanceIn(1, 50)) {
|
|
||||||
dbot.say(data.channel, data.user + ': Get a job!');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
'on': 'PRIVMSG'
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.fetch = function(dbot) {
|
|
||||||
return getAJob(dbot);
|
|
||||||
};
|
|
@ -4,7 +4,7 @@ var spelling = function(dbot) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'listener': function(data, params) {
|
'listener': function(data, params) {
|
||||||
var q = data.message.valMatch(/^\*([\d\w\s]*)/, 2);
|
var q = data.message.valMatch(/^(\*|\*\*)([\d\w\s]*)/, 3);
|
||||||
if(q) {
|
if(q) {
|
||||||
var correction = q[1];
|
var correction = q[1];
|
||||||
var candidates = last[data.channel][data.user].split(' ');
|
var candidates = last[data.channel][data.user].split(' ');
|
||||||
@ -19,8 +19,6 @@ var spelling = function(dbot) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(winner + ' ' + winnerDistance);
|
|
||||||
|
|
||||||
if(winnerDistance < 3) {
|
if(winnerDistance < 3) {
|
||||||
if(winner !== correction) {
|
if(winner !== correction) {
|
||||||
var fix = last[data.channel][data.user].replace(winner, correction);
|
var fix = last[data.channel][data.user].replace(winner, correction);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
var youAre = function(dbot) {
|
var youAre = function(dbot) {
|
||||||
var dbot = dbot;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'listener': function(data) {
|
'listener': function(data) {
|
||||||
var key = data.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
|
var key = data.message.valMatch(/(\bis\b|\bare\b)\s+([\w\s\d]*?)(\s+)?(,|\.|\band\b|$)/, 5);
|
||||||
|
11
run.js
11
run.js
@ -6,17 +6,20 @@ require('./snippets');
|
|||||||
var modules = ['spelling', 'web', 'modehate', 'user', 'admin', 'puns', 'kick', 'karma', 'youare', 'quotes'];
|
var modules = ['spelling', 'web', 'modehate', 'user', 'admin', 'puns', 'kick', 'karma', 'youare', 'quotes'];
|
||||||
|
|
||||||
var DBot = function(dModules, timers) {
|
var DBot = function(dModules, timers) {
|
||||||
this.admin = 'reality';
|
this.config = fs.readFileSync('conf.json', 'utf-8');
|
||||||
this.waitingForKarma = false;
|
|
||||||
this.name = 'depressionbot';
|
this.admin = this.config.admin;
|
||||||
|
this.name = this.config.username;
|
||||||
|
|
||||||
this.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
this.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
||||||
this.timers = timers.create();
|
this.timers = timers.create();
|
||||||
|
|
||||||
|
this.waitingForKarma = false;
|
||||||
|
|
||||||
this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {
|
this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {
|
||||||
this.instance.join('#42');
|
this.instance.join('#42');
|
||||||
this.instance.join('#not42');
|
this.instance.join('#not42');
|
||||||
this.instance.join('#itonlygetsworse');
|
this.instance.join('#itonlygetsworse');
|
||||||
|
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.moduleNames = dModules;
|
this.moduleNames = dModules;
|
||||||
|
Loading…
Reference in New Issue
Block a user