Перейти к содержимому

Guild emojis

A guild emoji is a custom image that one guild owns and its members use in messages and reactions. To look up one emoji without joining its guild, use Get emoji metadata.

An emoji as the API returns it.

FieldTypeDescription
idsnowflakeThe ID of the emoji
namestringThe name of the emoji (2-32 characters)
animatedbooleanWhether the image is animated
user?1partial user objectThe account that uploaded the emoji

1 Only List guild emojis includes it

{
"id": "1501314428688998182",
"name": "party_parrot",
"animated": true
}

The name and image for one new emoji.

FieldTypeDescription
namestringThe name of the emoji (2-32 characters, ASCII letters, digits and underscore)
image1base64 stringThe emoji image as base64

1 You can include a data URL prefix. The decoded image can be at most the emoji_max_size limit key, 524288 bytes by default. The API accepts PNG, JPEG, WebP, GIF, APNG, AVIF, HEIC, HEIF, JXL and SVG, but not animated AVIF

{
"name": "party_parrot",
"image": "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEAAAAALAAAAAABAAEAAAI="
}

The result of a bulk create, with each submitted item in either success or failed.

FieldTypeDescription
successarray[guild emoji object]The emojis this request created
failedarray[expression creation failure object]The items Squad rejected

One item a bulk creation rejected.

FieldTypeDescription
namestringThe name submitted for the item
errorstringThe failure message, in the account’s locale
GET /v1/guilds/{guild_id}/emojis
Принимает токен бота.

Returns the guild’s guild emoji objects, each with the user who uploaded it. An emoji whose uploader cannot be resolved is left out. You need to be a member of the guild.

StatusBodyCondition
200array[guild emoji object]Emojis were returned

The rate limit is 60 requests per 10 seconds, on the guild:emojis:list::guild_id bucket.

POST /v1/guilds/{guild_id}/emojis
Принимает токен бота. Можно указать причину для журнала аудита.

Creates an emoji and returns its guild emoji object. You need CREATE_EXPRESSIONS. A guild can have 500 emojis, or the max_guild_emojis limit if the instance sets one. A guild with UNLIMITED_EMOJI can have 999999.

The body is an emoji create object.

StatusBodyCondition
200guild emoji objectThe emoji was created
400error responseMAX_EMOJIS when the guild is full, or INVALID_FORM_BODY when the image is too large or in an unsupported format
403error responseCONTENT_BLOCKED when the name or image is blocked

Squad sends a Guild Emojis Update event and records an EMOJI_CREATE audit entry.

The rate limit is 10 requests per 30 seconds, on the guild:emoji:create::guild_id bucket.

POST /v1/guilds/{guild_id}/emojis/bulk
Принимает токен бота. Можно указать причину для журнала аудита.

Creates several emojis in one request and returns an emoji bulk create response object. You need CREATE_EXPRESSIONS.

The response is 200 even when every item fails. An item goes into failed when the guild is full or the API can’t use its image, and the rest of the batch still runs.

FieldTypeDescription
emojisarray[emoji create object]The emojis to create (1-50)
StatusBodyCondition
200emoji bulk create response objectSquad attempted every item
400error responseINVALID_FORM_BODY when the list is empty or over 50 items, or an item has an invalid name
403error responseCONTENT_BLOCKED when any item name is blocked, and nothing is created

Squad sends one Guild Emojis Update event and records an EMOJI_CREATE audit entry for each created emoji.

The rate limit is 6 requests per minute, on the guild:emoji:bulk_create::guild_id bucket.

POST /v1/guilds/{guild_id}/emojis/clone
Принимает токен бота. Можно указать причину для журнала аудита.

Copies an emoji from any guild into the guild in the path and returns the new guild emoji object, which keeps the source emoji’s name. You need CREATE_EXPRESSIONS in the target guild. The source guild needs CLONE_EMOJI_ENABLED.

FieldTypeDescription
source_emoji_idsnowflakeThe ID of the emoji to copy
StatusBodyCondition
200guild emoji objectThe emoji was cloned
400error responseMAX_EMOJIS when the target guild is full
403error responseMISSING_ACCESS when the source guild does not allow cloning
404error responseUNKNOWN_EMOJI when the source emoji does not exist

Squad sends a Guild Emojis Update event in the target guild and records an EMOJI_CREATE audit entry.

The rate limit is 10 requests per 30 seconds, on the guild:emoji:clone::guild_id bucket.

PATCH /v1/guilds/{guild_id}/emojis/{emoji_id}
Принимает токен бота. Можно указать причину для журнала аудита.

Renames an emoji and returns its guild emoji object. The uploader needs CREATE_EXPRESSIONS and anyone else needs MANAGE_EXPRESSIONS.

FieldTypeDescription
namestringThe new name of the emoji (2-32 characters, ASCII letters, digits and underscore)
StatusBodyCondition
200guild emoji objectThe emoji was renamed
403error responseCONTENT_BLOCKED when the name is blocked
404error responseUNKNOWN_EMOJI when the emoji is not in this guild

Squad sends a Guild Emojis Update event and records an EMOJI_UPDATE audit entry.

The rate limit is 20 requests per 10 seconds, on the guild:emoji:update::guild_id bucket.

DELETE /v1/guilds/{guild_id}/emojis/{emoji_id}
Принимает токен бота. Можно указать причину для журнала аудита.

Deletes an emoji. The uploader needs CREATE_EXPRESSIONS and anyone else needs MANAGE_EXPRESSIONS.

FieldTypeDescription
purge?booleanWhether to delete the image file too (default false)
StatusBodyCondition
204emptyThe emoji was deleted
403error responseMISSING_ACCESS when purge is true without EXPRESSION_PURGE_ALLOWED on the guild
404error responseUNKNOWN_EMOJI when the emoji is not in this guild

Squad sends a Guild Emojis Update event and records an EMOJI_DELETE audit entry.

The guild:emoji:delete::guild_id bucket allows 10 requests per 30 seconds. The guild:emoji:delete:daily::guild_id bucket also allows 300 requests per day.