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:
commit
058f8f91ac
1 changed files with 3 additions and 0 deletions
|
@ -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:]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue