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.
/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
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.
-
Clone & install
git clone [email protected]:wersplat/bodega-esports-platform.git cd bodega-esports-platform/discord-bot npm ci
-
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.
-
Local development
npm run dev
-
Register commands
npm run register
-
Build & run
npm run build npm run start
The bot includes powerful roster management features that integrate with Supabase:
-
Environment Setup: Add these variables to your
.env
:SUPABASE_URL
— Your Supabase project URLSUPABASE_SERVICE_ROLE_KEY
— Service role key for server-side accessROSTER_CHANNEL_ID
— Optional global fallback roster channel
-
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)
-
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
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
- Follow KISS: keep commands small & focused
- Add new commands under
commands/
- Write tests alongside new features (TBD)
- Submit PR to the
master
branch
GPLv3 (see root LICENSE
)