From aee106b21ba0e856c6ffb0f0b68a8a0043c4d126 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Tue, 22 Jan 2019 10:43:10 -0500 Subject: [PATCH] emojify: make sure there are spaces around beginning/ending emojy --- plugins/emojifyme/emojifyme.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/emojifyme/emojifyme.go b/plugins/emojifyme/emojifyme.go index d4cc975..de15e70 100644 --- a/plugins/emojifyme/emojifyme.go +++ b/plugins/emojifyme/emojifyme.go @@ -77,8 +77,8 @@ func (p *EmojifyMePlugin) Message(message msg.Message) bool { } for _, c := range candidates { if strings.Contains(msg, " "+c+" ") || - strings.HasPrefix(msg, c) || - strings.HasSuffix(msg, c) { + strings.HasPrefix(msg, c+" ") || + strings.HasSuffix(msg, " "+c) { emojys = append(emojys, v) if !stringsContain(inertTokens, k) || len(v) < 2 { emojied += 1