Skip to content

Commit

Permalink
fix(node): use track id not identifier to play
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Feb 4, 2023
1 parent 29baebf commit 12e0db4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mafic/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions test_bot/bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")


Expand All @@ -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):
Expand Down

0 comments on commit 12e0db4

Please sign in to comment.