UNPKG

forgescript

Version:

ForgeScript is a comprehensive package that empowers you to effortlessly interact with Discord's API. It ensures scripting remains easy to learn and consistently effective.

31 lines 971 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const structures_1 = require("../structures"); exports.default = new structures_1.NativeFunction({ name: "$arrayIndexOf", version: "1.0.0", description: "Gets the index of an element in the array", unwrap: true, args: [ { name: "name", description: "The variable that holds the array", rest: false, required: true, type: structures_1.ArgType.String, }, { name: "value", description: "The exact value to get its index", rest: false, required: true, type: structures_1.ArgType.String, }, ], brackets: true, execute(ctx, [name, value]) { const arr = ctx.getEnvironmentKey(name); return this.success(Array.isArray(arr) ? arr.indexOf(value) : -1); }, }); //# sourceMappingURL=arrayIndexOf.js.map