This commit is contained in:
Matthieu Grieger 2015-02-02 11:41:11 -08:00
parent 23ef674313
commit 0275ab2fb3
2 changed files with 6 additions and 4 deletions

View file

@ -4,6 +4,7 @@ MumbleDJ Changelog
### February 2, 2015 -- `v2.3.4, v2.3.5`
* Added panic on audio play fail for debugging purposes.
* Fixed '!' being recognized as '!skipplaylist'.
* Fixed !reset crash when there is no audio playing.
### January 30, 2015 -- `v2.3.3`
* Fixed private messages crashing the bot when the target user switches channels or disconnects.

View file

@ -304,12 +304,13 @@ func reload(user *gumble.User) {
// remaining songs in the ~/.mumbledj/songs directory.
func reset(username string) {
dj.queue.queue = dj.queue.queue[:0]
if err := dj.audioStream.Stop(); err == nil {
if err := deleteSongs(); err == nil {
dj.client.Self().Channel().Send(fmt.Sprintf(QUEUE_RESET_HTML, username), false)
} else {
if dj.audioStream.IsPlaying() {
if err := dj.audioStream.Stop(); err != nil {
panic(err)
}
}
if err := deleteSongs(); err == nil {
dj.client.Self().Channel().Send(fmt.Sprintf(QUEUE_RESET_HTML, username), false)
} else {
panic(err)
}