From caff4d809c1726c3e31a5e43d1ae0bda864eb27c Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Sun, 28 Mar 2021 23:14:56 +0200 Subject: [PATCH] types: add Template type --- src/types/templates/template.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/types/templates/template.ts diff --git a/src/types/templates/template.ts b/src/types/templates/template.ts new file mode 100644 index 000000000..3081541e3 --- /dev/null +++ b/src/types/templates/template.ts @@ -0,0 +1,29 @@ +import { SnakeCaseProps } from "../util.ts"; + +export interface Template { + /** The template code (unique ID) */ + code: string; + /** Template name */ + name: string; + /** The description for the template */ + description: string | null; + /** Number of times this template has been used */ + usageCount: number; + /** The ID of the user who created the template */ + creatorId: string; + /** The user who created the template */ + creator: URLSearchParams; + /** When this template was created */ + createdAt: string; + /** When this template was last synced to the source guild */ + updatedAt: string; + /** The ID of the guild this template is based on */ + sourceGuildId: string; + /** The guild snapshot this template contains */ + serializedSourceGuild: Partial; + /** Whether the template has unsynced changes */ + isDirty: boolean | null; +} + +/** https://discord.com/developers/docs/resources/template#template-object-template-structure */ +export type DiscordTemplate = SnakeCaseProps