From c182348010e6369fa242ee5a34ba32ec04253166 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 24 Aug 2024 16:47:14 -0500 Subject: [PATCH 1/2] updated player to default to track.position instead of 'start' --- wavelink/player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wavelink/player.py b/wavelink/player.py index 3f0d1fd2..1b42c39a 100644 --- a/wavelink/player.py +++ b/wavelink/player.py @@ -820,6 +820,7 @@ async def play( start: int The position to start playing the track at in milliseconds. Defaults to ``0`` which will start the track from the beginning. + If ``track.position`` has a non-zero position, that position will be used instead. end: Optional[int] The position to end the track at in milliseconds. Defaults to ``None`` which means this track will play until the very end. @@ -900,6 +901,9 @@ async def play( if filters: self._filters = filters + start = track.position or start + track._position = 0 + request: RequestPayload = { "track": {"encoded": track.encoded, "userData": dict(track.extras)}, "volume": vol, From bc9ff7c762020010e0908d1b26de85c780ed8a00 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 24 Aug 2024 17:22:31 -0500 Subject: [PATCH 2/2] updated documentation --- wavelink/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wavelink/player.py b/wavelink/player.py index 1b42c39a..d1e6cadb 100644 --- a/wavelink/player.py +++ b/wavelink/player.py @@ -820,7 +820,7 @@ async def play( start: int The position to start playing the track at in milliseconds. Defaults to ``0`` which will start the track from the beginning. - If ``track.position`` has a non-zero position, that position will be used instead. + If ``track`` has a non-zero :attr:`~wavelink.Playable.position`, that position will be used instead. end: Optional[int] The position to end the track at in milliseconds. Defaults to ``None`` which means this track will play until the very end.