Skip to content

wersplat/bodega-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js TypeScript Discord.js License Railway Deploy Discord Bot Uptime CI

Bodega Discord Bot

A unified TypeScript Discord.js bot and web app for the Bodega Esports Platform.

This single codebase powers all Discord bot features—roster lookups, announcements, moderation, OCR stat parsing—as well as the Activity App and web endpoints. The Activity App (including the live /standings route) is now fully integrated into the main server, providing seamless access to Google Sheets-powered standings and more. All integrations (Google Sheets, Discord, Sentry, etc.) are managed together for easier development and deployment.


🛠️ Features

  • /roster <team_name> — show a team’s roster
  • /broadcast <message> — send announcements (admin only)
  • /submitstats — OCR‐process a screenshot and display stats
  • /flag <id> — flag a submission for review
  • /pingmissing — DM captains who haven’t submitted stats
  • Buttons, dropdowns & modals for rich interactions
  • Scheduled MVP & leaderboard announcements
  • Activity App: Displays live Google Sheets standings in Discord (see below)
  • Roster Management (admin only):
    • /set-roster-channel <#channel> — configure roster posting channel
    • /post-roster <team> — post single team roster embed
    • /post-all-rosters — post all active teams' rosters

📊 Integrated Activity App: Google Sheets Standings

The Activity App is fully integrated into the main bot's Express server, eliminating the need for a separate service. It provides a /standings web route that displays live standings from a Google Sheet as an HTML table. This feature can be launched as a Discord Activity or viewed directly in any web browser.

  • Access Route: /standings
  • Data Source: Google Sheets (configured via GOOGLE_SHEET_ID in your .env file)
  • Required Setup: Ensure the following environment variables are correctly set in your .env file:
    • GOOGLE_SHEET_ID: The ID of your Google Sheet.
    • GOOGLE_CREDS_JSON: The JSON credentials for the Google API service account.

🚀 Quick Start

  1. Clone & install

    git clone [email protected]:wersplat/bodega-esports-platform.git
    cd bodega-esports-platform/discord-bot
    npm ci
  2. Configure

    cp .env.example .env
    # Edit .env with your values: DISCORD_TOKEN, DISCORD_CLIENT_ID, DISCORD_CLIENT_SECRET, GUILD_ID, API_URL, GOOGLE_SHEET_ID, GOOGLE_CREDS_JSON, SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, etc.
  3. Local development

    npm run dev
  4. Register commands

    npm run register
  5. Build & run

    npm run build
    npm run start

🗂️ Roster Management Setup

The bot includes powerful roster management features that integrate with Supabase:

  1. Environment Setup: Add these variables to your .env:

    • SUPABASE_URL — Your Supabase project URL
    • SUPABASE_SERVICE_ROLE_KEY — Service role key for server-side access
    • ROSTER_CHANNEL_ID — Optional global fallback roster channel
  2. Usage:

    • /set-roster-channel #rosters — Configure where rosters are posted
    • /post-roster bodega-cats — Post roster by team slug
    • /post-roster 00000000-0000-0000-0000-000000000000 — Post roster by UUID
    • /post-all-rosters — Post all active teams (with rate limiting)
  3. Features:

    • Automatic embed pagination for teams with >25 players
    • Captain highlighting with ⭐ emoji
    • Jersey number and position display
    • Team logo thumbnails and league/season info
    • Permission validation before posting

📁 Folder Structure

bodega-discord-bot/
├── activity/          # Web assets (HTML, CSS, JS) for the /standings Activity App route
├── commands/          # Slash command handlers
├── docs/              # Documentation
├── scripts/           # One-off utilities (e.g. deploy-commands.ts)
├── utils/             # Shared helpers (API calls, scheduler)
├── .env.example       # Example environment variables
├── .gitignore
├── main.ts            # Main application entry point: bootstraps Discord bot, Express web server (including Activity App routes)
├── package.json
├── sentry.ts          # Sentry integration
└── tsconfig.json

🤝 Contributing

  • Follow KISS: keep commands small & focused
  • Add new commands under commands/
  • Write tests alongside new features (TBD)
  • Submit PR to the master branch

📄 License

GPLv3 (see root LICENSE)

About

Discord Bot module of esports-platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published