Creators
Main base structures for creating commands and systems
On this base, to create commands and systems you must use the creator functions, which are createCommand
, createEvent
and createResponder
.
When executing these functions passing the data of the respective structures, they will be created and registered.
You can set some options in the index
file of the discord
folder, see:
This function receives options and returns the creators of commands, events and responders for you to use. By exporting this return you can import them at any time using the base import alias:
Command Options
You can set some command options in the setupCreators
function:
Set what the default permissions will be for all commands, if none are defined with the defaultMemberPermissions
option (It is the same permissions array as the command).
This way, when you create a command and do not set any default member permissions, what you set in the setupCreators
function will be the default for all commands.
Responder Options
You can set some responder options in the setupCreators
function:
You can set a middleware
function that will be executed before the responders` run function
Just like with commands, you can do a lot with this, such as displaying standardized logs for all executed responders, injecting additional information into the interaction, or even blocking execution based on checks.
You can run the block
function to block responders from executing.