Skip to content

Set up the Discord bridge

The Discord bridge is an optional host service that carries a Discord voice channel into teaport. When the user it follows joins a voice channel on your server, the teaport bot joins the same channel: you talk to the assistant through Discord, and it answers there. The installer adds the bridge only when you ask for it; a plain install leaves no bridge behind.

Discord carries voice as UDP media, and the brain runs in a sandbox that allows only TCP. The bridge therefore runs on the host next to the brain, owns only the audio leg, and pipes it to the brain’s /talk endpoint. The brain keeps doing what it does on the dashboard Talk page: speech recognition, the language model, speech synthesis, and barge-in.

The brain holds one conversation at a time. When the bot joins, a live dashboard Talk session ends; a live bridge session refuses the dashboard the same way. Joining again replaces the bot’s own session. What the assistant can do in your server, such as posting or pinning, comes from the agent’s own Discord tools and permissions.

  • A running teaport brain: the bridge pipes the audio to it over ws://127.0.0.1:7861/talk.
  • Node.js 22 or later on the host. The installer stops when it is missing.
  • The ID of your Discord server (the guild ID) and your Discord user ID, both numeric.
  1. Create an application in the Discord Developer Portal and add a bot to it.

  2. Enable the Server Members intent for the bot.

  3. Invite the bot to your server, and give it the Connect and Speak permissions.

  4. Save the token to ~/.config/teaport/discord_bot_token with mode 600:

    Terminal window
    mkdir -p ~/.config/teaport
    printf '%s' DISCORD_BOT_TOKEN > ~/.config/teaport/discord_bot_token
    chmod 600 ~/.config/teaport/discord_bot_token

    Replace DISCORD_BOT_TOKEN with the token from the application you created. The file now holds the token, and only your user can read it.

The installer does the rest: it copies the bridge, installs its dependencies, writes /etc/teaport/bridge.env and the teaport-discord-bridge unit, and enables the service.

  • On the Jetson, re-run the installer with the bridge turned on:

    Terminal window
    TEAPORT_ENABLE_BRIDGE=1 TEAPORT_BRIDGE_GUILD_ID=GUILD_ID \
    TEAPORT_BRIDGE_FOLLOW_USER_ID=USER_ID ./install.sh

    Replace the following:

    • GUILD_ID: the ID of your Discord server.
    • USER_ID: the ID of the user the bot follows into voice channels.

The installer writes both values to /etc/teaport/bridge.env.

Leave the variables out and the installer prompts for the server and the user, and for the token when no token file exists. The installer also accepts the token as DISCORD_BOT_TOKEN and writes it to the token file. A repair run keeps the values already in bridge.env unless you set the variables again.

The token itself never lands in the unit or in bridge.env: the env file records the token path, DISCORD_BOT_TOKEN_FILE, ~/.config/teaport/discord_bot_token by default. The bridge reads the token from that file at startup, and a DISCORD_BOT_TOKEN environment variable wins when set. A new token needs a bridge restart to take effect.

  1. Check that the service is enabled and active:

    Terminal window
    systemctl status teaport-discord-bridge

    An inactive unit with no log entries means the installer skipped the bridge; re-run it with TEAPORT_ENABLE_BRIDGE=1.

  2. Follow the log while you test:

    Terminal window
    journalctl -u teaport-discord-bridge -f

    While the bridge waits for the user, the output is similar to the following:

    waiting for user 271828182845159064 to join a voice channel

    The line bot is not in the configured guild means you have not added the bot to the server in BRIDGE_GUILD_ID.

  3. Join a voice channel on the server as the user the bot follows, and speak. The bot joins the channel with you and leaves when you leave; the assistant hears you and answers in the channel.

  • To stop the bridge and keep it from starting at boot:

    Terminal window
    sudo systemctl disable --now teaport-discord-bridge

    The bot leaves the channel, and the unit no longer starts at boot. To use the bridge again, run the same command with enable.

For the settings the bridge reads, and for the other ways to talk to teaport, see: