Addon System

Understanding and setting up addons. This system is meant for experienced developers.

Creating Addons for Drako Bot

To start creating addons for Drako Bot, please review the examples within the Addons > Example folder.

Types of Addons

There are two main types of addons you can create for Drako Bot:

  1. Command Addons

  2. Event Addons

Command Addons

  • Naming Convention: Command addons need to be named in the format cmd_x (where x is a unique name).

Example Command Addon

const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('test')
        .setDescription('Test command!'),
    async execute(interaction, client) {
        interaction.reply({ content: 'This is a test', ephemeral: true });
    }
};

Event Addons

  • Naming Convention: Event addons can be named anything. For example, example_addon.

Example Event Addon

module.exports.run = async (client) => {
    client.on('ready', async () => {
        console.log("This is an example addon! You can delete it in addons/example");
    });
};

Steps to Create Addons

  1. Review Examples: Start by looking at the examples provided in the Addons > Example folder. This will give you a good idea of the structure and conventions used for Drako Bot addons.

  2. Create a New Addon: Based on the type of addon you want to create, follow the naming conventions and structure shown in the examples.

  3. Test Your Addon: Before deploying your addon, make sure to test it thoroughly to ensure it works as expected and does not cause any issues with the bot.

  4. Deploy Your Addon: Once tested, you can add your new addon to the Addons folder of Drako Bot and restart the bot to load the new addon.

Last updated