Skip to content

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

components

The recommended way to load components is to pass in a directory path (or paths). JellyCommands will recursively search the given path(s), and load any components it finds. Every export will be checked, and anything that isn’t a component is ignored. Files that start with _ or don’t match the allowed extensions will also be ignored.

clientOptions

This is passed directly to the discord.js client

props

The built-in way to pass data through a JellyCommands app

messages

Customise JellyCommands responses

messages.unknownCommand

  • Type: string | MessagePayload | InteractionReplyOptions

The default message sent when an unknown command interaction is recieved

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

Enables debug messages to be printed to console. If a non-empty DEBUG environment variable is set then this will automatically be enabled.

fs

fs.extensions

  • Type: string[]
  • Default: ['.js', '.ts']

Only files that end in these extensions are loaded.