Discord Bot没有播放音乐

问题描述 投票:-1回答:1

我从2年前开始关注不和谐的机器人教程。如您所知,他们重新制作了discord.py,经过大约一个小时的搜索,我发现存在相同问题但没有答案的人。我不断收到“ AttributeError:'VoiceClient'对象没有属性'create_ytdl_player'”。如果有人有任何东西,将不胜感激。

@client.command(pass_context = True)
async def play(ctx):
    guild = ctx.message.guild
    voice_client = ctx.guild.voice_client
    player = await voice_client.create_ytdl_player("https://youtu.be/HKe1jFjojzA")
    players[guild.id] = player
    player.start()
audio discord discord.py audio-player discord.py-rewrite
1个回答
0
投票

您正在使用discord.py以前版本中的语法,该语法不再起作用。看看discord.py迁移到v1时产生的changes

编辑:Here's示例

© www.soinside.com 2019 - 2024. All rights reserved.