Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.
Merged
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
8 changes: 7 additions & 1 deletion wavelink/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def __init__(self, bot: Union[commands.Bot, commands.AutoShardedBot], guild_id:
self._equalizer = Equalizer.flat()
self.channel_id = None

self._new_track = False

@property
def equalizer(self):
"""The currently applied Equalizer."""
Expand Down Expand Up @@ -239,8 +241,9 @@ async def _dispatch_voice_update(self) -> None:
await self.node._send(op='voiceUpdate', guildId=str(self.guild_id), **self._voice_state)

async def hook(self, event) -> None:
if isinstance(event, TrackEnd):
if isinstance(event, TrackEnd) and not self._new_track:
self.current = None
self._new_track = False

def _get_shard_socket(self, shard_id: int) -> Optional[DiscordWebSocket]:
if isinstance(self.bot, commands.AutoShardedBot):
Expand Down Expand Up @@ -316,6 +319,9 @@ async def play(self, track: Track, *, replace: bool = True, start: int = 0, end:

no_replace = not replace

if self.current:
self._new_track = True

self.current = track

payload = {'op': 'play',
Expand Down