Files
BattleBot/DEPLOYMENT.md
VinceC dd8aa456d9 v1.2.11: Add tournaments command with filtering and improve error handling
Features:
- Add /tournaments command with status and game filters
- Add tournament API integration to PlayerService
- Add beautiful tournament embed builders with prize pools
- Protect sync-games from overwriting manual customizations
- Improve error handling with proper MessageFlags

Changes:
- Add getTournamentsData() and getTournamentData() to PlayerService
- Add tournament command handler with pagination support
- Add tournament embed builders with rich formatting
- Update deployment docs for v1.2.10 features
- Add issue tracker documentation
- Add tournament testing script
- Fix ephemeral flags throughout CommandHandler
- Improve permission checks with PermissionFlagsBits

Version: 1.2.11
2025-10-02 06:24:54 -05:00

172 lines
5.3 KiB
Markdown

# 🚀 VRBattles Discord Bot - Deployment Guide
## 📦 **Latest Version: v1.2.10**
### **What's New in v1.2.10:**
- ✅ MAJOR FIX: Tournament status filter now works correctly and permanently
- ✅ Fixed sync-games script overwriting tournament status choices
- ✅ Tournament status uses actual API values (Published, In-progress, Ended)
- ✅ Excluded Unpublished status (admin-only tournaments)
- ✅ Protected manual choice customizations from future overwrites
- ✅ Added emojis to status filter choices for better UX
### **Previous in v1.2.9:**
- ✅ FIXED: Tournament status filter now works correctly
- ✅ Tournament status filter uses proper values (Published, In-progress, Ended)
- ✅ Removed Unpublished status from filter options
- ✅ Added emojis to status filter choices for better UX
### **Previous in v1.2.8:**
- ✅ NEW: `/tournaments` command with beautiful formatting
- ✅ Filter tournaments by status (Published, In-progress, Ended, Unpublished)
- ✅ Filter tournaments by game (VAIL, Echo Arena, Blacktop Hoops, etc.)
- ✅ Smart date formatting with relative times
- ✅ Rich embeds with prize pools, entry fees, and team sizes
- ✅ Enhanced PlayerService with tournaments API integration
### **Previous in v1.2.7:**
- ✅ Fixed Docker multi-platform build (x86_64 + ARM64)
- ✅ Resolved "exec format error" on Coolify deployment
- ✅ Enhanced deployment script with buildx support
### **Previous in v1.2.6:**
- ✅ Fixed autocomplete interaction spam
- ✅ All 9 games now available in dropdowns
- ✅ Working help button navigation
- ✅ Automatic game sync from Supabase
- ✅ Optimized Docker image (355MB)
- ✅ Enhanced error handling
### **Docker Images Available:**
```
far54/vrbattles-discord-bot:latest (always current)
far54/vrbattles-discord-bot:v1.2.10 (specific version)
```
### **Multi-Platform Support:**
Images are built for both Intel/AMD (x86_64) and ARM64 architectures to ensure compatibility across different server environments. If you encounter "exec format error", the image architecture doesn't match your server.
## 🔧 **Deploy to Coolify**
### **Option 1: Using Docker Hub Image**
1. **Create New Application** in Coolify
2. **Source Type**: Public Repository
3. **Docker Image**: `far54/vrbattles-discord-bot:latest`
4. **Port**: `3000`
### **Option 2: From GitHub (Auto-deploy)**
1. **Source Type**: Git Repository
2. **Repository**: Your GitHub repo URL
3. **Branch**: `main`
4. **Build Pack**: Docker
5. **Port**: `3000`
## 🔐 **Required Environment Variables**
Set these in Coolify Environment tab:
```bash
# Discord Configuration
DISCORD_TOKEN=your_discord_bot_token
DISCORD_APPLICATION_ID=your_discord_application_id
# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_KEY=your_supabase_anon_key
# Environment
NODE_ENV=production
```
## 🎯 **Features Included**
### **Commands Available:**
- `/help` - Interactive help system with working buttons
- `/finduser` - Search players (9 game dropdown)
- `/findteam` - Search teams (9 game dropdown)
- `/matchhistory` - View match history (optional game filter)
- `/tournaments` - **NEW!** View all tournaments with filters
- `/subscribe` - Admin: Subscribe to game notifications
- `/unsubscribe` - Admin: Remove game subscriptions
- `/list_subscriptions` - Admin: View active subscriptions
- `/register_server` - Admin: Register server with BattleBot
- `/version` - Show bot version and system info
### **Supported Games:**
- Big Ballers VR
- Blacktop Hoops
- Breachers
- Echo Arena
- Echo Combat
- Gun Raiders
- Nock
- Orion Drift
- VAIL
### **Services:**
- **Discord Bot**: Main command handling
- **Webhook Server**: Port 3000 for match notifications
- **Auto Sync**: Game choices sync with Supabase
## 🔄 **Updating Games**
When you add/remove games in Supabase:
```bash
# Locally run:
npm run sync-games
# Then rebuild and push (multi-platform):
./scripts/deploy.sh v1.2.7
# Update Coolify deployment
```
## 🏗️ **Building for Production**
### **Using Deploy Script (Recommended):**
```bash
# This builds for both Intel/AMD and ARM64
./scripts/deploy.sh v1.2.7
```
### **Manual Multi-Platform Build:**
```bash
# Setup buildx (one-time)
docker buildx create --name multiarch --use --driver docker-container --bootstrap
# Build and push for both architectures
docker buildx build --platform linux/amd64,linux/arm64 \
-t far54/vrbattles-discord-bot:v1.2.7 \
. --push
```
## 📊 **Health Check**
The Docker container includes a health check that validates:
- Node.js process is running
- Port 3000 is accessible
- Basic application startup
## 🔍 **Troubleshooting**
### **Common Issues:**
1. **Bot not responding**: Check DISCORD_TOKEN is valid
2. **Database errors**: Verify SUPABASE_URL and SUPABASE_KEY
3. **Game dropdowns empty**: Run `npm run sync-games` and redeploy
4. **Help buttons not working**: Ensure latest v1.2.7+ is deployed
5. **exec format error**: Architecture mismatch - use multi-platform images
### **Log Locations:**
- Coolify: Check application logs tab
- Discord: Bot activity in server
- Health: `/version` command shows system info
## 🎉 **Deployment Complete!**
Your bot should now be running with:
- ✅ All 9 games in dropdowns
- ✅ Working help navigation
- ✅ No debug message spam
- ✅ Match notifications on port 3000
- ✅ Clean, optimized Docker image