mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 22:39:26 +01:00
this rather than dbot
This commit is contained in:
parent
84558f13d5
commit
e1047362a2
4
run.js
4
run.js
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user