Skip to content

Commit

Permalink
fix(player): pre-emptively update .current if v3 (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed May 15, 2023
1 parent 61c99b0 commit 3ecb4d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mafic/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,18 @@ async def update(
if self._node is None or not self._connected:
raise PlayerNotConnected

# v4+ receives the full payload in events, so there is no need to
# pre-emptyively update the player.
if track is not None and self.node.version == 3:
if isinstance(track, str):
message = (
"Lavalink version 3 does not support identifiers "
"due to unexpected behaviour with events."
)
raise TypeError(message)

self._current = track

data = await self._node.update(
guild_id=self._guild_id,
track=track,
Expand Down

0 comments on commit 3ecb4d9

Please sign in to comment.