返回

python——让discord bot加入vc,但缺少“PyNaCl”

发布时间:2022-04-30 07:30:10 276
# node.js

试图让我的不和谐机器人连接到语音通道,但我收到“RuntimeError:使用语音所需的 PyNaCl 库”错误。

这是我的代码:

def __init__(self,client):
    self.client = client

@commands.Cog.listener()
async def on_ready(self):
    print('Voice Lines is online')


@commands.command()
async def play(self, ctx):
    if ctx.author.voice and ctx.author.voice.channel:
        channel = ctx.author.voice.channel
        await ctx.send("trying to connect to ")
        await channel.connect()

    else:
        await ctx.send("You are not connected to a voice channel")
    return
    

def设置(客户端):客户端。添加_cog(设置语音线(客户端))

错误是:

Ignoring exception in command play:
Traceback (most recent call last):
  File "C:\Users\vargh\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Dev\DiscordBots\GGBot\cogs\setVoiceLines.py", line 19, in play
    await channel.connect()
  File "C:\Users\vargh\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\abc.py", line 1277, in connect
    voice = cls(client, self)
  File "C:\Users\vargh\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\voice_client.py", line 199, in __init__   
    raise RuntimeError("PyNaCl library needed in order to use voice")
RuntimeError: PyNaCl library needed in order to use voice
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像