From 007540beadea07059d89b063db3b869138df655a Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 9 Jan 2012 14:51:34 +0000 Subject: [PATCH] do that properly --- modules/spelling.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/spelling.js b/modules/spelling.js index 69e2189..cf7af5b 100644 --- a/modules/spelling.js +++ b/modules/spelling.js @@ -17,7 +17,9 @@ var spelling = function(dbot) { if(winnerDistance < 7) { 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)) { fix = fix.replace(/^.ACTION/, '/me'); }