yarin Cohen
yarin Cohen

Reputation: 1142

discord.py 'VoiceClient' object has no attribute 'create_ytdl_player'

I am trying to play music from given URL but I'm facing an error that says 'VoiceClient' object has no attribute 'create_ytdl_player', I looked up everywhere and I cannot find my mistake please help me :)

@bot.command(pass_context=True)
async def play(ctx, url):
    voice_channel = ctx.author.voice.channel
    vc = await voice_channel.connect()
    player = await vc.create_ytdl_player(url)
    player.start()

Upvotes: 1

Views: 2203

Answers (1)

Sai Kiran Sangam
Sai Kiran Sangam

Reputation: 368

API Reference shows:

voice = await client.join_voice_channel(channel)
player = await voice.create_ytdl_player('https://www.youtube.com/watch?v=d62TYemN6MQ')
player.start()

Upvotes: 1

Related Questions