Merge pull request #141 from zneix/zneix/fix/command-args-crash

Fix a crash that would occur upon typing prefix with no command
This commit is contained in:
gempir 2021-12-27 19:10:57 +01:00 committed by GitHub
commit 058f8f91ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:]