From 2f70be7f83df836e7616eb0e1fec6b75cb12631c Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Mon, 29 Aug 2022 11:11:40 -0400 Subject: implement guild profiles and fix user profiles --- assets/schemas.json | 6819 ++++++++++++-------- .../guilds/#guild_id/members/#member_id/index.ts | 82 +- src/api/routes/guilds/#guild_id/profile/index.ts | 30 + src/api/routes/users/#id/profile.ts | 97 +- src/cdn/Server.ts | 7 + src/cdn/routes/guild-profiles.ts | 85 + src/util/entities/Member.ts | 15 +- src/util/schemas/MemberChangeProfileSchema.ts | 5 + src/util/schemas/MemberChangeSchema.ts | 2 + src/util/schemas/UserProfileModifySchema.ts | 5 + src/util/schemas/index.ts | 10 + 11 files changed, 4245 insertions(+), 2912 deletions(-) create mode 100644 src/api/routes/guilds/#guild_id/profile/index.ts create mode 100644 src/cdn/routes/guild-profiles.ts create mode 100644 src/util/schemas/MemberChangeProfileSchema.ts create mode 100644 src/util/schemas/UserProfileModifySchema.ts diff --git a/assets/schemas.json b/assets/schemas.json index e281e979..59fcc952 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -781,43 +781,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -874,6 +837,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -1368,43 +1368,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -1461,6 +1424,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -1938,43 +1938,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -2031,6 +1994,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -2048,7 +2048,6 @@ }, "additionalProperties": false, "required": [ - "avatar", "name" ], "definitions": { @@ -2509,71 +2508,34 @@ "type": "object", "additionalProperties": false }, - "Partial": { + "CustomStatus": { "type": "object", "properties": { - "message_notifications": { - "type": "integer" + "emoji_id": { + "type": "string" }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" + "emoji_name": { + "type": "string" }, - "muted": { - "type": "boolean" + "expires_at": { + "type": "integer" }, - "channel_id": { - "type": [ - "null", - "string" - ] + "text": { + "type": "string" } }, "additionalProperties": false }, - "MuteConfig": { + "FriendSourceFlags": { "type": "object", "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" + "all": { + "type": "boolean" } }, "additionalProperties": false, "required": [ - "end_time", - "selected_time_window" - ] - }, - "CustomStatus": { - "type": "object", - "properties": { - "emoji_id": { - "type": "string" - }, - "emoji_name": { - "type": "string" - }, - "expires_at": { - "type": "integer" - }, - "text": { - "type": "string" - } - }, - "additionalProperties": false - }, - "FriendSourceFlags": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "all" + "all" ] }, "GuildFolder": { @@ -2602,6 +2564,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -3160,43 +3159,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -3253,6 +3215,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -3726,43 +3725,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -3819,6 +3781,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -4314,43 +4313,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -4407,11 +4369,48 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "BanCreateSchema": { + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "BanCreateSchema": { "type": "object", "properties": { "delete_message_days": { @@ -4880,43 +4879,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -4973,6 +4935,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -5461,43 +5460,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -5554,6 +5516,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -6045,43 +6044,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -6138,36 +6100,73 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "EmojiCreateSchema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "image": { - "type": "string" - }, - "require_colons": { - "type": [ - "null", - "boolean" - ] }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "image" - ], + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "EmojiCreateSchema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "image": { + "type": "string" + }, + "require_colons": { + "type": [ + "null", + "boolean" + ] + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "image" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -6626,43 +6625,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -6719,6 +6681,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -7195,43 +7194,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -7288,6 +7250,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -7772,43 +7771,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -7865,11 +7827,48 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "TemplateCreateSchema": { + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "TemplateCreateSchema": { "type": "object", "properties": { "name": { @@ -8341,43 +8340,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -8434,6 +8396,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -8910,43 +8909,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -9003,6 +8965,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -9475,43 +9474,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -9568,35 +9530,72 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "GuildUpdateWelcomeScreenSchema": { - "type": "object", - "properties": { - "welcome_channels": { - "type": "array", - "items": { - "type": "object", - "properties": { - "channel_id": { - "type": "string" - }, - "description": { - "type": "string" - }, - "emoji_id": { - "type": "string" - }, - "emoji_name": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "channel_id", - "description" + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GuildUpdateWelcomeScreenSchema": { + "type": "object", + "properties": { + "welcome_channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "description": { + "type": "string" + }, + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "description" ] } }, @@ -10066,43 +10065,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -10159,6 +10121,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -10636,43 +10635,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -10729,59 +10691,248 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "MemberChangeSchema": { + "IdentifySchema": { "type": "object", "properties": { - "roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "nick": { + "token": { "type": "string" - } - }, - "additionalProperties": false, - "definitions": { - "ChannelPermissionOverwriteType": { - "enum": [ - 0, - 1, - 2 - ], - "type": "number" }, - "Embed": { + "properties": { "type": "object", "properties": { - "title": { + "os": { "type": "string" }, - "type": { - "enum": [ - "article", - "gifv", - "image", - "link", - "rich", - "video" - ], + "os_atch": { "type": "string" }, - "description": { + "browser": { "type": "string" }, - "url": { + "device": { "type": "string" }, - "timestamp": { - "type": "string", - "format": "date-time" + "$os": { + "type": "string" + }, + "$browser": { + "type": "string" + }, + "$device": { + "type": "string" + }, + "browser_user_agent": { + "type": "string" + }, + "browser_version": { + "type": "string" + }, + "os_version": { + "type": "string" + }, + "referrer": { + "type": "string" + }, + "referring_domain": { + "type": "string" + }, + "referrer_current": { + "type": "string" + }, + "referring_domain_current": { + "type": "string" + }, + "release_channel": { + "enum": [ + "canary", + "dev", + "ptb", + "stable" + ], + "type": "string" + }, + "client_build_number": { + "type": "integer" + }, + "client_event_source": {}, + "client_version": { + "type": "string" + }, + "system_locale": { + "type": "string" + } + }, + "additionalProperties": false + }, + "intents": { + "type": "bigint" + }, + "presence": { + "$ref": "#/definitions/ActivitySchema" + }, + "compress": { + "type": "boolean" + }, + "large_threshold": { + "type": "integer" + }, + "largeThreshold": { + "type": "integer" + }, + "shard": { + "type": "array", + "items": [ + { + "type": "bigint" + }, + { + "type": "bigint" + } + ], + "minItems": 2, + "maxItems": 2 + }, + "guild_subscriptions": { + "type": "boolean" + }, + "capabilities": { + "type": "integer" + }, + "client_state": { + "type": "object", + "properties": { + "guild_hashes": {}, + "highest_last_message_id": { + "type": [ + "string", + "integer" + ] + }, + "read_state_version": { + "type": "integer" + }, + "user_guild_settings_version": { + "type": "integer" + }, + "user_settings_version": { + "type": "integer" + }, + "useruser_guild_settings_version": { + "type": "integer" + }, + "private_channels_version": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "clientState": { + "type": "object", + "properties": { + "guildHashes": {}, + "highestLastMessageId": { + "type": [ + "string", + "integer" + ] + }, + "readStateVersion": { + "type": "integer" + }, + "userGuildSettingsVersion": { + "type": "integer" + }, + "useruserGuildSettingsVersion": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "v": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "properties", + "token" + ], + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" }, "color": { "type": "integer" @@ -11205,43 +11356,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -11298,39 +11412,81 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "RoleModifySchema": { + "LazyRequestSchema": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "permissions": { + "guild_id": { "type": "string" }, - "color": { - "type": "integer" + "channels": { + "$ref": "#/definitions/Record" }, - "hoist": { + "activities": { "type": "boolean" }, - "mentionable": { + "threads": { "type": "boolean" }, - "position": { - "type": "integer" + "typing": { + "enum": [ + true + ], + "type": "boolean" }, - "icon": { - "type": "string" + "members": { + "type": "array", + "items": {} }, - "unicode_emoji": { - "type": "string" + "thread_member_lists": { + "type": "array", + "items": {} } }, "additionalProperties": false, + "required": [ + "guild_id" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -11789,43 +11945,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -11882,27 +12001,64 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "GuildTemplateCreateSchema": { + "MemberChangeProfileSchema": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "avatar": { + "banner": { "type": [ "null", "string" ] + }, + "nick": { + "type": "string" + }, + "bio": { + "type": "string" } }, "additionalProperties": false, - "required": [ - "name" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -12361,43 +12517,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -12454,27 +12573,70 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "DmChannelCreateSchema": { + "MemberChangeSchema": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "recipients": { + "roles": { "type": "array", "items": { "type": "string" } + }, + "nick": { + "type": "string" + }, + "avatar": { + "type": [ + "null", + "string" + ] + }, + "bio": { + "type": "string" } }, "additionalProperties": false, - "required": [ - "recipients" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -12933,43 +13095,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -13026,50 +13151,72 @@ "id", "name" ] - } + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserModifySchema": { + "RoleModifySchema": { "type": "object", "properties": { - "username": { - "minLength": 1, - "maxLength": 100, + "name": { "type": "string" }, - "avatar": { - "type": [ - "null", - "string" - ] - }, - "bio": { - "maxLength": 1024, + "permissions": { "type": "string" }, - "accent_color": { + "color": { "type": "integer" }, - "banner": { - "type": [ - "null", - "string" - ] - }, - "password": { - "type": "string" + "hoist": { + "type": "boolean" }, - "new_password": { - "type": "string" + "mentionable": { + "type": "boolean" }, - "code": { - "type": "string" + "position": { + "type": "integer" }, - "email": { + "icon": { "type": "string" }, - "discriminator": { + "unicode_emoji": { "type": "string" } }, @@ -13532,43 +13679,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -13625,24 +13735,63 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "RelationshipPostSchema": { + "GuildTemplateCreateSchema": { "type": "object", "properties": { - "discriminator": { + "name": { "type": "string" }, - "username": { - "type": "string" + "avatar": { + "type": [ + "null", + "string" + ] } }, "additionalProperties": false, "required": [ - "discriminator", - "username" + "name" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -14102,43 +14251,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -14195,59 +14307,99 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "RelationshipPutSchema": { - "type": "object", - "properties": { - "type": { - "enum": [ - 1, - 2, - 3, - 4 - ], - "type": "number" - } - }, - "additionalProperties": false, - "definitions": { - "ChannelPermissionOverwriteType": { - "enum": [ - 0, - 1, - 2 - ], - "type": "number" }, - "Embed": { + "Partial": { "type": "object", "properties": { - "title": { - "type": "string" - }, - "type": { - "enum": [ - "article", - "gifv", - "image", - "link", - "rich", - "video" - ], - "type": "string" + "message_notifications": { + "type": "integer" }, - "description": { - "type": "string" + "mute_config": { + "$ref": "#/definitions/MuteConfig" }, - "url": { - "type": "string" + "muted": { + "type": "boolean" }, - "timestamp": { - "type": "string", - "format": "date-time" + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "DmChannelCreateSchema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "recipients": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "recipients" + ], + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" }, "color": { "type": "integer" @@ -14671,43 +14823,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -14764,28 +14879,91 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "CodesVerificationSchema": { + "UserModifySchema": { "type": "object", "properties": { - "key": { + "username": { + "minLength": 1, + "maxLength": 100, "type": "string" }, - "nonce": { + "avatar": { + "type": [ + "null", + "string" + ] + }, + "bio": { + "maxLength": 1024, "type": "string" }, - "regenerate": { - "type": "boolean" + "accent_color": { + "type": "integer" + }, + "banner": { + "type": [ + "null", + "string" + ] + }, + "password": { + "type": "string" + }, + "new_password": { + "type": "string" + }, + "code": { + "type": "string" + }, + "email": { + "type": "string" + }, + "discriminator": { + "type": "string" } }, "additionalProperties": false, - "required": [ - "key", - "nonce" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -15244,43 +15422,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -15337,28 +15478,66 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "MfaCodesSchema": { - "type": "object", - "properties": { - "password": { - "type": "string" }, - "regenerate": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "password" - ], - "definitions": { - "ChannelPermissionOverwriteType": { - "enum": [ - 0, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "RelationshipPostSchema": { + "type": "object", + "properties": { + "discriminator": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "discriminator", + "username" + ], + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, 1, 2 ], @@ -15813,43 +15992,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -15906,21 +16048,61 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "TotpDisableSchema": { + "RelationshipPutSchema": { "type": "object", "properties": { - "code": { - "type": "string" + "type": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" } }, "additionalProperties": false, - "required": [ - "code" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -16379,43 +16561,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -16472,26 +16617,64 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "TotpEnableSchema": { + "CodesVerificationSchema": { "type": "object", "properties": { - "password": { + "key": { "type": "string" }, - "code": { + "nonce": { "type": "string" }, - "secret": { - "type": "string" + "regenerate": { + "type": "boolean" } }, "additionalProperties": false, "required": [ - "password" + "key", + "nonce" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -16951,57 +17134,20 @@ "type": "object", "additionalProperties": false }, - "Partial": { + "CustomStatus": { "type": "object", "properties": { - "message_notifications": { - "type": "integer" + "emoji_id": { + "type": "string" }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" + "emoji_name": { + "type": "string" }, - "muted": { - "type": "boolean" + "expires_at": { + "type": "integer" }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, - "CustomStatus": { - "type": "object", - "properties": { - "emoji_id": { - "type": "string" - }, - "emoji_name": { - "type": "string" - }, - "expires_at": { - "type": "integer" - }, - "text": { - "type": "string" + "text": { + "type": "string" } }, "additionalProperties": false @@ -17044,58 +17190,60 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "VoiceIdentifySchema": { + "MfaCodesSchema": { "type": "object", "properties": { - "server_id": { - "type": "string" - }, - "user_id": { - "type": "string" - }, - "session_id": { - "type": "string" - }, - "token": { + "password": { "type": "string" }, - "video": { + "regenerate": { "type": "boolean" - }, - "streams": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "rid": { - "type": "string" - }, - "quality": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "quality", - "rid", - "type" - ] - } } }, "additionalProperties": false, "required": [ - "server_id", - "session_id", - "token", - "user_id" + "password" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -17555,43 +17703,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -17648,43 +17759,57 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "VoiceStateUpdateSchema": { + "TotpDisableSchema": { "type": "object", "properties": { - "guild_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "self_mute": { - "type": "boolean" - }, - "self_deaf": { - "type": "boolean" - }, - "self_video": { - "type": "boolean" - }, - "preferred_region": { + "code": { "type": "string" - }, - "request_to_speak_timestamp": { - "type": "string", - "format": "date-time" - }, - "suppress": { - "type": "boolean" } }, "additionalProperties": false, "required": [ - "self_deaf", - "self_mute" + "code" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -18144,43 +18269,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -18237,98 +18325,63 @@ "id", "name" ] - } - }, + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "VoiceVideoSchema": { + "TotpEnableSchema": { "type": "object", "properties": { - "audio_ssrc": { - "type": "integer" - }, - "video_ssrc": { - "type": "integer" - }, - "rtx_ssrc": { - "type": "integer" + "password": { + "type": "string" }, - "user_id": { + "code": { "type": "string" }, - "streams": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "enum": [ - "audio", - "video" - ], - "type": "string" - }, - "rid": { - "type": "string" - }, - "ssrc": { - "type": "integer" - }, - "active": { - "type": "boolean" - }, - "quality": { - "type": "integer" - }, - "rtx_ssrc": { - "type": "integer" - }, - "max_bitrate": { - "type": "integer" - }, - "max_framerate": { - "type": "integer" - }, - "max_resolution": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "width": { - "type": "integer" - }, - "height": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "height", - "type", - "width" - ] - } - }, - "additionalProperties": false, - "required": [ - "active", - "max_bitrate", - "max_framerate", - "max_resolution", - "quality", - "rid", - "rtx_ssrc", - "ssrc", - "type" - ] - } + "secret": { + "type": "string" } }, "additionalProperties": false, "required": [ - "audio_ssrc", - "video_ssrc" + "password" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -18788,43 +18841,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -18881,186 +18897,106 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "IdentifySchema": { + "VoiceIdentifySchema": { "type": "object", "properties": { + "server_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "session_id": { + "type": "string" + }, "token": { "type": "string" }, - "properties": { - "type": "object", - "properties": { - "os": { - "type": "string" - }, - "os_atch": { - "type": "string" - }, - "browser": { - "type": "string" - }, - "device": { - "type": "string" - }, - "$os": { - "type": "string" - }, - "$browser": { - "type": "string" - }, - "$device": { - "type": "string" - }, - "browser_user_agent": { - "type": "string" - }, - "browser_version": { - "type": "string" - }, - "os_version": { - "type": "string" - }, - "referrer": { - "type": "string" - }, - "referring_domain": { - "type": "string" - }, - "referrer_current": { - "type": "string" - }, - "referring_domain_current": { - "type": "string" - }, - "release_channel": { - "enum": [ - "canary", - "dev", - "ptb", - "stable" - ], - "type": "string" - }, - "client_build_number": { - "type": "integer" - }, - "client_event_source": {}, - "client_version": { - "type": "string" - }, - "system_locale": { - "type": "string" - } - }, - "additionalProperties": false - }, - "intents": { - "type": "bigint" - }, - "presence": { - "$ref": "#/definitions/ActivitySchema" - }, - "compress": { - "type": "boolean" - }, - "large_threshold": { - "type": "integer" - }, - "largeThreshold": { - "type": "integer" - }, - "shard": { - "type": "array", - "items": [ - { - "type": "bigint" - }, - { - "type": "bigint" - } - ], - "minItems": 2, - "maxItems": 2 - }, - "guild_subscriptions": { - "type": "boolean" - }, - "capabilities": { - "type": "integer" - }, - "client_state": { - "type": "object", - "properties": { - "guild_hashes": {}, - "highest_last_message_id": { - "type": [ - "string", - "integer" - ] - }, - "read_state_version": { - "type": "integer" - }, - "user_guild_settings_version": { - "type": "integer" - }, - "user_settings_version": { - "type": "integer" - }, - "useruser_guild_settings_version": { - "type": "integer" - }, - "private_channels_version": { - "type": "integer" - } - }, - "additionalProperties": false - }, - "clientState": { - "type": "object", - "properties": { - "guildHashes": {}, - "highestLastMessageId": { - "type": [ - "string", - "integer" - ] - }, - "readStateVersion": { - "type": "integer" - }, - "userGuildSettingsVersion": { - "type": "integer" - }, - "useruserGuildSettingsVersion": { - "type": "integer" - } - }, - "additionalProperties": false - }, - "v": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "properties", - "token" - ], - "definitions": { - "ChannelPermissionOverwriteType": { - "enum": [ - 0, - 1, - 2 - ], - "type": "number" - }, - "Embed": { + "video": { + "type": "boolean" + }, + "streams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "rid": { + "type": "string" + }, + "quality": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "quality", + "rid", + "type" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "server_id", + "session_id", + "token", + "user_id" + ], + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { "type": "object", "properties": { "title": { @@ -19509,43 +19445,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -19602,44 +19501,67 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "LazyRequestSchema": { + "UserProfileModifySchema": { "type": "object", "properties": { - "guild_id": { + "bio": { "type": "string" }, - "channels": { - "$ref": "#/definitions/Record" - }, - "activities": { - "type": "boolean" + "accent_color": { + "type": [ + "null", + "integer" + ] }, - "threads": { - "type": "boolean" - }, - "typing": { - "enum": [ - true - ], - "type": "boolean" - }, - "members": { - "type": "array", - "items": {} - }, - "thread_member_lists": { - "type": "array", - "items": {} + "banner": { + "type": [ + "null", + "string" + ] } }, "additionalProperties": false, - "required": [ - "guild_id" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -20098,43 +20020,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -20191,106 +20076,232 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "GuildUpdateSchema": { + "UserSettingsSchema": { "type": "object", "properties": { - "name": { + "index": { "type": "string" }, - "banner": { - "type": [ - "null", - "string" - ] + "afk_timeout": { + "type": "integer" }, - "splash": { - "type": [ - "null", - "string" + "allow_accessibility_detection": { + "type": "boolean" + }, + "animate_emoji": { + "type": "boolean" + }, + "animate_stickers": { + "type": "integer" + }, + "contact_sync_enabled": { + "type": "boolean" + }, + "convert_emoticons": { + "type": "boolean" + }, + "custom_status": { + "anyOf": [ + { + "$ref": "#/definitions/CustomStatus" + }, + { + "type": "null" + } ] }, - "description": { - "type": "string" + "default_guilds_restricted": { + "type": "boolean" }, - "features": { - "type": "array", - "items": { - "type": "string" - } + "detect_platform_accounts": { + "type": "boolean" }, - "verification_level": { - "type": "integer" + "developer_mode": { + "type": "boolean" }, - "default_message_notifications": { - "type": "integer" + "disable_games_tab": { + "type": "boolean" }, - "system_channel_flags": { - "type": "integer" + "enable_tts_command": { + "type": "boolean" }, "explicit_content_filter": { "type": "integer" }, - "public_updates_channel_id": { - "type": "string" + "friend_source_flags": { + "$ref": "#/definitions/FriendSourceFlags" }, - "afk_timeout": { - "type": "integer" + "gateway_connected": { + "type": "boolean" }, - "afk_channel_id": { - "type": "string" + "gif_auto_play": { + "type": "boolean" }, - "preferred_locale": { - "type": "string" + "guild_folders": { + "type": "array", + "items": { + "$ref": "#/definitions/GuildFolder" + } }, - "premium_progress_bar_enabled": { + "guild_positions": { + "type": "array", + "items": { + "type": "string" + } + }, + "inline_attachment_media": { "type": "boolean" }, - "discovery_splash": { - "type": "string" + "inline_embed_media": { + "type": "boolean" }, - "region": { + "locale": { "type": "string" }, - "icon": { - "type": [ - "null", - "string" - ] + "message_display_compact": { + "type": "boolean" }, - "guild_template_code": { - "type": "string" + "native_phone_integration_enabled": { + "type": "boolean" }, - "system_channel_id": { - "type": "string" + "render_embeds": { + "type": "boolean" }, - "rules_channel_id": { + "render_reactions": { + "type": "boolean" + }, + "restricted_guilds": { + "type": "array", + "items": { + "type": "string" + } + }, + "show_current_game": { + "type": "boolean" + }, + "status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], "type": "string" - } - }, - "additionalProperties": false, - "definitions": { - "ChannelPermissionOverwriteType": { + }, + "stream_notifications_enabled": { + "type": "boolean" + }, + "theme": { "enum": [ - 0, - 1, - 2 + "dark", + "light" ], - "type": "number" + "type": "string" }, - "Embed": { + "timezone_offset": { + "type": "integer" + }, + "assign": { "type": "object", - "properties": { - "title": { - "type": "string" - }, - "type": { - "enum": [ - "article", - "gifv", + "additionalProperties": false + }, + "toJSON": { + "type": "object", + "additionalProperties": false + }, + "hasId": { + "description": "Checks if entity has an id.\nIf entity composite compose ids, it will check them all.", + "type": "object", + "additionalProperties": false + }, + "save": { + "description": "Saves current entity in the database.\nIf entity does not exist in the database then inserts, otherwise updates.", + "type": "object", + "additionalProperties": false + }, + "remove": { + "description": "Removes current entity from the database.", + "type": "object", + "additionalProperties": false + }, + "softRemove": { + "description": "Records the delete date of current entity.", + "type": "object", + "additionalProperties": false + }, + "recover": { + "description": "Recovers a given entity in the database.", + "type": "object", + "additionalProperties": false + }, + "reload": { + "description": "Reloads entity data from the database.", + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", "image", "link", "rich", @@ -20730,43 +20741,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -20823,32 +20797,80 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "ChannelPermissionOverwriteSchema": { + "VoiceStateUpdateSchema": { "type": "object", "properties": { - "allow": { + "guild_id": { "type": "string" }, - "deny": { + "channel_id": { "type": "string" }, - "id": { + "self_mute": { + "type": "boolean" + }, + "self_deaf": { + "type": "boolean" + }, + "self_video": { + "type": "boolean" + }, + "preferred_region": { "type": "string" }, - "type": { - "$ref": "#/definitions/ChannelPermissionOverwriteType" + "request_to_speak_timestamp": { + "type": "string", + "format": "date-time" + }, + "suppress": { + "type": "boolean" } }, "additionalProperties": false, "required": [ - "allow", - "deny", - "id", - "type" + "self_deaf", + "self_mute" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -21308,43 +21330,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -21401,70 +21386,136 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserGuildSettingsSchema": { + "VoiceVideoSchema": { "type": "object", "properties": { - "channel_overrides": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Partial" - } - }, - "version": { + "audio_ssrc": { "type": "integer" }, - "guild_id": { - "type": [ - "null", - "string" - ] - }, - "flags": { + "video_ssrc": { "type": "integer" }, - "message_notifications": { + "rtx_ssrc": { "type": "integer" }, - "mobile_push": { - "type": "boolean" + "user_id": { + "type": "string" }, - "mute_config": { - "anyOf": [ - { - "$ref": "#/definitions/MuteConfig" + "streams": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "enum": [ + "audio", + "video" + ], + "type": "string" + }, + "rid": { + "type": "string" + }, + "ssrc": { + "type": "integer" + }, + "active": { + "type": "boolean" + }, + "quality": { + "type": "integer" + }, + "rtx_ssrc": { + "type": "integer" + }, + "max_bitrate": { + "type": "integer" + }, + "max_framerate": { + "type": "integer" + }, + "max_resolution": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "height", + "type", + "width" + ] + } }, - { - "type": "null" - } - ] - }, - "muted": { - "type": "boolean" - }, - "suppress_everyone": { - "type": "boolean" - }, - "suppress_roles": { - "type": "boolean" - }, - "mute_scheduled_events": { - "type": "boolean" - }, - "hide_muted_channels": { - "type": "boolean" - }, - "notify_highlights": { - "enum": [ - 0 - ], - "type": "number" + "additionalProperties": false, + "required": [ + "active", + "max_bitrate", + "max_framerate", + "max_resolution", + "quality", + "rid", + "rtx_ssrc", + "ssrc", + "type" + ] + } } }, "additionalProperties": false, + "required": [ + "audio_ssrc", + "video_ssrc" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -21923,43 +21974,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -22016,110 +22030,1399 @@ "id", "name" ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "RolePositionUpdateSchema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "position": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "id", - "position" - ] - }, - "definitions": { - "ChannelPermissionOverwriteType": { - "enum": [ - 0, - 1, - 2 - ], - "type": "number" }, - "Embed": { + "Partial": { "type": "object", "properties": { - "title": { - "type": "string" - }, - "type": { - "enum": [ - "article", - "gifv", - "image", - "link", - "rich", - "video" - ], - "type": "string" - }, - "description": { - "type": "string" - }, - "url": { - "type": "string" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "color": { + "message_notifications": { "type": "integer" }, - "footer": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "icon_url": { - "type": "string" - }, - "proxy_icon_url": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "text" - ] - }, - "image": { - "$ref": "#/definitions/EmbedImage" - }, - "thumbnail": { - "$ref": "#/definitions/EmbedImage" + "mute_config": { + "$ref": "#/definitions/MuteConfig" }, - "video": { - "$ref": "#/definitions/EmbedImage" + "muted": { + "type": "boolean" }, - "provider": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "additionalProperties": false + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" }, - "author": { - "type": "object", - "properties": { - "name": { + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GuildUpdateSchema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "banner": { + "type": [ + "null", + "string" + ] + }, + "splash": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "verification_level": { + "type": "integer" + }, + "default_message_notifications": { + "type": "integer" + }, + "system_channel_flags": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "afk_timeout": { + "type": "integer" + }, + "afk_channel_id": { + "type": "string" + }, + "preferred_locale": { + "type": "string" + }, + "premium_progress_bar_enabled": { + "type": "boolean" + }, + "discovery_splash": { + "type": "string" + }, + "region": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "guild_template_code": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "color": { + "type": "integer" + }, + "footer": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "text" + ] + }, + "image": { + "$ref": "#/definitions/EmbedImage" + }, + "thumbnail": { + "$ref": "#/definitions/EmbedImage" + }, + "video": { + "$ref": "#/definitions/EmbedImage" + }, + "provider": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "author": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "inline": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "value" + ] + } + } + }, + "additionalProperties": false + }, + "EmbedImage": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ChannelModifySchema": { + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "type": "string" + }, + "type": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "topic": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "rate_limit_per_user": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "default_reaction_emoji": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "default_thread_rate_limit_per_user": { + "type": "integer" + }, + "video_quality_mode": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ActivitySchema": { + "type": "object", + "properties": { + "afk": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/Status" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "since": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "status" + ] + }, + "Status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string" + }, + "Activity": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ActivityType" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "end": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end", + "start" + ] + }, + "application_id": { + "type": "string" + }, + "details": { + "type": "string" + }, + "state": { + "type": "string" + }, + "emoji": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "name" + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "type": "array", + "items": [ + { + "type": "integer" + } + ], + "minItems": 1, + "maxItems": 1 + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "flags": { + "type": "string" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "album_id", + "artist_ids" + ] + }, + "session_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "flags", + "name", + "session_id", + "type" + ] + }, + "ActivityType": { + "enum": [ + 0, + 1, + 2, + 4, + 5 + ], + "type": "number" + }, + "Record": { + "type": "object", + "additionalProperties": false + }, + "CustomStatus": { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FriendSourceFlags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "GuildFolder": { + "type": "object", + "properties": { + "color": { + "type": "integer" + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "guild_ids", + "id", + "name" + ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ChannelPermissionOverwriteSchema": { + "type": "object", + "properties": { + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ], + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "color": { + "type": "integer" + }, + "footer": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "text" + ] + }, + "image": { + "$ref": "#/definitions/EmbedImage" + }, + "thumbnail": { + "$ref": "#/definitions/EmbedImage" + }, + "video": { + "$ref": "#/definitions/EmbedImage" + }, + "provider": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "author": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "inline": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "value" + ] + } + } + }, + "additionalProperties": false + }, + "EmbedImage": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ChannelModifySchema": { + "type": "object", + "properties": { + "name": { + "maxLength": 100, + "type": "string" + }, + "type": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "topic": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "rate_limit_per_user": { + "type": "integer" + }, + "position": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + }, + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + } + }, + "parent_id": { + "type": "string" + }, + "id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "rtc_region": { + "type": "string" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "default_reaction_emoji": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "default_thread_rate_limit_per_user": { + "type": "integer" + }, + "video_quality_mode": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "ActivitySchema": { + "type": "object", + "properties": { + "afk": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/Status" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "since": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "status" + ] + }, + "Status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string" + }, + "Activity": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ActivityType" + }, + "url": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "timestamps": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "end": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end", + "start" + ] + }, + "application_id": { + "type": "string" + }, + "details": { + "type": "string" + }, + "state": { + "type": "string" + }, + "emoji": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "name" + ] + }, + "party": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "size": { + "type": "array", + "items": [ + { + "type": "integer" + } + ], + "minItems": 1, + "maxItems": 1 + } + }, + "additionalProperties": false + }, + "assets": { + "type": "object", + "properties": { + "large_image": { + "type": "string" + }, + "large_text": { + "type": "string" + }, + "small_image": { + "type": "string" + }, + "small_text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "secrets": { + "type": "object", + "properties": { + "join": { + "type": "string" + }, + "spectate": { + "type": "string" + }, + "match": { + "type": "string" + } + }, + "additionalProperties": false + }, + "instance": { + "type": "boolean" + }, + "flags": { + "type": "string" + }, + "id": { + "type": "string" + }, + "sync_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "context_uri": { + "type": "string" + }, + "album_id": { + "type": "string" + }, + "artist_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "album_id", + "artist_ids" + ] + }, + "session_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "flags", + "name", + "session_id", + "type" + ] + }, + "ActivityType": { + "enum": [ + 0, + 1, + 2, + 4, + 5 + ], + "type": "number" + }, + "Record": { + "type": "object", + "additionalProperties": false + }, + "CustomStatus": { + "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + }, + "additionalProperties": false + }, + "FriendSourceFlags": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "GuildFolder": { + "type": "object", + "properties": { + "color": { + "type": "integer" + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "guild_ids", + "id", + "name" + ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "UserGuildSettingsSchema": { + "type": "object", + "properties": { + "channel_overrides": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Partial" + } + }, + "version": { + "type": "integer" + }, + "guild_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "message_notifications": { + "type": "integer" + }, + "mobile_push": { + "type": "boolean" + }, + "mute_config": { + "anyOf": [ + { + "$ref": "#/definitions/MuteConfig" + }, + { + "type": "null" + } + ] + }, + "muted": { + "type": "boolean" + }, + "suppress_everyone": { + "type": "boolean" + }, + "suppress_roles": { + "type": "boolean" + }, + "mute_scheduled_events": { + "type": "boolean" + }, + "hide_muted_channels": { + "type": "boolean" + }, + "notify_highlights": { + "enum": [ + 0 + ], + "type": "number" + } + }, + "additionalProperties": false, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "Embed": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "type": { + "enum": [ + "article", + "gifv", + "image", + "link", + "rich", + "video" + ], + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "color": { + "type": "integer" + }, + "footer": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "icon_url": { + "type": "string" + }, + "proxy_icon_url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "text" + ] + }, + "image": { + "$ref": "#/definitions/EmbedImage" + }, + "thumbnail": { + "$ref": "#/definitions/EmbedImage" + }, + "video": { + "$ref": "#/definitions/EmbedImage" + }, + "provider": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "author": { + "type": "object", + "properties": { + "name": { "type": "string" }, "url": { @@ -22496,43 +23799,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -22589,11 +23855,48 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "ChannelReorderSchema": { + "RolePositionUpdateSchema": { "type": "array", "items": { "type": "object", @@ -22603,17 +23906,12 @@ }, "position": { "type": "integer" - }, - "lock_permissions": { - "type": "boolean" - }, - "parent_id": { - "type": "string" } }, "additionalProperties": false, "required": [ - "id" + "id", + "position" ] }, "definitions": { @@ -23055,288 +24353,145 @@ "additionalProperties": false, "required": [ "flags", - "name", - "session_id", - "type" - ] - }, - "ActivityType": { - "enum": [ - 0, - 1, - 2, - 4, - 5 - ], - "type": "number" - }, - "Record": { - "type": "object", - "additionalProperties": false - }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, - "CustomStatus": { - "type": "object", - "properties": { - "emoji_id": { - "type": "string" - }, - "emoji_name": { - "type": "string" - }, - "expires_at": { - "type": "integer" - }, - "text": { - "type": "string" - } - }, - "additionalProperties": false - }, - "FriendSourceFlags": { - "type": "object", - "properties": { - "all": { - "type": "boolean" - } - }, - "additionalProperties": false, - "required": [ - "all" - ] - }, - "GuildFolder": { - "type": "object", - "properties": { - "color": { - "type": "integer" - }, - "guild_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "color", - "guild_ids", - "id", - "name" - ] - } - }, - "$schema": "http://json-schema.org/draft-07/schema#" - }, - "UserSettingsSchema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "afk_timeout": { - "type": "integer" - }, - "allow_accessibility_detection": { - "type": "boolean" - }, - "animate_emoji": { - "type": "boolean" - }, - "animate_stickers": { - "type": "integer" - }, - "contact_sync_enabled": { - "type": "boolean" - }, - "convert_emoticons": { - "type": "boolean" - }, - "custom_status": { - "anyOf": [ - { - "$ref": "#/definitions/CustomStatus" - }, - { - "type": "null" - } - ] - }, - "default_guilds_restricted": { - "type": "boolean" - }, - "detect_platform_accounts": { - "type": "boolean" - }, - "developer_mode": { - "type": "boolean" - }, - "disable_games_tab": { - "type": "boolean" - }, - "enable_tts_command": { - "type": "boolean" - }, - "explicit_content_filter": { - "type": "integer" - }, - "friend_source_flags": { - "$ref": "#/definitions/FriendSourceFlags" - }, - "gateway_connected": { - "type": "boolean" - }, - "gif_auto_play": { - "type": "boolean" - }, - "guild_folders": { - "type": "array", - "items": { - "$ref": "#/definitions/GuildFolder" - } - }, - "guild_positions": { - "type": "array", - "items": { - "type": "string" - } - }, - "inline_attachment_media": { - "type": "boolean" - }, - "inline_embed_media": { - "type": "boolean" - }, - "locale": { - "type": "string" - }, - "message_display_compact": { - "type": "boolean" - }, - "native_phone_integration_enabled": { - "type": "boolean" - }, - "render_embeds": { - "type": "boolean" - }, - "render_reactions": { - "type": "boolean" - }, - "restricted_guilds": { - "type": "array", - "items": { - "type": "string" - } - }, - "show_current_game": { - "type": "boolean" - }, - "status": { - "enum": [ - "dnd", - "idle", - "invisible", - "offline", - "online" - ], - "type": "string" - }, - "stream_notifications_enabled": { - "type": "boolean" - }, - "theme": { - "enum": [ - "dark", - "light" - ], - "type": "string" - }, - "timezone_offset": { - "type": "integer" - }, - "assign": { - "type": "object", - "additionalProperties": false + "name", + "session_id", + "type" + ] }, - "toJSON": { - "type": "object", - "additionalProperties": false + "ActivityType": { + "enum": [ + 0, + 1, + 2, + 4, + 5 + ], + "type": "number" }, - "hasId": { - "description": "Checks if entity has an id.\nIf entity composite compose ids, it will check them all.", + "Record": { "type": "object", "additionalProperties": false }, - "save": { - "description": "Saves current entity in the database.\nIf entity does not exist in the database then inserts, otherwise updates.", + "CustomStatus": { "type": "object", + "properties": { + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "text": { + "type": "string" + } + }, "additionalProperties": false }, - "remove": { - "description": "Removes current entity from the database.", + "FriendSourceFlags": { "type": "object", - "additionalProperties": false + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] }, - "softRemove": { - "description": "Records the delete date of current entity.", + "GuildFolder": { "type": "object", - "additionalProperties": false + "properties": { + "color": { + "type": "integer" + }, + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "guild_ids", + "id", + "name" + ] }, - "recover": { - "description": "Recovers a given entity in the database.", + "Partial": { "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, "additionalProperties": false }, - "reload": { - "description": "Reloads entity data from the database.", + "MuteConfig": { "type": "object", - "additionalProperties": false + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, - "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "ChannelReorderSchema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "lock_permissions": { + "type": "boolean" + }, + "parent_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -23795,43 +24950,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -23888,6 +25006,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -24355,48 +25510,11 @@ 4, 5 ], - "type": "number" - }, - "Record": { - "type": "object", - "additionalProperties": false - }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] + "type": "number" + }, + "Record": { + "type": "object", + "additionalProperties": false }, "CustomStatus": { "type": "object", @@ -24454,6 +25572,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -24963,43 +26118,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -25056,6 +26174,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -25535,43 +26690,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -25628,6 +26746,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -26092,98 +27247,98 @@ "type": "object", "additionalProperties": false }, - "Partial": { + "CustomStatus": { "type": "object", "properties": { - "message_notifications": { - "type": "integer" + "emoji_id": { + "type": "string" }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" + "emoji_name": { + "type": "string" }, - "muted": { - "type": "boolean" + "expires_at": { + "type": "integer" }, - "channel_id": { - "type": [ - "null", - "string" - ] + "text": { + "type": "string" } }, "additionalProperties": false }, - "MuteConfig": { + "FriendSourceFlags": { "type": "object", "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" + "all": { + "type": "boolean" } }, "additionalProperties": false, "required": [ - "end_time", - "selected_time_window" + "all" ] }, - "CustomStatus": { + "GuildFolder": { "type": "object", "properties": { - "emoji_id": { - "type": "string" + "color": { + "type": "integer" }, - "emoji_name": { - "type": "string" + "guild_ids": { + "type": "array", + "items": { + "type": "string" + } }, - "expires_at": { + "id": { "type": "integer" }, - "text": { + "name": { "type": "string" } }, - "additionalProperties": false + "additionalProperties": false, + "required": [ + "color", + "guild_ids", + "id", + "name" + ] }, - "FriendSourceFlags": { + "Partial": { "type": "object", "properties": { - "all": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] } }, - "additionalProperties": false, - "required": [ - "all" - ] + "additionalProperties": false }, - "GuildFolder": { + "MuteConfig": { "type": "object", "properties": { - "color": { + "end_time": { "type": "integer" }, - "guild_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { + "selected_time_window": { "type": "integer" - }, - "name": { - "type": "string" } }, "additionalProperties": false, "required": [ - "color", - "guild_ids", - "id", - "name" + "end_time", + "selected_time_window" ] } }, @@ -26661,43 +27816,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -26754,6 +27872,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -27227,43 +28382,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -27320,6 +28438,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" @@ -27793,43 +28948,6 @@ "type": "object", "additionalProperties": false }, - "Partial": { - "type": "object", - "properties": { - "message_notifications": { - "type": "integer" - }, - "mute_config": { - "$ref": "#/definitions/MuteConfig" - }, - "muted": { - "type": "boolean" - }, - "channel_id": { - "type": [ - "null", - "string" - ] - } - }, - "additionalProperties": false - }, - "MuteConfig": { - "type": "object", - "properties": { - "end_time": { - "type": "integer" - }, - "selected_time_window": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "end_time", - "selected_time_window" - ] - }, "CustomStatus": { "type": "object", "properties": { @@ -27886,6 +29004,43 @@ "id", "name" ] + }, + "Partial": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false + }, + "MuteConfig": { + "type": "object", + "properties": { + "end_time": { + "type": "integer" + }, + "selected_time_window": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "end_time", + "selected_time_window" + ] } }, "$schema": "http://json-schema.org/draft-07/schema#" diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index 28085752..8e6c3ce7 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -9,6 +9,7 @@ import { Sticker, Emoji, Guild, + handleFile, MemberChangeSchema, } from "@fosscord/util"; import { route } from "@fosscord/api"; @@ -26,54 +27,39 @@ router.get("/", route({}), async (req: Request, res: Response) => { return res.json(member); }); -router.patch( - "/", - route({ body: "MemberChangeSchema" }), - async (req: Request, res: Response) => { - let { guild_id, member_id } = req.params; - if (member_id === "@me") member_id = req.user_id; - const body = req.body as MemberChangeSchema; - - const member = await Member.findOneOrFail({ - where: { id: member_id, guild_id }, - relations: ["roles", "user"], - }); - const permission = await getPermission(req.user_id, guild_id); - const everyone = await Role.findOneOrFail({ - where: { guild_id: guild_id, name: "@everyone", position: 0 }, - }); - - if (body.roles) { - permission.hasThrow("MANAGE_ROLES"); - - if (body.roles.indexOf(everyone.id) === -1) - body.roles.push(everyone.id); - member.roles = body.roles.map((x) => Role.create({ id: x })); // foreign key constraint will fail if role doesn't exist - } - - if ("nick" in body) { - permission.hasThrow( - req.user_id == member.user.id - ? "CHANGE_NICKNAME" - : "MANAGE_NICKNAMES", - ); - member.nick = body.nick?.trim() || undefined; - } - - await member.save(); - - member.roles = member.roles.filter((x) => x.id !== everyone.id); - - // do not use promise.all as we have to first write to db before emitting the event to catch errors - await emitEvent({ - event: "GUILD_MEMBER_UPDATE", - guild_id, - data: { ...member, roles: member.roles.map((x) => x.id) }, - } as GuildMemberUpdateEvent); - - res.json(member); - }, -); +router.patch("/", route({ body: "MemberChangeSchema" }), async (req: Request, res: Response) => { + let { guild_id, member_id } = req.params; + if (member_id === "@me") member_id = req.user_id; + const body = req.body as MemberChangeSchema; + + let member = await Member.findOneOrFail({ where: { id: member_id, guild_id }, relations: ["roles", "user"] }); + const permission = await getPermission(req.user_id, guild_id); + const everyone = await Role.findOneOrFail({ where: { guild_id: guild_id, name: "@everyone", position: 0 } }); + + if (body.roles) { + permission.hasThrow("MANAGE_ROLES"); + + if (body.roles.indexOf(everyone.id) === -1) body.roles.push(everyone.id); + member.roles = body.roles.map((x) => Role.create({ id: x })); // foreign key constraint will fail if role doesn't exist + } + + if (body.avatar) body.avatar = await handleFile(`/guilds/${guild_id}/users/${member_id}/avatars`, body.avatar as string); + + member.assign(body); + + await member.save(); + + member.roles = member.roles.filter((x) => x.id !== everyone.id); + + // do not use promise.all as we have to first write to db before emitting the event to catch errors + await emitEvent({ + event: "GUILD_MEMBER_UPDATE", + guild_id, + data: { ...member, roles: member.roles.map((x) => x.id) } + } as GuildMemberUpdateEvent); + + res.json(member); +}); router.put("/", route({}), async (req: Request, res: Response) => { // TODO: Lurker mode diff --git a/src/api/routes/guilds/#guild_id/profile/index.ts b/src/api/routes/guilds/#guild_id/profile/index.ts new file mode 100644 index 00000000..ddc30943 --- /dev/null +++ b/src/api/routes/guilds/#guild_id/profile/index.ts @@ -0,0 +1,30 @@ +import { route } from "@fosscord/api"; +import { emitEvent, GuildMemberUpdateEvent, handleFile, Member, MemberChangeProfileSchema, OrmUtils } from "@fosscord/util"; +import { Request, Response, Router } from "express"; + +const router = Router(); + +router.patch("/:member_id", route({ body: "MemberChangeProfileSchema" }), async (req: Request, res: Response) => { + let { guild_id, member_id } = req.params; + if (member_id === "@me") member_id = req.user_id; + const body = req.body as MemberChangeProfileSchema; + + let member = await Member.findOneOrFail({ where: { id: req.user_id, guild_id }, relations: ["roles", "user"] }); + + if (body.banner) body.banner = await handleFile(`/guilds/${guild_id}/users/${req.user_id}/avatars`, body.banner as string); + + member = await OrmUtils.mergeDeep(member, body); + + await member.save(); + + // do not use promise.all as we have to first write to db before emitting the event to catch errors + await emitEvent({ + event: "GUILD_MEMBER_UPDATE", + guild_id, + data: { ...member, roles: member.roles.map((x) => x.id) } + } as GuildMemberUpdateEvent); + + res.json(member); +}); + +export default router; diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts index ebea805b..45cc4412 100644 --- a/src/api/routes/users/#id/profile.ts +++ b/src/api/routes/users/#id/profile.ts @@ -6,6 +6,11 @@ import { UserPublic, Member, Guild, + UserProfileModifySchema, + handleFile, + PrivateUserProjection, + emitEvent, + UserUpdateEvent, } from "@fosscord/util"; import { route } from "@fosscord/api"; @@ -84,36 +89,66 @@ router.get( bot: user.bot, }; - const guildMemberDto = guild_member - ? { - avatar: user.avatar, // TODO - banner: user.banner, // TODO - bio: req.user_bot ? null : user.bio, // TODO - communication_disabled_until: null, // TODO - deaf: guild_member.deaf, - flags: user.flags, - is_pending: guild_member.pending, - pending: guild_member.pending, // why is this here twice, discord? - joined_at: guild_member.joined_at, - mute: guild_member.mute, - nick: guild_member.nick, - premium_since: guild_member.premium_since, - roles: guild_member.roles - .map((x) => x.id) - .filter((id) => id != guild_id), - user: userDto, - } - : undefined; - - res.json({ - connected_accounts: user.connected_accounts, - premium_guild_since: premium_guild_since, // TODO - premium_since: user.premium_since, // TODO - mutual_guilds: mutual_guilds, // TODO {id: "", nick: null} when ?with_mutual_guilds=true - user: userDto, - guild_member: guildMemberDto, - }); - }, -); + const guildMemberDto = guild_member + ? { + avatar: guild_member.avatar, + banner: guild_member.banner, + bio: req.user_bot ? null : guild_member.bio, + communication_disabled_until: guild_member.communication_disabled_until, + deaf: guild_member.deaf, + flags: user.flags, + is_pending: guild_member.pending, + pending: guild_member.pending, // why is this here twice, discord? + joined_at: guild_member.joined_at, + mute: guild_member.mute, + nick: guild_member.nick, + premium_since: guild_member.premium_since, + roles: guild_member.roles.map((x) => x.id).filter((id) => id != guild_id), + user: userDto + } + : undefined; + + const guildMemberProfile = { + accent_color: null, + banner: guild_member?.banner || null, + bio: guild_member?.bio || "", + guild_id + }; + res.json({ + connected_accounts: user.connected_accounts, + premium_guild_since: premium_guild_since, // TODO + premium_since: user.premium_since, // TODO + mutual_guilds: mutual_guilds, // TODO {id: "", nick: null} when ?with_mutual_guilds=true + user: userDto, + guild_member: guildMemberDto, + guild_member_profile: guildMemberProfile + }); +}); + +router.patch("/", route({ body: "UserProfileModifySchema" }), async (req: Request, res: Response) => { + const body = req.body as UserProfileModifySchema; + + if (body.banner) body.banner = await handleFile(`/banners/${req.user_id}`, body.banner as string); + let user = await User.findOneOrFail({ where: { id: req.user_id }, select: [...PrivateUserProjection, "data"] }); + + user.assign(body); + await user.save(); + + // @ts-ignore + delete user.data; + + // TODO: send update member list event in gateway + await emitEvent({ + event: "USER_UPDATE", + user_id: req.user_id, + data: user + } as UserUpdateEvent); + + res.json({ + accent_color: user.accent_color, + bio: user.bio, + banner: user.banner + }); +}); export default router; diff --git a/src/cdn/Server.ts b/src/cdn/Server.ts index 45d3abd9..1fd9ca38 100644 --- a/src/cdn/Server.ts +++ b/src/cdn/Server.ts @@ -2,6 +2,7 @@ import { Server, ServerOptions } from "lambert-server"; import { Config, initDatabase, registerRoutes } from "@fosscord/util"; import path from "path"; import avatarsRoute from "./routes/avatars"; +import guildProfilesRoute from "./routes/guild-profiles"; import iconsRoute from "./routes/role-icons"; import bodyParser from "body-parser"; @@ -74,6 +75,12 @@ export class CDNServer extends Server { this.app.use("/channel-icons/", avatarsRoute); this.log("verbose", "[Server] Route /channel-icons registered"); + this.app.use("/guilds/:guild_id/users/:user_id/avatars", guildProfilesRoute); + this.log("verbose", "[Server] Route /guilds/avatars registered"); + + this.app.use("/guilds/:guild_id/users/:user_id/banners", guildProfilesRoute); + this.log("verbose", "[Server] Route /guilds/banners registered"); + return super.start(); } diff --git a/src/cdn/routes/guild-profiles.ts b/src/cdn/routes/guild-profiles.ts new file mode 100644 index 00000000..98af7f69 --- /dev/null +++ b/src/cdn/routes/guild-profiles.ts @@ -0,0 +1,85 @@ +import { Config, Snowflake } from "@fosscord/util"; +import crypto from "crypto"; +import { Request, Response, Router } from "express"; +import FileType from "file-type"; +import { HTTPError } from "lambert-server"; +import { multer } from "../util/multer"; +import { storage } from "../util/Storage"; + +// TODO: check premium and animated pfp are allowed in the config +// TODO: generate different sizes of icon +// TODO: generate different image types of icon +// TODO: delete old icons + +const ANIMATED_MIME_TYPES = ["image/apng", "image/gif", "image/gifv"]; +const STATIC_MIME_TYPES = ["image/png", "image/jpeg", "image/webp", "image/svg+xml", "image/svg"]; +const ALLOWED_MIME_TYPES = [...ANIMATED_MIME_TYPES, ...STATIC_MIME_TYPES]; + +const router = Router(); + +router.post("/", multer.single("file"), async (req: Request, res: Response) => { + if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature"); + if (!req.file) throw new HTTPError("Missing file"); + const { buffer, mimetype, size, originalname, fieldname } = req.file; + const { guild_id, user_id } = req.params; + + let hash = crypto.createHash("md5").update(Snowflake.generate()).digest("hex"); + + const type = await FileType.fromBuffer(buffer); + if (!type || !ALLOWED_MIME_TYPES.includes(type.mime)) throw new HTTPError("Invalid file type"); + if (ANIMATED_MIME_TYPES.includes(type.mime)) hash = `a_${hash}`; // animated icons have a_ infront of the hash + + const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`; + const endpoint = Config.get().cdn.endpointPublic || "http://localhost:3003"; + + await storage.set(path, buffer); + + return res.json({ + id: hash, + content_type: type.mime, + size, + url: `${endpoint}${req.baseUrl}/${user_id}/${hash}` + }); +}); + +router.get("/", async (req: Request, res: Response) => { + let { guild_id, user_id } = req.params; + user_id = user_id.split(".")[0]; // remove .file extension + const path = `guilds/${guild_id}/users/${user_id}/avatars`; + + const file = await storage.get(path); + if (!file) throw new HTTPError("not found", 404); + const type = await FileType.fromBuffer(file); + + res.set("Content-Type", type?.mime); + res.set("Cache-Control", "public, max-age=31536000"); + + return res.send(file); +}); + +router.get("/:hash", async (req: Request, res: Response) => { + let { guild_id, user_id, hash } = req.params; + hash = hash.split(".")[0]; // remove .file extension + const path = `guilds/${guild_id}/users/${user_id}/avatars/${hash}`; + + const file = await storage.get(path); + if (!file) throw new HTTPError("not found", 404); + const type = await FileType.fromBuffer(file); + + res.set("Content-Type", type?.mime); + res.set("Cache-Control", "public, max-age=31536000"); + + return res.send(file); +}); + +router.delete("/:id", async (req: Request, res: Response) => { + if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature"); + const { guild_id, user_id, id } = req.params; + const path = `guilds/${guild_id}/users/${user_id}/avatars/${id}`; + + await storage.delete(path); + + return res.send({ success: true }); +}); + +export default router; diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts index ae2a6803..1c8bfbef 100644 --- a/src/util/entities/Member.ts +++ b/src/util/entities/Member.ts @@ -114,7 +114,19 @@ export class Member extends BaseClassWithoutId { // do not auto-kick force-joined members just because their joiners left the server }) **/ @Column({ nullable: true }) - joined_by?: string; + joined_by: string; + + @Column({ nullable: true }) + avatar: string; + + @Column({ nullable: true }) + banner: string; + + @Column() + bio: string; + + @Column({ nullable: true }) + communication_disabled_until: Date; // TODO: add this when we have proper read receipts // @Column({ type: "simple-json" }) @@ -313,6 +325,7 @@ export class Member extends BaseClassWithoutId { deaf: false, mute: false, pending: false, + bio: "", }; await Promise.all([ diff --git a/src/util/schemas/MemberChangeProfileSchema.ts b/src/util/schemas/MemberChangeProfileSchema.ts new file mode 100644 index 00000000..3e85174d --- /dev/null +++ b/src/util/schemas/MemberChangeProfileSchema.ts @@ -0,0 +1,5 @@ +export interface MemberChangeProfileSchema { + banner?: string | null; + nick?: string; + bio?: string; +} diff --git a/src/util/schemas/MemberChangeSchema.ts b/src/util/schemas/MemberChangeSchema.ts index 2367bef3..4156c8c1 100644 --- a/src/util/schemas/MemberChangeSchema.ts +++ b/src/util/schemas/MemberChangeSchema.ts @@ -1,4 +1,6 @@ export interface MemberChangeSchema { roles?: string[]; nick?: string; + avatar?: string | null; + bio?: string; } diff --git a/src/util/schemas/UserProfileModifySchema.ts b/src/util/schemas/UserProfileModifySchema.ts new file mode 100644 index 00000000..33a372c9 --- /dev/null +++ b/src/util/schemas/UserProfileModifySchema.ts @@ -0,0 +1,5 @@ +export interface UserProfileModifySchema { + bio?: string; + accent_color?: number | null; + banner?: string | null; +} diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts index 58565496..a03cebe2 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts @@ -22,6 +22,11 @@ export * from "./TemplateModifySchema"; export * from "./VanityUrlSchema"; export * from "./GuildUpdateWelcomeScreenSchema"; export * from "./WidgetModifySchema"; +export * from "./IdentifySchema"; +export * from "./InviteCreateSchema"; +export * from "./LazyRequestSchema"; +export * from "./LoginSchema"; +export * from "./MemberChangeProfileSchema"; export * from "./MemberChangeSchema"; export * from "./RoleModifySchema"; export * from "./GuildTemplateCreateSchema"; @@ -34,6 +39,11 @@ export * from "./MfaCodesSchema"; export * from "./TotpDisableSchema"; export * from "./TotpEnableSchema"; export * from "./VoiceIdentifySchema"; +export * from "./TotpSchema"; +export * from "./UserModifySchema"; +export * from "./UserProfileModifySchema"; +export * from "./UserSettingsSchema"; +export * from "./VanityUrlSchema"; export * from "./VoiceStateUpdateSchema"; export * from "./VoiceVideoSchema"; export * from "./IdentifySchema"; -- cgit 1.4.1