Client
The JellyCommands
client is the core of every project. It extends the discord.js client to add additional functionality.
Get Started
The basic setup is shown below. The intents field is required by the discord.js
client.
import { JellyCommands } from 'jellycommands';
const client = new JellyCommands({
clientOptions: {
// Intents is required
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
},
});
client.login();
Options
commands
- Type:
string | Array<string | Command>
- Guide: /guide/commands
Passing a string will automatically load commands from that directory, otherwise you can manually import your commands and pass them in as an array
. Files prefixed with _
are ignored.
events
- Type:
string | Array<string | Event>
- Guide: /guide/events
Passing a string
will automatically load events from that directory. Otherwise, you can manually import your events and pass them in as an array
. Files prefixed with _
are ignored.
buttons
- Type:
string | Array<string | Button>
- Guide: /guide/buttons
Passing a string
will automatically load buttons from that directory. Otherwise, you can manually import your events and pass them in as an array
. Files prefixed with _
are ignored.
clientOptions
- Type:
ClientOptions
- Required
This is passed directly to the discord.js
client
props
- Type:
Props
- Guide: /guide/props
- API: /api/props
The built-in way to pass data through a JellyCommands
app
messages
- Guide: /guide/messages
Customise JellyCommands
responses
messages.unknownCommand
- Type:
string | MessagePayload | InteractionReplyOptions
The default message sent when an unknown command interaction is recieved
dev
- Guide: /guide/commands/dev
DX focused developer mode
dev.global
- Type:
boolean
Whether dev mode should be enabled globally
dev.guilds
- Type:
string[]
The guilds to register dev mode commands in
cache
- Type:
boolean
- Default:
true
Enables JellyCommands
cache. It's recommended to keep this on
debug
- Type:
boolean
Emits debug messages when true