3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 03:33:07 +01:00

Fixed some regex, fixed the admin module etc. Small changes.

This commit is contained in:
Luke Slater 2011-08-25 13:32:54 +01:00
parent c5c37334f1
commit 98e66a3086
3 changed files with 5 additions and 8 deletions

View File

@ -10,7 +10,7 @@ var adminCommands = function(dbot) {
},
'part': function(data, params) {
dbot.part(params[1]);
dbot.instance.part(params[1]);
},
'reload': function(data, params) {
@ -34,7 +34,7 @@ var adminCommands = function(dbot) {
'unload': function(data, params) {
console.log(dbot.moduleNames);
if(dbot.moduleNames.include(params[1])) {
dbot.moduleNames[params[1]] = undefined;
dbot.moduleNames[params[1]] = null;
dbot.reloadModules();
dbot.say(data.channel, 'Turned off module: ' + params[1]);
} else {

View File

@ -4,9 +4,9 @@ var reality = function(dbot) {
return {
'listener': function(data, params) {
if(data.user == 'reality') {
var once = data.message.match(/^I ([\d\w\s,]* once)/);
var once = data.message.match(/^I ([\d\w\s,'-]* once)/);
} else {
var once = data.message.match(/^reality ([\d\w\s,]* once)/);
var once = data.message.match(/^reality ([\d\w\s,'-]* once)/);
}
if(once != null) {

5
run.js
View File

@ -14,15 +14,12 @@ var DBot = function(dModules, quotes) {
this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {
this.instance.join('#realitest');
this.instance.join('#42');
this.instance.join('#fail');
this.instance.join('#itonlygetsworse');
}.bind(this));
this.moduleNames = dModules;
this.rawModules = [];
this.modules = [];
this.reloadModules();
this.instance.connect();
};