this rather than dbot

This commit is contained in:
Luke Slater 2012-02-15 20:34:01 +00:00
parent 84558f13d5
commit e1047362a2

4
run.js
View File

@ -111,7 +111,7 @@ DBot.prototype.reloadModules = function() {
// See if it's similar to anything // See if it's similar to anything
var winnerDistance = Infinity; var winnerDistance = Infinity;
var winner = false; var winner = false;
for(var commandName in dbot.commands) { for(var commandName in this.commands) {
var distance = String.prototype.distance(params[0], commandName); var distance = String.prototype.distance(params[0], commandName);
if(distance < winnerDistance) { if(distance < winnerDistance) {
winner = commandName; winner = commandName;
@ -120,7 +120,7 @@ DBot.prototype.reloadModules = function() {
} }
if(winnerDistance < 3) { if(winnerDistance < 3) {
dbot.say(data.channel, 'Did you mean ' + winner + '? Learn to type, hippie!'); this.say(data.channel, 'Did you mean ' + winner + '? Learn to type, hippie!');
} else { // See if there's anything in quotes } else { // See if there's anything in quotes
var q = data.message.valMatch(/^~([\d\w\s-]*)/, 2); var q = data.message.valMatch(/^~([\d\w\s-]*)/, 2);
if(q) { if(q) {