Optional
aliasRepresents the command this command is an alias of
Optional
aliasesRepresents a list of commands that are identical to the original command, with different names
Optional
categoryThis command's category, if omitted, the command's origin file's parent folder name will be parsed and used
'file parent folder name'
Optional
clientPermissions required by the client to execute the command
Optional
cooldownCommand cooldown/throttling configuration to apply to this command
Note: This is NOT persistent, for that, you should use your own persistent cooldown middleware
Command data to send off to the Discord API, resolved by builder
Optional
deferDefers the reply to run
interactions internally if possible
Optional
disabledIs the command currently disabled? If so - it won't be available anywhere. Late API updates (users that see the command in their command overview after the API data update) are accounted for
false
Optional
globalIndicates if this command is available globally. If
NODE_ENV is production
it will default to true
. If NODE_ENV
is anything else, it will default to false
.
Optional
guildIs this command only available in guilds/servers, or also in DMs?
You should use InteractionUtils.requireAvailableGuild
in your
command/controller to assert the interaction type
true
Optional
isTries to (defer, edit, followUp, etc.) reply ephemerally if possible
Optional
middlewareMiddleware for this command
import { ChatInputMiddlewareFunction } from '../middleware/CommandMiddleware';
const requireDJRole: ChatInputMiddlewareFunction = async ({
next,
client,
command,
interaction,
previousResult,
nextMiddleware,
previousMiddleware,
}) => {
// Do something with available Context
next(); // Only continue to next middleware if next is called
};
export default new ChatInputCommand({
deferReply: true, // You should defer replies ASAP if you're using async middleware
permLevel: PermLevel.Developer,
middleware: [ requireDJRole ],
// OR
middleware: {
preRunChecks: [ requireDJRole ],
// Etc.
}
})
Optional
nsfwIs the command Not Safe For Work? If it is, it will only be available in channels that have the NSFW-flag set enabled
false
Optional
permThe permission level required to use the command
If higher than or equal to Administrator, data#setDefaultMemberPermissions(0)
is automatically called if not explicitly set
PermLevel.User
Optional
requiredRepresents a list of required resource IDs for a command
These are used to restrict command usage to specific resources, which is especially useful for private bots/functionality
Every parameter represents a oneOf list of IDs of which AT LEAST ONE is required to match If multiple parameters are provided, all of them must match
Internal permissions and availability/constraint checks still apply
The function to run when the command is executed
Optional
userPermissions required by the user to execute the command
Represents a client command configuration object