From 3c4b97896c76be29b8e54806dafede9640d90375 Mon Sep 17 00:00:00 2001 From: zneix Date: Mon, 27 Dec 2021 18:48:23 +0100 Subject: [PATCH] Check if args are empty --- bot/commands.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/commands.go b/bot/commands.go index 8556d2f..7cc8768 100644 --- a/bot/commands.go +++ b/bot/commands.go @@ -25,6 +25,9 @@ func (b *Bot) handlePrivateMessageCommands(message twitch.PrivateMessage) { } args := strings.Fields(message.Message[len(commandPrefix):]) + if len(args) < 1 { + return + } commandName := args[0] args = args[1:]