summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-17 02:42:57 +0100
committerRory& <root@rory.gay>2026-03-17 02:42:57 +0100
commitef9c51fed16fe2c2a5a3ea201c094df3a86eaa8e (patch)
tree6692f5998e416dfcff9f03acf4b1052789a33c60
parentSchemas for stickers (diff)
downloadserver-ts-ef9c51fed16fe2c2a5a3ea201c094df3a86eaa8e.tar.xz
Schemas for emojis
-rw-r--r--assets/openapi.json46
-rw-r--r--assets/schemas.json51
-rw-r--r--src/api/routes/guilds/#guild_id/emojis.ts2
-rw-r--r--src/schemas/api/guilds/Emoji.ts17
4 files changed, 114 insertions, 2 deletions
diff --git a/assets/openapi.json b/assets/openapi.json

index c1df0643..3145285a 100644 --- a/assets/openapi.json +++ b/assets/openapi.json
@@ -7267,6 +7267,50 @@ "video_ssrc" ] }, + "EmojisResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EmojiResponse" + } + }, + "EmojiResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "user": { + "$ref": "#/components/schemas/PartialUser" + }, + "require_colons": { + "type": "boolean" + }, + "managed": { + "type": "boolean" + }, + "animated": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "required": [ + "id", + "name" + ] + }, "CreateReportSchema": { "type": "object", "properties": { @@ -21643,7 +21687,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/APIEmojiArray" + "$ref": "#/components/schemas/EmojisResponse" } } } diff --git a/assets/schemas.json b/assets/schemas.json
index a3fe6de9..6c621322 100644 --- a/assets/schemas.json +++ b/assets/schemas.json
@@ -7725,6 +7725,57 @@ ], "$schema": "http://json-schema.org/draft-07/schema#" }, + "EmojisResponse": { + "type": "array", + "items": { + "$ref": "#/definitions/EmojiResponse" + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "EmojiResponse": { + "type": "object", + "properties": { + "id": { + "type": [ + "null", + "string" + ] + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "user": { + "$ref": "#/definitions/PartialUser" + }, + "require_colons": { + "type": "boolean" + }, + "managed": { + "type": "boolean" + }, + "animated": { + "type": "boolean" + }, + "available": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name" + ], + "$schema": "http://json-schema.org/draft-07/schema#" + }, "CreateReportSchema": { "type": "object", "properties": { diff --git a/src/api/routes/guilds/#guild_id/emojis.ts b/src/api/routes/guilds/#guild_id/emojis.ts
index 321331f4..a08ed1a5 100644 --- a/src/api/routes/guilds/#guild_id/emojis.ts +++ b/src/api/routes/guilds/#guild_id/emojis.ts
@@ -28,7 +28,7 @@ router.get( route({ responses: { 200: { - body: "APIEmojiArray", + body: "EmojisResponse", }, 403: { body: "APIErrorResponse", diff --git a/src/schemas/api/guilds/Emoji.ts b/src/schemas/api/guilds/Emoji.ts new file mode 100644
index 00000000..6543fda7 --- /dev/null +++ b/src/schemas/api/guilds/Emoji.ts
@@ -0,0 +1,17 @@ +import { Snowflake } from "../../Identifiers"; +import { PartialUser } from "../users"; + +export type EmojisResponse = EmojiResponse[]; + +// why is almost everything optional? +export interface EmojiResponse { + id: Snowflake | null; + // null only when deleted + name: string | null; + roles?: Snowflake[]; + user?: PartialUser; + require_colons?: boolean; + managed?: boolean; + animated?: boolean; + available?: boolean; +}