Only for people who knows Java Script please. 2

Discussion in 'General Discussion / Real life stuff' started by _Lovell_, Feb 11, 2018.

  1. _Lovell_

    _Lovell_ AKA Kali ;) Donator

    Messages:
    64
    Likes Received:
    8
    Minecraft:
    Denzel_Lovell
    So, my bot plays music, it can stop and skip, but when i put a list, the music doesn't play, so could anyone give me a code so the bot can play a list as well, and i would really like if you sent a repeat code as well ( so i can repeat the video/list :) )

    My current code for my bot when it comes to music, its this:
     
  2. TwageTomato

    TwageTomato Former Mod Donator

    Messages:
    977
    Likes Received:
    1,413
    Minecraft:
    Twage
    What do you mean by "a list"? Do you mean being able to have multiple songs queued up? Being able to request multiple songs at once? Setting an entire YouTube playlist to play?
     
  3. _Lovell_

    _Lovell_ AKA Kali ;) Donator

    Messages:
    64
    Likes Received:
    8
    Minecraft:
    Denzel_Lovell
    Yes sir yes
     
  4. RadeonX

    RadeonX 闇はどこにでもあります。 Donator

    Messages:
    635
    Likes Received:
    1,499
    Typical customer in a world of coding right there ^ :)
    You need to be more specific, do you want your bot to handle a YouTube list or support a list of random songs?

    I haven't used it myself, but I guess it works like it does with videos. YouTube API returns an object which consists of songs, and you need to handle each item in that object once you receive it.
    Split the items in the json object you got in the response and store them in your queue, shouldn't be too difficult I imagine.
    Then proceed to execute the play function like you normally would for each item in your "queue" array.