Only for people who knows Java Script please. 2

Discussion in 'General Discussion' started by _Lovell_, Feb 11, 2018.

  1. _Lovell_

    _Lovell_ AKA Zack or Kali Donator

    Messages:
    63
    Likes Received:
    8
    Minecraft:
    _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:
    993
    Likes Received:
    1,425
    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 Zack or Kali Donator

    Messages:
    63
    Likes Received:
    8
    Minecraft:
    _Lovell_
    Yes sir yes
     
  4. RadeonX

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

    Messages:
    637
    Likes Received:
    1,502
    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.