No description
Find a file
ElZeckos b923691684
All checks were successful
ci/woodpecker/push/check Pipeline was successful
ci/woodpecker/tag/check Pipeline was successful
ci/woodpecker/release/check Pipeline was successful
ci/woodpecker/release/docker-stable Pipeline was successful
Merge pull request 'cleaned code' (#7) from yorrick-#2 into main
Reviewed-on: #7
2026-01-13 16:56:51 +01:00
.woodpecker removed deploy-secret 2026-01-12 18:39:03 +01:00
.gitignore Changed db directory and added check§ 2026-01-11 21:23:31 +01:00
database.js Changed db directory and added check§ 2026-01-11 21:23:31 +01:00
Dockerfile Added Dockerfile 2026-01-11 21:35:59 +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 cleaned code 2026-01-13 00:58:01 +01:00
package-lock.json Fixed hardcoded token split into using .env File 2026-01-12 18:55:22 +01:00
package.json Fixed hardcoded token split into using .env File 2026-01-12 18:55:22 +01:00
README.md README.md aktualisiert 2026-01-13 01:20:59 +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

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

  1. Create a category where temporary channels will be created

  2. Use the /createspawn command to create a spawn channel:

    /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")
  3. Users can now join the 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 /removespawn channel:<channel>
/permissions Shows bot permissions status /permissions
/checkcategory Shows bot permissions status for categorys /checkcategory category:<category>

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:

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

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 Channel sehen
Connect Verbinden

Category permissions:

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

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
├── data/                # SQLite database directory (auto-created)
├── 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
├── package.json         # Project dependencies and scripts
└── 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
  • User names: Saves custom channel names for users