Skip to content

Custom Function Handler

This will load the functions in your functions directory.

Setup: Custom Function Handler

...
// Initialize a Handler for structured command handling
const handler = new Handler(
{
client: client,
readyLog: true
},
{
// Additional Handler configuration options go here
},
__dirname
);
handler.loadFunctions('/folder-name') // needs to be a folder

Same as command handler create a folder in your root directory where your index is.
This takes the same structure you will find in making custom function normally. You can ser below how its done.

Structure

module.exports = {
name: "$mePro",
type: "djs",
code: async d => {
const data = d.util.aoiFunc(d);
data.result = 'This is a djs function'
return {
code: d.util.setCode(data),
}
}
}
module.exports = {
name: "$youPro",
type: "aoijs",
param: [""],
code: `
This is an aoijs function, cool?
`}

You cannot put 2 functions inside 1 fileā€¦ That will be in future version ig.