mirror of https://github.com/velour/catbase.git
emojify: make sure there are spaces around beginning/ending emojy
This commit is contained in:
parent
0ee92123c1
commit
aee106b21b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue