This commit is contained in:
Matthieu Grieger 2015-02-02 11:50:31 -08:00
parent 0275ab2fb3
commit 6ba9f94e71
2 changed files with 3 additions and 1 deletions

View file

@ -5,6 +5,7 @@ MumbleDJ Changelog
* Added panic on audio play fail for debugging purposes.
* Fixed '!' being recognized as '!skipplaylist'.
* Fixed !reset crash when there is no audio playing.
* Fixed newlines after YouTube URL messing up !add commands.
### January 30, 2015 -- `v2.3.3`
* Fixed private messages crashing the bot when the target user switches channels or disconnects.

View file

@ -22,7 +22,8 @@ import (
// it contains a command.
func parseCommand(user *gumble.User, username, command string) {
var com, argument string
sanitizedCommand := sanitize.HTML(command)
newlineSplit := strings.Split(command, "<br />")
sanitizedCommand := sanitize.HTML(newlineSplit[0])
if strings.Contains(sanitizedCommand, " ") {
index := strings.Index(sanitizedCommand, " ")
com, argument = sanitizedCommand[0:index], sanitizedCommand[(index+1):]