Welcome to Disruptor, the bot that brings delightful chaos to your Discord server! This mischievous Go bot randomly joins voice channels at unpredictable intervals to play surprise sounds from your server's Discord soundboard. Whether you want spontaneous fun, a good laugh, or a jump scare, Disruptor delivers! Fast, reliable, and built on Discord's native soundboard APIโno external sound storage required. ๐๐
- ๐ฒ Random Voice Channel Invasions: Sneaks into voice channels at random intervals for maximum surprise.
- ๐ Native Soundboard Integration: Plays sounds directly from your server's Discord soundboard.
- โฐ Unpredictable Timing: You never know when it's coming next!
- ๐ต Auto-Discovery: Automatically uses all soundboard sounds available in your server.
- ๐ฏ Smart Channel Selection: Picks active voice channels using weighted random selection for maximum impact.
- โ๏ธ Per-Guild Configuration: Each server can customize disruption intervals and preferences.
- ๐โโ๏ธ Bun ORM & SQLite: Fast, modern database operations with automatic schema management.
- ๐ ๏ธ Environment Variable Config: Fine-tune chaos levels with simple env vars.
- ๐ณ Docker-Ready: Optimized Dockerfile for easy deployment.
- ๐ Metrics & Logs: Track disruptions with integrated metrics and structured logging.
- ๐งฉ Modular Mayhem: Easily add new disruption strategies.
- ๐ต๏ธ Voice Channel Vigilance: Monitors voice channels and picks the perfect moments to strike.
- โ๏ธ Weighted Channel Selection: Set custom weights for voice channels to control disruption probability.
- ๐งโ๐ป Slash Commands: Control the bot with Discord slash commands (
/play,/interval,/chance,/disconnect,/next,/weight). - ๐๏ธ Interval & Chance Control: Adjust how often and how likely disruptions are per guild.
- ๐ Manual Disconnect: Instantly stop disruptions with a command.
- ๐ Next Disruption Preview: See when the next chaos event is scheduled.
- ๐ง Advanced Scheduler: Worker pools, jitter, grouping, and more for unpredictable disruption schedules.
- ๐ท๏ธ Structured Logging: Debug and monitor with clear, contextual logs.
- ๐๏ธ Automatic Schema Migration: Database tables and schema managed on startup.
- ๐งช Test Infrastructure: Ready for tests (no unit tests yet, but infra is set up).
- ๐ก๏ธ Safe Defaults: In-memory DB for dev, file-based for production.
Want to get up and running immediately? Follow the Quick Start Guide for the fastest setup path.
Choose the guide that matches your experience level: ๐ฏ
| Guide | Audience | Time | Description |
|---|---|---|---|
| Quick Start | Everyone ๐ฅ | 10 min โก | Fastest path to a working bot ๐ |
| Discord Setup | New to Discord bots ๐ | 15 min ๐ | Step-by-step Discord bot creation ๐ค |
| Installation | All platforms ๐ | 20 min ๐ง | Detailed platform-specific installation ๐ป |
| Configuration | Advanced users ๐ค | 30 min โ๏ธ | Complete configuration reference ๐ |
| Deployment | Production ๐ญ | 45 min ๐ | Production deployment strategies ๐ณ |
If you just want to test locally (the lazy way ๐):
# 1. Create Discord bot (get token from Discord Developer Portal)
# 2. Clone and build
git clone https://github.com/XanderD99/disruptor.git
cd disruptor && go mod download && make build
# 3. Run with your token
export CONFIG_TOKEN="your_discord_bot_token"
./output/bin/disruptorNeed help? ๐ค Start with the Discord Setup Guide if you're new to Discord bots.
๐ Complete Documentation Index - Find the right guide for your needs! ๐บ๏ธ
# Build image ๐๏ธ
make docker-build
# Run with environment variables ๐
docker run -d --name disruptor \
-e CONFIG_TOKEN="your_discord_bot_token" \
-e CONFIG_DATABASE_DSN="file:/data/disruptor.db?cache=shared" \
-v $(pwd)/data:/data \
disruptor:latest# docker-compose.yml ๐
version: '3.8'
services:
disruptor:
build: .
environment:
- CONFIG_TOKEN=${DISCORD_TOKEN} # Set in .env file
- CONFIG_DATABASE_DSN=file:/data/disruptor.db?cache=shared
volumes:
- ./data:/data
restart: unless-stoppedecho "DISCORD_TOKEN=your_bot_token" > .env # ๐ Secret sauce!
docker-compose up -d # ๐ Blast off!๐ Production Deployment: See Deployment Guide for advanced deployment scenarios! ๐ญโจ
- Soundboard Discovery ๐: Finds all soundboard sounds in your server.
- Random Selection ๐ฒ: Picks a sound and a channel at random.
- Native Playback ๐: Uses Discord's soundboard API for high-quality audio.
- Smart Timing ๐ง : Advanced scheduler determines when to disrupt.
- Guild Configuration โ๏ธ: Stores only server settings (intervals, preferences) in the database.
- Slash Commands โก: Control disruption, intervals, chance, and more directly from Discord.
Required (or it won't work! ๐ฑ):
CONFIG_TOKEN: Your Discord bot token (get from Discord Developer Portal) ๐๏ธ
Recommended (for a better experience ๐ฏ):
CONFIG_DATABASE_DSN: Database location (file:./disruptor.db?cache=sharedfor persistent storage) ๐๏ธCONFIG_LOGGING_LEVEL: Log verbosity (debug,info,warn,error) ๐
# Development (for testing & breaking things ๐งช)
export CONFIG_TOKEN="your_bot_token"
export CONFIG_DATABASE_DSN="file::memory:?cache=shared" # In-memory (poof! gone when you restart ๐จ)
export CONFIG_LOGGING_LEVEL="debug"
# Production (for the real deal ๐ฏ)
export CONFIG_TOKEN="your_bot_token"
export CONFIG_DATABASE_DSN="file:./disruptor.db?cache=shared" # Persistent (keeps your data safe ๐ก๏ธ)
export CONFIG_LOGGING_LEVEL="info"๐ Complete Reference: See Configuration Guide for all options and examples! ๐โจ
- SQLite + Bun ORM ๐ช: Zero config, fast, reliable, portable.
- Options (pick your flavor! ๐ฆ):
- In-memory:
CONFIG_DATABASE_DSN=file::memory:?cache=sharedโก (fast but forgetful!) - File-based:
CONFIG_DATABASE_DSN=file:./disruptor.db?cache=shared๐พ (remembers everything!) - Custom path:
CONFIG_DATABASE_DSN=file:/path/to/your/database.db?cache=shared๐๏ธ (your way!)
- In-memory:
- Automatic Schema Management ๐ค: Tables and migrations handled on startup.
cmd/๐ช: Application entrypointsinternal/๐: Core application logiccommands/โก: Discord slash commands (/play,/interval,/chance,/disconnect,/next)handlers/๐ฏ: Discord event handlersmodels/๐๏ธ: Database models (Bun ORM)scheduler/โฐ: Audio scheduling and timing logicmetrics/๐: Prometheus metrics and monitoringutil/๐ ๏ธ: Shared utilities
pkg/๐ฆ: Reusable packages (logging, processes)ci/๐ญ: CI/CD configuration and Docker filesdocs/๐: Documentationoutput/๐ฏ: Compiled binaries
# Download dependencies ๐ฆ
go mod download
# Build application ๐จ
make build
# Run tests (currently no tests implemented ๐
)
make test
# Static analysis and formatting ๐งน
go vet ./...
go fmt ./...Note make lint - there are known configuration issues with golangci-lint. Use go vet ./... instead.
# Clone repository ๐ฅ
git clone https://github.com/XanderD99/disruptor.git
cd disruptor
# Install system dependencies (Ubuntu/Debian) ๐ง
sudo apt install -y libopus-dev pkg-config
# Build and run in development mode ๐
go mod download
make build
export CONFIG_TOKEN="your_dev_bot_token"
export CONFIG_LOGGING_LEVEL="debug"
./output/bin/disruptor๐ Contributing: See CONTRIBUTING.md for development guidelines! ๐คโจ
/play๐ต โ Play a soundboard sound immediately/intervalโฑ๏ธ โ Set disruption interval per guild/chance๐ฒ โ Set disruption chance per guild/weightโ๏ธ โ Set channel selection weight (0-100, higher = more likely to be chosen)/disconnect๐ โ Instantly stop disruptions/next๐ฎ โ Preview next scheduled disruption
Disruptor now supports weighted channel selection, allowing you to control which voice channels are more likely to be chosen for disruptions! ๐ฏโจ
- Each voice channel has a weight that determines its selection probability ๐
- Default weight: 50 (balanced selection) โ๏ธ
- Range: 0-100 (0 = never selected ๐ซ, 100 = maximum priority ๐)
- Smart selection: Channels with higher weights are proportionally more likely to be chosen ๐ง
# Set a channel's weight ๐ฏ
/weight channel:#general-voice weight:75
# Check current weight (omit weight parameter) ๐
/weight channel:#general-voice
# High priority channel (disrupted more often) ๐ฅ
/weight channel:#chaos-room weight:90
# Low priority channel (disrupted less often) ๐คซ
/weight channel:#quiet-study weight:10
# Exclude channel from disruptions ๐ซ
/weight channel:#meeting-room weight:0If you have 3 channels with these weights:
- ๐ต Music Room: Weight 80 (party time! ๐)
- ๐ฃ๏ธ General Chat: Weight 50 (default balance โ๏ธ)
- ๐ Study Hall: Weight 20 (keep it quiet ๐คซ)
Music Room will be disrupted ~53% of the time, General Chat ~33%, and Study Hall ~13%. Math! ๐งฎโจ
- Priority channels ๐: Boost weight for channels where disruptions are most welcome
- Protected spaces ๐ก๏ธ: Lower weight for serious discussion channels
- Event management ๐: Temporarily adjust weights for special events
- Community preferences ๐ณ๏ธ: Let server members vote on channel disruption preferences
| Issue | Quick Fix |
|---|---|
| "CONFIG_TOKEN is not set" ๐ฑ | export CONFIG_TOKEN="your_bot_token" ๐ |
| Bot won't connect ๐ต | Verify token in Discord Developer Portal ๐ |
| No slash commands ๐ญ | Wait 1 hour for sync, or re-invite bot โฐ |
| Can't join voice ๐ซ | Check bot has Connect + Speak permissions ๐ค |
| No sounds playing ๐ | Upload sounds to server soundboard ๐ต |
- ๐ Quick fixes: Troubleshooting Guide (coming soon! ๐)
- ๐ Setup help: Setup Guide (your new best friend ๐ค)
- โ๏ธ Config issues: Configuration Guide (all the knobs and dials ๐๏ธ)
- ๐ Bug reports: GitHub Issues (oops, we broke something! ๐ )
- ๐ฌ Questions: GitHub Discussions (let's chat! โ)
We welcome contributions! Here are some areas where help is appreciated: ๐โโ๏ธ๐โโ๏ธ
- ๐ฏ Smart channel selection algorithms - Better logic for choosing voice channels (make it smarter! ๐ง )
- ๐ญ New disruption strategies - Creative ways to surprise users (chaos innovation! ๐ก)
- โ๏ธ Advanced configuration options - More customization features (all the knobs! ๐๏ธ)
- ๐ Performance optimizations - Memory and CPU improvements (faster chaos! โก)
- ๐ Global soundboard support - Cross-server sound sharing (world domination! ๐)
- ๐ Documentation improvements - Better guides and examples (make it clearer! ๐)
- ๐งช Test coverage - Unit and integration tests (break it properly! ๐จ)
๐ Read more: CONTRIBUTING.md for development guidelines! ๐คโจ
MIT License. See LICENSE.
- Discord API ๐ค (the magic behind the curtain)
- Disgo โก (our Discord superhero library)
- Bun ๐๏ธ (database wizardry)
- Go ๐น (gopher power!)
- SQLite ๐ฑ (tiny but mighty database)
- Everyone who's been "disrupted" by this botโyou're the real MVP! ๐๐
Warning