mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 12:12:35 +01:00
fix spelling bug with replacing parts of words instead of the word if the letter sequence occurs first
This commit is contained in:
parent
9b00578a60
commit
bb934fb1db
@ -17,7 +17,7 @@ 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);
|
var fix = last[data.channel][candidate].replace(' ' + winner + ' ', correction);
|
||||||
if (/^.ACTION/.test(fix)) {
|
if (/^.ACTION/.test(fix)) {
|
||||||
fix = fix.replace(/^.ACTION/, '/me');
|
fix = fix.replace(/^.ACTION/, '/me');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user