Skip to content

Latest commit

Β 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo

Discord NPM Version NPM License NPM Downloads

DiscoBase

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

πŸš€ Quick Start

Create your Discord bot in seconds:

npx create-discobase@latest

The 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

⚑ Core Features

πŸ“¦ Command System

  • 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

πŸ” Advanced Controls

  • 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

πŸ“Š Dashboard & Monitoring

  • 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

βš™οΈ Developer Experience

  • 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

πŸ“¦ Installation

Interactive Setup

npx create-discobase@latest

🧩 Command Options

Powerful 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: new SlashCommandBuilder()
    .setName('ping')
    .setDescription('Replies with pong!'),
  cooldown: 5,
  botPermissions: ['SendMessages'],
  userPermissions: ['SendMessages'],
  async execute(interaction, client) {
    // Your command logic here
  }
};

πŸ“… Event Options

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 uses
    window: 60000 // 60 seconds
  },
  
  async execute(interaction, client) {
    // Your event logic here
  }
};

βš™οΈ Configuration

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

πŸ”§ Function Options

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:

const exampleFunction = async () => {
  console.log("Function executed!");
};

exampleFunction.config = {
  once: false,
  interval: 10000, // Run every 10 seconds
  retryAttempts: 3,
  maxExecution: 100,
  initializer: 0
};

module.exports = exampleFunction;

πŸ” Activity Tracker

Monitor all file changes in real-time through discobase.json:

{
  "activityTracker": {
    "enabled": true,
    "ignoredPaths": [
      "**/logs/**",
      "**/node_modules/**",
      "**/private/**"
    ]
  }
}

✨ Generate Commands & Events

Create new commands and events instantly:

npm run generate

Supported Builders:

  • EmbedBuilder - Rich embedded messages
  • ButtonBuilder & ActionRowBuilder - Interactive buttons
  • StringSelectMenuBuilder - Dropdown menus
  • ModalBuilder & TextInputBuilder - Input forms

The CLI automatically generates imports and example code!

πŸ“Š Manage Commands & Events

Edit, pause, or delete commands and events:

npm run manage

Features:

  • Enable/disable commands without deleting
  • Edit command properties
  • View all commands and events
  • Bulk operations

πŸ“š Documentation

For complete guides, tutorials, and API reference:

🌐 discobase.site

πŸ’¬ Community & Support

Join our Discord community:

Discord Server

πŸ”— Links

πŸ“œ License

Apache-2.0 Β© DiscoBase Team

Built with ❀️ by the DiscoBase Team

About

Easily create and manage your Discord bot with our powerful toolkit! πŸš€

Resources

Contributing

Stars

31 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages