Compare commits

..
2 Commits
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -99,13 +99,13 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess
Guild: guild,
Member: m.Member,
Invoked: "",
ErrorChannel: c.ErrorChannel,
CommandManager: c,
}
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, "\"")
+2 -2
View File
@@ -80,6 +80,6 @@ type Context struct {
Member *discordgo.Member
// Name of the command as it was invoked (this is so you know what alias was used to call the command)
Invoked string
// Error channel
ErrorChannel chan CommandError
// Command Manager
CommandManager *CommandManager
}