Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

source must be an AudioSource not YouTubeTrack #234

Closed
@Celiian

Description

@Celiian

Everything work pretty good with wavelink and i could listen to music with my bot but from times to times i get this error : source must be an AudioSource not YouTubeTrack, on whatever music i search and i can't do anything about it. When the error come once, i get it for a few hours and can't listen at all. Here's my play function if needed : `
async def playAction(ctx, musique, wavelink, reconnect_nodes, queue):
try:
player: wavelink.Player = ctx.guild.voice_client

if not player:
  player: wavelink.Player = await ctx.author.voice.channel.connect(
    cls=wavelink.Player)

if ctx.author.voice.channel.id != player.channel.id:
  return await ctx.respond("Vous devez être dans la même vocale que moi.",
                           ephemeral=True,
                           delete_after=3)

song = await wavelink.YouTubeTrack.search(query=musique, return_first=True)

if not song:
  return await ctx.respond("Aucun son trouvé.",
                           ephemeral=True,
                           delete_after=3)
if queue == [] and not player.is_playing():
  print(song.title)
  await player.play(song)
  await ctx.respond(f"Je joue actuellement : {song.title}")

else:
  queue.append(song)
  await ctx.respond(f"Musique ajouté a la liste d'attente : {song.title}"
                    )

except Exception as e:
print(e)
await ctx.respond(
f"Désole, un problème est survenu, je ne peux jouer de musique pour le moment."
)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions