问题描述
@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
谢谢您的时间!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)