Logo
Kythia
Logo
Kythia
Login
Login
Addon Development
Minimized (Click to Restore)

Addon Development

Learn how to build your own features and extensions for Kythia.


Addons are the lifeblood of Kythia. Every feature—from simple pings to complex AI interactions—is implemented as an addon. This structure makes Kythia incredibly easy to maintain and extend.


Addon Structure

Every addon lives in its own folder within the addons/ directory.

  • addons/
    • birthday/
      • commands/ # Slash command files
      • components/ # Button/Modal handlers
      • events/ # Discord event listeners
      • helpers/ # Utility functions
      • lang/ # i18n translation files
      • addon.json # Metadata for the addon manager

The addon.json File

This file tells Kythia's AddonManager how to load your feature.

{
  "name": "MyAwesomeAddon",
  "version": "1.0.0",
  "description": "Adds a cool new feature to your server.",
  "active": true
}

Creating Your First Command

Let's build a simple /echo command that repeats whatever the user says.

1
Create the directory: addons/hello-world/commands/
2
Create the file: echo.js
3
Implement the command:
// addons/hello-world/commands/echo.js

const { SlashCommandBuilder } = require('discord.js');

module.exports = {
  slashCommand: new SlashCommandBuilder()
    .setName('echo')
    .setDescription('Repeats your message')
    .addStringOption(option => 
      option.setName('message').setDescription('The message to repeat').setRequired(true)
    ),

  async execute(interaction, container) {
    const { logger } = container;
    const message = interaction.options.getString('message');

    logger.info(`User ${interaction.user.tag} used echo: ${message}`);
    await interaction.reply({ content: `You said: ${message}` });
  }
};

Handling Events

Addons can also listen to any Discord event. Create an events/ folder and add a file named after the event you want to hear.

// addons/hello-world/events/MessageCreate.js

module.exports = {
  name: 'messageCreate',
  async execute(message, container) {
    if (message.author.bot) return;

    if (message.content.includes('hello kythia')) {
      await message.reply('Hello! I am here to help. 🌸');
    }
  }
};

Adding Translations

Kythia is built for a global audience. Never hardcode strings! Use the lang/ folder.

  1. Create addons/hello-world/lang/en.json:

    {
      "hello": {
        "greeting": "Hello {user}! Welcome to the server."
      }
    }
    
  2. Use it in your command:

    const { t } = container;
    await interaction.reply(await t(interaction, 'hello.greeting', { user: interaction.user.username }));
    

Registering Your Addon

Once your files are in place:

  1. Ensure active: true is set in your addon.json.
  2. Add your addon to the addons block in kythia.config.js (optional, but good for control).
  3. Restart the bot.
  4. Run npx kythia deploy to register your new slash commands with Discord.
Kythia's AddonManager uses "Hot Discovery". You don't need to register files manually; as long as they are in the correct directory, they will be loaded automatically!
Kythia Documentation Sign in →