@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.
39 lines • 1.14 kB
JavaScript
;
/*
* 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: "$cloneChannel",
version: "1.4.0",
description: "Clones the given channel",
brackets: true,
output: structures_1.ArgType.Channel,
unwrap: true,
args: [
{
name: "channel ID",
description: "The channel to clone",
type: structures_1.ArgType.Channel,
rest: false,
required: true,
check: (i) => "clone" in i
},
{
name: "name",
description: "The name for the cloned channel",
type: structures_1.ArgType.String,
rest: false,
}
],
async execute(ctx, [raw, name]) {
const channel = await raw.clone({
name: name || raw.name,
reason: ctx.reason
}).catch(ctx.noop);
return this.success(channel?.id);
},
});
//# sourceMappingURL=cloneChannel.js.map