discord-music-player icon indicating copy to clipboard operation
discord-music-player copied to clipboard

[BUG] queue.playlist() throwing errors

Open Wolvinny opened this issue 2 years ago • 0 comments

Bug Description When running queue.playlist(), i receive the following error:

TypeError: Cannot read properties of undefined (reading 'playlist'): There was an Unknown Error.
    at C:\Users\user\djs_v2\node_modules\discord-music-player\dist\managers\Queue.js:270:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Queue.playlist (C:\Users\user\djs_v2\node_modules\discord-music-player\dist\managers\Queue.js:268:24)
    at async Object.execute (C:\Users\user\djs_v2\commands\music\play.js:24:20)

Playing regular songs works just fine. Code:

        const query = args.join(" ");

        const client = message.client;
    
        let queue = await client.player.createQueue(message.guild.id)
      
        let song;
        
        if(query.includes("&list=")){
            console.log(query)
            await queue.join(message.member.voice.channel)
            song = await queue.playlist(query, {maxSongs : -1}).catch((err) =>{
                console.log(err)
                return message.channel.send("Something went wrong!")
            });
        }else{
            await queue.join(message.member.voice.channel);
            song = await queue.play(query).catch((err) =>{
                console.log(err)
                return message.channel.send("Something went wrong!")
            });
        }

Versioning:

  • OS: Windows 10
  • Node Version 18.8.0
  • Module Version: tried with both the latest and 9.0.0

Wolvinny avatar Sep 13 '22 19:09 Wolvinny