I am coding my first music bot and implemented joining voice chat, but there was a problem when playing music from youtube. I'm trying to play music from the received YouTube link and getting an error. I tried to find a solution on the Internet, but everywhere the code is from the old documentation. Here is my code:
@client.command()
async def play(ctx, url):
guild = ctx.message.guild
voice_client = guild.voice_client
player = await voice_client.create_ytdl_player(url)
players[guild.id] = player
player.start()
Error in the console: AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player'