Commands
Loading
- Guide: /guide/commands
Command File
A command file uses the command
helper function and exports it. For example:
Command Types
There are 3 types of commands you can do in JellyCommands
Slash Commands
SlashCommands are the main type of command
Use
You can use the command
helper from JellyCommands, for example:
Options
This section lists extra options that a slash command has, click here to see the core options for all commands.
description
- Type:
string
- Required
The name of the command
descriptionLocalizations
- Type:
Partial<Record<Locale, string>>
The localizations for users not in english, you can view the available Locale
options here
options
The options for the slash command
Message Commands
Message commands are context menus available on messages
Use
You can use with the messageCommand
helper, for example:
Options
Click here to view the core options
User Commands
User commands are context menus available on users
Use
You can use with the userCommand
helper, for example:
Options
Click here to view the core options
Core Options
This shows options that all command types share
name
- Type:
string
- Required
The name of the command
nameLocalizations
- Type:
Partial<Record<Locale, string>>
The localizations for users not in english, you can view the available Locale
options here
dev
- Type:
boolean
- Guide: /guide/commands/dev
Whether the command is in dev mode or not
defer
- Type:
boolean | InteractionDeferReplyOptions
Should the interaction be defered
guards
- Guide: /guide/commands/guards
Guards allow you to prevent/allow access to your command
guards.permissions
- Type:
PermissionResolvable
The permissions a member must have to run this command
guilds
- Type:
string
The guilds to register the slash command in
global
- Type:
boolean
Whether the command should be registered as a global command
dynamic
- Type:
boolean
- Default:
true
Should the command work in DMs, this only works on global commands
disabled
- Type:
boolean
When true JellyCommands will ignore this command.
run
- Type:
Function
- Guide: /guide/commands/files
- Required
The main handler for the command
autocomplete
- Type:
Function
- Guide: /guide/commands/files
Handles autocomplete interaction for slash commands