From 6707902caff66dc1e7a2686548e942c199b6afeb Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:46:22 -0500 Subject: [PATCH] fact: don't look for is actions --- plugins/fact/factoid.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/plugins/fact/factoid.go b/plugins/fact/factoid.go index 9a68f68..e399624 100644 --- a/plugins/fact/factoid.go +++ b/plugins/fact/factoid.go @@ -90,21 +90,8 @@ func New(botInst bot.Bot) *FactoidPlugin { // findAction simply regexes a string for the action verb func findAction(message string) string { - r, err := regexp.Compile("<.+?>") - if err != nil { - panic(err) - } - action := r.FindString(message) - - if action == "" { - if strings.Contains(message, " is ") { - return "is" - } else if strings.Contains(message, " are ") { - return "are" - } - } - - return action + r := regexp.MustCompile("<.+?>") + return r.FindString(message) } // learnFact assumes we have a learning situation and inserts a new fact