Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
48 stars 13 forks source link

Query #11

Closed PandaIN95 closed 11 months ago

PandaIN95 commented 11 months ago

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 ??

Tomato6966 commented 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})

Tomato6966 commented 11 months ago

image 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..

PandaIN95 commented 11 months ago

got it thanks for the help..

PandaIN95 commented 11 months ago

hey @Tomato6966 can i give player.play({ track, startTime }) is it a thing ??

Tomato6966 commented 11 months ago

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]

PandaIN95 commented 11 months ago

@Tomato6966 got it also how to search something without creating a player like erela manager.search()

Tomato6966 commented 10 months ago

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);

PandaIN95 commented 10 months ago

@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.

Tomato6966 commented 10 months ago

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

PandaIN95 commented 10 months ago

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

Tomato6966 commented 10 months ago

Please ask that in lavalink not in a client which just sends requests to lavalink.