Visual drag-and-drop Discord bot creation platform built with Next.js 16 (Turbopack), React 19, Discord.js v14, and MongoDB. ||No more coding needed!||
Discord Bot Builder is a multi-tenant platform designed to create, configure, and host custom Discord bots visually. Built-in node canvas editor allows designing complex event-driven workflows, slash commands, moderation rules, role assignments, and interactive components. ||No more coding needed!||
Bots are executed as isolated Node.js child processes with AES-256 encrypted token security, automatic slash command registration, live stdout process logging, and guild audit log integration.
- Visual Graph Canvas: Drag-and-drop canvas powered by
@dnd-kitfor connecting triggers, dynamic variables, conditional logic, and action outputs without writing code. - Automated Slash Command Engine: Automatically registers slash commands with Discord API and inspects input blocks (
get_command_input) to dynamically infer required option types (string,channel,user,role,number,boolean). - Interactive UI Component Suite: Build and handle Discord buttons (
create_button,button_row), select menus (create_select_menu), and modal dialogs (open_modal,create_text_input). - Role & Member Moderation: Complete moderation suite including
timeout_member,remove_timeout,kick_member,ban_member,unban_member,purge_messages,add_role, andremove_rolewith automatic target resolution for both triggering executors and specific users. - Guild Audit Log Resolver: Automatic audit log lookup for
GuildRoleCreate,GuildRoleDelete,ChannelCreate, andChannelDeleteevents to identify the executor. - Security & Process Isolation:
- Bot tokens encrypted using AES-256 (
CryptoJS) before database persistence. - Bots executed in dedicated child processes with isolated environments.
- Rate-limited bot control endpoints and strict input sanitization to prevent path traversal.
- Bot tokens encrypted using AES-256 (
- Real-time Live Logs & Monitoring: Stream live stdout and stderr logs from running bot child processes directly in the dashboard UI.
| Requirement | Minimum Version | Recommended Version |
|---|---|---|
| Node.js | v18.17.0 |
v20.x or v22.x |
| npm / pnpm | v9.0.0 |
v10.x |
| MongoDB | v6.0 |
Local MongoDB or MongoDB Atlas |
| Discord.js | v14.18.0 |
v14.18.0 |
| Next.js | v16.1.2 |
v16.1.2 (Turbopack) |
- Clone the repository
git clone https://github.com/fczavian/DiscordBot-Builder.git
cd DiscordBot-Builder- Install dependencies
npm install- Environment Variables Setup
Create a
.envfile in the root directory:
# Discord OAuth2 Credentials
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_CLIENT_SECRET=your_discord_client_secret
# NextAuth Configuration
NEXTAUTH_SECRET=your_32_character_random_secret_string
NEXTAUTH_URL=http://localhost:3000
# Security & Encryption Key (AES-256)
ENCRYPTION_KEY=your_custom_secret_encryption_key_2024
# Database Connection String
MONGODB_URI=mongodb://localhost:27017/discord-bot-builder
# For MongoDB Atlas: mongodb+srv://<username>:<password>@cluster.mongodb.net/discord-bot-builder- Start Development Server
npm run devOpen http://localhost:3000 in your browser.
- Production Build & Execution
npm run build
npm start- Navigate to the Discord Developer Portal and click New Application.
- Under OAuth2
$\rightarrow$ General:- Copy the Client ID and Client Secret into your
.envfile. - Add Redirect URI:
http://localhost:3000/api/auth/callback/discord
- Copy the Client ID and Client Secret into your
- Under Bot:
- Generate a Bot Token (copied and saved into individual bot settings in the dashboard).
- Enable Privileged Gateway Intents:
- ✅ Presence Intent
- ✅ Server Members Intent
- ✅ Message Content Intent
||No more coding needed!|| Complete catalog of supported canvas blocks:
on_message: Listens for message content matching a configured prefix (e.g.!hi).on_command: Slash command trigger with automated option discovery.on_reaction: Listens for specific emoji reactions on messages.on_member_join: Triggers when a new member joins the server.on_member_leave: Triggers when a member leaves the server.on_button_click: Triggers when a user clicks a specific button component.on_select_choose: Triggers when a user makes a selection from a dropdown menu.on_modal_submit: Triggers when a user submits a modal popup form.on_role_event: Triggers when a server role is created or deleted (with executor lookup).on_channel_event: Triggers when a text/voice channel is created or deleted.on_bot_startup: Executes actions automatically as soon as the bot logs in.
get_command_input: Extracts string, channel, user, role, number, or boolean options from slash command interactions into{var:optionName}and{var:blockId}.get_executor: Extracts username, ID, tag, mention, or avatar of the user executing the event.get_user: Fetches target user information forexecutororspecificuser ID.get_server: Extracts server name, ID, or member count into{server.name},{server.members}.get_channel: Extracts channel name, ID, or mention formatting into{channel.name},{channel.id}.get_modal_value: Pulls text input values from submitted modal forms using custom IDs.random_number: Generates a random integer between a configured minimum and maximum.random_choice: Selects a random item from a comma-separated list of values.
send_message: Sends plain text or formatted messages tosame channel,reply,specific channel, ordirect message (DM).send_embed: Constructs and sends rich embeds with titles, descriptions, hex colors, thumbnail URLs, image URLs, footers, and inline field arrays.reply: Replies directly to a message or slash command interaction.add_role: Assigns a server role toexecutororspecific userwith mention stripping and name fallback.remove_role: Removes a server role fromexecutororspecific user.delete_message: Deletes the triggering message or last sent message.add_reaction: Adds an emoji reaction to the triggering message.
create_button: Generates custom button components with style, label, custom ID, or URL.button_row: Action row container for organizing up to 5 buttons per row.create_select_menu: Dropdown select menu with placeholder and custom choice options.open_modal: Modal popup form dialog with custom title and input fields.create_text_input: Text input field for modal popups (short text or paragraph style).
timeout_member: Times out a member for a configured duration in minutes.remove_timeout: Removes an active timeout from a member.kick_member: Kicks a member from the server with a reason.ban_member: Bans a member with reason and optional message deletion history days.unban_member: Unbans a user by ID.purge_messages: Bulk deletes up to 100 recent messages in a channel.send_log: Sends structured log messages (INFO,WARN,ERROR) to a designated log channel.create_channel: Creates a new text or voice channel.delete_channel: Deletes a specified channel by ID.rename_channel: Renames a channel.
if_condition: Evaluates condition types (equals,contains,startsWith,endsWith,hasRole,isBot,inChannel) and routes execution tothenorelsebranches.permission_check: Verifies if the member has specified permissions (e.g.ADMINISTRATOR,MANAGE_MESSAGES).cooldown: Enforces user, channel, or guild rate limit cooldowns in seconds.delay: Asynchronously pauses execution flow for a specified duration in milliseconds/seconds.loop: Repeats connected child actions for a specified iteration count.
| Endpoint | Method | Description |
|---|---|---|
/api/bots |
GET, POST |
List user bots or create a new bot instance. |
/api/bot/[id] |
GET, DELETE |
Fetch bot details or delete bot instance and stored features. |
/api/bot/[id]/control |
POST |
Control bot lifecycle (start, stop, restart). |
/api/bot/[id]/status |
GET |
Fetch bot execution status, uptime, and stdout logs. |
/api/bot/[id]/token |
GET, POST |
Retrieve or securely save encrypted bot token. |
/api/bot/[id]/features |
GET, POST |
List or save bot feature configurations. |
/api/bot/[id]/features/[featureId]/blocks |
GET, POST |
Fetch or save block graph nodes and connections for a feature. |
- Token Encryption: Bot tokens are encrypted using AES-256 before being written to MongoDB or disk storage.
- Process Sandboxing: Each running bot process is spawned as a separate Node.js child process using
process.execPathand communicates via filesystem configuration files. - Input Sanitization: Slash command names and option keys undergo regular expression sanitization (
/[^a-z0-9_-]/g) and length enforcement to strictly comply with Discord API rules.
Distributed under the MIT License.