You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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."
)`
The text was updated successfully, but these errors were encountered:
Please be aware that since 2.6.0 (github is 2.6.1) return_first has been removed and .search() methods will always return a list now. But this version should hopefully resolve your issues. If not, please let us know.
Just as an extra note if queue == [] is not really best practice, in Wavelink you can simply use if queue.is_empty .
Although in general Python if not queue is the more pythonic way to that check if a list was empty.
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
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."
)`
The text was updated successfully, but these errors were encountered: