async function createGuildFromTemplate(templateCode, data) {
  if (await cacheHandlers.size("guilds") >= 10) {
    throw new Error(
      "This function can only be used by bots in less than 10 guilds.",
    );
  }
  if (data.icon) {
    data.icon = await urlToBase64(data.icon);
  }
  const createdGuild = await rest.runMethod(
    "post",
    endpoints.GUILD_TEMPLATE(templateCode),
    data,
  );
  return await structures.createDiscordenoGuild(
    createdGuild,
    Number(
      (BigInt(createdGuild.id) >> 22n % BigInt(ws.botGatewayData.shards))
        .toString(),
    ),
  );
}
/**
 * Create a new guild based on a template
 * NOTE: This endpoint can be used only by bots in less than 10 guilds.
 */
Create a new guild based on a template
NOTE: This endpoint can be used only by bots in less than 10 guilds.
Create a new guild based on a template NOTE : This endpoint can be used only by bots in less than 10 guilds .
async function createGuildFromTemplate(templateCode, data) {
  if (await cacheHandlers.size("guilds") >= 10) {
    throw new Error(
      "This function can only be used by bots in less than 10 guilds.",
    );
  }
  if (data.icon) {
    data.icon = await urlToBase64(data.icon);
  }
  const createdGuild = await rest.runMethod(
    "post",
    endpoints.GUILD_TEMPLATE(templateCode),
    data,
  );
  return await structures.createDiscordenoGuild(
    createdGuild,
    Number(
      (BigInt(createdGuild.id) >> 22n % BigInt(ws.botGatewayData.shards))
        .toString(),
    ),
  );
}
async function createGuildFromTemplate ( templateCode , data ) { if ( await cacheHandlers . size ( "guilds" ) >= 10 ) { throw new Error ( "This function can only be used by bots in less than 10 guilds." , ) ; } if ( data . icon ) { data . icon = await urlToBase64 ( data . icon ) ; } const createdGuild = await rest . runMethod ( "post" , endpoints . GUILD_TEMPLATE ( templateCode ) , data , ) ; return await structures . createDiscordenoGuild ( createdGuild , Number ( ( BigInt ( createdGuild . id ) >> 22n % BigInt ( ws . botGatewayData . shards ) ) . toString ( ) , ) , ) ; }
Create a new guild based on a template
 NOTE: This endpoint can be used only by bots in less than 10 guilds.
Create a new guild based on a template NOTE : This endpoint can be used only by bots in less than 10 guilds .