jack3898 / discord-youtube-bot-2

A powerful Discord YouTube Bot.
0 stars 0 forks source link

unite play and playlist suggestion #15

Open giorgionegro opened 2 years ago

giorgionegro commented 2 years ago

i think it would be more handy if play and playlist command would be one, i have made a dirty workaround adding a check in play


const query = handler.commandInteraction.options.getString('query');
    const youtubeInterface = YouTubeInterface.fromGuild(handler.guild);
    //if query is a youtube playlist url reinterpret it as a playlist
    if(query!=null&&query.startsWith('https://www.youtube.com/playlist?list=')){
                const playlistUrl = query;
        const youtubePlaylist = YouTubePlaylist.fromUrl(playlistUrl);
        ///
        playlist 
        ...
        ///
        }
    else if (query) {
        const [video] = await YouTubeVideo.search(query, 1);
              ///
            normal audio 
            .....
            ////
jack3898 commented 2 years ago

Interesting suggestion, I think I will have a look into this with more detail at some point and see if it's something I would add to the project 🤔

Thanks!

Jack