npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

create-discobase

v2.0.10

Published

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

Downloads

631

Readme

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:

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:

| Parameter | Type | Description | | :------------------------------| :------- | :----------------------------------------------------------- | | bot.token | string | Required. Your Discord bot token | | bot.id | string | Required. The ID of your Discord bot | | bot.admins | array | Optional. List of admin user IDs | | bot.ownerId | string | Optional. The owner's user ID | | bot.developerCommandsServerIds| array | Optional. Server IDs where developer commands are enabled | | 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. Command prefix for non-slash commands |

Command Options

| Option | Type | Description | | :------------------ | :---------- | :--------------------------------------------------------------------------------------------------- | | ownerOnly | boolean | Optional. If true, the command can only be run by the bot owner. | | adminOnly | boolean | Optional. If true, the command can only be used by bot admins specified in the config file. | | devOnly | boolean | Optional. If true, the command is only registered/run in specific developer servers. | | botPermissions | array | Optional. List of permissions the bot needs to execute the command (e.g., 'SendMessages', 'ManageChannels'). | | userPermissions | array | Optional. List of permissions the user needs to execute the command (e.g., 'Administrator', 'KickMembers'). | | cooldown | number | Optional. The cooldown time in seconds before the command can be reused. Default is 3 seconds. |

Function Options

| Property | Type | Description | |------------------|------------|------------------------------------------------------------------------------------------------------| | once | boolean | If true, the function will only execute once. If false, it can be executed repeatedly. | | interval | number | The time interval (in milliseconds) between repeated executions of the function. | | retryAttempts | number | Specifies the number of retry attempts if the function fails during execution. | | maxExecution | number | Defines the maximum number of times the function can execute. | | initializer | number | Initial 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.