Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a389de2c77 | ||
|
|
bc86a36745 |
+2
-2
@@ -99,13 +99,13 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess
|
|||||||
Guild: guild,
|
Guild: guild,
|
||||||
Member: m.Member,
|
Member: m.Member,
|
||||||
Invoked: "",
|
Invoked: "",
|
||||||
ErrorChannel: c.ErrorChannel,
|
CommandManager: c,
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmd []string
|
var cmd []string
|
||||||
// If we found our prefix then remove it and split the command into pieces
|
// If we found our prefix then remove it and split the command into pieces
|
||||||
content = strings.TrimPrefix(content, prefix)
|
content = strings.TrimPrefix(content, prefix)
|
||||||
r := regexp.MustCompile(`[^\s"]+|"([^"]*)"`)
|
r := regexp.MustCompile(`[^ "]+|"([^"]*)"`)
|
||||||
cmd = r.FindAllString(content, -1)
|
cmd = r.FindAllString(content, -1)
|
||||||
for i, val := range cmd {
|
for i, val := range cmd {
|
||||||
cmd[i] = strings.Trim(val, "\"")
|
cmd[i] = strings.Trim(val, "\"")
|
||||||
|
|||||||
+2
-2
@@ -80,6 +80,6 @@ type Context struct {
|
|||||||
Member *discordgo.Member
|
Member *discordgo.Member
|
||||||
// Name of the command as it was invoked (this is so you know what alias was used to call the command)
|
// Name of the command as it was invoked (this is so you know what alias was used to call the command)
|
||||||
Invoked string
|
Invoked string
|
||||||
// Error channel
|
// Command Manager
|
||||||
ErrorChannel chan CommandError
|
CommandManager *CommandManager
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user