From 1acb78bb5acccb80bf7d4e3628a84abf8772cf01 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 9 Jan 2021 17:22:47 -0500 Subject: [PATCH] bot: disable suffix commands --- bot/bot.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bot/bot.go b/bot/bot.go index d019692..0067a91 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -182,10 +182,6 @@ var suffixRegex *regexp.Regexp func IsCmd(c *config.Config, message string) (bool, string) { cmdcs := c.GetArray("CommandChar", []string{"!"}) botnick := strings.ToLower(c.Get("Nick", "bot")) - r := fmt.Sprintf(`(?i)\s*\W*\s*?%s\W*$`, botnick) - if suffixRegex == nil { - suffixRegex = regexp.MustCompile(r) - } if botnick == "" { log.Fatal(). Msgf(`You must run catbase -set nick -val `) @@ -204,9 +200,6 @@ func IsCmd(c *config.Config, message string) (bool, string) { if message[0] == ':' || message[0] == ',' { message = message[1:] } - } else if suffixRegex.MatchString(message) { - iscmd = true - message = suffixRegex.ReplaceAllString(message, "") } else { for _, cmdc := range cmdcs { if strings.HasPrefix(lowerMessage, cmdc) && len(cmdc) > 0 {