A Discord bot for managing RuneScape (OSRS) clan events, built in Go. Complete rewrite of TopezEventBot with improved performance, better maintainability, and modern patterns.
-
Account Linking (
/link-rsn,/unlink-rsn)- Link Discord accounts to RuneScape usernames
- Player verification with Wise Old Man API
- Interactive confirmation flow with player stats embed
-
Boss of the Week (
/botw)- Weekly boss kill count competitions across 5 categories:
- Wilderness bosses (Callisto, Vet'ion, Venenatis, etc.)
- Group bosses (CoX, ToB, ToA, Corp, Nex, etc.)
- Quest bosses (Galvek, Vanstrom, Glough, etc.)
- Slayer bosses (Cerberus, Hydra, Sire, etc.)
- World bosses (Phantom Muspah, DT2 bosses, etc.)
- Automatic tracking via Wise Old Man competitions
- Thread-based participation with buttons
- Winner announcements with medals (🥇🥈🥉)
- Weekly boss kill count competitions across 5 categories:
-
Skill of the Week (
/sotw)- Weekly skill experience competitions (all 23 OSRS skills)
- Automatic XP gain tracking via Wise Old Man
- Thread-based participation
-
Mass Events (
/mass)- Schedule clan mass events with boss dropdown
- OSRS Wiki images for activities
- Discord timestamp formatting with timezone support
- User and server-specific timezone preferences
-
Server Configuration (
/config)- Set coordinator role for event management
- Configure competition code notification channel
- Set default server timezone
- Personal timezone preferences
- Scheduled notifications (30min before events)
- Progress tracking background job
- Leaderboard history tracking
- Admin/warning system
- Comprehensive test coverage
- Language: Go 1.24.1
- Discord Library: discordgo v0.29.0
- Database: SQLite with sqlc (type-safe queries) and goose (migrations)
- External API: Wise Old Man API for player tracking
- Scheduler: robfig/cron v3 for background tasks (planned)
voidling/
├── cmd/voidling/ # Application entry point with migration runner
├── internal/
│ ├── bot/ # Discord bot core with interaction routing
│ ├── commands/ # Command handlers (register, trackable, schedulable, config)
│ ├── embeds/ # Discord embed builders for all event types
│ ├── database/ # Generated sqlc code (type-safe queries)
│ ├── models/ # Domain models (events, players, hiscores)
│ ├── wiseoldman/ # Wise Old Man API client
│ └── timezone/ # Timezone utilities and autocomplete
├── migrations/ # Database migrations (goose) - 6 migrations
├── queries/ # SQL query definitions for sqlc
├── config/ # Configuration management (.env support)
├── refactor/ # Development documentation and session notes
└── Makefile # Build automation (25+ targets)
- Go 1.24.1 or higher
- SQLite3
- Discord bot token (Create one here)
# Clone repository
git clone https://github.com/kaffeed/voidling.git
cd voidling
# Install dev tools and dependencies
make init
# Configure environment
cp .env.example .env
# Edit .env and add your DISCORD_TOKEN
# Build and run
make runThe database migrations run automatically on startup. Your bot is now ready!
Create a .env file (or set environment variables):
# Required
DISCORD_TOKEN=your_bot_token_here
# Optional
DATABASE_PATH=~/.voidling/voidling.db # Default database location
LOG_LEVEL=info # debug|info|warn|error
DISCORD_GUILD_ID=123456789 # For fast command registration during devmake build # Build for current OS
make run # Build and run
make test # Run tests
make fmt # Format code
make vet # Run go vet
make check # Run fmt + vet + test
make sqlc-generate # Regenerate database queries
make migrate-up # Run migrations
make migrate-down # Rollback migration
make migrate-status # Show migration status
make build-all # Build for Windows, Linux, macOS
make release # Create optimized release builds
make help # Show all available targetsSQLite database with automatic migrations on startup. Schema managed via goose, queries via sqlc.
Schema includes:
- Account links (Discord ↔ RuneScape)
- Trackable events (BOTW/SOTW competitions)
- Schedulable events (Mass events)
- Guild configuration (roles, channels, timezones)
- User timezone preferences
Regenerate queries after modifying queries/*.sql:
make sqlc-generateCreate new migration:
make migrate-create NAME=add_new_featureBot Core (internal/bot/)
- Discord session management
- Interaction routing (commands, buttons, modals, autocomplete)
- Permission checking (coordinator role, admin role)
- Handler registration
Commands (internal/commands/)
register.go- Account linking (/link-rsn,/unlink-rsn)trackable.go- Base logic for BOTW/SOTW eventsbotw.go- Boss of the Week command handlerssotw.go- Skill of the Week command handlersschedulable.go- Mass event schedulingconfig.go- Server configuration commandschoices.go- Boss and skill dropdown data
Embeds (internal/embeds/)
- PlayerInfo - Player stats with WOM data
- BossOfTheWeek / SkillOfTheWeek - Event announcements
- EventWinners - Winner displays with medals
- MassEvent - Mass event scheduling with timestamps
- Error/Success - Consistent messaging
Wise Old Man Client (internal/wiseoldman/)
- HTTP client for WOM API
- Player data fetching
- Competition creation and management
- Participant tracking
Database Layer (internal/database/)
- Type-safe queries generated by sqlc
- Transaction support
- Proper error handling
Custom ID Routing: "action:data" format for buttons/modals
confirm-rsn:username
register-for-botw:womCompetitionID,threadIDModal Flow: Command → Modal → Processing → Followup
/link-rsn → show modal → process submission → show player embed → button confirmationTransaction Pattern: Proper rollback/commit
tx, _ := db.Begin()
defer tx.Rollback()
qtx := queries.WithTx(tx)
// ... operations ...
tx.Commit()/link-rsn- Link your RuneScape account/unlink-rsn- Unlink your account/config set-my-timezone- Set your timezone preference
/botw wildy|group|quest|slayer|world- Start BOTW competition/botw finish- Finish current BOTW and announce winners/sotw start- Start SOTW competition/sotw finish- Finish current SOTW and announce winners/mass- Schedule a mass event
/config set-coordinator-role- Set coordinator role/config set-competition-code-channel- Set WOM code channel/config set-default-timezone- Set server default timezone/config set-event-notification-role- Set role to ping when events are created/config show- Show current configuration
Complete rewrite of TopezEventBot (C#/.NET) in Go.
Key Improvements:
- 🚀 Better performance and lower resource usage
- 📦 Single binary deployment (no runtime dependencies)
- 🔒 Type-safe database queries (sqlc vs EF Core)
- 🎯 Cleaner migration management (goose vs EF)
- 🌐 Modern API integration (Wise Old Man vs OSRS Hiscore)
- ⚡ Faster command registration and interaction handling
Data Migration: Database schema is similar but not directly compatible. Manual migration required.
The project includes automated CI/CD pipelines using GitHub Actions.
CI Pipeline (automatic on push/PR):
- Format checking
- Static analysis (go vet)
- Linting (golangci-lint)
- Test execution with race detector
- Multi-platform builds (Linux, Windows, macOS)
- SQLC generation validation
- Database migration testing
CD Pipeline (automatic on version tags):
- Builds production Linux binary with SQLite support
- Deploys to Ubuntu server via SSH
- Manages systemd service (stop/start/verify)
- Creates GitHub releases with binaries
- Automatic rollback on deployment failure
See implement/SECRETS.md for detailed setup instructions.
Quick setup:
# On Ubuntu server
sudo bash scripts/setup-server.sh
# Edit .env with your bot token
sudo nano /opt/voidling/.env
# Add SSH public key for GitHub Actions
echo "ssh-ed25519 AAAAC3..." | sudo tee -a /opt/voidling/.ssh/authorized_keysConfigure GitHub Secrets:
SSH_HOST- Server IP/hostnameSSH_USERNAME- SSH user (typicallyvoidling)SSH_KEY- SSH private keySSH_PORT- SSH port (default: 22)DEPLOY_PATH- Deployment path (default:/opt/voidling)
Deploy:
# Tag and push to trigger deployment
git tag v1.0.0
git push origin v1.0.0Service Management:
sudo systemctl status voidling # Check status
sudo systemctl restart voidling # Restart
sudo journalctl -u voidling -f # View logsIssues and pull requests welcome! This is an active project.
Development priorities:
- Scheduled notifications implementation
- Progress tracking background job
- Test coverage expansion
MIT License
- Original Project: TopezEventBot (C#)
- Wise Old Man: API Documentation
- OSRS Wiki: Boss Information
Status: Active development • Production ready for core features • ~5,300 lines of Go code