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.

77 lines 2.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const structures_1 = require("../../structures"); exports.default = new structures_1.NativeFunction({ name: "$editRole", version: "1.0.7", description: "Edits role data, returns boolean", unwrap: true, output: structures_1.ArgType.Boolean, args: [ { name: "guild ID", description: "The guild to pull the role from", rest: false, required: true, type: structures_1.ArgType.Guild, }, { name: "role ID", pointer: 0, type: structures_1.ArgType.Role, description: "The role to edit data", rest: false, required: true, }, { name: "role name", description: "The new role name, leave empty to not modify", rest: false, type: structures_1.ArgType.String, }, { name: "role color", description: "The new role color, leave empty to not modify", rest: false, type: structures_1.ArgType.String, }, { name: "role icon", description: "The new role icon, leave empty to not modify", rest: false, type: structures_1.ArgType.String, }, { name: "hoisted", description: "Whether the role is hoisted, leave empty to not modify", rest: false, type: structures_1.ArgType.Boolean, }, { name: "mentionable", description: "Whether the role can be mentioned, leave empty to not modify", rest: false, type: structures_1.ArgType.Boolean, }, { name: "perms", description: "The new perms for the role", rest: true, type: structures_1.ArgType.Permission, }, ], brackets: true, async execute(ctx, [, role, name, color, icon, hoist, mentionable, perms]) { return this.success(!!(await role .edit({ color: color || undefined, hoist: hoist || undefined, icon: icon || undefined, mentionable: mentionable || undefined, name: name || undefined, permissions: perms || undefined, }) .catch(ctx.noop))); }, }); //# sourceMappingURL=editRole.js.map