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