async function editGuild(
  guildId,
  options,
) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_GUILD",
  ]);
  if (options.icon && !options.icon.startsWith("data:image/")) {
    options.icon = await urlToBase64(options.icon);
  }
  if (options.banner && !options.banner.startsWith("data:image/")) {
    options.banner = await urlToBase64(options.banner);
  }
  if (options.splash && !options.splash.startsWith("data:image/")) {
    options.splash = await urlToBase64(options.splash);
  }
  const result = await rest.runMethod(
    "patch",
    endpoints.GUILDS_BASE(guildId),
    options,
  );
  const cached = await cacheHandlers.get("guilds", guildId);
  return structures.createDiscordenoGuild(
    result,
    cached?.shardId ||
      Number(
        (BigInt(result.id) >> 22n % BigInt(ws.botGatewayData.shards))
          .toString(),
      ),
  );
}
/** Modify a guilds settings. Requires the MANAGE_GUILD permission. */
Modify a guilds settings. Requires the MANAGE_GUILD permission.
Modify a guilds settings . Requires the MANAGE_GUILD permission .
async function editGuild(
  guildId,
  options,
) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_GUILD",
  ]);
  if (options.icon && !options.icon.startsWith("data:image/")) {
    options.icon = await urlToBase64(options.icon);
  }
  if (options.banner && !options.banner.startsWith("data:image/")) {
    options.banner = await urlToBase64(options.banner);
  }
  if (options.splash && !options.splash.startsWith("data:image/")) {
    options.splash = await urlToBase64(options.splash);
  }
  const result = await rest.runMethod(
    "patch",
    endpoints.GUILDS_BASE(guildId),
    options,
  );
  const cached = await cacheHandlers.get("guilds", guildId);
  return structures.createDiscordenoGuild(
    result,
    cached?.shardId ||
      Number(
        (BigInt(result.id) >> 22n % BigInt(ws.botGatewayData.shards))
          .toString(),
      ),
  );
}
async function editGuild ( guildId , options , ) { await requireBotGuildPermissions ( guildId , [ "MANAGE_GUILD" , ] ) ; if ( options . icon && ! options . icon . startsWith ( "data:image/" ) ) { options . icon = await urlToBase64 ( options . icon ) ; } if ( options . banner && ! options . banner . startsWith ( "data:image/" ) ) { options . banner = await urlToBase64 ( options . banner ) ; } if ( options . splash && ! options . splash . startsWith ( "data:image/" ) ) { options . splash = await urlToBase64 ( options . splash ) ; } const result = await rest . runMethod ( "patch" , endpoints . GUILDS_BASE ( guildId ) , options , ) ; const cached = await cacheHandlers . get ( "guilds" , guildId ) ; return structures . createDiscordenoGuild ( result , cached ?. shardId || Number ( ( BigInt ( result . id ) >> 22n % BigInt ( ws . botGatewayData . shards ) ) . toString ( ) , ) , ) ; }
Modify a guilds settings.
Modify a guilds settings .