discord.py'VoiceClient'对象没有属性'create_ytdl_player'

时间:2019-09-15 18:10:44

标签: python discord.py-rewrite

我正在尝试从给定的URL播放音乐,但是遇到一个错误,提示“ VoiceClient”对象没有属性“ create_ytdl_player”,我到处查找,但找不到错误,请帮帮我:)

@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()

1 个答案:

答案 0 :(得分:0)

API Reference显示:

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