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.

34 lines 1.01 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: "$guildID", version: "1.0.0", description: "Returns the guild id with given name", unwrap: true, aliases: [ "$serverID" ], output: structures_1.ArgType.Guild, brackets: false, args: [ { name: "name", description: "The guild name to return the id", rest: true, type: structures_1.ArgType.String, required: true, }, ], execute(ctx, [args]) { if (!this.hasFields) return this.success(ctx.guild?.id ?? ctx.interaction?.guildId); const name = args.join(";"); return this.success(ctx.client.guilds.cache.find((x) => x.name === name)?.id); }, }); //# sourceMappingURL=guildID.js.map