From c07e612941e34ac5c8e35ab849170ed4aaa953a2 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 21 Jan 2019 18:30:20 -0500 Subject: [PATCH] emojify: woops --- plugins/emojifyme/emojifyme.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/emojifyme/emojifyme.go b/plugins/emojifyme/emojifyme.go index 629174e..0960474 100644 --- a/plugins/emojifyme/emojifyme.go +++ b/plugins/emojifyme/emojifyme.go @@ -71,6 +71,7 @@ func (p *EmojifyMePlugin) Message(message msg.Message) bool { for k, v := range p.Emoji { k = strings.Replace(k, "_", " ", -1) candidates := []string{ + k, k + "es", k + "s", } @@ -79,8 +80,8 @@ func (p *EmojifyMePlugin) Message(message msg.Message) bool { strings.HasPrefix(msg, c) || strings.HasSuffix(msg, c) { emojys = append(emojys, v) - if !stringsContain(inertTokens, k) || len(k) <= 2 { - emojied++ + if !stringsContain(inertTokens, k) || len(v) < 2 { + emojied += 1 } } }