Fixed error on attempting to play a playlist.

master
Astoria Floyd 3 years ago
parent 336b4e4269
commit e9186caf31

@ -7,7 +7,9 @@ def playMusic(bot, bang)
bot.voice_connect(voice_channel)
arguments = message.sub("#{bang}Play ", '').split.first
#event.voice.play_file('./example.mp3')
if arguments.include? "youtu"
if arguments.include? "&list"
event.respond "Do not play playlists. They are unsupported."
elsif arguments.include? "youtu"
event.respond "Playing song! This may take some time."
tempFile = Dir::Tmpname.create(['youtubedlruby-', '.mp3']) {}
cmd = "yt-dlp --extract-audio --audio-format mp3 --output " + tempFile + " " + arguments

Loading…
Cancel
Save