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).
Are you sure all used libraries are available? The error message indicates that this is not the case.
Yes, I am. I have copied the complete folder of the project, even once only copied the code and reinstalled all Libarys, but the same error comes
Just use discord.js… is literally 5-10 times simpler
JS at dc bot is groundless and does not need a lol
That’s why you love it! It’s just…
Don’t! Python is literally 5 times more complex than NodeJS
python is easy