From 2668bb8cf59a66f475c2ae5ed6d53cc4248dcc26 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Sun, 5 Apr 2020 19:27:05 -0800 Subject: [PATCH] Update command-manager to not exit on bad command Add logging to see issue with prefix --- command-manager.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/command-manager.go b/command-manager.go index 6728ffe..68b3f8e 100644 --- a/command-manager.go +++ b/command-manager.go @@ -68,6 +68,8 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess break } } + fmt.Println(prefix) + fmt.Println(prefixes) if prefix == "" { 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 { command = cmnd } else { - log.Fatal("Command Not Found") + fmt.Println("Command Not Found") return } channel, err := session.Channel(m.ChannelID) if err != nil { - log.Fatal("Couldn't retrieve Channel.") + fmt.Println("Couldn't retrieve Channel.") return }