new attempt to add clearQueue()

This commit is contained in:
da
2017-08-03 18:50:20 +02:00
parent 0ca13a53b9
commit 7a5cdfedf2
2 changed files with 17 additions and 1 deletions
+5 -1
View File
@@ -90,7 +90,11 @@ func handlePlaySound(w http.ResponseWriter, r *http.Request) {
}
if user != nil && guild != nil && soundCollection != nil {
if sound != nil {
go enqueuePlay(user, guild, soundCollection, sound)
if sound.Name == "clearqueue" && soundCollection.Prefix == "1" {
clearQueue()
} else {
go enqueuePlay(user, guild, soundCollection, sound)
}
} else {
go enqueuePlay(user, guild, soundCollection, soundCollection.Random())
}