Pycord music not playing?

Hello everyone,
It's about a Discord bot I have that uses Pycord. I get this error:

@bot.slash_command(name='play', description="Lasse den Bot deine Musik spielen") async def play(ctx, url: Option(str, "Gebe einen Youtube URL an")): guild_id = str(ctx.guild.id) guild_data = load_guild_data() guild_info = guild_data.get(str(ctx.guild.id), {}) if guild_id in guild_data and guild_info.get("Musik-Commands"): if ctx.voice_client is None: channel = ctx.author.voice.channel await channel.connect() # Es wird PyNaCl Libary gebraucht await ctx.guild.change_voice_state(channel=channel, self_mute=False, self_deaf=True) yt = YouTube(url) audio_stream = yt.streams.filter(only_audio=True).first() audio_stream.download(filename="video.mp3") voice_client = discord.utils.get(bot.voice_clients, guild=ctx.guild) voice_client.play(FFmpegPCMAudio("video.mp3")) await ctx.respond(f"Es wird nun **{yt.title}** abgespielt.") else: await ctx.respond("Der Musik Command ist für diesen Server deaktiviert.")

Here's the code again. I reset my PC and it worked before, but now it doesn't work anymore (I'm currently using Python 3.9.13 for the bot).

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
7 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
GuteAntwort2021
1 year ago

I had reset my PC and it was before, but now it is no longer possible

Are you sure all used libraries are available? The error message indicates that this is not the case.

Justman
1 year ago

Just use discord.js… is literally 5-10 times simpler

Justman
1 year ago
Reply to  Bambussocke

That’s why you love it! It’s just…

Justman
1 year ago

Don’t! Python is literally 5 times more complex than NodeJS