Skip to content

Getting Started


Welcome to JellyCommands! A framework built around discord.js that allows you to easily create fully featured Discord bots. This guide will be easier to follow with our official template, which setups all the necessary boilerplate for you:

Terminal window
npm create jellycommands@latest

Project Structure

Now you’ve got your project created, take a moment to familiarise yourself with the structure:

  • package.json
  • README.md Helpful tips/reminders about your project
  • .env.example This shows what your .env file should look like
  • Directorysrc/ Project source code
    • index.js Your main file
    • app.d.ts Contains app types
    • Directorycomponents/
      • ready.js This ready event fires when the client starts
      • hello.js Demo Hello World command

The Client

JellyCommands wraps the standard discord.js Client to add in extra goodies for developing Discord Bots. If you’re familiar with discord.js you’ll be right at home. Setting up the client is simple, you need to create a new instance and pass it your intents. The intents tell Discord what your bot is going to do, and what events it needs to recieve. For now we’ll just stick with the guild intent:

import { JellyCommands } from 'jellycommands';
import { IntentsBitField } from 'discord.js';
const client = new JellyCommands({
clientOptions: {
intents: [IntentsBitField.Flags.Guilds],
},
});
client.login();

Once we call client.login() JellyCommands gets to work. It’ll load and register any components (we’ll learn about these next), then delegate to Discord.js to actually start up your bot and open a websocket connection to Discord.

If this is your first time building a Discord bot, we recommend checking out discordjs.guide and having the Discord.js docs handy. There are also plenty of tutorials available on YouTube. From here we’ll assume some prerequisite knowledge on building Discord bots.