我试图将我的 BOT 连接到语音通道来做音乐 BOT,但我不知道为什么,它不起作用。你能帮我吗 ?我已经安装了 PyNaCl,但它仍然无法正常工作......
这是命令的代码:
@bot.command()
async def join(ctx):
channel = get(ctx.guild.voice_channels, id=722012728176410694)
await channel.connect()
这是打印的错误:
Ignoring exception in command join:
Traceback (most recent call last):
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 83, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Maxence\Documents\Programmation\Python\Discord\Music BOT\main.py", line 44, in join
await channel.connect()
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\abc.py", line 1076, in connect
voice = VoiceClient(state=state, timeout=timeout, channel=self)
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\voice_client.py", line 91, in __init__
raise RuntimeError("PyNaCl library needed in order to use voice")
RuntimeError: PyNaCl library needed in order to use voice
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Maxence\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: PyNaCl library needed in order to use voice
我真的需要帮助我没有找到答案......