def stopMusic_getName() return "stop" end def stopMusic_getCommand() return "stopMusic_main" end def stopMusic_main(event) voice_channel = event.author.voice_channel.id if ENV["#{voice_channel}"] == 'playing' event.respond "Stopping music" while $queue[voice_channel][0] != nil puts "Stop 2" $queue[voice_channel].pop end voiceBot = $voicebots[voice_channel] voiceBot.destroy() ENV["#{voice_channel}"] = 'open' else event.respond "Bot not playing!" end end