No description
  • JavaScript 99.6%
  • Dockerfile 0.4%
Find a file
ElZeckos 1ef754d16a
All checks were successful
ci/woodpecker/push/check Pipeline was successful
updated readme
2026-03-01 13:19:18 +01:00
.woodpecker Removed package-lock.json from CI/Docker/Git 2026-02-22 20:54:40 +01:00
commands ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
.dockerignore added dockerignore 2026-02-23 12:29:11 +01:00
.gitignore Docker npm i to npm ci 2026-02-23 10:29:42 +01:00
bridgehandler.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
commands.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
database.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
Dockerfile Dockerfile aktualisiert 2026-02-23 12:14:07 +01:00
eslint.config.js Added eslint for dev depends 2026-01-11 21:32:36 +01:00
example.env Fixed hardcoded token split into using .env File 2026-01-12 18:55:22 +01:00
index.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
interactions.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
package-lock.json fix: upgrade discord.js to v14 and fix deprecation warning- Update discord.js from v13.17.1 to v14.18.0- Change 'ready' event to 'clientReady' for v15 compatibility- Remove BOM from index.js 2026-02-20 19:16:31 +01:00
package.json fix: upgrade discord.js to v14 and fix deprecation warning- Update discord.js from v13.17.1 to v14.18.0- Change 'ready' event to 'clientReady' for v15 compatibility- Remove BOM from index.js 2026-02-20 19:16:31 +01:00
README.md updated readme 2026-03-01 13:19:18 +01:00
renovate.json renovate.json aktualisiert 2026-02-22 21:02:35 +01:00
utils.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00
voicehandler.js ChannelBridge (#27) 2026-03-01 13:03:56 +01:00

Temp-Voice-URC

A Discord bot that creates temporary voice channels with admin panels. Users can join a spawn channel to automatically get their own private voice channel with a dedicated admin text channel and control panel.

Features

  • Automatic Channel Creation: When a user joins a spawn channel, a temporary voice channel and admin text channel are automatically created
  • Admin Control Panel: Each temporary channel comes with a dedicated text channel containing a control panel with buttons for:
    • ✏️ Rename the voice channel
    • 👢 Kick all members
    • Add role permissions
    • Remove role permissions
  • Auto-Cleanup: Temporary channels are automatically deleted when empty
  • Persistent Settings: User names and spawn channel configurations are saved to SQLite database
  • Slash Commands: Easy-to-use commands for server administrators to manage spawn channels
  • Permission Checking: Built-in command to verify bot permissions
  • Bridge: Connect text channels across multiple Discord servers to sync messages in real time

Prerequisites

  • Node.js 18 or higher
  • npm (Node Package Manager)
  • A Discord bot token and client ID
  • Docker (optional, for containerized deployment)

Installation

Local Development

  1. Clone the repository:
git clone <repository-url>
cd Temp-Voice-URC
  1. Install dependencies:
npm ci
  1. Create a .env file:
cp example.env .env
  1. Edit the .env file with your bot credentials:
BOT_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
  1. Run the bot:
node index.js

Configuration

Environment Variables

Variable Description Required
BOT_TOKEN Your Discord bot token Yes
CLIENT_ID Your Discord application client ID Yes

Getting Bot Credentials

  1. Go to the Discord Developer Portal
  2. Create a new application or select an existing one
  3. Navigate to the Bot section and create a bot
  4. Copy the Token (keep this secret!)
  5. Navigate to OAuth2 → General and copy the Application ID (this is your CLIENT_ID)
  6. Under Bot, enable the following intents:
    • Server Members Intent
    • Message Content Intent

Usage

Setting Up Spawn Channels

There are two ways to set up spawn channels:

Option A Create a new channel (/createspawn): Creates a brand new voice channel that immediately acts as a spawn.

  1. Create a category where temporary channels will be created
  2. Use /createspawn:
    /createspawn category:<category> name:<optional_name>
    
    • category: The category where temp channels will be created (required)
    • name: Name of the spawn channel (optional, defaults to "🎧 Temp Voice Spawn")

Option B Register an existing channel as a spawn (/spawn add): Registers an already existing voice channel as a spawn without recreating it.

  1. Use /spawn add:

    /spawn add kanal:<voice-channel> kategorie:<category>
    
    • kanal: The existing voice channel to register as spawn (required)
    • kategorie: The category where temp channels will be created (required)
  2. To remove a spawn registration without deleting the channel:

    /spawn remove kanal:<voice-channel>
    
  3. To list all registered spawns on the server:

    /spawn list
    

Users can now join any registered spawn channel to get their own temporary voice channel.

Slash Commands

Command Description Usage
/createspawn Creates a new spawn channel /createspawn category:<category> [name:<name>]
/removespawn Removes a spawn channel and deletes it /removespawn channel:<channel>
/spawn add Registers an existing voice channel as spawn /spawn add kanal:<channel> kategorie:<category>
/spawn remove Unregisters a spawn channel (channel is not deleted) /spawn remove kanal:<channel>
/spawn list Lists all registered spawn channels /spawn list
/permissions Shows bot permissions status /permissions
/checkcategory Shows bot permissions for a category /checkcategory category:<category>
/bridge create Creates a new bridge group /bridge create name:<name>
/bridge add Adds a text channel to a bridge /bridge add kanal:<channel> bridge:<name>
/bridge remove Removes a text channel from a bridge /bridge remove kanal:<channel>
/bridge list Lists all active bridges /bridge list
/bridge delete Deletes an entire bridge group /bridge delete name:<name>

Admin Panel Buttons

When a user joins a spawn channel, they receive:

  • A private voice channel (named after them or their saved name)
  • A private admin text channel with a control panel

Button Functions:

  • ✏️ Rename: Send a new name in the chat to rename the voice channel
  • 👢 Kick: Kicks all members except the owner from the voice channel
  • Add Role: Add a role to have access to the voice channel
  • Remove Role: Remove a role's access to the voice channel

Bridge Connecting Text Channels Across Servers

The bridge feature allows you to sync messages between text channels on different Discord servers. Messages are forwarded via webhooks and appear with the sender's username and avatar.

Note: The bot must be invited to all servers you want to connect, and needs the Manage Webhooks permission in each bridged channel.

Setup:

  1. Create a bridge (only needs to be done once, on any server):

    /bridge create name:global-chat
    
  2. Add a channel on Server A:

    /bridge add kanal:#your-channel bridge:global-chat
    
  3. Add a channel on Server B (same bridge name!):

    /bridge add kanal:#your-channel bridge:global-chat
    

Messages sent in either channel will now appear in both. They are displayed as:

Username • Server Name Hello everyone! 👋

Bot Permissions

The bot requires the following permissions in your server:

Permission German Name
Manage Channels Kanäle verwalten
Send Messages Nachrichten senden
Manage Messages Nachrichten verwalten
Move Members Mitglieder verschieben
Manage Roles Rollen verwalten
View Channels Kanäle anzeigen
Connect Verbinden
Manage Webhooks Webhooks verwalten

Category permissions:

Permission German Name
Manage Channels Kanäle verwalten
View Channel Kanal anzeigen
Send Messages Nachrichten senden
Connect Verbinden

Use the /permissions and /checkcategory command to check if your bot has all required permissions.

Docker Deployment

Build Docker Image (locally)

docker build -t temp-voice-urc .

Run with Docker

docker run -d \
  --name temp-voice-urc \
  -e BOT_TOKEN=your_bot_token \
  -e CLIENT_ID=your_client_id \
  -v $(pwd)/data:/app/data \
  temp-voice-urc

Create a docker-compose.yml file:

version: '3.8'
services:
  bot:
    build: .
    container_name: temp-voice-urc
    environment:
      - BOT_TOKEN=${BOT_TOKEN}
      - CLIENT_ID=${CLIENT_ID}
    volumes:
      - ./data:/app/data
    restart: unless-stopped

Run with:

docker-compose up -d

Project Structure

Temp-Voice-URC/
├── .gitignore           # Git ignore rules
├── .woodpecker/         # CI/CD configuration
├── commands/            # Slash command handlers
│   ├── bridge.js        # /bridge command logic
│   ├── checkcategory.js # /checkcategory command logic
│   ├── createspawn.js   # /createspawn command logic
│   ├── permissions.js   # /permissions command logic
│   ├── removespawn.js   # /removespawn command logic
│   └── spawn.js         # /spawn add, remove, list logic
├── data/                # SQLite database directory (auto-created)
├── bridgehandler.js     # Bridge message forwarding logic
├── commands.js          # Discord slash command registration
├── database.js          # SQLite database setup and initialization
├── Dockerfile           # Docker container configuration
├── eslint.config.js     # ESLint configuration
├── example.env          # Example environment variables
├── index.js             # Main bot application
├── interactions.js      # Slash command & button interaction handler
├── utils.js             # Shared utilities and helpers
├── voicehandler.js      # Voice state update handler
└── README.md            # This file

Database

The bot uses SQLite (via better-sqlite3) for persistent storage. The database is stored in ./data/data.db and contains:

  • Spawn channel configurations: Maps spawn channel IDs to category IDs per guild (stored as spawn-list-<guildId> and spawn-<guildId>-<channelId>)
  • Temporary voice channels: Persists active temp channels across restarts
  • User names: Saves custom channel names for users
  • Voice roles: Saves per-user role permissions that are restored on channel recreation
  • Bridges: Stores bridge groups and their connected channels with webhook URLs