A Discord bot to automate whitelist applications for a Minecraft server integrated with DiscordSRV.
Includes MongoDB storage, automatic role assignment, DM confirmation, staff logs, and public whitelist result announcements.
/whitelist-applycommand (staff-only)- Button + Modal for Minecraft username & platform
- Automatic
_prefix for Bedrock usernames - DM confirmation to applicant
- Logs application in a staff-only channel
- Sends whitelist command to DiscordSRV console channel
- Assigns a “Whitelisted” role automatically
- Public announcement embed for successfully whitelisted players
- MongoDB storage of all applications
- Fully configurable via
.env
- Node.js (v18+)
- Discord.js v14
- MongoDB (via Mongoose)
- DiscordSRV for server whitelist automation
.envfor sensitive configuration
-
Clone the repository
git clone <your-repo-url> cd <repo-folder>
-
Install dependencies
npm install
-
Create
.envin the project root:DISCORD_TOKEN=YOUR_BOT_TOKEN CLIENT_ID=YOUR_CLIENT_ID GUILD_ID=YOUR_GUILD_ID CONSOLE_CHANNEL_ID=DISCORDSRV_CONSOLE_CHANNEL_ID FORMS_CHANNEL_ID=WHITELIST_FORMS_CHANNEL_ID WHITELISTED_ROLE_ID=WHITELISTED_ROLE_ID STAFF_ROLE_ID=STAFF_ROLE_ID_OR_EMPTY MONGO_URI=MONGODB_CONNECTION_URI CONSOLE_COMMAND_PREFIX=! WHITELIST_COMMAND_TEMPLATE=whitelist add {ign} AUTO_WHITELIST=true PUBLIC_RESULTS_CHANNEL_ID=PUBLIC_WHITELIST_RESULTS_CHANNEL_ID SERVER_LOGO=[https://example.com/server_logo.png](https://example.com/server_logo.png)
Replace placeholders with your actual bot credentials, role/channel IDs, MongoDB URI, and server logo URL.
-
Deploy the slash command
npm run deploy
-
Run the bot
npm start
-
Staff runs
/whitelist-apply→ bot posts an embed with “Apply for Whitelist” button. -
User clicks the button → modal opens for Minecraft username and Platform.
-
Bot actions on submission:
- Saves application to MongoDB
- Sends DM confirmation to user
- Logs in forms channel for staff review
- Sends whitelist command to DiscordSRV console channel
- Assigns Whitelisted role
- Posts public announcement embed in configured channel
project/ ├── .env ├── package.json ├── deploy-commands.js ├── index.js └── models/ └── Whitelist.js
## Customization
- Staff-only command: Assign a role ID in
.envforSTAFF_ROLE_IDor rely on Manage Guild permission. - Whitelist command template: Change
WHITELIST_COMMAND_TEMPLATEin.envif your Minecraft server uses a different command. - Public announcement: Add a server logo via
SERVER_LOGOURL.
- Discord modals do not support dropdowns, so Platform input is text-based (Java or Bedrock).
- Duplicate IGN checks can be added in MongoDB for extra security.
- DiscordSRV must be configured to accept commands from the console channel.
MIT License – free to use, modify, and distribute.