UNPKG

@tryforge/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.

36 lines 1.09 kB
"use strict"; /* * SPDX-License-Identifier: GPL-3.0-or-later * Copyright © 2025 BotForge */ Object.defineProperty(exports, "__esModule", { value: true }); const structures_1 = require("../../structures"); exports.default = new structures_1.NativeFunction({ name: "$arrayAt", version: "1.0.0", description: "Returns the element at given index", unwrap: true, brackets: true, args: [ { name: "variable", description: "The variable the array is held on", type: structures_1.ArgType.String, rest: false, required: true, }, { name: "index", type: structures_1.ArgType.Number, description: "The index to get the element of", rest: false, required: true, }, ], output: structures_1.ArgType.Unknown, execute(ctx, [variable, index]) { const arr = ctx.getEnvironmentKey(variable); return this.successJSON(Array.isArray(arr) ? arr.at(index) : undefined); }, }); //# sourceMappingURL=arrayAt.js.map