Skip to content

Dusk-afk/bridgecord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bridgecord

Bridgecord Logo

A lightweight Discord voice control bridge for seamless audio management

Table of Contents

Description

Bridgecord is a background service that enables external applications and scripts to control Discord voice settings through a simple Unix socket interface. Control your Discord mute/deaf status programmatically without touching the Discord interface.

Key Features:

  • Mute/Unmute your microphone
  • Deafen/Undeafen your audio
  • Toggle both settings programmatically
  • Runs as a systemd service with automatic Discord OAuth authentication
  • Simple Unix socket interface at /tmp/bridgecord.sock

Architecture

External App/Script → Unix Socket → Bridgecord → Discord IPC → Discord Client
                   /tmp/bridgecord.sock         discord-ipc-*

Supported Commands

Send these commands to /tmp/bridgecord.sock:

  • mute_on - Mute your microphone
  • mute_off - Unmute your microphone
  • mute_toggle - Toggle mute status
  • deaf_on - Deafen audio (also mutes microphone)
  • deaf_off - Undeafen audio
  • deaf_toggle - Toggle deaf status

Example Usage

# Using the helper command (installed automatically)
bridgecord-cmd mute_toggle
bridgecord-cmd deaf_on
bridgecord-cmd                    # Show all commands

# Using raw socket communication
echo "mute_on" | socat - UNIX-SENDTO:/tmp/bridgecord.sock

Prerequisites

  • Go 1.24.4+ - For building the application
  • Linux - Currently supports Linux systems only
  • Discord Application - You need to create a Discord application and get credentials
  • systemd - For service management (optional but recommended)

Installation

Automatic Installation

git clone https://github.com/yourusername/bridgecord
cd bridgecord
chmod +x scripts/install.sh
./scripts/install.sh

This installs the service, helper command, and handles Discord app setup automatically.

Manual Installation

# 1. Get Discord credentials from https://discord.com/developers/applications
export CLIENT_ID="your_client_id"
export CLIENT_SECRET="your_client_secret"

# 2. Build and run
go build -o bridgecord ./cmd/bridgecord/
./bridgecord

# 3. Optional: Install helper script
sudo cp scripts/bridgecord-cmd.sh /usr/local/bin/bridgecord-cmd

Configuration

Automatic Installation: Credentials are configured during installation. To change them later, either:

  • Run the installer script again, or
  • Edit /etc/systemd/system/bridgecord.service and restart the service

Manual Installation: Export environment variables as shown in the installation steps above.

Service Management

sudo systemctl status bridgecord        # Check status
sudo journalctl -u bridgecord -f        # View logs  
sudo systemctl restart bridgecord       # Restart service

Uninstallation

Automatic Uninstallation

To completely remove Bridgecord from your system:

chmod +x scripts/uninstall.sh
./scripts/uninstall.sh

This will:

  • Stop and disable the systemd service
  • Remove the binary and helper script from /usr/bin/
  • Remove the service file

Manual Uninstallation

If you prefer to remove components manually:

# Stop and disable service
sudo systemctl stop bridgecord
sudo systemctl disable bridgecord

# Remove files
sudo rm -f /usr/bin/bridgecord
sudo rm -f /usr/bin/bridgecord-cmd
sudo rm -f /etc/systemd/system/bridgecord.service

# Reload systemd
sudo systemctl daemon-reload

# Remove socket (if present)
rm -f /tmp/bridgecord.sock

Security

  • Token Storage: Discord OAuth tokens are securely stored in the system keyring
  • User Isolation: The service runs under your user account, not as root
  • Minimal Permissions: Only requires Discord voice settings permissions

Project Structure

bridgecord/
├── cmd/bridgecord/          # Main application entry point
├── internal/
│   ├── auth/                # OAuth token management
│   ├── bridge/              # Unix socket command server
│   └── discord/             # Discord IPC client
├── scripts/
│   ├── dev.sh               # Development script for running locally
│   ├── install.sh           # Installation script
│   ├── uninstall.sh         # Uninstallation script
│   └── bridgecord-cmd.sh    # Helper script for sending commands
└── README.md

Troubleshooting

Service issues: sudo journalctl -u bridgecord -f
Discord connection: Ensure Discord is running and logged in
Socket access: Check /tmp/bridgecord.sock exists
Permissions: Service should run as your user, not root

Contributing

Contributions welcome! Submit issues and pull requests on GitHub.

About

A lightweight Discord voice control bridge for seamless audio management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published