@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.
48 lines • 1.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TemplateProperty = void 0;
const structures_1 = require("../../structures");
var TemplateProperty;
(function (TemplateProperty) {
TemplateProperty["code"] = "code";
TemplateProperty["name"] = "name";
TemplateProperty["description"] = "description";
TemplateProperty["guildID"] = "guildId";
TemplateProperty["authorID"] = "creatorId";
TemplateProperty["timestamp"] = "createdTimestamp";
TemplateProperty["updatedTimestamp"] = "updatedTimestamp";
TemplateProperty["url"] = "url";
TemplateProperty["usageCount"] = "usageCount";
})(TemplateProperty || (exports.TemplateProperty = TemplateProperty = {}));
exports.default = new structures_1.NativeFunction({
name: "$getGuildTemplate",
version: "1.5.0",
description: "Gets the template of a guild",
aliases: [
"$getServerTemplate"
],
unwrap: true,
brackets: true,
args: [
{
name: "template code",
description: "The code of the template to get",
rest: false,
required: true,
type: structures_1.ArgType.String,
},
{
name: "property",
description: "The property of the template to return",
rest: false,
type: structures_1.ArgType.Enum,
enum: TemplateProperty
},
],
output: structures_1.ArgType.Unknown,
async execute(ctx, [code, prop]) {
const template = await ctx.client.fetchGuildTemplate(code).catch();
return this.successJSON(prop ? template[prop] : template);
},
});
//# sourceMappingURL=getGuildTemplate.js.map