aoi-command-manager

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

Generated using TypeDoc