
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
create-discobase
Advanced tools
Easily create and manage your Discord bot with our powerful toolkit! š
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.
errors
folder for easier debugging.once
, interval
, retryAttempts
, maxExecution
, and initializer
in your functions to control execution patterns. Ideal for scheduling tasks or retrying operations with ease.errors
folder. npm run generate
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.
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 |
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. |
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;
Contributions are always welcome!
See contributing.md
for ways to get started.
Please adhere to this project's code of conduct
.
Give a āļø if this project helped you!
If you have any feedback or suggestion, please reach out to us at Discord Community
For support & questions, join our Discord server: Discord Community.
FAQs
Easily create and manage your Discord bot with our powerful toolkit! š
The npm package create-discobase receives a total of 145 weekly downloads. As such, create-discobase popularity was classified as not popular.
We found that create-discobase demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.