Update command-manager to not exit on bad command
Add logging to see issue with prefix
This commit is contained in:
parent
7057f2019b
commit
2668bb8cf5
@ -68,6 +68,8 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fmt.Println(prefix)
|
||||||
|
fmt.Println(prefixes)
|
||||||
if prefix == "" {
|
if prefix == "" {
|
||||||
return // If we didn't find a valid prefix then exit
|
return // If we didn't find a valid prefix then exit
|
||||||
}
|
}
|
||||||
@ -84,13 +86,13 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess
|
|||||||
if cmnd, ok := c.Commands[invoked]; ok {
|
if cmnd, ok := c.Commands[invoked]; ok {
|
||||||
command = cmnd
|
command = cmnd
|
||||||
} else {
|
} else {
|
||||||
log.Fatal("Command Not Found")
|
fmt.Println("Command Not Found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
channel, err := session.Channel(m.ChannelID)
|
channel, err := session.Channel(m.ChannelID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Couldn't retrieve Channel.")
|
fmt.Println("Couldn't retrieve Channel.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user