Originally used on https://discord.gg/n3DV3aUygA
A Discord bot with a browser-based control panel for posting messages to a server.
- Web panel (opens in a browser): pick a server and a channel, and send a tournament announcement to it.
- The form is tailored to a specific message format (organization card + title + subtitle with a link + big image + corner logo):
- Organization name + its icon (small icon at the top of the card)
- Title (large bold text)
- Subtitle/description with a mini formatting toolbar: bold, italic, link, ||spoiler||
- Big banner image
- Small logo thumbnail in the top-right corner of the card
- Left stripe color
- Optional auto-reaction under the message (the bot adds an emoji itself, e.g. ✅ — from there the counter grows based on real clicks from people; you can't set an exact number in advance)
- Shows the bot's status (online / offline) in the panel.
The AI feature (answering questions about Matcherino / Brawl Stars tournaments via /ask and the panel) is
temporarily disabled, but the code is fully written and sitting in the project — see
NOTES.md for step-by-step instructions on what to uncomment to turn it back on.
Briefly, for future reference: Matcherino has no official public API, so data about a specific
tournament is meant to be scraped from its public page (lib/matcherino.js), and the Claude API
(lib/ai.js) handles the actual answering.
-
Install Node.js version 18 or newer.
-
Unzip the project and open a terminal in it.
-
Install dependencies:
npm install
-
Copy
.env.exampleto.env:cp .env.example .env
-
Fill in
.env:- Go to https://discord.com/developers/applications
- Create an application (New Application).
- In the General Information section, copy the Application ID → this is
DISCORD_CLIENT_ID. - In the Bot section, click Reset Token and copy the token → this is
DISCORD_TOKEN. - In the same section, enable MESSAGE CONTENT INTENT (the toggle under Privileged Gateway Intents).
- In OAuth2 → URL Generator, select the
botandapplications.commandsscopes, and under permissions check at leastSend MessagesandRead Messages/View Channels. Copy the generated link and open it in a browser — that's how the bot gets added to your server.
Two independent layers of protection:
-
Main method (in the Discord Developer Portal): open your application → Installation → under Authorization Flow, turn off the Public Bot toggle. After that, only the application owner (you) can use the invite link. This is how the project is set up by default — don't forget to turn this toggle off.
-
Backup (in the bot's code): if you fill in
OWNER_DISCORD_IDin.env, the bot will check on startup and every time it's added to a new server that the server's owner is actually you. If not, the bot leaves the server on its own.- In Discord: User Settings → Advanced → enable Developer Mode.
- Right-click your username (in any chat or the member list) → Copy User ID.
- Paste this ID into
OWNER_DISCORD_IDin.env.
Get a key at https://console.anthropic.com/ (API Keys section).
Pick any password — you'll use it to log into the web panel.
-
Start the bot:
npm start
-
Open in a browser:
http://localhost:3000(or another port if you changedPORTin.env), enterPANEL_PASSWORD— you'll land in the panel.
The easiest options are Railway or Render:
- Push the project to a GitHub repository.
- On Railway/Render, create a new service from that repository.
- In the service settings, add the same environment variables as in
.env. - Start command:
npm start. - After deploying, the service will give you a public URL — the panel will be available there (
https://your-service.up.railway.app).
discord-tournament-bot/
├── server.js # Express server + bot startup
├── lib/
│ ├── discordClient.js # Discord client, /ask slash command, sending messages
│ ├── ai.js # Talks to the Claude API
│ └── matcherino.js # Scrapes the tournament page
├── public/ # Web panel (HTML/CSS/JS)
├── .env.example
└── package.json
- The panel is protected by a single shared password (
PANEL_PASSWORD) — that's enough for personal use, but it's not designed for many users with different permission levels. For a serious production setup, add proper authentication (e.g. via Discord OAuth2). - Never commit the
.envfile (with your tokens) to a public repository — add it to.gitignore(already done).