From 7465922c43b28481ba0a222f42c6b25d26a32ae3 Mon Sep 17 00:00:00 2001 From: Matthieu Grieger Date: Mon, 19 Jan 2015 13:28:25 -0800 Subject: [PATCH] Fix https://github.com/matthieugrieger/mumbledj/issues/23: Move to channel with spaces in name --- CHANGELOG.md | 3 +++ commands.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bacc96..f9e787f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ MumbleDJ Changelog ================== +### January 19, 2015 -- `v2.2.11` +* Fixed not being able to use the move command with channels with spaces in their name. + ### January 14, 2015 -- `v2.2.9, v2.2.10` * Set AudioEncoder Application to `gopus.Audio` instead of `gopus.Voice` for hopefully better sound quality. * Added some commands to the !help string that were missing. diff --git a/commands.go b/commands.go index 3307b2f..8a080f3 100644 --- a/commands.go +++ b/commands.go @@ -24,8 +24,8 @@ func parseCommand(user *gumble.User, username, command string) { var com, argument string sanitizedCommand := sanitize.HTML(command) if strings.Contains(sanitizedCommand, " ") { - parsedCommand := strings.Split(sanitizedCommand, " ") - com, argument = parsedCommand[0], parsedCommand[1] + index := strings.Index(sanitizedCommand, " ") + com, argument = sanitizedCommand[0:index], sanitizedCommand[(index + 1):] } else { com = command argument = ""