Build the foundation of a production-ready Discord bot for my Builders Hideout server.
IMPORTANT: Treat this as a Discord bot project only. Do NOT create a website, web server, API server, React app, Vite app, Express server, or any unrelated frontend/backend workspace.
TECH STACK
- Node.js
- TypeScript
- discord.js
- Self-contained project configuration
- tsconfig.json must NOT extend or depend on any root/external tsconfig file.
- Keep dependencies minimal and appropriate for a Discord bot.
- The Discord bot token is already stored in the project's secure Token field. Never hard-code or expose it.
- The bot must be deployable as a persistent Discord bot.
PROJECT ARCHITECTURE Use a clean modular structure so each feature can be developed and maintained independently.
For example: src/ index.ts command-definitions.ts config-store.ts modules/ welcome/ giveaways/ tickets/ moderation/ automod/ payments/ etc.
Do not create unnecessary files, packages, frameworks, or services.
CONFIGURATION UI REQUIREMENT This is extremely important:
By default, EVERY module we add must have its customization/configuration handled through a proper configuration FORM/UI, NOT by forcing the server owner to configure everything through chat messages or complicated commands.
The configuration UI should:
- Be clean and easy to use.
- Group settings by module.
- Allow administrators to save/update settings.
- Persist settings after bot restarts.
- Validate inputs.
- Show clear success/error feedback.
- Only allow authorized administrators/staff to modify settings.
If a future module needs a different configuration method, I will explicitly tell you. Otherwise, use the configuration-form approach for that module.
FIRST MODULE: WELCOME + LEAVE SYSTEM
Create a professional Welcome and Leave system inspired by the attached screenshot.
The attached image is a VISUAL DESIGN REFERENCE. Do not copy copyrighted assets from it. Recreate the general layout/style using our own generated design.
WELCOME IMAGE STYLE:
- Professional Discord server welcome-card appearance.
- Dark, polished, modern design.
- Member's actual Discord avatar prominently displayed.
- Username displayed clearly.
- Server name displayed clearly.
- Welcome text displayed clearly.
- Member number/count can be displayed.
- Clean typography.
- Good spacing and alignment.
- Image should look good on Discord mobile.
- Avoid tiny unreadable text.
- Automatically use the joining member's current Discord avatar.
- Generate the image dynamically for each joining member.
LEAVE IMAGE:
- Use the same overall visual identity as the welcome card.
- Clearly indicate that the member has left.
- Use the member's avatar and username where available.
- Keep the design clean and professional.
WELCOME/LEAVE CONFIGURATION FORM
Create separate settings for Welcome and Leave.
Administrators should be able to configure:
Welcome:
- Enable/disable
- Channel
- Message
- Server name/text
- Whether to show member number
- Image background/design
- Main color
- Secondary color
- Text customization
Leave:
- Enable/disable
- Channel
- Message
- Image background/design
- Main color
- Secondary color
- Text customization
Use sensible defaults so the system works immediately after setup.
MESSAGE VARIABLES
Support useful placeholders such as: {user} {username} {server} {membercount}
Replace them safely when sending the message.
IMPORTANT TECHNICAL REQUIREMENTS
- Correctly handle Discord member join events.
- Correctly handle Discord member leave events.
- Use the correct Discord Gateway intents required for this functionality.
- Handle users without custom avatars.
- Handle image-generation/rendering errors gracefully.
- If image generation fails, still send the configured text message instead of completely failing.
- Do not crash the entire bot because one welcome/leave image failed.
- Persist all configuration.
- Recover configuration after restart.
- Use proper error handling and logging.
- Do not expose bot tokens or secrets in logs.
SLASH COMMANDS
Create only the minimum commands needed for initial setup/testing.
At minimum:
The bot should correctly register slash commands for the configured Discord server.
Before considering this task complete:
- Check the entire project for TypeScript errors.
- Fix all TypeScript errors.
- Make sure package.json has a correct start command.
- Make sure tsconfig.json is self-contained.
- Make sure there are no references to missing root configuration files.
- Make sure there is no web-server/frontend code.
- Make sure the bot can start successfully using the configured Discord token.
- Make sure /ping works.
- Make sure the Welcome/Leave module does not crash the bot if image generation fails.
- Keep the implementation modular because additional modules will be added later.
DO NOT add the other major modules yet. We will add them one by one after this foundation is confirmed working.