The modern, production-ready framework for building powerful Discord bots with ease.
DiscoBase provides everything you need to create scalable, feature-rich Discord bots using Discord.js v14. Whether you're building a simple utility bot or a complex multi-server system, DiscoBase gives you the tools and flexibility to succeed.
β¨ Built on Discord.js v14
π Production-ready architecture
π Documentation:discobase.site
Create your Discord bot in seconds:
npx create-discobase@latestThe interactive setup will guide you through:
- β Edition Selection: Core (package-based) or Source (full customization)
- β MongoDB Integration: Optional database setup
- β Admin Dashboard: Built-in web dashboard
- β Auto Installation: All dependencies installed automatically
- Slash Commands - Modern Discord interactions
- Prefix Commands - Traditional text-based commands
- Hot Reload - Changes apply instantly without restart
- Command Generator - Scaffold new commands with
npm run generate - Command Manager - Enable/disable commands with
npm run manage
- Bot Permissions - Automatic bot permission validation
- User Permissions - Role-based access control
- Cooldowns - Built-in rate limiting per user
- Cooldown Messages - Custom cooldown feedback
- Role Requirements - Restrict commands to specific roles
- Owner/Admin Only - Special access controls
- Dev Mode - Test commands in specific servers
- Real-time Stats - Monitor bot performance live
- Guild Management - View and manage all servers
- Command Analytics - Track slash & prefix command usage separately
- Error Logging - Automatic error tracking
- Activity Tracker - Monitor file changes in real-time
- Auto-detect Intents - Never miss required intents
- Structured & Scalable - Clean, organized codebase
- MongoDB Integration - Built-in database support with Mongoose
- Configurable Functions - Advanced function options
- Error Recovery - Graceful error handling
npx create-discobase@latestPowerful options available for every command:
| Option | Type | Description |
|---|---|---|
ownerOnly | boolean | Only bot owner can use this command |
adminOnly | boolean | Only users in bot.admins can use it |
devOnly | boolean | Only works in developer servers |
botPermissions | array | Required bot permissions (e.g., ['SendMessages', 'ManageChannels']) |
userPermissions | array | Required user permissions (e.g., ['Administrator', 'KickMembers']) |
cooldown | number | Cooldown in seconds before reuse (default: 3) |
disabled | boolean | Disable command without deleting it |
requiredRoles | array | Array of role IDs required to run command |
Example Command:
module.exports={data: newSlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),cooldown: 5,botPermissions: ['SendMessages'],userPermissions: ['SendMessages'],asyncexecute(interaction,client){// Your command logic here}};Configure your event handlers with these options:
| Option | Type | Description |
|---|---|---|
name | string | Required. The Discord.js event name (e.g., 'messageCreate', 'guildMemberAdd') |
customId | string | For button/select menu interactions - matches the component's customId |
cooldown | number | Cooldown in seconds before reuse |
cooldownMessage | string | Cooldown message to send when user uses command while on cooldown. Use {time} for showing remaining time in message |
botPermissions | array | Required bot permissions (e.g., ['SendMessages', 'ManageChannels']) |
userPermissions | array | Required user permissions (e.g., ['Administrator', 'KickMembers']) |
rateLimit | object | Rate limit configuration |
Example Event:
module.exports={name: 'interactionCreate',customId: 'verify-button',//or multiple customIds in array ['verify-button', 'verify-button2']cooldown: 5,cooldownMessage: 'You are on cooldown! Please try again in {time}.',botPermissions: ['SendMessages'],userPermissions: ['SendMessages'],rateLimit: {type: 'user',// 'user', 'guild', 'channel',max: 5,// max useswindow: 60000// 60 seconds},asyncexecute(interaction,client){// Your event logic here}};Your config.json structure:
| Parameter | Type | Description |
|---|---|---|
bot.token | string | Required. Your Discord bot token |
bot.id | string | Required. Your Discord bot ID |
bot.admins | array | Optional. List of admin user IDs |
bot.ownerId | string | Optional. The owner's user ID |
bot.developerCommandsServerIds | array | Optional. Server IDs for dev-only commands |
database.mongodbUrl | string | Optional. MongoDB connection URL |
logging.guildJoinLogsId | string | Optional. Channel ID for guild join logs |
logging.guildLeaveLogsId | string | Optional. Channel ID for guild leave logs |
logging.commandLogsChannelId | string | Optional. Channel ID for command logs |
logging.errorLogs | string | Optional. Webhook URL for error logging |
prefix.value | string | Optional. Prefix for text commands |
Advanced function configuration:
| Property | Type | Description |
|---|---|---|
once | boolean | Run once then stop |
interval | number | Time (ms) between repeated executions |
retryAttempts | number | Number of retries if function fails |
maxExecution | number | Maximum number of executions allowed |
initializer | number | Initial value/state for setup |
Example:
constexampleFunction=async()=>{console.log("Function executed!");};exampleFunction.config={once: false,interval: 10000,// Run every 10 secondsretryAttempts: 3,maxExecution: 100,initializer: 0};module.exports=exampleFunction;Monitor all file changes in real-time through discobase.json:
{
"activityTracker": {
"enabled": true,
"ignoredPaths": [
"**/logs/**",
"**/node_modules/**",
"**/private/**"
]
}
}Create new commands and events instantly:
npm run generate- EmbedBuilder - Rich embedded messages
- ButtonBuilder & ActionRowBuilder - Interactive buttons
- StringSelectMenuBuilder - Dropdown menus
- ModalBuilder & TextInputBuilder - Input forms
The CLI automatically generates imports and example code!
Edit, pause, or delete commands and events:
npm run manageFeatures:
- Enable/disable commands without deleting
- Edit command properties
- View all commands and events
- Bulk operations
For complete guides, tutorials, and API reference:
π discobase.site
Join our Discord community:
- NPM Package:create-discobase
- Core Library:discobase-core
- GitHub:ethical-programmer/create-discobase
- Documentation:discobase.site
- Discord:Join our community
Apache-2.0 Β© DiscoBase Team
