Self-hosting voice
This guide sets you up with self-hosted voice bridging for your Fluxcord bot.
Prerequisites
Section titled “Prerequisites”- A working self-hosted bot from the Self-hosting guide
- Both Fluxer and Discord has Developer Mode enabled (go to Settings > Advanced and enable “Developer Mode”)
Enabling voice on the bot
Section titled “Enabling voice on the bot”The bot and the voice runner share a secret password so they can trust each other. You’ll generate it here and reuse it in the next section.
- Firstly, generate a random secret and copy the output.
Terminal window openssl rand -hex 32 - Then, open your
config.js:Terminal window nano config.js # or vi, gedit, kwrite, emacs... - Set the secret to what you copied and enable voice:
Keep the defaultRunnerSecret: "paste-the-secret-here",VoiceBridgingEnabled: true,
RunnerWsPortunless you know you need to change it. - After that, restart the bot.
Terminal window docker compose up -d
Running the voice runner
Section titled “Running the voice runner”The voice runner is a second container that sits next to your bot. It connects to the bot over a WebSocket using the secret from the previous step.
- Firstly, add the voice runner to your
docker-compose.yml. If you already used the combined file from the Self-hosting guide, thevoiceservice is already there and you can skip to step 3. Otherwise, open the file and add this underservices:, next to yourbotservice:Terminal window nano docker-compose.ymlvoice:image: git.gay/fluxcord/voice:latestrestart: unless-stoppedenvironment:- CORE_WS_URL=${CORE_WS_URL:-ws://bot:8765}- RUNNER_SECRET=${RUNNER_SECRET:-}- RUNNER_REGION=${RUNNER_REGION:-}networks:- fluxcord-net - Then, make sure the runner is pointed at your bot.
CORE_WS_URLis where the runner reaches the bot. It defaults tows://bot:8765, which matches the bot’s service name in the combined file. If your bot’s service is named differently, changebotto match. - Create a
.envfile next to yourdocker-compose.ymlwith the same secret from the previous section:Terminal window nano .envRUNNER_SECRET=paste-the-secret-here - Now, start everything.
Terminal window docker compose up -d - To check that it worked, look at the logs.
Look for
Terminal window docker compose logs -fConnected to core. If you see that, the runner is ready. If not, the two most common causes are aRUNNER_SECRETthat doesn’t match the one inconfig.js, or aCORE_WS_URLthat points at the wrong service name.
Bridging multiple voice channels in one server
Section titled “Bridging multiple voice channels in one server”Discord only lets one bot user join one voice channel per server at a time. So to bridge two voice channels in the same server at the same time, you need an extra Discord application per extra channel.
- Firstly, make another bot by following the Making a bot (Discord) steps on the Self-hosting guide. You only need the token, no Message Content Intent needed. Invite it to your server with the View Channel, Connect, Send Messages, Use Voice Activity, and Speak permissions.
- Then, add its token to your
config.js:DiscordVoiceTokens: ["VOICE_TOKEN_1",], - After that, restart the bot.
Terminal window docker compose up -d