mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
Fixed some regex, fixed the admin module etc. Small changes.
This commit is contained in:
parent
c5c37334f1
commit
98e66a3086
@ -10,7 +10,7 @@ var adminCommands = function(dbot) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'part': function(data, params) {
|
'part': function(data, params) {
|
||||||
dbot.part(params[1]);
|
dbot.instance.part(params[1]);
|
||||||
},
|
},
|
||||||
|
|
||||||
'reload': function(data, params) {
|
'reload': function(data, params) {
|
||||||
@ -34,7 +34,7 @@ var adminCommands = function(dbot) {
|
|||||||
'unload': function(data, params) {
|
'unload': function(data, params) {
|
||||||
console.log(dbot.moduleNames);
|
console.log(dbot.moduleNames);
|
||||||
if(dbot.moduleNames.include(params[1])) {
|
if(dbot.moduleNames.include(params[1])) {
|
||||||
dbot.moduleNames[params[1]] = undefined;
|
dbot.moduleNames[params[1]] = null;
|
||||||
dbot.reloadModules();
|
dbot.reloadModules();
|
||||||
dbot.say(data.channel, 'Turned off module: ' + params[1]);
|
dbot.say(data.channel, 'Turned off module: ' + params[1]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,9 +4,9 @@ var reality = function(dbot) {
|
|||||||
return {
|
return {
|
||||||
'listener': function(data, params) {
|
'listener': function(data, params) {
|
||||||
if(data.user == 'reality') {
|
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 {
|
} else {
|
||||||
var once = data.message.match(/^reality ([\d\w\s,]* once)/);
|
var once = data.message.match(/^reality ([\d\w\s,'-]* once)/);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(once != null) {
|
if(once != null) {
|
||||||
|
5
run.js
5
run.js
@ -14,15 +14,12 @@ var DBot = function(dModules, quotes) {
|
|||||||
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('#realitest');
|
this.instance.join('#realitest');
|
||||||
this.instance.join('#42');
|
this.instance.join('#42');
|
||||||
|
this.instance.join('#fail');
|
||||||
this.instance.join('#itonlygetsworse');
|
this.instance.join('#itonlygetsworse');
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.moduleNames = dModules;
|
this.moduleNames = dModules;
|
||||||
this.rawModules = [];
|
|
||||||
this.modules = [];
|
|
||||||
|
|
||||||
this.reloadModules();
|
this.reloadModules();
|
||||||
|
|
||||||
this.instance.connect();
|
this.instance.connect();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user