You create a custom function handler code first
- name-file.js :
const { LoadCommands } = require("aoi.js");
const loader = new LoadCommands(this);
async function customFunction(client, pathGG) {
client.customFunctions = {
djs: new client.cacheManager.cachers.Group(),
};
await loader.load(client.customFunctions, pathGG);
Object.values(client.customFunctions).forEach(
async (x) => {
await client.functionManager.createFunction(
...x.allValues()
);
}
);
console.log("Custom Function Handler is Ready");
}
module.exports = customFunction;
and
You import the custom function handler code in index.js first