Skip to content

Commit

Permalink
Don't send queue cleared message from playSound
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Mar 25, 2021
1 parent c4fe76d commit 94700e4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func playSound(s *discordgo.Session, guildID, channelID, fileName string, i *dis
removeFromQueue(strings.TrimSuffix(fileName, ".dca"), guildID)
// If this is the last element, we have finished clearing the queue
if len(server[guildID].queue) == 0 {
go modfyInteractionAndDelete(s, NewEmbed().SetTitle(s.State.User.Username).AddField("Cleared", "Queue cleared").
SetColor(0x7289DA).MessageEmbed, i, time.Second*5)
server[guildID].clear = false
}
server[guildID].server.Unlock()
Expand Down Expand Up @@ -148,9 +146,7 @@ func soundStream(s *discordgo.Session, guildID, channelID, fileName string, i *d
if server[guildID].clear {
removeFromQueue(strings.TrimSuffix(fileName, ".dca"), guildID)
// If this is the last element, we have finished clearing the queue
if len(server[guildID].queue) == 1 {
go sendAndDeleteEmbed(s, NewEmbed().SetTitle(s.State.User.Username).AddField("Cleared", "Queue cleared").
SetColor(0x7289DA).MessageEmbed, i, time.Second*5)
if len(server[guildID].queue) == 0 {
server[guildID].clear = false
}
server[guildID].server.Unlock()
Expand Down

0 comments on commit 94700e4

Please sign in to comment.