Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated player to default to track.position instead of 'start' #319

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wavelink/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`` 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.
Expand Down Expand Up @@ -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,
Expand Down