A branded Discord bot starter for a CODM clan with slash commands, modal join applications, roster management, scrim reminders, stat tracking, and a highlight board.
- Posts polished embedded responses themed for
Tryhard Esports - Registers slash commands with Discord
- Includes clan-focused commands:
/about/roster/rosteradd/rosterupdate/rosterremove/syncroles/schedule/scrimschedule/scrimedit/scrimcancel/scrims/tryout/tryoutpanel/claimtryout/reviewtryout/closeticket/rules/announce/match/result/record/playercard/playerstats/addpoints/leaderboard/mvpleaderboard/statleaderboard/dashboardpost/starboard/ping
- Awards 1 activity point per message automatically
- Creates private application channels from a modal-based join form
- Lets staff claim, review, and close tryout tickets
- Schedules scrims with automatic countdown reminders
- Lets staff edit or cancel scrims without touching code
- Sends starred community highlights to a configured starboard channel
- Tracks team wins, losses, recent results, MVP awards, lineup attendance, and player stat lines
- Supports a live dashboard post that refreshes when roster, scrims, or results change
- Copy
.env.exampleto.env - Fill in your Discord bot token and application IDs
- Optional: change the clan info in
.env - Optional: set
STAFF_ROLE_ID,TRYOUT_CATEGORY_ID,TRIAL_ROLE_ID,MEMBER_ROLE_ID, andANNOUNCEMENTS_CHANNEL_ID - Deploy commands:
npm run deploy- Start the bot:
npm startDISCORD_GUILD_IDis recommended while testing because guild commands update quickly.- The
/announcecommand requiresManage Guild. - The bot now uses message and reaction events, so enable the Message Content intent in the Discord Developer Portal if Discord prompts for it.
- Social links in
.env.exampleare placeholders right now.
- Run
/tryoutpanelin your applications channel - Applicants click the button and get a private ticket
- Staff uses
/claimtryoutinside that ticket - Staff uses
/reviewtryoutwithtrial,accept, ordeny - Staff uses
/closeticketwhen finished
If TRIAL_ROLE_ID and MEMBER_ROLE_ID are filled in, the bot will assign roles automatically during review.
- Run
/scrimschedule - Use a parseable time like
2026-04-05 20:00 - The bot will post countdown reminders at the chosen minute marks
- Log the result after the match with
/result
- Run
/dashboardpostin your main info or announcements channel - Use
/syncrolesafter building the roster the first time - Use
/scrimschedule,/scrimedit, and/scrimcancelfor match ops - The dashboard will refresh automatically after roster changes and results
For an always-on bot on a VPS or your own server, PM2 is the easiest option.
- Install PM2 globally:
npm install -g pm2- Start the bot:
npm run pm2:start- Check logs:
npm run pm2:logs- Restart after code changes:
npm run pm2:restart- Save the process list:
pm2 save- Generate startup config for your server:
pm2 startupCloudflare note:
- Regular Cloudflare Workers are not a good fit for this
discord.jsgateway bot. - Cloudflare Containers can work because they run a persistent containerized app.
- PM2 is for a VPS or dedicated host, not for Cloudflare Workers.
This repo now includes:
What you need locally before deploy:
- Docker installed and running
- Cloudflare Wrangler login:
npx wrangler login- Install dependencies:
npm install- Set required Cloudflare Worker secrets:
npx wrangler secret put DISCORD_TOKEN
npx wrangler secret put DISCORD_CLIENT_SECRET-
Edit
wrangler.jsoncvars for your real channel and role IDs -
Deploy:
npm run cf:deployUseful Cloudflare commands:
npm run cf:list
npm run cf:logsAfter deploy, your Worker URL will respond on:
//health/boot
You can still deploy this project by using GitHub Actions so Docker runs on GitHub's runner instead of your PC.
- Push this project to a GitHub repository
- Add these GitHub repository secrets:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID
- Keep
wrangler.jsoncin the repo - Push to
mainor run the workflow manually
The workflow file is:
Cloudflare docs I used:
- GitHub Actions for Wrangler: https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
- Containers get started: https://developers.cloudflare.com/containers/get-started/
- Containers image management: https://developers.cloudflare.com/containers/platform-details/image-management/
- Replace placeholder leader, region, and social links
- Add a real roster and scrim schedule
- Connect a database if you want persistent player applications or match history