From bc86a367458c5afd5f858d2c66f16b71ed3ea74e Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Tue, 1 Sep 2020 20:56:27 -0800 Subject: [PATCH] Fix bug in regex which removed newlines --- command-manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command-manager.go b/command-manager.go index 268886a..f9f4fad 100644 --- a/command-manager.go +++ b/command-manager.go @@ -105,7 +105,7 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess var cmd []string // If we found our prefix then remove it and split the command into pieces content = strings.TrimPrefix(content, prefix) - r := regexp.MustCompile(`[^\s"]+|"([^"]*)"`) + r := regexp.MustCompile(`[^ "]+|"([^"]*)"`) cmd = r.FindAllString(content, -1) for i, val := range cmd { cmd[i] = strings.Trim(val, "\"")