From fc4b370a1ed2127c9f279b7e5f97b05e8876b9e9 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Mon, 1 Jun 2020 14:59:55 -0800 Subject: [PATCH] Fix bug when cmd is empty --- command-manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command-manager.go b/command-manager.go index c96f4c1..912b2de 100644 --- a/command-manager.go +++ b/command-manager.go @@ -116,6 +116,10 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess } } + if len(cmd) < 1 { + return + } + var command *Command invoked := cmd[0] if cmnd, ok := c.Commands[invoked]; ok {