1.0.2 • Published 5 months ago

aoi-command-manager v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

Application Command Manager

aoi-command-manager is an application command loader to sync your Slash Commands to the Discord API with ease.

Setup

const { ApplicationCommandManager } = require('aoi-command-manager')
const { AoiClient } = require('aoi.js')
const { config } = require('dotenv')
const { join } = require('path')

const client = new AoiClient({
    intents: [
        'Guilds',
        'GuildMessages',
        'MessageContent'
    ],
    token: config().parsed.TOKEN
})

client.readyCommand({
    code: `
        $log[Client user started!]
    `
})

const apps = new ApplicationCommandManager(client)
apps.load(join(__dirname, 'data'), true).then(() => {
    setTimeout(function () {
        if (client.isReady()) {
            apps.sync()
            console.log('Commands synced')
        }
    }, 5000)
})

Slash command file structure

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

module.exports = {
    data: new SlashCommandBuilder()
    .setName('ping')
    .setDescription('Returns the client websocket latency.')
}

File structure for the previous example

Structure

Custom functions

$applicationCommandReload

Reload application command specifications from a directory.

Usage: $applicationCommandReload

$applicationCommandSync

Synces all loaded specifications into multiple guilds or bots if no args.

Usage: $applicationCommandSync[...guildIDs?]

Documentation

Link

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago