async function createGuildTemplate(guildId, data) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_GUILD",
  ]);
  if (data.name.length < 1 || data.name.length > 100) {
    throw new Error("The name can only be in between 1-100 characters.");
  }
  if (data.description?.length && data.description.length > 120) {
    throw new Error("The description can only be in between 0-120 characters.");
  }
  return await rest.runMethod("post", endpoints.GUILD_TEMPLATES(guildId), data);
}
/**
 * Creates a template for the guild.
 * Requires the `MANAGE_GUILD` permission.
 * @param name name of the template (1-100 characters)
 * @param description description for the template (0-120 characters
 */
Creates a template for the guild.
Requires the `MANAGE_GUILD` permission.
@param name name of the template (1-100 characters)
@param description description for the template (0-120 characters
Creates a template for the guild . Requires the ` MANAGE_GUILD ` permission . @param name name of the template ( 1 - 100 characters ) @param description description for the template ( 0 - 120 characters
async function createGuildTemplate(guildId, data) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_GUILD",
  ]);
  if (data.name.length < 1 || data.name.length > 100) {
    throw new Error("The name can only be in between 1-100 characters.");
  }
  if (data.description?.length && data.description.length > 120) {
    throw new Error("The description can only be in between 0-120 characters.");
  }
  return await rest.runMethod("post", endpoints.GUILD_TEMPLATES(guildId), data);
}
async function createGuildTemplate ( guildId , data ) { await requireBotGuildPermissions ( guildId , [ "MANAGE_GUILD" , ] ) ; if ( data . name . length < 1 || data . name . length > 100 ) { throw new Error ( "The name can only be in between 1-100 characters." ) ; } if ( data . description ?. length && data . description . length > 120 ) { throw new Error ( "The description can only be in between 0-120 characters." ) ; } return await rest . runMethod ( "post" , endpoints . GUILD_TEMPLATES ( guildId ) , data ) ; }
Creates a template for the guild.
Creates a template for the guild .