3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

glee protection

This commit is contained in:
Luke Slater 2011-11-10 13:14:50 +00:00
parent d60038a852
commit 5b1fce5767
2 changed files with 12 additions and 2 deletions

View File

@ -9,7 +9,12 @@ var quotes = function(dbot) {
if(q) { if(q) {
key = q[1].trim().toLowerCase(); key = q[1].trim().toLowerCase();
if(quotes.hasOwnProperty(key)) { if(quotes.hasOwnProperty(key)) {
dbot.say(data.channel, key + ': ' + quotes[key].random()); var output = quotes[key].random();
if(output == "glee") {
dbot.instance.send('KICK ' + data.channel + ' ' + data.user + ' :glee off dickhead');
} else {
dbot.say(data.channel, key + ': ' + output);
}
} else { } else {
dbot.say(data.channel, 'Nobody loves ' + key); dbot.say(data.channel, 'Nobody loves ' + key);
} }

7
run.js
View File

@ -102,7 +102,12 @@ DBot.prototype.reloadModules = function() {
if(q) { if(q) {
key = q[1].trim().toLowerCase(); key = q[1].trim().toLowerCase();
if(this.db.quoteArrs.hasOwnProperty(key)) { if(this.db.quoteArrs.hasOwnProperty(key)) {
this.say(data.channel, key + ': ' + this.db.quoteArrs[key].random()); var output = this.db.quoteArrs[key].random();
if(output == "glee") {
dbot.instance.send('KICK ' + data.channel + ' ' + data.user + ' :glee off dickhead');
} else {
this.say(data.channel, key + ': ' + output);
}
} else { } else {
this.say(data.channel, 'Nobody loves ' + key); this.say(data.channel, 'Nobody loves ' + key);
} }