Skip to content

Commit ef9c51f

Browse files
Schemas for emojis
1 parent ecea554 commit ef9c51f

4 files changed

Lines changed: 114 additions & 2 deletions

File tree

assets/openapi.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7267,6 +7267,50 @@
72677267
"video_ssrc"
72687268
]
72697269
},
7270+
"EmojisResponse": {
7271+
"type": "array",
7272+
"items": {
7273+
"$ref": "#/components/schemas/EmojiResponse"
7274+
}
7275+
},
7276+
"EmojiResponse": {
7277+
"type": "object",
7278+
"properties": {
7279+
"id": {
7280+
"type": "string",
7281+
"nullable": true
7282+
},
7283+
"name": {
7284+
"type": "string",
7285+
"nullable": true
7286+
},
7287+
"roles": {
7288+
"type": "array",
7289+
"items": {
7290+
"type": "string"
7291+
}
7292+
},
7293+
"user": {
7294+
"$ref": "#/components/schemas/PartialUser"
7295+
},
7296+
"require_colons": {
7297+
"type": "boolean"
7298+
},
7299+
"managed": {
7300+
"type": "boolean"
7301+
},
7302+
"animated": {
7303+
"type": "boolean"
7304+
},
7305+
"available": {
7306+
"type": "boolean"
7307+
}
7308+
},
7309+
"required": [
7310+
"id",
7311+
"name"
7312+
]
7313+
},
72707314
"CreateReportSchema": {
72717315
"type": "object",
72727316
"properties": {
@@ -21643,7 +21687,7 @@
2164321687
"content": {
2164421688
"application/json": {
2164521689
"schema": {
21646-
"$ref": "#/components/schemas/APIEmojiArray"
21690+
"$ref": "#/components/schemas/EmojisResponse"
2164721691
}
2164821692
}
2164921693
}

assets/schemas.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7725,6 +7725,57 @@
77257725
],
77267726
"$schema": "http://json-schema.org/draft-07/schema#"
77277727
},
7728+
"EmojisResponse": {
7729+
"type": "array",
7730+
"items": {
7731+
"$ref": "#/definitions/EmojiResponse"
7732+
},
7733+
"$schema": "http://json-schema.org/draft-07/schema#"
7734+
},
7735+
"EmojiResponse": {
7736+
"type": "object",
7737+
"properties": {
7738+
"id": {
7739+
"type": [
7740+
"null",
7741+
"string"
7742+
]
7743+
},
7744+
"name": {
7745+
"type": [
7746+
"null",
7747+
"string"
7748+
]
7749+
},
7750+
"roles": {
7751+
"type": "array",
7752+
"items": {
7753+
"type": "string"
7754+
}
7755+
},
7756+
"user": {
7757+
"$ref": "#/definitions/PartialUser"
7758+
},
7759+
"require_colons": {
7760+
"type": "boolean"
7761+
},
7762+
"managed": {
7763+
"type": "boolean"
7764+
},
7765+
"animated": {
7766+
"type": "boolean"
7767+
},
7768+
"available": {
7769+
"type": "boolean"
7770+
}
7771+
},
7772+
"additionalProperties": false,
7773+
"required": [
7774+
"id",
7775+
"name"
7776+
],
7777+
"$schema": "http://json-schema.org/draft-07/schema#"
7778+
},
77287779
"CreateReportSchema": {
77297780
"type": "object",
77307781
"properties": {

src/api/routes/guilds/#guild_id/emojis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ router.get(
2828
route({
2929
responses: {
3030
200: {
31-
body: "APIEmojiArray",
31+
body: "EmojisResponse",
3232
},
3333
403: {
3434
body: "APIErrorResponse",

src/schemas/api/guilds/Emoji.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Snowflake } from "../../Identifiers";
2+
import { PartialUser } from "../users";
3+
4+
export type EmojisResponse = EmojiResponse[];
5+
6+
// why is almost everything optional?
7+
export interface EmojiResponse {
8+
id: Snowflake | null;
9+
// null only when deleted
10+
name: string | null;
11+
roles?: Snowflake[];
12+
user?: PartialUser;
13+
require_colons?: boolean;
14+
managed?: boolean;
15+
animated?: boolean;
16+
available?: boolean;
17+
}

0 commit comments

Comments
 (0)