• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN "YTDL and YT" not working

Status
Not open for further replies.

Pringus

Member
Code:
    event.on('chat', function (ev) {
        var cmdTxt = ev.text.split(" ");
        engine.log(cmdTxt[0]);
        engine.log(cmdTxt[1]);
        if (cmdTxt[0] === ".yt") {
            ev.client.chat("Downloading " + cmdTxt[1]);
            sinusbot.ytdl("https://www.youtube.com/watch?v=srFLo-WShf4", true);
        }
    });

Here's the code I've got, and nothing is being downloaded. I've tried using media.ytdl as well as sinusbot.ytdl.
All the debug messages are going through fine, and the regular !yt command works as well. So the code is working, and YT-DL is installed correctly.

Any ideas?
 

Pringus

Member
this is wrong, import the media module and use media.ytdl()


I've not set it up to use media.ytdl(), which works when playing links hardcoded into the script.

However, when I use my command ".yt *youtube link*" it doesn't work. Here's what the new code looks like:
Code:
    event.on('chat', function (ev) {
        var cmdTxt = ev.text.split(" ");
        engine.log(cmdTxt[0]);
        engine.log(cmdTxt[1]);
        if (cmdTxt[0] === ".yt") {
            ev.client.chat("Downloading " + cmdTxt[1]);
            media.ytdl(cmdTxt[1], true);
        }
    });
 
Status
Not open for further replies.
Top