Closed PandaIN95 closed 11 months ago
If there are no tracks in queue, and then call skip nothing it throws error because you shouldn't skip that.
U have the options to: Delete the player on lavalink, without disconnecting from the channel
Or delete the player on lavalink, with disconnecting
Or stop playing, for that i forgot to add the method player.stop() which just does player.play({ encodedTrack: null})
In that image you can see that
player.play({ encodedTrack: null })
is technically just telling lavalink server "stop the track". which then executes trackend (and the wrapper internally autoSkip's to the next track), if there is no next track -> queue will end.
If you really need to "stop" the player after the last track without destroying nor deleting the player. Think about it..
got it thanks for the help..
hey @Tomato6966 can i give player.play({ track, startTime }) is it a thing ??
player.play({ track: LavalinkTrack, position: numberInMs })
startTime is wrong variable, it's called "position" to probably cover how lavalink names things... (startTime was erela.js thing, position is lavalink thing) you should see it in intellisense...
you can use track to define which track, but you don't need to, if the track is in player.queue.tracks[0]
@Tomato6966 got it also how to search something without creating a player like erela manager.search()
this feature got disabled intentionally for multi-node automation and support. as if you search on a different node which is not the player node you cannot play the tracks.
However you can do node.search()
aka manager.nodeManager.nodes.get("ID").search({ query: string, source: string }, requester);
@Tomato6966 got it thanks and Also one suggestion for the previous played tracks can you make it so that it will only hold unique tracks always and suppose if there is a Track at index 8 and someone played again so remove the track from from index 8 and put it infront of the array[0] in that case it will always have unique tracks.
Thats a very specific usecase
U can adjust the player.queue.previous and then execute await player.queue.utils.save()
Its not ment to only. Hold unique tracks as thats then not a real previous handler
if the bot is Playing Songs for a Long time sometimes the audio gets bugged i can't hear anything in the vc. can you tell me how can i fix this ?? @Tomato6966
Please ask that in lavalink not in a client which just sends requests to lavalink.
How am i suppose to skip the current playing track when there is no queue ?? i mean i can use .seek(track.duration) but is there any better way to do it ??