Skip to content

abcodeworks-team/discord-builder-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Discord Server Builder Bot

An automated Discord server setup bot that creates fully configured servers with roles, channels, categories, and modules based on predefined templates. Perfect for quickly deploying professional Discord servers for businesses, communities, gaming groups, and support teams.

✨ Features

πŸ—οΈ Template-Based Server Setup

  • 4 Pre-built Templates:
    • Business - Professional setup for companies and organizations
    • Community - Engaging structure for social communities
    • Gaming - Optimized for gaming groups and teams
    • Support - Help desk and customer support focused

πŸ€– Smart Bot Recommendations

Automatically suggests and provides invite links for complementary bots based on your chosen template:

  • Business: MEE6, Ticket Tool, Statbot, Hydra, Carl-bot
  • Community: MEE6, Carl-bot, Statbot, Hydra, Giveaway Bot
  • Gaming: MEE6, Rythm, Statbot, Ticket Tool, Carl-bot
  • Support: Ticket Tool, Carl-bot, Statbot, MEE6, Logger

πŸ“¦ Modular System

Enable additional features during setup:

  • 🎫 Ticket System - Support ticket management
  • βœ… Verification - Member verification system
  • πŸ“ Logging - Comprehensive event logging
  • πŸ‘‹ Onboarding - Welcome messages and guides
  • 🎭 Auto Role - Automatic role assignment

πŸ§™ Interactive Setup Wizard

User-friendly step-by-step wizard with:

  • Template selection
  • Module configuration
  • Confirmation and review
  • One-click deployment

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ installed
  • Discord Bot Token (Get one here)
  • Git (for cloning)

Installation

  1. Clone the repository
git clone https://github.com/abcodeworks-cod/discord-builder-server.git
cd discord-builder-server
  1. Install dependencies
npm install

Note for WSL Users: If you encounter esbuild platform errors, delete node_modules and package-lock.json, then run npm install again in WSL.

  1. Configure environment variables

Create a .env file in the root directory:

DISCORD_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
GUILD_ID=your_test_server_id_here

How to get these values:

  • DISCORD_TOKEN: Discord Developer Portal β†’ Your App β†’ Bot β†’ Token
  • CLIENT_ID: Discord Developer Portal β†’ Your App β†’ General Information β†’ Application ID
  • GUILD_ID: Right-click your test server β†’ Copy Server ID (enable Developer Mode in Discord settings)
  1. Invite the bot to your server

Generate an invite URL with required permissions:

  • Go to Discord Developer Portal β†’ Your App β†’ OAuth2 β†’ URL Generator
  • Select scopes: bot, applications.commands
  • Select bot permissions:
    • Administrator (or specific permissions below)
    • Manage Server
    • Manage Roles
    • Manage Channels
    • Send Messages
    • Embed Links
    • Read Message History
    • Manage Messages
  1. Start the bot

Development mode (with auto-reload):

npm run dev

Production mode:

npm run build
npm start

πŸ“– Usage

Available Commands

Command Description
/setup Start the server setup wizard
/help Display help information
/template View available templates
/bots Show recommended bots for your server
/module Configure additional modules
/reset Reset server configuration (admin only)

Setup Flow

  1. Run /setup in your Discord server
  2. Choose a template (Business, Community, Gaming, or Support)
  3. Select modules you want to enable
  4. Review and confirm your configuration
  5. Wait for setup completion (takes ~30-60 seconds)

The bot will automatically create:

  • βœ… Custom roles with colors and permissions
  • βœ… Organized channel categories
  • βœ… Text and voice channels
  • βœ… Permission overwrites
  • βœ… Welcome messages
  • βœ… Module configurations

Example Output

[INFO] ServerBuilder Creating 6 roles in "Your Server"...
[INFO] ServerBuilder Created role: CEO
[INFO] ServerBuilder Created role: Management
[INFO] ServerBuilder Creating 6 categories...
[INFO] ServerBuilder Created category: πŸ“‹ Information
[INFO] ServerBuilder Creating 15 channels...
[INFO] ServerBuilder Created text channel: welcome
[INFO] ServerBuilder Created voice channel: General Voice
[INFO] ServerBuilder Server setup complete!

πŸ—οΈ Project Structure

discord-builder-server/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/          # Slash command handlers
β”‚   β”‚   β”œβ”€β”€ setup.ts       # Main setup command
β”‚   β”‚   β”œβ”€β”€ help.ts        # Help command
β”‚   β”‚   β”œβ”€β”€ bots.ts        # Bot recommendations
β”‚   β”‚   β”œβ”€β”€ template.ts    # Template info
β”‚   β”‚   β”œβ”€β”€ module.ts      # Module configuration
β”‚   β”‚   └── reset.ts       # Reset command
β”‚   β”œβ”€β”€ events/            # Event handlers
β”‚   β”‚   β”œβ”€β”€ ready.ts       # Bot ready event
β”‚   β”‚   └── interactionCreate.ts  # Command/button handler
β”‚   β”œβ”€β”€ services/          # Core business logic
β”‚   β”‚   β”œβ”€β”€ database.ts    # Database service (SQLite)
β”‚   β”‚   β”œβ”€β”€ serverBuilder.ts  # Server setup logic
β”‚   β”‚   β”œβ”€β”€ wizard.ts      # Setup wizard flow
β”‚   β”‚   └── botRecommendations.ts # Bot suggestions
β”‚   β”œβ”€β”€ templates/         # Server templates
β”‚   β”‚   β”œβ”€β”€ business.ts
β”‚   β”‚   β”œβ”€β”€ community.ts
β”‚   β”‚   β”œβ”€β”€ gaming.ts
β”‚   β”‚   └── support.ts
β”‚   └── index.ts           # Entry point
β”œβ”€β”€ data/                  # SQLite database (auto-created)
β”œβ”€β”€ .env                   # Environment variables
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ”§ Configuration

Database

The bot uses SQLite for data persistence. The database is automatically created in the data/ folder on first run.

Tables:

  • servers - Server configurations
  • modules - Enabled modules per server
  • settings - Bot settings

Templates

Each template defines:

  • Roles: Name, color, permissions, position
  • Categories: Name, position
  • Channels: Name, type, topic, parent category, permissions
  • Modules: Default enabled modules

You can customize templates by editing files in src/templates/.

Modules

Modules add extra functionality:

Module Description
tickets Creates ticket system with categories and roles
verification Adds verification channel and role
logging Sets up logging channel for events
onboarding Creates welcome/onboarding channels
autorole Auto-assigns roles to new members

πŸ› οΈ Development

Scripts

# Development with auto-reload
npm run dev

# Build for production
npm run build

# Start production build
npm start

# Deploy slash commands
npm run deploy

Adding New Templates

  1. Create a new file in src/templates/ (e.g., education.ts)
  2. Define roles, categories, channels, and modules
  3. Export the template configuration
  4. Add it to the template list in src/services/wizard.ts

Adding New Modules

  1. Add module definition to src/services/serverBuilder.ts
  2. Implement module setup logic
  3. Add module to template configurations
  4. Update wizard UI in src/services/wizard.ts

πŸ› Troubleshooting

Common Issues

Issue: Unknown interaction errors

  • Solution: Interactions expire after 3 seconds. The bot handles this gracefully with try-catch blocks. Check console for details.

Issue: esbuild platform error in WSL

  • Solution: Delete node_modules and package-lock.json, then run npm install in WSL.

Issue: Bot doesn't respond to commands

  • Solution:
    1. Make sure you ran npm run deploy to register commands
    2. Check bot has proper permissions in the server
    3. Verify .env file has correct values

Issue: Channel creation fails

  • Solution: Ensure bot has "Manage Channels" permission and is not rate-limited.

Issue: Role creation fails

  • Solution:
    1. Check bot's role is higher than roles it's trying to create
    2. Verify "Manage Roles" permission
    3. Server may have reached role limit (250)

Debug Mode

Enable verbose logging by setting environment variable:

DEBUG=true

πŸ“ Environment Variables

Variable Required Description
DISCORD_TOKEN βœ… Your Discord bot token
CLIENT_ID βœ… Your Discord application ID
GUILD_ID ⚠️ Test server ID (for dev command deployment)
DATABASE_PATH ❌ Custom database path (default: ./data/database.db)

πŸ”’ Security

  • Never commit .env file to version control
  • Keep your bot token secret
  • Use .gitignore to exclude sensitive files
  • Regularly update dependencies: npm update
  • Review bot permissions - use minimum required

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Discord.js - Powerful Discord API library
  • better-sqlite3 - Fast SQLite3 library
  • Discord community for inspiration and feedback

πŸ“ž Support

If you encounter issues or need help:

  1. Check the Troubleshooting section
  2. Open an issue on GitHub
  3. Join our Discord support server (link coming soon)

πŸ—ΊοΈ Roadmap

  • Add more templates (Education, NFT/Crypto, Content Creators)
  • Multi-language support
  • Web dashboard for configuration
  • Backup/restore functionality
  • Template marketplace
  • Custom template builder

Made with ❀️ for the Discord community

About

A Discord.js-powered server builder bot that automates Discord server setup using customizable templates, modular features, interactive setup wizards, and SQLite-powered configuration management.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors