From 5160db811495bcb9e31058913ea0904260fa3608 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Sun, 5 Apr 2020 19:32:06 -0800 Subject: [PATCH] Fix issue with detecting a prefix when there is none --- command-manager.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command-manager.go b/command-manager.go index 68b3f8e..4ee9efa 100644 --- a/command-manager.go +++ b/command-manager.go @@ -63,14 +63,14 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess prefixes := c.Prefixes(m.GuildID) var prefix string + var has bool for _, prefix = range prefixes { if strings.HasPrefix(content, prefix) { + has = true break } } - fmt.Println(prefix) - fmt.Println(prefixes) - if prefix == "" { + if !has { return // If we didn't find a valid prefix then exit }