do that properly

This commit is contained in:
Luke Slater 2012-01-09 14:51:34 +00:00
parent bb934fb1db
commit 007540bead

View File

@ -17,7 +17,9 @@ var spelling = function(dbot) {
if(winnerDistance < 7) { if(winnerDistance < 7) {
if(winner !== correction) { if(winner !== correction) {
var fix = last[data.channel][candidate].replace(' ' + winner + ' ', correction); candidates[i] = correction;
var fix = candidates.join(' ');
last[data.channel][candidate] = fix;
if (/^.ACTION/.test(fix)) { if (/^.ACTION/.test(fix)) {
fix = fix.replace(/^.ACTION/, '/me'); fix = fix.replace(/^.ACTION/, '/me');
} }