命令引发异常:OpusNotLoaded: [英] Command raised an exception: OpusNotLoaded:

查看:84
本文介绍了命令引发异常:OpusNotLoaded:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用discord.py对discord机器人进行编程,一切都非常完美。
除了一件事情:我不能让机器人播放音乐。

I just started programming a discord bot with discord.py and everything is perfect. Except one thing: I can't let the bot play music.

这是我的代码:

@client.command(pass_context=True)
async def yt(ctx, url):

    author = ctx.message.author
    voice_channel = author.voice_channel
    vc = await client.join_voice_channel(voice_channel)

    player = await vc.create_ytdl_player(url)
    player.start()

我的错误:

discord.ext.commands.errors.CommandInvokeError: 
Command raised an exception: 
OpusNotLoaded:

为什么会发生?

推荐答案

您需要使用 discord.opus.load_opus 到加载Opus库。

You need to use discord.opus.load_opus to load the Opus library.

这篇关于命令引发异常:OpusNotLoaded:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆