From 12e0db499a07a2a56a804d817cfdcec2dba43857 Mon Sep 17 00:00:00 2001 From: Oliver Wilkes Date: Sat, 4 Feb 2023 22:42:53 +0000 Subject: [PATCH] fix(node): use track id not identifier to play --- mafic/node.py | 2 +- test_bot/bot/__main__.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mafic/node.py b/mafic/node.py index 3c810a4..aac208a 100644 --- a/mafic/node.py +++ b/mafic/node.py @@ -757,7 +757,7 @@ def update( data: UpdatePlayerPayload = {} if track is not MISSING: - data["encodedTrack"] = track.identifier if track is not None else None + data["encodedTrack"] = track.id if track is not None else None if position is not None: data["position"] = position diff --git a/test_bot/bot/__main__.py b/test_bot/bot/__main__.py index 8877789..2776668 100644 --- a/test_bot/bot/__main__.py +++ b/test_bot/bot/__main__.py @@ -154,7 +154,7 @@ async def join(inter: Interaction): return await inter.response.send_message("You are not in a voice channel.") channel = inter.user.voice.channel - await channel.connect(cls=Player) + await channel.connect(cls=MyPlayer) await inter.send(f"Joined {channel.mention}.") @@ -178,13 +178,15 @@ async def play(inter: Interaction, query: str): if isinstance(tracks, Playlist): tracks = tracks.tracks + if len(tracks) > 1: + player.queue.extend(tracks[1:]) track = tracks[0] - if len(tracks) > 1: - player.queue.extend(tracks[1:]) await player.play(track) + await inter.send(f"Playing {track}") + @bot.listen() async def on_track_end(event: TrackEndEvent):