You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
493 B
Ruby

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