aoi-command-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i aoi-command-manager

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

12.7 kB

Total Files

5

Last publish

Collaborators

  • cyberghxstuwu
  • asperion