pa3ck
Active Member
Hi, I have the following code which basically stores Youtube-DL URL in a variable and when I use !resume it should play it back. The problem is, that I'm getting youtube download failed error..
When I replace media.yt(lastYT) with a hardcoded URL it works.. is there anything I'm missing for media.yt function?
JavaScript:
var media = require('media');
var lastYT = "";
event.on('chat', function(ev){
if (ev.text.match(new RegExp("^!yt.+$"))) {
var cmd = ev.text.split(" ");
if(cmd[1] != undefined ){
lastYT = cmd[1].trim();
}
}else if(ev.text == '!resume'){
ev.client.chat("Előző zene lejátszása: " + lastYT);
media.yt(lastYT);
}
});
When I replace media.yt(lastYT) with a hardcoded URL it works.. is there anything I'm missing for media.yt function?