Nostrum.Api.create_guild_emoji

You're seeing just the function create_guild_emoji, go back to Nostrum.Api module for more information.
Link to this function

create_guild_emoji(guild_id, options, reason \\ nil)

View Source

Specs

Creates a new emoji for the given guild.

This endpoint requires the MANAGE_EMOJIS permission. It fires a Nostrum.Consumer.guild_emojis_update/0 event.

An optional reason can be provided for the audit log.

If successful, returns {:ok, emoji}. Otherwise, returns Nostrum.Api.error/0.

Options

  • :name (string) - name of the emoji
  • :image (base64 data URI) - the 128x128 emoji image. Maximum size of 256kb
  • :roles (list of Nostrum.Snowflake.t/0) - roles for which this emoji will be whitelisted (default: [])

:name and :image are always required.

Examples

image = "data:image/png;base64,YXl5IGJieSB1IGx1a2luIDQgc3VtIGZ1az8="

Nostrum.Api.create_guild_emoji(43189401384091, name: "nostrum", image: image, roles: [])