mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 03:33:07 +01:00
fixed kick
This commit is contained in:
parent
df4c7a0e24
commit
013908d6b2
9
admin.js
9
admin.js
@ -4,22 +4,21 @@ var adminCommands = function(dbot) {
|
||||
var commands = {
|
||||
'join': function(data, params) {
|
||||
dbot.join(params[1]);
|
||||
dbot.say(admin, 'Joined ' + params[1]);
|
||||
dbot.say(dbot.admin, 'Joined ' + params[1]);
|
||||
},
|
||||
|
||||
'part': function(data, params) {
|
||||
dbot.part(params[1]);
|
||||
dbot.say(admin);
|
||||
},
|
||||
|
||||
'reload': function(data, params) {
|
||||
dbot.say(admin, 'Reloading DB.');
|
||||
dbot.say(dbot.admin, 'Reloading DB.');
|
||||
try {
|
||||
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
||||
} catch(err) {
|
||||
dbot.say(admin, 'DB reload failed.');
|
||||
dbot.say(dbot.admin, 'DB reload failed.');
|
||||
} finally {
|
||||
dbot.say(admin, 'DB Reload successful.');
|
||||
dbot.say(dbot.admin, 'DB Reload successful.');
|
||||
}
|
||||
},
|
||||
|
||||
|
6
kick.js
6
kick.js
@ -1,12 +1,14 @@
|
||||
var kick = function(dbot) {
|
||||
var dbot = dbot;
|
||||
|
||||
return {
|
||||
'listener': function(data) {
|
||||
if(data.kickee == dbot.name) {
|
||||
dbot.instance.join(data.channel); // make interface
|
||||
dbot.instance.join(data.channel); // TODO: make interface
|
||||
dbot.say(data.channel, 'Thou shalt not kick ' + dbot.name);
|
||||
dbot.db.kicks[name] += 1;
|
||||
} else {
|
||||
if(dbot.db.kicks[data.kickee] == undefined) {
|
||||
if(dbot.db.kicks.hasOwnProperty(data.kickee)) {
|
||||
dbot.db.kicks[data.kickee] = 1;
|
||||
} else {
|
||||
dbot.db.kicks[data.kickee] += 1;
|
||||
|
2
puns.js
2
puns.js
@ -7,7 +7,7 @@ var puns = function(dbot) {
|
||||
dbot.say(data.channel, dbot.db.quoteArrs.lamp.random());
|
||||
} else if(data.user == 'reality') {
|
||||
dbot.instance.say(data.channel, dbot.db.realiPuns.random());
|
||||
} else if(instance.inChannel(data.channel)) {
|
||||
} else if(dbot.instance.inChannel(data.channel)) {
|
||||
dbot.instance.say('aisbot', '.karma ' + data.user);
|
||||
dbot.waitingForKarma = data.channel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user