Skip to main content
Module

x/harmony/src/structures/template.ts>Template

An easy to use Discord API Library for Deno.
Latest
class Template
extends Base
import { Template } from "https://deno.land/x/harmony@v2.9.1/src/structures/template.ts";

Constructors

new
Template(client: Client, data: TemplatePayload)

Properties

code: string

The template code (unique ID)

createdAt: number

When this template was created (in ms)

creator: User

The user who created the template

creatorID: string

The ID of the user who created the template

description: string | null

The description for the template

isDirty: boolean | null

Whether the template has unsynced changes

name: string

The template name

serializedSourceGuild: Guild

The guild snapshot this template contains

sourceGuildID: string

The ID of the guild this template is based on

updatedAt: number

When this template was last synced to the source guild (in ms)

usageCount: number

Number of times this template has been used

Methods

delete(): Promise<Template>

Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted template object on success.

Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the template object on success.

sync(): Promise<Template>

Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the template object on success.