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.
33 lines • 994 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const structures_1 = require("../structures");
exports.default = new structures_1.NativeFunction({
name: "$arrayPushJSON",
version: "1.3.0",
description: "Appends an element to an array",
unwrap: true,
args: [
{
name: "name",
description: "The variable that holds the array",
rest: false,
required: true,
type: structures_1.ArgType.String,
},
{
name: "values",
description: "The values to append at the end of the array",
rest: true,
required: true,
type: structures_1.ArgType.Json,
},
],
brackets: true,
execute(ctx, [name, values]) {
const arr = ctx.getEnvironmentKey(name);
if (Array.isArray(arr))
arr.push(...values);
return this.success();
},
});
//# sourceMappingURL=arrayPushJSON.js.map