import { Guild , integer , Internal , snowflake , timestamp , User } from '.' ; /** https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure */ export interface GuildTemplate { /** the template code (unique ID) */ code : string ; /** template name */ name : string ; /** the description for the template */ description ? : string ; /** number of times this template has been used */ usage_count : integer ; /** the ID of the user who created the template */ creator_id : snowflake ; /** the user who created the template */ creator : User ; /** when this template was created */ created_at : timestamp ; /** when this template was last synced to the source guild */ updated_at : timestamp ; /** the ID of the guild this template is based on */ source_guild_id : snowflake ; /** the guild snapshot this template contains */ serialized_source_guild : Partial < Guild > ; /** whether the template has unsynced changes */ is_dirty ? : boolean ; } export namespace GuildTemplate { /** https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template-json-params */ export interface CreateGuildParams { /** name of the guild (2-100 characters) */ name : string ; /** base64 128x128 image for the guild icon */ icon ? : string ; } /** https://discord.com/developers/docs/resources/guild-template#create-guild-template-json-params */ export interface CreateParams { /** name of the template (1-100 characters) */ name : string ; /** description for the template (0-120 characters) */ description ? : string ; } /** https://discord.com/developers/docs/resources/guild-template#modify-guild-template-json-params */ export interface ModifyParams { /** name of the template (1-100 characters) */ name ? : string ; /** description for the template (0-120 characters) */ description ? : string ; } } declare module './internal' { interface Internal { see https getGuildTemplate ( code ) : Promise < GuildTemplate > ; see https createGuildfromGuildTemplate ( code , params ) : Promise < Guild > ; see https getGuildTemplates ( guild_id ) : Promise < GuildTemplate [ ] > ; see https createGuildTemplate ( guild_id , params ) : Promise < GuildTemplate > ; see https syncGuildTemplate ( guild_id , code ) : Promise < GuildTemplate > ; see https modifyGuildTemplate ( guild_id , code , params ) : Promise < GuildTemplate > ; see https deleteGuildTemplate ( guild_id , code ) : Promise < GuildTemplate > ; } } Internal . define ( { '/guilds/templates/{template.code}' : { GET : 'getGuildTemplate' , POST : 'createGuildfromGuildTemplate' , } , '/guilds/{guild.id}/templates' : { GET : 'getGuildTemplates' , POST : 'createGuildTemplate' , } , '/guilds/{guild.id}/templates/{template.code}' : { PUT : 'syncGuildTemplate' , PATCH : 'modifyGuildTemplate' , DELETE : 'deleteGuildTemplate' , } , } ) ;