2.0.10 • Published 8 months ago

create-discobase v2.0.10

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

Logo

Discord NPM Version NPM License NPM Downloads

discoBase

discoBase is a lightweight command and event handler package for Discord bots, enabling easy management of commands and events with a structured file organization and dynamic loading system. It allows you to build almost any advanced Discord bot effortlessly.

✨ Supports Latest Discord.js v14.

šŸŽ‰ New Update (v2.0.0) šŸŽ‰

  • šŸš€ Enhanced Terminal Look: Experience a cleaner and more modern terminal display with colorful logs for success, errors, and info messages.
  • šŸ“ Auto-Generated Files: Commands, events, and prefix commands now come with pre-built templates to save you time.
  • ⚔ Optimized File Watching: Automatic detection and template insertion for new command, event, and prefix files.
  • šŸ” Error Logging: Errors encountered during runtime are automatically logged into an errors folder for easier debugging.
  • šŸ“Š Discobase Dashboard: A comprehensive dashboard running on localhost allows you to:
    • View statistics such as bot guilds, command counts, and user counts.
    • Monitor recent activities (e.g., command creation, deletion, and changes).
    • Manage bot settings like banner, avatar, and name directly from the dashboard.

Features

  • šŸŽ‰ Command Handler
  • šŸ“… Event Handler
  • āš™ļø Advanced Customization
  • šŸš€ Asynchronous Support
  • šŸ”„ Dynamic Reloading
  • šŸ› ļø Modular Structure
  • šŸ›” Never Crash
  • 🌐 Compatibility with Advanced Discord Bots
  • šŸ”¤ Prefix Commands Support
  • āž— Slash Commands Support
  • šŸ”” Automatic Detection of Missing Intents
  • āš™ļø Configurable Function Execution: Allows for setting properties such as once, interval, retryAttempts, maxExecution, and initializer in your functions to control execution patterns. Ideal for scheduling tasks or retrying operations with ease.
  • šŸ—‚ļø Error Logging: Automatic logging of runtime errors into an errors folder.
  • šŸ“Š Discobase Dashboard: View and manage your bot's statistics and settings easily.
  • šŸ”§ Discobase Generate Command: Generate new commands and events with ease. For example: run this in your terminal after setuping discobase!
     npm run generate 
## Installation

To create a new **discoBase** project, run the following commands:


```bash
npx create-discobase@latest my-project

You can also create a new project in the current directory without specifying a project name:

npx create-discobase@latest

This will generate a new discoBase project in the current directory.

Useful Addon

Configuration

To run this project, you will need to provide the necessary values in the config.json file located in the root directory. The structure of the file is as follows:

ParameterTypeDescription
bot.tokenstringRequired. Your Discord bot token
bot.idstringRequired. The ID of your Discord bot
bot.adminsarrayOptional. List of admin user IDs
bot.ownerIdstringOptional. The owner's user ID
bot.developerCommandsServerIdsarrayOptional. Server IDs where developer commands are enabled
database.mongodbUrlstringOptional. MongoDB connection URL
logging.guildJoinLogsIdstringOptional. Channel ID for guild join logs
logging.guildLeaveLogsIdstringOptional. Channel ID for guild leave logs
logging.commandLogsChannelIdstringOptional. Channel ID for command logs
logging.errorLogsstringOptional. Webhook URL for error logging
prefix.valuestringOptional. Command prefix for non-slash commands

Command Options

OptionTypeDescription
ownerOnlybooleanOptional. If true, the command can only be run by the bot owner.
adminOnlybooleanOptional. If true, the command can only be used by bot admins specified in the config file.
devOnlybooleanOptional. If true, the command is only registered/run in specific developer servers.
botPermissionsarrayOptional. List of permissions the bot needs to execute the command (e.g., 'SendMessages', 'ManageChannels').
userPermissionsarrayOptional. List of permissions the user needs to execute the command (e.g., 'Administrator', 'KickMembers').
cooldownnumberOptional. The cooldown time in seconds before the command can be reused. Default is 3 seconds.

Function Options

PropertyTypeDescription
oncebooleanIf true, the function will only execute once. If false, it can be executed repeatedly.
intervalnumberThe time interval (in milliseconds) between repeated executions of the function.
retryAttemptsnumberSpecifies the number of retry attempts if the function fails during execution.
maxExecutionnumberDefines the maximum number of times the function can execute.
initializernumberInitial value or state to use when starting the function; can be used for setup or as a counter.
const exampleFunction = async () => {
    console.log("Function executed successfully.");
};

exampleFunction.config = {
    once: true,           
    interval: 10000,      
    retryAttempts: 3,     
    maxExecution: 5,     
    initializer: 10       
};

module.exports = exampleFunction;

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

Show your support

Give a ā­ļø if this project helped you!

Feedback & Suggestion

If you have any feedback or suggestion, please reach out to us at Discord Community

Support

For support & questions, join our Discord server: Discord Community.

2.0.9

8 months ago

2.0.10

8 months ago

2.0.5

8 months ago

2.0.7

8 months ago

2.0.6

8 months ago

2.0.8

8 months ago

2.0.3

9 months ago

2.0.2

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.0.9

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.12

9 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.0

10 months ago