You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ channel }=interaction.member.voice;checkIntChannel(interaction,channel)constsearch=interaction.options.getString("search");constplayer=awaitclient.manager.createPlayer({guildId: interaction.guild.id,textId: interaction.channel.id,voiceId: channel.id,volume: 50,deaf: true,shardId: interaction.guild.shardId,});constres=awaitplayer.search(search,{requester: interaction.user});if(!res.tracks.length){constNoResultsEmb=newEmbedBuilder().setAuthor({name: "No results found.",iconURL: interaction.user.displayAvatarURL({dynamic: true})});returninteraction.reply({embeds: [NoResultsEmb],ephemeral: true});}if(res.type==="PLAYLIST"){for(lettrackofres.tracks){awaitplayer.queue.add(track);}if(!player.playing&&!player.paused){player.play();}}else{awaitplayer.queue.add(res.tracks[0]);if(!player.playing&&!player.paused){player.play();}}returninteraction.reply({content: `Added ${res.tracks[0].title} to the Queue.`,ephemeral: true});}catch(e){awaitconsole.log("Error in play.js: "+e);if(!interaction.replied){returninteraction.reply({content: "An error occurred while trying to play the song.",ephemeral: true});}}
sorry but what do you mean "Next time you restart everythings dead" ? is it the next time when you execute the play command?
does "getting the res array and the player is being created without a result to play." means the player is getting created, but there's no result to play, thus it's stuck? if yes, yoy should do put this code if (!player.queue.current && !player.queue.length) player.destroy(); when there's no result. for example in your case, it'll be
if(!res.tracks.length){constNoResultsEmb=newEmbedBuilder().setAuthor({name: "No results found.",iconURL: interaction.user.displayAvatarURL({dynamic: true})});if(!player.queue.current&&!player.queue.length)player.destroy();returninteraction.reply({embeds: [NoResultsEmb],ephemeral: true});}
Next time you restart everythings dead, getting the res array and the player is being created without a result to play.
Multiple Resolves: resolve Promise { ArrayBuffer { [Uint8Contents]: <>, byteLength: 0 } } undefined
Originally posted by @path1337 in #34 (comment)
The text was updated successfully, but these errors were encountered: