Files
BattleBot/DEPLOYMENT.md
VinceC a8e836fd5b Add help system, deployment docs, and improve setup
Introduces a new interactive help command with button navigation, adds a detailed DEPLOYMENT.md guide, and improves server setup validation and error handling. Updates command registration to include all 9 games, adds version reporting, enhances Docker deployment with a multi-platform script, and removes local .env files from the repo. Also refactors bot startup for better diagnostics and graceful shutdown.
2025-07-13 04:00:39 -05:00

4.1 KiB

🚀 VRBattles Discord Bot - Deployment Guide

📦 Latest Version: v1.2.7

What's New 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.7   (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:

# 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)
  • /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:

# Locally run:
npm run sync-games

# Then rebuild and push (multi-platform):
./scripts/deploy.sh v1.2.7

# Update Coolify deployment

🏗️ Building for Production

# This builds for both Intel/AMD and ARM64
./scripts/deploy.sh v1.2.7

Manual Multi-Platform Build:

# 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