已安装但仍出现RuntimeError:需要PyNaCl库才能使用语音

时间:2020-10-05 07:44:40

标签: python discord discord.py pynacl

@client.command()
async def join(ctx):
    if ctx.message.author.voice:
        channel = ctx.author.voice.channel
        await channel.connect()

出于练习目的,我一直在开发一款不和谐的机器人,但我一直坚持让它加入语音通道。我已经安装了PyNaCl,并且已在1.3.0和1.4.0之间用pip进行了交换,以查看它是否有所作为,什么也没有。我确定已安装libsodium,认为可以解决该问题,但是每当我尝试使漫游器加入语音通道时,我仍然遇到相同的错误。

我愿意尝试其他任何故障排除方法和修复程序,但是到目前为止,我已经检查了stackoverflow并没有任何结果。

import discord
from discord.ext import commands
import random
import youtube_dl
from discord import channel


try:
    import nacl.secret
    has_nacl = True
except ImportError:
    has_nacl = False

这些是我工作的导入,我尝试仅使用'import.nacl'也没有结果。

Traceback (most recent call last):
  File "C:\Users\Fernando\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Fernando\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 859, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Fernando\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 94, 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

谢谢您的时间!

0 个答案:

没有答案
相关问题