diff --git a/plugins/babbler/babbler.go b/plugins/babbler/babbler.go index 4dd816b..5b21dea 100644 --- a/plugins/babbler/babbler.go +++ b/plugins/babbler/babbler.go @@ -121,7 +121,8 @@ func (p *BabblerPlugin) Message(message msg.Message) bool { saidWhat, saidSomething = p.getBabbleWithSuffix(tokens) } else if numTokens >= 2 && tokens[1] == "says-middle-out" { saidWhatStart, saidSomethingStart := p.getBabbleWithSuffix(tokens) - if !saidSomethingStart || saidWhatStart == strings.Join(tokens[2:], " ") { + neverSaidLooksLike := fmt.Sprintf("%s never said '%s'", tokens[0], strings.Join(tokens[2:], " ")) + if !saidSomethingStart || saidWhatStart == neverSaidLooksLike { saidSomething = saidSomethingStart saidWhat = saidWhatStart } else { diff --git a/plugins/babbler/babbler_test.go b/plugins/babbler/babbler_test.go index d3e0727..b574f6a 100644 --- a/plugins/babbler/babbler_test.go +++ b/plugins/babbler/babbler_test.go @@ -262,7 +262,7 @@ func TestBabblerBadMiddleOutSeed(t *testing.T) { res = c.Message(makeMessage("!seabass says-middle-out anything true")) assert.Len(t, mb.Messages, 1) assert.True(t, res) - assert.Contains(t, mb.Messages[0], "seabass never said 'anything true'") + assert.Equal(t, mb.Messages[0], "seabass never said 'anything true'") }