【问题标题】:How I can use discord.py with PyNaCl problem?如何将 discord.py 与 PyNaCl 问题一起使用?
【发布时间】:2021-02-04 10:44:57
【问题描述】:

我遇到了这个问题:

discord.ext.commands.errors.CommandInvokeError:命令引发异常:RuntimeError:使用语音需要 PyNaCl 库

这是我的代码:

import discord
from discord.ext import commands



client = commands.Bot(command_prefix = '.')

@client.event
async def on_ready():
    print('Pronto!')

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

@client.command()
async def leave(ctx):
    await ctx.voice_client.disconnect()

client.run(TOKEN)

但是我安装了 PyNaCl 我该怎么办?

【问题讨论】:

    标签: discord.py


    【解决方案1】:

    您需要安装 voice 版本的 discord.py 我们通过执行以下操作来做到这一点,

    pip install discord.py[voice]
    

    这将安装 discord.py 语音版,其中包含所有需要的包以及它们应该如何提供:)

    【讨论】:

      猜你喜欢
      • 2019-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-23
      • 2016-04-19
      • 1970-01-01
      • 2013-05-12
      • 2021-10-06
      相关资源
      最近更新 更多