Creating Addons

Addon Template

const { SlashCommandBuilder } = require("discord.js");
const Utility = require("../utils/modules/Utility");

module.exports = {
    commands: [
        {
            category: "addon",
            aliases: [],
            data: new SlashCommandBuilder()
                .setName('')
                .setDescription(''),
            async execute(moi, args, client, { type, send }) {
                send(type, moi, {
                    content: 'Command works !!!'
                });
            }
        }
    ], // Array of commands
    events: [
        // {
        //     name: ''
        //     id: '',
        //     once: false,
        //     async execute(interaction) {
        //
        //     }
        // }
    ], //Array of events

    function: {
        name: 'setAddon',
        execute(client) {
            Utility.addonConsole(module.exports.commands);
        }
    } // Timers, Intervals, etc..
};
Utility.embed() // Custom EmbedBuilder
Utility.db // Database
Utility.config() // Custom Config for addons
Utility.permission() // Permission check

// There is more!
async execute(moi, args, client, { type, send }) {
   send(type, moi, {
      content: 'Command works !!!'
   });
}

Last updated