UNPKG

ariaa

Version:
24 lines 965 B
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { readdirSync } from "fs"; import { fileURLToPath } from "url"; const root = new URL("../", import.meta.url); const commandFoldersPath = fileURLToPath(new URL("./commands/", root)); async function handleRegistry(aria) { const commandFolders = readdirSync(commandFoldersPath); for (const folder of commandFolders) { const commandFiles = readdirSync(fileURLToPath(new URL(`./commands/${folder}`, root))).filter((file) => file.endsWith(".js")); for (const file of commandFiles) { const path = `../commands/${folder}/${file}`; const { default: command } = await import(path); command.options.name ??= file.split(".")[0]; aria.addCommand(command.parse()); } } return aria; } __name(handleRegistry, "handleRegistry"); export { handleRegistry }; //# sourceMappingURL=registerCommands.js.map