我有所有的库(libopus.dll和libsodium.dll),我的执行路径中有FFMPEG和音频文件,但是加入频道后机器人仍会立即断开连接。为什么会发生这种情况?如何解决?
编辑:我将此示例用于音频:https://gist.github.com/Joe4evr/773d3ce6cc10dbea6924d59bbfa3c62a
答案 0 :(得分:3)
这些是我从官方Discord API公会中提取的一些内容。
Windows 64位:https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x64.zip
Windows 32位:https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x86.zip
FFmpeg for Windows:https://dsharpplus.emzi0767.com/natives/index.html#ffmpeg-for-windows
其他操作系统:
GNU / Linux:https://dsharpplus.emzi0767.com/articles/vnext_setup.html#gnulinux-1
OS X:https://dsharpplus.emzi0767.com/articles/vnext_setup.html#mac-os-x-1
FreeBSD:https://dsharpplus.emzi0767.com/articles/vnext_setup.html#freebsd
D.NET用户注意事项:您需要在使用前将libopus.dll重命名为opus.dll,否则音频客户端仍会抱怨缺少库。
答案 1 :(得分:1)
使用Discord.Net,您必须将libopus.dll
重命名为opus.dll
。
答案 2 :(得分:1)
对于初学者来说,Foxbot已准备好Windows的libsodium和opus库。这些也是我在个人音频bot中使用的。
现在,根据所执行的操作来确定dll的位置之间存在细微差别。
在已部署的运行,又名已发布的项目中,或者直接通过bin/insert path to env etc
从控制台运行它时,discord.net会在bin/insert path to env etc
中查找libsodium / opus dll。
但是,在使用Visual Studio等进行调试的过程中,它将在项目的根文件夹中查找,而不是在bin/insert path to env etc
中查找。因此,对于这种情况,您还需要在.csproj所在的文件夹中包含libsodium和opus dll。
作为个人喜好,我也对ffmpeg.exe做同样的事情。将其包括在已部署的bin文件夹中,并在csproj之外添加一个副本。