Discord.NET - Bot immediately disconnects after joining voice channel

后端 未结 3 922
盖世英雄少女心
盖世英雄少女心 2021-01-16 15:29

I have all of the libraries (libopus.dll and libsodium.dll), I have FFMPEG and an audio file in my execution path, but still the bot immediately disconnects after joining th

3条回答
  •  情书的邮戳
    2021-01-16 16:10

    For starters, Foxbot has the libsodium and opus libraries for windows ready to go. These are the ones I use in my personal audio bot as well.

    Now, there is a slight difference between where you have to locate your dll's based on what you are doing.

    During deployed runs, aka published project or running it from the console through your bin/insert path to env etc directly, discord.net looks for the libsodium/opus dll's in your bin/insert path to env etc.

    However, during debug runs with visual studio and the likes, instead of looking in your bin/insert path to env etc, it will look in the root folder of your project. Hence for this scenario, you will also need to include the libsodium and opus dll's in the folder where your .csproj is located.

    As a personal preference, I also do the same for the ffmpeg.exe. Including this both in deployed bin folders, and having a copy besides the csproj.

提交回复
热议问题