-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy patheditGuildTemplate.ts
More file actions
47 lines (44 loc) · 1.2 KB
/
editGuildTemplate.ts
File metadata and controls
47 lines (44 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright © 2026 BotForge
*/
import { ArgType, NativeFunction, Return } from "../../structures"
export default new NativeFunction({
name: "$editGuildTemplate",
version: "1.5.0",
description: "Edits template on a guild, returns bool",
aliases: [
"$editServerTemplate"
],
unwrap: true,
brackets: true,
args: [
{
name: "template code",
description: "The code of the template to edit",
rest: false,
required: true,
type: ArgType.Template,
},
{
name: "name",
description: "The new name for the template",
rest: false,
type: ArgType.String,
},
{
name: "description",
description: "The new description for the template",
rest: false,
type: ArgType.String,
},
],
output: ArgType.Boolean,
async execute(ctx, [template, name, desc]) {
const edit = await template.edit({
name: name || undefined,
description: desc ?? undefined
}).catch(ctx.noop)
return this.success(!!edit)
},
})