A function that increments the given number by one. (Basically x++)
Parameters: [number, returnNaN (false by default)]
client.functionManager.createFunction({
name: "$inc",
type: "djs",
code: async d => {
const data = d.util.aoiFunc(d);
const [a, returnNaN] = data.inside.splits;
let res = Number(a)
let newres = res + 1
if (returnNaN == "true") {
} else {
if (isNaN(newres)) {
return d.aoiError.fnError(d, "custom", {}, "Error at $inc[" + a + "]: Invalid Number Provided!");
} }
data.result = newres
return {
code: d.util.setCode(data)
};
}
});