async function createEmoji(
  guildId,
  name,
  image,
  options,
) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_EMOJIS",
  ]);
  if (image && !image.startsWith("data:image/")) {
    image = await urlToBase64(image);
  }
  const emoji = await rest.runMethod("post", endpoints.GUILD_EMOJIS(guildId), {
    ...options,
    name,
    image,
  });
  return {
    ...emoji,
    id: snowflakeToBigint(emoji.id),
  };
}
/** Create an emoji in the server. Emojis and animated emojis have a maximum file size of 256kb. Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message, but not a JSON status code. If a URL is provided to the image parameter, Discordeno will automatically convert it to a base64 string internally. */
Create an emoji in the server. Emojis and animated emojis have a maximum file size of 256kb. Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message, but not a JSON status code. If a URL is provided to the image parameter, Discordeno will automatically convert it to a base64 string internally.
Create an emoji in the server . Emojis and animated emojis have a maximum file size of 256kb . Attempting to upload an emoji larger than this limit will fail and return 400 Bad Request and an error message but not a JSON status code . If a URL is provided to the image parameter Discordeno will automatically convert it to a base64 string internally .
async function createEmoji(
  guildId,
  name,
  image,
  options,
) {
  await requireBotGuildPermissions(guildId, [
    "MANAGE_EMOJIS",
  ]);
  if (image && !image.startsWith("data:image/")) {
    image = await urlToBase64(image);
  }
  const emoji = await rest.runMethod("post", endpoints.GUILD_EMOJIS(guildId), {
    ...options,
    name,
    image,
  });
  return {
    ...emoji,
    id: snowflakeToBigint(emoji.id),
  };
}
async function createEmoji ( guildId , name , image , options , ) { await requireBotGuildPermissions ( guildId , [ "MANAGE_EMOJIS" , ] ) ; if ( image && ! image . startsWith ( "data:image/" ) ) { image = await urlToBase64 ( image ) ; } const emoji = await rest . runMethod ( "post" , endpoints . GUILD_EMOJIS ( guildId ) , { ... options , name , image , } ) ; return { ... emoji , id : snowflakeToBigint ( emoji . id ) , } ; }
Create an emoji in the server.
Create an emoji in the server .