|
|
||
|---|---|---|
| .woodpecker | ||
| .gitignore | ||
| database.js | ||
| Dockerfile | ||
| eslint.config.js | ||
| example.env | ||
| index.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
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
- Clone the repository:
git clone <repository-url>
cd Temp-Voice-URC
- Install dependencies:
npm ci
- Create a
.envfile:
cp example.env .env
- Edit the
.envfile with your bot credentials:
BOT_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
- 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
- Go to the Discord Developer Portal
- Create a new application or select an existing one
- Navigate to the Bot section and create a bot
- Copy the Token (keep this secret!)
- Navigate to OAuth2 → General and copy the Application ID (this is your CLIENT_ID)
- Under Bot, enable the following intents:
- Server Members Intent
- Message Content Intent
Usage
Setting Up Spawn Channels
-
Create a category where temporary channels will be created
-
Use the
/createspawncommand 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")
-
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
Docker Compose (recommended)
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