Skip to content
BaumianerNiklas edited this page Jun 13, 2022 · 21 revisions

Welcome to the Iubus wiki!

Iubus is an intuitive framework on top of discord.js v14 for easily managing slash commands (and client events!). It is designed to get out of your way, by reducing boilerplate and making the process of both the initial setup and command creation, response, and deployment as simple as possible.

About this Wiki

This wiki is both the guide and the documentation for the framework. It is made up of sections about Setup, Commands, Events, Inhibitors and Miscellaneous Information, which can be accessed through the sidebar.

You'll find options and interfaces documented via the following syntax:

optionName - type (in TypeScript syntax): description

If optionName has a ? after its name it's an optional field.

Any piece of code in the wiki uses TypeScript and ESM. It is expected you can adapt your code accordingly if you have a different coding environment. Iubus itself is written in TypeScript and ESM so it provides first-class support for them.

Quick start

In your entry file:

import { IubusClient } from "iubus";

const client = new IubusClient({
    intents: /* ... */,
    dirs: {
        commands: "./dist/commands/",
        events: "./dist/events/",
    },
    deploy: {
        token: "YOUR_TOKEN",
        applicationId: "YOUR_APPLICATION_ID",
        guildId: "YOUR_GUILD_ID", // will be ignored if deployGlobally is set to true
        deployGlobally: true, // defaults to false
        deployOnChange: true, // Re-deploy commands whenever Iubus detects a change in the command data
    }
});

client.login("YOUR_TOKEN");

Then, in a command file (inside commandDir):

import { ApplicationCommandOptionType, ChatInputCommandInteraction } from "discord.js";
import { ChatInputCommand } from "iubus";

export default new ChatInputCommand({
    name: "echo", 
    description: "Echo back your text",
    options: {
        type: ApplicationCommandOptionType.String,
        name: "text",
        description: "The text to echo back",
        required: true,
    },
    run(interaction: ChatInputCommandInteraction) {
        const text = interaction.getString("text", true);
        interaction.reply({ content: text });
    },
});
Clone this wiki locally