Class GuildTemplateMethods

Methods for interacting with Guild Templates

Hierarchy

  • GuildTemplateMethods

Constructors

  • Create a new Guild Template Method Handler

    Usually SnowTransfer creates a method handler for you, this is here for completion

    You can access the methods listed via client.guildTemplate.method, where client is an initialized SnowTransfer instance

    Parameters

    • requestHandler: RequestHandler

      request handler that calls the rest api

    Returns GuildTemplateMethods

Methods

  • Creates a guild from a template. If using a bot account, the bot can only be in < 10 guilds (guild create limitation)

    Returns

    A guild

    Example

    const client = new SnowTransfer("TOKEN")
    const guild = await client.guildTemplate.createGuildFromGuildTemplate("code", { name: "Cool guild" })

    Parameters

    • code: string

      The code of the template

    • options: {
          icon?: null | string;
          name: string;
      }

      Specific options for the new guild

      • Optional icon?: null | string
      • name: string

    Returns Promise<Guild>

  • Creates a template from the current state of the guild

    Returns

    A guild tempalte

    Permissions needed Condition
    MANAGE_GUILD always

    Example

    const client = new SnowTransfer("TOKEN")
    const template = await client.guildTemplate.createGuildTemplate("guildId", { name: "Cool guild template", description: "This is a cool guild template" })

    Parameters

    • guildId: string

      The Id of the guild

    • data: {
          description?: null | string;
          name: string;
      }

      Metadata for the template

      • Optional description?: null | string
      • name: string

    Returns Promise<GuildTemplate>

  • Deletes a template from a guild

    Returns

    A guild template

    Permissions needed Condition
    MANAGE_GUILD always

    Example

    const client = new SnowTransfer("TOKEN")
    const template = await client.guildTemplate.deleteGuildTemplate("guildId", "code")

    Parameters

    • guildId: string

      The Id of the guild

    • code: string

      The code of the template

    Returns Promise<GuildTemplate>

  • Get a guild template by code

    Returns

    A guild template

    Example

    const client = new SnowTransfer("TOKEN")
    const template = await client.guildTemplate.getGuildTemplate("code")

    Parameters

    • code: string

      The code for the template

    Returns Promise<GuildTemplate>

  • Gets all templates from a guild

    Returns

    An array of guild templates

    Permissions needed Condition
    MANAGE_GUILD always

    Example

    const client = new SnowTransfer("TOKEN")
    const templates = await client.guildTemplate.getGuildTemplates("guildId")

    Parameters

    • guildId: string

      The Id of the guild

    Returns Promise<GuildTemplate[]>

  • Updates a guild template's metadata

    Returns

    A guild template

    Permissions needed Condition
    MANAGE_GUILD always

    Example

    const client = new SnowTransfer("TOKEN")
    const template = await client.guildTemplate.modifyGuildTemplate("guildId", "code", { name: "Coolest guild template", description: "This is the coolest guild template hands down" })

    Parameters

    • guildId: string

      The Id of the guild

    • code: string

      The code of the template

    • data: {
          description?: null | string;
          name?: string;
      }

      Metadata for the template

      • Optional description?: null | string
      • Optional name?: string

    Returns Promise<GuildTemplate>

  • Updates a guild template to match the current state of the guild

    Returns

    A guild template

    Permissions needed Condition
    MANAGE_GUILD always

    Example

    const client = new SnowTransfer("TOKEN")
    const template = await client.guildTemplate.syncGuildTemplate("guildId", "code")

    Parameters

    • guildId: string

      The Id of the guild

    • code: string

      The code of the template

    Returns Promise<GuildTemplate>

Properties

requestHandler: RequestHandler

Generated using TypeDoc