From bd2e28f72af9f5267f0a2c3820f80016cb003c3f Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 19 Oct 2020 21:28:13 -0400 Subject: [PATCH] first: disallow empty messages --- plugins/first/first.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/first/first.go b/plugins/first/first.go index 254e736..fa2b9ee 100644 --- a/plugins/first/first.go +++ b/plugins/first/first.go @@ -175,6 +175,9 @@ func (p *FirstPlugin) message(c bot.Connector, kind bot.Kind, message msg.Messag } func (p *FirstPlugin) allowed(message msg.Message) bool { + if message.Body == "" { + return false + } for _, m := range p.Bot.Config().GetArray("Bad.Msgs", []string{}) { match, err := regexp.MatchString(m, strings.ToLower(message.Body)) if err != nil {