From 07569328b14d346eb45bf865e9f610dc3f689ee6 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Wed, 14 Jun 2023 11:37:17 -0400 Subject: update user modify for unique usernames --- assets/locales/en/common.json | 6 +- assets/locales/ur/auth.json | 4 +- assets/openapi.json | 10 +- assets/schemas.json | 10063 ++++++++++++++++++- src/api/routes/users/@me/index.ts | 63 +- .../types/subconfigurations/limits/UserLimits.ts | 1 + src/util/entities/User.ts | 9 +- src/util/schemas/UserModifySchema.ts | 1 + 8 files changed, 9771 insertions(+), 386 deletions(-) diff --git a/assets/locales/en/common.json b/assets/locales/en/common.json index edcafa1d..dcb97ec0 100644 --- a/assets/locales/en/common.json +++ b/assets/locales/en/common.json @@ -13,7 +13,11 @@ "BASE_TYPE_CONSTANT": "This field must be {{value}}", "EMAIL_TYPE_INVALID_EMAIL": "Not a well-formed email address", "DATE_TYPE_PARSE": "Could not parse {{date}}. Should be ISO8601", - "BASE_TYPE_BAD_LENGTH": "Must be between {{length}} in length" + "BASE_TYPE_BAD_LENGTH": "Must be between {{length}} in length", + "PASSWORD_DOES_NOT_MATCH": "Password does not match.", + "DISCRIMINATOR_UPDATE_BLOCKED": "This discriminator cannot be updated", + "USERNAME_ALREADY_TAKEN": "Username is unavailable. Try adding numbers, letters, underscores _ , or periods.", + "INVALID_DISCRIMINATOR": "This discriminator is already in use." }, "body": { "INVALID_BODY": "Invalid Body", diff --git a/assets/locales/ur/auth.json b/assets/locales/ur/auth.json index 1dac2474..93631abc 100644 --- a/assets/locales/ur/auth.json +++ b/assets/locales/ur/auth.json @@ -10,8 +10,8 @@ "EMAIL_INVALID": "Invalid Email", "EMAIL_ALREADY_REGISTERED": "Email is already registered", "DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older", - "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Must be at least {{min}} characters long.", - "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", + "PASSWORD_REQUIREMENTS_MIN_LENGTH": "Must be at least {{min}} characters long.", + "CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.", "USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another" } } diff --git a/assets/openapi.json b/assets/openapi.json index 4c9006c2..7b2243e9 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -4049,6 +4049,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -4061,7 +4065,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -5835,6 +5840,9 @@ "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } } }, diff --git a/assets/schemas.json b/assets/schemas.json index 9a00e613..0f2602f7 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -4237,6 +4237,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -4250,7 +4254,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -8480,6 +8485,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -8493,7 +8502,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -12723,6 +12733,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -12736,7 +12750,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -16961,6 +16976,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -16974,7 +16993,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -21235,6 +21255,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -21248,7 +21272,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -25478,6 +25503,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -25491,7 +25520,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -29712,6 +29742,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -29725,7 +29759,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -33949,6 +33984,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -33962,7 +34001,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -38195,6 +38235,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -38208,7 +38252,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -42429,6 +42474,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -42442,7 +42491,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -46663,6 +46713,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -46676,7 +46730,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -50916,6 +50971,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -50929,7 +50988,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -55153,6 +55213,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -55166,7 +55230,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -59450,6 +59515,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -59463,7 +59532,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -63706,6 +63776,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -63719,7 +63793,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -68103,6 +68178,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -68116,7 +68195,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -72358,6 +72438,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -72371,7 +72455,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -76623,6 +76708,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -76636,7 +76725,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -80870,6 +80960,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -80883,7 +80977,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -85123,6 +85218,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -85136,7 +85235,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -89366,6 +89466,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -89379,7 +89483,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -93597,6 +93702,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -93610,7 +93719,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -97946,6 +98056,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -97959,7 +98073,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -102292,6 +102407,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -102305,7 +102424,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -106526,6 +106646,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -106539,7 +106663,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -110768,6 +110893,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -110781,7 +110910,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -115003,6 +115133,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -115016,7 +115150,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -119238,6 +119373,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -119251,7 +119390,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -123508,6 +123648,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -123521,7 +123665,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -127743,6 +127888,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -127756,7 +127905,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -131977,6 +132127,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -131990,7 +132144,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -136226,6 +136381,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -136239,7 +136398,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -140464,6 +140624,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -140477,7 +140641,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -144776,6 +144941,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -144789,7 +144958,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -149010,6 +149180,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -149023,7 +149197,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -153244,6 +153419,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -153257,7 +153436,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -157475,6 +157655,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -157488,7 +157672,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -161712,6 +161897,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -161725,7 +161914,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -165959,6 +166149,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -165972,7 +166166,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -170190,6 +170385,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -170203,7 +170402,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -174470,6 +174670,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -174483,7 +174687,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -174864,6 +175069,9 @@ "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } }, "additionalProperties": false, @@ -178736,6 +178944,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -178749,7 +178961,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -182967,6 +183180,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -182980,7 +183197,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -187223,6 +187441,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -187236,7 +187458,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -191568,6 +191791,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -191581,7 +191808,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -195798,6 +196026,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -195811,7 +196043,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -200067,6 +200300,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -200080,7 +200317,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -204324,6 +204562,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -204337,7 +204579,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -208633,6 +208876,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -208646,7 +208893,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -212864,6 +213112,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -212877,7 +213129,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -217103,6 +217356,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -217116,7 +217373,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -221332,6 +221590,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -221345,7 +221607,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -225567,6 +225830,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -225580,7 +225847,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -229802,6 +230070,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -229815,7 +230087,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -234037,6 +234310,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -234050,7 +234327,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -238304,6 +238582,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -238317,7 +238599,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -242543,6 +242826,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -242556,7 +242843,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -246772,6 +247060,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -246785,7 +247077,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -251007,6 +251300,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -251020,7 +251317,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -255253,6 +255551,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -255266,7 +255568,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -259513,6 +259816,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -259526,7 +259833,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -263744,6 +264052,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -263757,7 +264069,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -267978,6 +268291,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -267991,7 +268308,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -272244,6 +272562,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -272257,7 +272579,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -276475,6 +276798,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -276488,7 +276815,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -280785,6 +281113,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -280798,7 +281130,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -285023,6 +285356,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -285036,7 +285373,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -289254,6 +289592,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -289267,7 +289609,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -293485,6 +293828,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -293498,7 +293845,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -297723,6 +298071,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -297736,7 +298088,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -301958,6 +302311,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -301971,7 +302328,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -306189,6 +306547,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -306202,7 +306564,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -310502,6 +310865,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -310515,7 +310882,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -314744,6 +315112,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -314757,7 +315129,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -318987,6 +319360,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -319000,7 +319377,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -323280,6 +323658,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -323293,7 +323675,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -327532,6 +327915,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -327545,7 +327932,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -331790,6 +332178,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -331803,7 +332195,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -336042,6 +336435,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -336055,7 +336452,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -340273,6 +340671,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -340286,7 +340688,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -344532,6 +344935,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -344545,7 +344952,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -348803,6 +349211,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -348816,7 +349228,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -353028,6 +353441,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -353041,7 +353458,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -357263,6 +357681,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -357276,7 +357698,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -361494,6 +361917,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -361507,7 +361934,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -365732,6 +366160,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -365745,7 +366177,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -370174,6 +370607,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -370187,7 +370624,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -374396,6 +374834,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -374409,7 +374851,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -378718,6 +379161,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -378731,7 +379178,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -382943,6 +383391,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -382956,7 +383408,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -387168,6 +387621,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -387181,7 +387638,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -391393,6 +391851,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -391406,7 +391868,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -395718,6 +396181,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -395731,7 +396198,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -399941,6 +400409,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -399954,7 +400426,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -404164,6 +404637,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -404177,7 +404654,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -408387,6 +408865,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -408400,7 +408882,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -412612,6 +413095,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -412625,7 +413112,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -416837,6 +417325,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -416850,7 +417342,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -421062,6 +421555,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -421075,7 +421572,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -425287,6 +425785,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -425300,7 +425802,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -429512,6 +430015,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -429525,7 +430032,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -433806,6 +434314,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -433819,7 +434331,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -438031,6 +438544,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -438044,7 +438561,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -442256,6 +442774,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -442269,7 +442791,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -446481,6 +447004,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -446494,7 +447021,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -447921,10 +448449,8 @@ "type": "integer", "default": 0 }, - "position": { - "description": "Must be calculated Channel.calculatePosition", - "type": "integer" - }, +<<<<<<< HEAD +======= "id": { "type": "string" } @@ -447938,7 +448464,6 @@ "nsfw", "owner", "parent_id", - "position", "type" ] }, @@ -448999,6 +449524,7 @@ }, "additionalProperties": false, "required": [ + "avatar", "banner", "bio", "communication_disabled_until", @@ -449043,9 +449569,13 @@ "permissions": { "type": "string" }, +>>>>>>> 99963e1b (update user modify for unique usernames) "position": { + "description": "Must be calculated Channel.calculatePosition", "type": "integer" }, +<<<<<<< HEAD +======= "icon": { "type": "string" }, @@ -450170,9 +450700,6 @@ "type": "string", "format": "date-time" }, - "avatar": { - "type": "string" - }, "username": { "type": "string" }, @@ -450188,6 +450715,9 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, @@ -450562,12 +451092,6 @@ }, "premium_progress_bar_enabled": { "type": "boolean" - }, - "channel_ordering": { - "type": "array", - "items": { - "type": "string" - } } }, "additionalProperties": false, @@ -450575,7 +451099,6 @@ "_do_validate", "assign", "bans", - "channel_ordering", "channels", "emojis", "features", @@ -450753,6 +451276,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -450766,7 +451293,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -451311,12 +451839,6 @@ "type": "boolean", "default": false }, - "channel_ordering": { - "type": "array", - "items": { - "type": "string" - } - }, "id": { "type": "string" } @@ -451324,7 +451846,6 @@ "additionalProperties": false, "required": [ "bans", - "channel_ordering", "channels", "emojis", "features", @@ -452230,12 +452751,6 @@ "type": "boolean", "default": false }, - "channel_ordering": { - "type": "array", - "items": { - "type": "string" - } - }, "id": { "type": "string" } @@ -452243,7 +452758,6 @@ "additionalProperties": false, "required": [ "bans", - "channel_ordering", "channels", "emojis", "features", @@ -452316,6 +452830,9 @@ "default_auto_archive_duration": { "type": "integer" }, + "position": { + "type": "integer" + }, "permission_overwrites": { "type": "array", "items": { @@ -452382,10 +452899,7 @@ "type": "integer", "default": 0 }, - "position": { - "description": "Must be calculated Channel.calculatePosition", - "type": "integer" - }, +>>>>>>> 99963e1b (update user modify for unique usernames) "id": { "type": "string" } @@ -455565,11 +456079,247 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIRoleArray": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" + "APIGuildWithJoinedAt": { + "type": "object", + "properties": { + "joined_at": { + "type": "string" + }, + "afk_channel_id": { + "type": "string" + }, + "afk_channel": { + "$ref": "#/definitions/Channel" + }, + "afk_timeout": { + "type": "integer" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "banner": { + "type": "string" + }, + "default_message_notifications": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "discovery_splash": { + "type": "string" + }, + "explicit_content_filter": { + "type": "integer" + }, + "features": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "primary_category_id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "large": { + "type": "boolean", + "default": false + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "template_id": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/Template" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "mfa_level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "public_updates_channel": { + "$ref": "#/definitions/Channel" + }, + "rules_channel_id": { + "type": "string" + }, + "rules_channel": { + "type": "string" + }, + "region": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "system_channel": { + "$ref": "#/definitions/Channel" + }, + "system_channel_flags": { + "type": "integer" + }, + "unavailable": { + "type": "boolean", + "default": false + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_channel": { + "$ref": "#/definitions/Channel" + }, + "widget_enabled": { + "type": "boolean", + "default": true + }, + "nsfw_level": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "parent": { + "type": "string" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean", + "default": false + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } }, + "additionalProperties": false, + "required": [ + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "id", + "invites", + "joined_at", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "roles", + "stickers", + "template", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -459439,6 +460189,8470 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, + "maxUsername": { + "type": "integer", + "default": 32 + }, + "maxFriends": { + "type": "integer", + "default": 5000 + } + }, + "additionalProperties": false, + "required": [ + "maxFriends", + "maxGuilds", + "maxUsername", + "minUsername" + ] + }, + "GuildLimits": { + "type": "object", + "properties": { + "maxRoles": { + "type": "integer", + "default": 1000 + }, + "maxEmojis": { + "type": "integer", + "default": 2000 + }, + "maxMembers": { + "type": "integer", + "default": 25000000 + }, + "maxChannels": { + "type": "integer", + "default": 65535 + }, + "maxChannelsInCategory": { + "type": "integer", + "default": 65535 + } + }, + "additionalProperties": false, + "required": [ + "maxChannels", + "maxChannelsInCategory", + "maxEmojis", + "maxMembers", + "maxRoles" + ] + }, + "MessageLimits": { + "type": "object", + "properties": { + "maxCharacters": { + "type": "integer", + "default": 1048576 + }, + "maxTTSCharacters": { + "type": "integer", + "default": 160 + }, + "maxReactions": { + "type": "integer", + "default": 2048 + }, + "maxAttachmentSize": { + "type": "integer", + "default": 1073741824 + }, + "maxBulkDelete": { + "type": "integer", + "default": 1000 + }, + "maxEmbedDownloadSize": { + "type": "integer", + "default": 5242880 + } + }, + "additionalProperties": false, + "required": [ + "maxAttachmentSize", + "maxBulkDelete", + "maxCharacters", + "maxEmbedDownloadSize", + "maxReactions", + "maxTTSCharacters" + ] + }, + "ChannelLimits": { + "type": "object", + "properties": { + "maxPins": { + "type": "integer", + "default": 500 + }, + "maxTopic": { + "type": "integer", + "default": 1024 + }, + "maxWebhooks": { + "type": "integer", + "default": 100 + } + }, + "additionalProperties": false, + "required": [ + "maxPins", + "maxTopic", + "maxWebhooks" + ] + }, + "RateLimits": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "ip": { + "$ref": "#/definitions/RateLimitOptions" + }, + "global": { + "$ref": "#/definitions/RateLimitOptions" + }, + "error": { + "$ref": "#/definitions/RateLimitOptions" + }, + "routes": { + "$ref": "#/definitions/RouteRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "error", + "global", + "ip", + "routes" + ] + }, + "RateLimitOptions": { + "type": "object", + "properties": { + "bot": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "window": { + "type": "integer" + }, + "onyIp": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "count", + "window" + ] + }, + "RouteRateLimit": { + "type": "object", + "properties": { + "guild": { + "$ref": "#/definitions/RateLimitOptions" + }, + "webhook": { + "$ref": "#/definitions/RateLimitOptions" + }, + "channel": { + "$ref": "#/definitions/RateLimitOptions" + }, + "auth": {} + }, + "additionalProperties": false, + "required": [ + "auth", + "channel", + "guild", + "webhook" + ] + }, + "GlobalRateLimits": { + "type": "object", + "properties": { + "register": { + "$ref": "#/definitions/GlobalRateLimit" + }, + "sendMessage": { + "$ref": "#/definitions/GlobalRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "register", + "sendMessage" + ] + }, + "GlobalRateLimit": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "default": 100 + }, + "window": { + "type": "integer", + "default": 3600000 + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "limit", + "window" + ] + }, + "PublicConnectedAccount": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio" + ] + }, + "TokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "settings": { + "$ref": "#/definitions/UserSettings" + } + }, + "additionalProperties": false, + "required": [ + "settings", + "token" + ] + }, + "MFAResponse": { + "type": "object", + "properties": { + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token" + ] + }, + "WebAuthnResponse": { + "type": "object", + "properties": { + "webauthn": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token", + "webauthn" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "APIRoleArray": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + }, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "ConnectedAccountTokenData": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "token_type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "expires_at": { + "type": "integer" + }, + "fetched_at": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "access_token", + "fetched_at" + ] + }, + "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" + } + } + }, + "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" + }, + "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 + }, + "ChannelOverride": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "message_notifications", + "mute_config", + "muted" + ] + }, + "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" + ] + }, + "GenerateWebAuthnCredentialsSchema": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "password" + ] + }, + "CreateWebAuthnCredentialSchema": { + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "credential", + "name", + "ticket" + ] + }, + "APIErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "_errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "message" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "_errors" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "code", + "errors", + "message" + ] + }, + "CaptchaRequiredResponse": { + "type": "object", + "properties": { + "captcha_key": { + "type": "string" + }, + "captcha_sitekey": { + "type": "string" + }, + "captcha_service": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "captcha_key", + "captcha_service", + "captcha_sitekey" + ] + }, + "Guild": { + "type": "object", + "properties": { + "afk_channel_id": { + "type": "string" + }, + "afk_channel": { + "$ref": "#/definitions/Channel" + }, + "afk_timeout": { + "type": "integer" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "banner": { + "type": "string" + }, + "default_message_notifications": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "discovery_splash": { + "type": "string" + }, + "explicit_content_filter": { + "type": "integer" + }, + "features": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "primary_category_id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "large": { + "type": "boolean", + "default": false + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "template_id": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/Template" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "mfa_level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "public_updates_channel": { + "$ref": "#/definitions/Channel" + }, + "rules_channel_id": { + "type": "string" + }, + "rules_channel": { + "type": "string" + }, + "region": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "system_channel": { + "$ref": "#/definitions/Channel" + }, + "system_channel_flags": { + "type": "integer" + }, + "unavailable": { + "type": "boolean", + "default": false + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_channel": { + "$ref": "#/definitions/Channel" + }, + "widget_enabled": { + "type": "boolean", + "default": true + }, + "nsfw_level": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "parent": { + "type": "string" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean", + "default": false + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "roles", + "stickers", + "template", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "Channel": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "type": { + "$ref": "#/definitions/ChannelType" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/Recipient" + } + }, + "last_message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "parent_id": { + "type": "string" + }, + "parent": { + "$ref": "#/definitions/Channel" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "last_pin_timestamp": { + "type": "integer" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelPermissionOverwrite" + } + }, + "video_quality_mode": { + "type": "integer" + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "rate_limit_per_user": { + "type": "integer" + }, + "topic": { + "type": "string" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "retention_policy_id": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/Message" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "read_states": { + "type": "array", + "items": { + "$ref": "#/definitions/ReadState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "flags": { + "type": "integer", + "default": 0 + }, + "default_thread_rate_limit_per_user": { + "type": "integer", + "default": 0 + }, + "position": { + "description": "Must be calculated Channel.calculatePosition", + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "created_at", + "default_thread_rate_limit_per_user", + "flags", + "id", + "nsfw", + "owner", + "parent_id", + "position", + "type" + ] + }, + "ChannelType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "Recipient": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "closed": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "closed", + "id", + "user", + "user_id" + ] + }, + "User": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "desktop": { + "type": "boolean", + "default": false + }, + "mobile": { + "type": "boolean", + "default": false + }, + "premium": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "bot": { + "type": "boolean", + "default": false + }, + "bio": { + "type": "string", + "default": "" + }, + "system": { + "type": "boolean", + "default": false + }, + "nsfw_allowed": { + "type": "boolean", + "default": true + }, + "mfa_enabled": { + "type": "boolean", + "default": false + }, + "webauthn_enabled": { + "type": "boolean", + "default": false + }, + "totp_secret": { + "type": "string", + "default": "" + }, + "totp_last_ticket": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "verified": { + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "default": false + }, + "deleted": { + "type": "boolean", + "default": false + }, + "email": { + "type": "string" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "public_flags": { + "type": "integer", + "default": 0 + }, + "purchased_flags": { + "type": "integer", + "default": 0 + }, + "premium_usage_flags": { + "type": "integer", + "default": 0 + }, + "rights": { + "type": "string" + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/definitions/Session" + } + }, + "relationships": { + "type": "array", + "items": { + "$ref": "#/definitions/Relationship" + } + }, + "connected_accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/ConnectedAccount" + } + }, + "data": { + "type": "object", + "properties": { + "valid_tokens_since": { + "type": "string", + "format": "date-time" + }, + "hash": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "valid_tokens_since" + ] + }, + "fingerprints": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "settings": { + "$ref": "#/definitions/UserSettings" + }, + "extended_settings": { + "type": "string", + "default": "{}" + }, + "security_keys": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityKey" + } + }, + "tag": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "connected_accounts", + "created_at", + "data", + "deleted", + "desktop", + "disabled", + "discriminator", + "extended_settings", + "fingerprints", + "flags", + "id", + "mfa_enabled", + "mobile", + "nsfw_allowed", + "premium", + "premium_since", + "premium_type", + "premium_usage_flags", + "public_flags", + "purchased_flags", + "relationships", + "rights", + "security_keys", + "sessions", + "settings", + "system", + "tag", + "username", + "verified", + "webauthn_enabled" + ] + }, + "Session": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "session_id": { + "type": "string" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "client_info": { + "type": "object", + "properties": { + "client": { + "type": "string" + }, + "os": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "client", + "os", + "version" + ] + }, + "status": { + "$ref": "#/definitions/Status" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "activities", + "client_info", + "id", + "session_id", + "status", + "user", + "user_id" + ] + }, + "Relationship": { + "type": "object", + "properties": { + "from_id": { + "type": "string" + }, + "from": { + "$ref": "#/definitions/User" + }, + "to_id": { + "type": "string" + }, + "to": { + "$ref": "#/definitions/User" + }, + "nickname": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/RelationshipType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "from", + "from_id", + "id", + "to", + "to_id", + "type" + ] + }, + "RelationshipType": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" + }, + "ConnectedAccount": { + "type": "object", + "properties": { + "external_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "friend_sync": { + "type": "boolean", + "default": false + }, + "name": { + "type": "string" + }, + "revoked": { + "type": "boolean", + "default": false + }, + "show_activity": { + "type": "integer", + "default": 0 + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": true + }, + "visibility": { + "type": "integer", + "default": 0 + }, + "integrations": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "metadata_": {}, + "metadata_visibility": { + "type": "integer", + "default": 0 + }, + "two_way_link": { + "type": "boolean", + "default": false + }, + "token_data": { + "anyOf": [ + { + "$ref": "#/definitions/ConnectedAccountTokenData" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "external_id", + "id", + "name", + "type", + "user", + "user_id" + ] + }, + "UserSettings": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "afk_timeout": { + "type": "integer", + "default": 3600 + }, + "allow_accessibility_detection": { + "type": "boolean", + "default": true + }, + "animate_emoji": { + "type": "boolean", + "default": true + }, + "animate_stickers": { + "type": "integer", + "default": 0 + }, + "contact_sync_enabled": { + "type": "boolean", + "default": false + }, + "convert_emoticons": { + "type": "boolean", + "default": false + }, + "custom_status": { + "anyOf": [ + { + "$ref": "#/definitions/CustomStatus" + }, + { + "type": "null" + } + ], + "default": null + }, + "default_guilds_restricted": { + "type": "boolean", + "default": false + }, + "detect_platform_accounts": { + "type": "boolean", + "default": false + }, + "developer_mode": { + "type": "boolean", + "default": true + }, + "disable_games_tab": { + "type": "boolean", + "default": true + }, + "enable_tts_command": { + "type": "boolean", + "default": false + }, + "explicit_content_filter": { + "type": "integer", + "default": 0 + }, + "friend_source_flags": { + "$ref": "#/definitions/FriendSourceFlags" + }, + "gateway_connected": { + "type": "boolean", + "default": false + }, + "gif_auto_play": { + "type": "boolean", + "default": false + }, + "guild_folders": { + "type": "array", + "items": { + "$ref": "#/definitions/GuildFolder" + }, + "default": [] + }, + "guild_positions": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "inline_attachment_media": { + "type": "boolean", + "default": true + }, + "inline_embed_media": { + "type": "boolean", + "default": true + }, + "locale": { + "type": "string", + "default": "en-US" + }, + "message_display_compact": { + "type": "boolean", + "default": false + }, + "native_phone_integration_enabled": { + "type": "boolean", + "default": true + }, + "render_embeds": { + "type": "boolean", + "default": true + }, + "render_reactions": { + "type": "boolean", + "default": true + }, + "restricted_guilds": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "show_current_game": { + "type": "boolean", + "default": true + }, + "status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string", + "default": "online" + }, + "stream_notifications_enabled": { + "type": "boolean", + "default": false + }, + "theme": { + "enum": [ + "dark", + "light" + ], + "type": "string", + "default": "dark" + }, + "timezone_offset": { + "type": "integer", + "default": 0 + } + }, + "additionalProperties": false, + "required": [ + "afk_timeout", + "allow_accessibility_detection", + "animate_emoji", + "animate_stickers", + "contact_sync_enabled", + "convert_emoticons", + "custom_status", + "default_guilds_restricted", + "detect_platform_accounts", + "developer_mode", + "disable_games_tab", + "enable_tts_command", + "explicit_content_filter", + "friend_source_flags", + "gateway_connected", + "gif_auto_play", + "guild_folders", + "guild_positions", + "index", + "inline_attachment_media", + "inline_embed_media", + "locale", + "message_display_compact", + "native_phone_integration_enabled", + "render_embeds", + "render_reactions", + "restricted_guilds", + "show_current_game", + "status", + "stream_notifications_enabled", + "theme", + "timezone_offset" + ] + }, + "SecurityKey": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "key_id": { + "type": "string" + }, + "public_key": { + "type": "string" + }, + "counter": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "counter", + "id", + "key_id", + "name", + "public_key", + "user", + "user_id" + ] + }, + "ChannelPermissionOverwrite": { + "type": "object", + "properties": { + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + }, + "Invite": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "temporary": { + "type": "boolean" + }, + "uses": { + "type": "integer" + }, + "max_uses": { + "type": "integer" + }, + "max_age": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "inviter_id": { + "type": "string" + }, + "inviter": { + "$ref": "#/definitions/User" + }, + "target_user_id": { + "type": "string" + }, + "target_user": { + "type": "string" + }, + "target_user_type": { + "type": "integer" + }, + "vanity_url": { + "type": "boolean" + }, + "flags": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "code", + "created_at", + "flags", + "guild", + "guild_id", + "inviter", + "max_age", + "max_uses", + "target_user_id", + "temporary", + "uses" + ] + }, + "Message": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "author_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/User" + }, + "member_id": { + "type": "string" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "webhook_id": { + "type": "string" + }, + "webhook": { + "$ref": "#/definitions/Webhook" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "content": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "edited_timestamp": { + "type": "string", + "format": "date-time" + }, + "tts": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "mention_channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "sticker_items": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment_1" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "reactions": { + "type": "array", + "items": { + "$ref": "#/definitions/Reaction" + } + }, + "nonce": { + "type": "string" + }, + "pinned": { + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "activity": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "party_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "party_id", + "type" + ] + }, + "flags": { + "type": "integer" + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message_id" + ] + }, + "referenced_message": { + "$ref": "#/definitions/Message" + }, + "interaction": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/InteractionType" + }, + "name": { + "type": "string" + }, + "user_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "type", + "user_id" + ] + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "embeds", + "id", + "mention_channels", + "mention_roles", + "mentions", + "reactions", + "timestamp", + "type" + ] + }, + "Member": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "nick": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "integer" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "pending": { + "type": "boolean" + }, + "settings": { + "$ref": "#/definitions/UserGuildSettings" + }, + "last_message_id": { + "type": "string" + }, + "joined_by": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "communication_disabled_until": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "banner", + "bio", + "communication_disabled_until", + "deaf", + "guild", + "guild_id", + "id", + "index", + "joined_at", + "joined_by", + "mute", + "pending", + "roles", + "settings", + "user" + ] + }, + "Role": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "color": { + "type": "integer" + }, + "hoist": { + "type": "boolean" + }, + "managed": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "unicode_emoji": { + "type": "string" + }, + "tags": { + "type": "object", + "properties": { + "bot_id": { + "type": "string" + }, + "integration_id": { + "type": "string" + }, + "premium_subscriber": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "flags": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "flags", + "guild", + "guild_id", + "hoist", + "id", + "managed", + "mentionable", + "name", + "permissions", + "position" + ] + }, + "UserGuildSettings": { + "type": "object", + "properties": { + "channel_overrides": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChannelOverride" + } + }, + { + "type": "null" + } + ] + }, + "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" + }, + "version": { + "type": "integer" + }, + "guild_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "mute_scheduled_events": { + "type": "boolean" + }, + "hide_muted_channels": { + "type": "boolean" + }, + "notify_highlights": { + "type": "number", + "enum": [ + 0 + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_overrides", + "flags", + "guild_id", + "hide_muted_channels", + "message_notifications", + "mobile_push", + "mute_config", + "mute_scheduled_events", + "muted", + "notify_highlights", + "suppress_everyone", + "suppress_roles", + "version" + ] + }, + "Webhook": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/WebhookType" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "token": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "application_id", + "channel", + "channel_id", + "guild", + "guild_id", + "id", + "source_guild", + "source_guild_id", + "type", + "user", + "user_id" + ] + }, + "WebhookType": { + "enum": [ + 1, + 2, + 3 + ], + "type": "number" + }, + "Application": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "description": { + "type": "string" + }, + "summary": { + "type": "string", + "default": "" + }, + "type": { + "type": "object", + "properties": {}, + "additionalProperties": true + }, + "hook": { + "type": "boolean", + "default": true + }, + "bot_public": { + "type": "boolean", + "default": true + }, + "bot_require_code_grant": { + "type": "boolean", + "default": false + }, + "verify_key": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "rpc_application_state": { + "type": "integer", + "default": 0 + }, + "store_application_state": { + "type": "integer", + "default": 1 + }, + "verification_state": { + "type": "integer", + "default": 1 + }, + "interactions_endpoint_url": { + "type": "string" + }, + "integration_public": { + "type": "boolean", + "default": true + }, + "integration_require_code_grant": { + "type": "boolean", + "default": false + }, + "discoverability_state": { + "type": "integer", + "default": 1 + }, + "discovery_eligibility_flags": { + "type": "integer", + "default": 2240 + }, + "bot": { + "$ref": "#/definitions/User" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "cover_image": { + "type": "string" + }, + "install_params": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "permissions", + "scopes" + ] + }, + "terms_of_service_url": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "description", + "discoverability_state", + "discovery_eligibility_flags", + "flags", + "hook", + "id", + "integration_public", + "integration_require_code_grant", + "name", + "owner", + "redirect_uris", + "rpc_application_state", + "store_application_state", + "summary", + "verification_state", + "verify_key" + ] + }, + "Team": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamMember" + } + }, + "name": { + "type": "string" + }, + "owner_user_id": { + "type": "string" + }, + "owner_user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "members", + "name", + "owner_user", + "owner_user_id" + ] + }, + "TeamMember": { + "type": "object", + "properties": { + "membership_state": { + "$ref": "#/definitions/TeamMemberState" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "team_id": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "membership_state", + "permissions", + "team", + "team_id", + "user", + "user_id" + ] + }, + "TeamMemberState": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "Sticker": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "available": { + "type": "boolean" + }, + "tags": { + "type": "string" + }, + "pack_id": { + "type": "string" + }, + "pack": { + "$ref": "#/definitions/StickerPack" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "type": { + "$ref": "#/definitions/StickerType" + }, + "format_type": { + "$ref": "#/definitions/StickerFormatType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "format_type", + "id", + "name", + "pack", + "type" + ] + }, + "StickerPack": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "banner_asset_id": { + "type": "string" + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "cover_sticker_id": { + "type": "string" + }, + "cover_sticker": { + "$ref": "#/definitions/Sticker" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "stickers" + ] + }, + "StickerType": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "StickerFormatType": { + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "number" + }, + "Attachment_1": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "content_type": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "message": { + "$ref": "#/definitions/Message" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "id", + "message", + "message_id", + "proxy_url", + "size", + "url" + ] + }, + "Reaction": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "user_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "count", + "emoji", + "user_ids" + ] + }, + "PartialEmoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "MessageType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 19, + 2, + 20, + 255, + 3, + 4, + 41, + 42, + 43, + 5, + 50, + 6, + 63, + 7, + 8, + 9 + ], + "type": "number" + }, + "InteractionType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "MessageComponent": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "style": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "custom_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + } + }, + "additionalProperties": false, + "required": [ + "components", + "type" + ] + }, + "VoiceState": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "session_id": { + "type": "string" + }, + "token": { + "type": "string" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "self_deaf": { + "type": "boolean" + }, + "self_mute": { + "type": "boolean" + }, + "self_stream": { + "type": "boolean" + }, + "self_video": { + "type": "boolean" + }, + "suppress": { + "type": "boolean" + }, + "request_to_speak_timestamp": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "deaf", + "guild_id", + "id", + "member", + "mute", + "self_deaf", + "self_mute", + "self_video", + "session_id", + "suppress", + "token", + "user", + "user_id" + ] + }, + "ReadState": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "last_message_id": { + "type": "string" + }, + "public_ack": { + "type": "string" + }, + "notifications_cursor": { + "type": "string" + }, + "last_pin_timestamp": { + "type": "string", + "format": "date-time" + }, + "mention_count": { + "type": "integer" + }, + "manual": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "id", + "last_message_id", + "manual", + "mention_count", + "notifications_cursor", + "public_ack", + "user", + "user_id" + ] + }, + "Ban": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "executor_id": { + "type": "string" + }, + "executor": { + "$ref": "#/definitions/User" + }, + "ip": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "executor", + "executor_id", + "guild", + "guild_id", + "id", + "ip", + "user", + "user_id" + ] + }, + "Template": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "usage_count": { + "type": "integer" + }, + "creator_id": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "serialized_source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "created_at", + "creator", + "creator_id", + "id", + "name", + "serialized_source_guild", + "source_guild", + "source_guild_id", + "updated_at" + ] + }, + "Emoji": { + "type": "object", + "properties": { + "animated": { + "type": "boolean" + }, + "available": { + "type": "boolean" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "managed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "require_colons": { + "type": "boolean" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "available", + "groups", + "guild", + "guild_id", + "id", + "managed", + "name", + "require_colons", + "roles", + "user", + "user_id" + ] + }, + "GuildWelcomeScreen": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "welcome_channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "description" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "enabled", + "welcome_channels" + ] + }, + "GuildMessagesSearchMessage": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "content": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/PublicUser" + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment_1" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicUser" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "pinned": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "tts": { + "type": "boolean" + }, + "timestamp": { + "type": "string" + }, + "edited_timestamp": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "components": { + "type": "array", + "items": {} + }, + "hit": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "additionalProperties": false, + "required": [ + "attachments", + "author", + "channel_id", + "components", + "edited_timestamp", + "embeds", + "flags", + "hit", + "id", + "mention_roles", + "mentions", + "pinned", + "timestamp", + "tts", + "type" + ] + }, + "PublicUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "avatar": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "bot": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ] + }, + "GuildVanityUrl": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "uses": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "code", + "uses" + ] + }, + "GuildVanityUrlNoInvite": { + "type": "object", + "properties": { + "code": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "code" + ] + }, + "ClientStatus": { + "type": "object", + "properties": { + "desktop": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "web": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Snowflake": { + "description": "A container for useful snowflake-related methods.", + "type": "object", + "additionalProperties": false + }, + "TenorGifResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "src": { + "type": "string" + }, + "gif_src": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "preview": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "gif_src", + "height", + "id", + "preview", + "src", + "title", + "url", + "width" + ] + }, + "BackupCode": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + }, + "code": { + "type": "string" + }, + "consumed": { + "type": "boolean" + }, + "expired": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "consumed", + "expired", + "id", + "user" + ] + }, + "APIGuild": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "reload": { + "description": "Reloads entity data from the database.", + "type": "object", + "additionalProperties": false + }, + "id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "parent": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "toJSON": { + "type": "object", + "additionalProperties": false + }, + "_do_validate": { + "type": "object", + "additionalProperties": false + }, + "assign": { + "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 + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "banner": { + "type": "string" + }, + "description": { + "type": "string" + }, + "unavailable": { + "type": "boolean" + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "region": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, + "afk_channel_id": { + "type": "string" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "default_message_notifications": { + "type": "integer" + }, + "discovery_splash": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "primary_category_id": { + "type": "string" + }, + "large": { + "type": "boolean" + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "template_id": { + "type": "string" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "mfa_level": { + "type": "integer" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_flags": { + "type": "integer" + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_enabled": { + "type": "boolean" + }, + "nsfw_level": { + "type": "integer" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean" + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "_do_validate", + "assign", + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "hasId", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "recover", + "reload", + "remove", + "roles", + "save", + "softRemove", + "stickers", + "toJSON", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "DmChannelDTO": { + "type": "object", + "properties": { + "icon": { + "type": [ + "null", + "string" + ] + }, + "id": { + "type": "string" + }, + "last_message_id": { + "type": [ + "null", + "string" + ] + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "origin_channel_id": { + "type": [ + "null", + "string" + ] + }, + "owner_id": { + "type": "string" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/MinimalPublicUserDTO" + } + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "icon", + "id", + "last_message_id", + "name", + "origin_channel_id", + "recipients", + "type" + ] + }, + "MinimalPublicUserDTO": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": [ + "null", + "string" + ], + "default": null + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "avatar": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "discriminator", + "global_name", + "id", + "public_flags", + "username" + ] + }, + "Categories": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "localizations": { + "type": "string" + }, + "is_primary": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id", + "is_primary", + "localizations", + "name" + ] + }, + "GuildVoiceRegion": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "custom": { + "type": "boolean" + }, + "deprecated": { + "type": "boolean" + }, + "optimal": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "custom", + "deprecated", + "id", + "name", + "optimal" + ] + }, + "UserLimits": { + "type": "object", + "properties": { + "maxGuilds": { + "type": "integer", + "default": 1048576 + }, + "minUsername": { + "type": "integer", + "default": 2 + }, + "maxUsername": { + "type": "integer", + "default": 32 + }, + "maxFriends": { + "type": "integer", + "default": 5000 + } + }, + "additionalProperties": false, + "required": [ + "maxFriends", + "maxGuilds", + "maxUsername", + "minUsername" + ] + }, + "GuildLimits": { + "type": "object", + "properties": { + "maxRoles": { + "type": "integer", + "default": 1000 + }, + "maxEmojis": { + "type": "integer", + "default": 2000 + }, + "maxMembers": { + "type": "integer", + "default": 25000000 + }, + "maxChannels": { + "type": "integer", + "default": 65535 + }, + "maxChannelsInCategory": { + "type": "integer", + "default": 65535 + } + }, + "additionalProperties": false, + "required": [ + "maxChannels", + "maxChannelsInCategory", + "maxEmojis", + "maxMembers", + "maxRoles" + ] + }, + "MessageLimits": { + "type": "object", + "properties": { + "maxCharacters": { + "type": "integer", + "default": 1048576 + }, + "maxTTSCharacters": { + "type": "integer", + "default": 160 + }, + "maxReactions": { + "type": "integer", + "default": 2048 + }, + "maxAttachmentSize": { + "type": "integer", + "default": 1073741824 + }, + "maxBulkDelete": { + "type": "integer", + "default": 1000 + }, + "maxEmbedDownloadSize": { + "type": "integer", + "default": 5242880 + } + }, + "additionalProperties": false, + "required": [ + "maxAttachmentSize", + "maxBulkDelete", + "maxCharacters", + "maxEmbedDownloadSize", + "maxReactions", + "maxTTSCharacters" + ] + }, + "ChannelLimits": { + "type": "object", + "properties": { + "maxPins": { + "type": "integer", + "default": 500 + }, + "maxTopic": { + "type": "integer", + "default": 1024 + }, + "maxWebhooks": { + "type": "integer", + "default": 100 + } + }, + "additionalProperties": false, + "required": [ + "maxPins", + "maxTopic", + "maxWebhooks" + ] + }, + "RateLimits": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "ip": { + "$ref": "#/definitions/RateLimitOptions" + }, + "global": { + "$ref": "#/definitions/RateLimitOptions" + }, + "error": { + "$ref": "#/definitions/RateLimitOptions" + }, + "routes": { + "$ref": "#/definitions/RouteRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "error", + "global", + "ip", + "routes" + ] + }, + "RateLimitOptions": { + "type": "object", + "properties": { + "bot": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "window": { + "type": "integer" + }, + "onyIp": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "count", + "window" + ] + }, + "RouteRateLimit": { + "type": "object", + "properties": { + "guild": { + "$ref": "#/definitions/RateLimitOptions" + }, + "webhook": { + "$ref": "#/definitions/RateLimitOptions" + }, + "channel": { + "$ref": "#/definitions/RateLimitOptions" + }, + "auth": {} + }, + "additionalProperties": false, + "required": [ + "auth", + "channel", + "guild", + "webhook" + ] + }, + "GlobalRateLimits": { + "type": "object", + "properties": { + "register": { + "$ref": "#/definitions/GlobalRateLimit" + }, + "sendMessage": { + "$ref": "#/definitions/GlobalRateLimit" + } + }, + "additionalProperties": false, + "required": [ + "register", + "sendMessage" + ] + }, + "GlobalRateLimit": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "default": 100 + }, + "window": { + "type": "integer", + "default": 3600000 + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false, + "required": [ + "enabled", + "limit", + "window" + ] + }, + "PublicConnectedAccount": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "UserProfile": { + "type": "object", + "properties": { + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio" + ] + }, + "TokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "settings": { + "$ref": "#/definitions/UserSettings" + } + }, + "additionalProperties": false, + "required": [ + "settings", + "token" + ] + }, + "MFAResponse": { + "type": "object", + "properties": { + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token" + ] + }, + "WebAuthnResponse": { + "type": "object", + "properties": { + "webauthn": { + "type": "string" + }, + "ticket": { + "type": "string" + }, + "mfa": { + "type": "boolean", + "enum": [ + true + ] + }, + "sms": { + "type": "boolean", + "enum": [ + false + ] + }, + "token": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "mfa", + "sms", + "ticket", + "token", + "webauthn" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "APIStickerArray": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + }, + "definitions": { + "ChannelPermissionOverwriteType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "ConnectedAccountTokenData": { + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "token_type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "expires_at": { + "type": "integer" + }, + "fetched_at": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "access_token", + "fetched_at" + ] + }, + "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" + } + } + }, + "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" + }, + "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 + }, + "ChannelOverride": { + "type": "object", + "properties": { + "message_notifications": { + "type": "integer" + }, + "mute_config": { + "$ref": "#/definitions/MuteConfig" + }, + "muted": { + "type": "boolean" + }, + "channel_id": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "message_notifications", + "mute_config", + "muted" + ] + }, + "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" + ] + }, + "GenerateWebAuthnCredentialsSchema": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "password" + ] + }, + "CreateWebAuthnCredentialSchema": { + "type": "object", + "properties": { + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "ticket": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "credential", + "name", + "ticket" + ] + }, + "APIErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "errors": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "_errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "message" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "_errors" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "code", + "errors", + "message" + ] + }, + "CaptchaRequiredResponse": { + "type": "object", + "properties": { + "captcha_key": { + "type": "string" + }, + "captcha_sitekey": { + "type": "string" + }, + "captcha_service": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "captcha_key", + "captcha_service", + "captcha_sitekey" + ] + }, + "Guild": { + "type": "object", + "properties": { + "afk_channel_id": { + "type": "string" + }, + "afk_channel": { + "$ref": "#/definitions/Channel" + }, + "afk_timeout": { + "type": "integer" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "banner": { + "type": "string" + }, + "default_message_notifications": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "discovery_splash": { + "type": "string" + }, + "explicit_content_filter": { + "type": "integer" + }, + "features": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "primary_category_id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "large": { + "type": "boolean", + "default": false + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "template_id": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/Template" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "mfa_level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "public_updates_channel": { + "$ref": "#/definitions/Channel" + }, + "rules_channel_id": { + "type": "string" + }, + "rules_channel": { + "type": "string" + }, + "region": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "system_channel": { + "$ref": "#/definitions/Channel" + }, + "system_channel_flags": { + "type": "integer" + }, + "unavailable": { + "type": "boolean", + "default": false + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_channel": { + "$ref": "#/definitions/Channel" + }, + "widget_enabled": { + "type": "boolean", + "default": true + }, + "nsfw_level": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "parent": { + "type": "string" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean", + "default": false + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "roles", + "stickers", + "template", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "Channel": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "name": { + "type": "string" + }, + "icon": { + "type": [ + "null", + "string" + ] + }, + "type": { + "$ref": "#/definitions/ChannelType" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/Recipient" + } + }, + "last_message_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "parent_id": { + "type": "string" + }, + "parent": { + "$ref": "#/definitions/Channel" + }, + "owner_id": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "last_pin_timestamp": { + "type": "integer" + }, + "default_auto_archive_duration": { + "type": "integer" + }, + "permission_overwrites": { + "type": "array", + "items": { + "$ref": "#/definitions/ChannelPermissionOverwrite" + } + }, + "video_quality_mode": { + "type": "integer" + }, + "bitrate": { + "type": "integer" + }, + "user_limit": { + "type": "integer" + }, + "nsfw": { + "type": "boolean", + "default": false + }, + "rate_limit_per_user": { + "type": "integer" + }, + "topic": { + "type": "string" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "retention_policy_id": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/Message" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "read_states": { + "type": "array", + "items": { + "$ref": "#/definitions/ReadState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "flags": { + "type": "integer", + "default": 0 + }, + "default_thread_rate_limit_per_user": { + "type": "integer", + "default": 0 + }, + "position": { + "description": "Must be calculated Channel.calculatePosition", + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "created_at", + "default_thread_rate_limit_per_user", + "flags", + "id", + "nsfw", + "owner", + "parent_id", + "position", + "type" + ] + }, + "ChannelType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 2, + 255, + 3, + 33, + 34, + 35, + 4, + 5, + 6, + 64, + 7, + 8, + 9 + ], + "type": "number" + }, + "Recipient": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "closed": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "closed", + "id", + "user", + "user_id" + ] + }, + "User": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "desktop": { + "type": "boolean", + "default": false + }, + "mobile": { + "type": "boolean", + "default": false + }, + "premium": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "bot": { + "type": "boolean", + "default": false + }, + "bio": { + "type": "string", + "default": "" + }, + "system": { + "type": "boolean", + "default": false + }, + "nsfw_allowed": { + "type": "boolean", + "default": true + }, + "mfa_enabled": { + "type": "boolean", + "default": false + }, + "webauthn_enabled": { + "type": "boolean", + "default": false + }, + "totp_secret": { + "type": "string", + "default": "" + }, + "totp_last_ticket": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "verified": { + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "default": false + }, + "deleted": { + "type": "boolean", + "default": false + }, + "email": { + "type": "string" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "public_flags": { + "type": "integer", + "default": 0 + }, + "purchased_flags": { + "type": "integer", + "default": 0 + }, + "premium_usage_flags": { + "type": "integer", + "default": 0 + }, + "rights": { + "type": "string" + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/definitions/Session" + } + }, + "relationships": { + "type": "array", + "items": { + "$ref": "#/definitions/Relationship" + } + }, + "connected_accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/ConnectedAccount" + } + }, + "data": { + "type": "object", + "properties": { + "valid_tokens_since": { + "type": "string", + "format": "date-time" + }, + "hash": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "valid_tokens_since" + ] + }, + "fingerprints": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "settings": { + "$ref": "#/definitions/UserSettings" + }, + "extended_settings": { + "type": "string", + "default": "{}" + }, + "security_keys": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityKey" + } + }, + "tag": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "connected_accounts", + "created_at", + "data", + "deleted", + "desktop", + "disabled", + "discriminator", + "extended_settings", + "fingerprints", + "flags", + "id", + "mfa_enabled", + "mobile", + "nsfw_allowed", + "premium", + "premium_since", + "premium_type", + "premium_usage_flags", + "public_flags", + "purchased_flags", + "relationships", + "rights", + "security_keys", + "sessions", + "settings", + "system", + "tag", + "username", + "verified", + "webauthn_enabled" + ] + }, + "Session": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "session_id": { + "type": "string" + }, + "activities": { + "type": "array", + "items": { + "$ref": "#/definitions/Activity" + } + }, + "client_info": { + "type": "object", + "properties": { + "client": { + "type": "string" + }, + "os": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "client", + "os", + "version" + ] + }, + "status": { + "$ref": "#/definitions/Status" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "activities", + "client_info", + "id", + "session_id", + "status", + "user", + "user_id" + ] + }, + "Relationship": { + "type": "object", + "properties": { + "from_id": { + "type": "string" + }, + "from": { + "$ref": "#/definitions/User" + }, + "to_id": { + "type": "string" + }, + "to": { + "$ref": "#/definitions/User" + }, + "nickname": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/RelationshipType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "from", + "from_id", + "id", + "to", + "to_id", + "type" + ] + }, + "RelationshipType": { + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "number" + }, + "ConnectedAccount": { + "type": "object", + "properties": { + "external_id": { + "type": "string" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "friend_sync": { + "type": "boolean", + "default": false + }, + "name": { + "type": "string" + }, + "revoked": { + "type": "boolean", + "default": false + }, + "show_activity": { + "type": "integer", + "default": 0 + }, + "type": { + "type": "string" + }, + "verified": { + "type": "boolean", + "default": true + }, + "visibility": { + "type": "integer", + "default": 0 + }, + "integrations": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "metadata_": {}, + "metadata_visibility": { + "type": "integer", + "default": 0 + }, + "two_way_link": { + "type": "boolean", + "default": false + }, + "token_data": { + "anyOf": [ + { + "$ref": "#/definitions/ConnectedAccountTokenData" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "external_id", + "id", + "name", + "type", + "user", + "user_id" + ] + }, + "UserSettings": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "afk_timeout": { + "type": "integer", + "default": 3600 + }, + "allow_accessibility_detection": { + "type": "boolean", + "default": true + }, + "animate_emoji": { + "type": "boolean", + "default": true + }, + "animate_stickers": { + "type": "integer", + "default": 0 + }, + "contact_sync_enabled": { + "type": "boolean", + "default": false + }, + "convert_emoticons": { + "type": "boolean", + "default": false + }, + "custom_status": { + "anyOf": [ + { + "$ref": "#/definitions/CustomStatus" + }, + { + "type": "null" + } + ], + "default": null + }, + "default_guilds_restricted": { + "type": "boolean", + "default": false + }, + "detect_platform_accounts": { + "type": "boolean", + "default": false + }, + "developer_mode": { + "type": "boolean", + "default": true + }, + "disable_games_tab": { + "type": "boolean", + "default": true + }, + "enable_tts_command": { + "type": "boolean", + "default": false + }, + "explicit_content_filter": { + "type": "integer", + "default": 0 + }, + "friend_source_flags": { + "$ref": "#/definitions/FriendSourceFlags" + }, + "gateway_connected": { + "type": "boolean", + "default": false + }, + "gif_auto_play": { + "type": "boolean", + "default": false + }, + "guild_folders": { + "type": "array", + "items": { + "$ref": "#/definitions/GuildFolder" + }, + "default": [] + }, + "guild_positions": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "inline_attachment_media": { + "type": "boolean", + "default": true + }, + "inline_embed_media": { + "type": "boolean", + "default": true + }, + "locale": { + "type": "string", + "default": "en-US" + }, + "message_display_compact": { + "type": "boolean", + "default": false + }, + "native_phone_integration_enabled": { + "type": "boolean", + "default": true + }, + "render_embeds": { + "type": "boolean", + "default": true + }, + "render_reactions": { + "type": "boolean", + "default": true + }, + "restricted_guilds": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "show_current_game": { + "type": "boolean", + "default": true + }, + "status": { + "enum": [ + "dnd", + "idle", + "invisible", + "offline", + "online" + ], + "type": "string", + "default": "online" + }, + "stream_notifications_enabled": { + "type": "boolean", + "default": false + }, + "theme": { + "enum": [ + "dark", + "light" + ], + "type": "string", + "default": "dark" + }, + "timezone_offset": { + "type": "integer", + "default": 0 + } + }, + "additionalProperties": false, + "required": [ + "afk_timeout", + "allow_accessibility_detection", + "animate_emoji", + "animate_stickers", + "contact_sync_enabled", + "convert_emoticons", + "custom_status", + "default_guilds_restricted", + "detect_platform_accounts", + "developer_mode", + "disable_games_tab", + "enable_tts_command", + "explicit_content_filter", + "friend_source_flags", + "gateway_connected", + "gif_auto_play", + "guild_folders", + "guild_positions", + "index", + "inline_attachment_media", + "inline_embed_media", + "locale", + "message_display_compact", + "native_phone_integration_enabled", + "render_embeds", + "render_reactions", + "restricted_guilds", + "show_current_game", + "status", + "stream_notifications_enabled", + "theme", + "timezone_offset" + ] + }, + "SecurityKey": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "key_id": { + "type": "string" + }, + "public_key": { + "type": "string" + }, + "counter": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "counter", + "id", + "key_id", + "name", + "public_key", + "user", + "user_id" + ] + }, + "ChannelPermissionOverwrite": { + "type": "object", + "properties": { + "allow": { + "type": "string" + }, + "deny": { + "type": "string" + }, + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ChannelPermissionOverwriteType" + } + }, + "additionalProperties": false, + "required": [ + "allow", + "deny", + "id", + "type" + ] + }, + "Invite": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "temporary": { + "type": "boolean" + }, + "uses": { + "type": "integer" + }, + "max_uses": { + "type": "integer" + }, + "max_age": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "expires_at": { + "type": "string", + "format": "date-time" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "inviter_id": { + "type": "string" + }, + "inviter": { + "$ref": "#/definitions/User" + }, + "target_user_id": { + "type": "string" + }, + "target_user": { + "type": "string" + }, + "target_user_type": { + "type": "integer" + }, + "vanity_url": { + "type": "boolean" + }, + "flags": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "code", + "created_at", + "flags", + "guild", + "guild_id", + "inviter", + "max_age", + "max_uses", + "target_user_id", + "temporary", + "uses" + ] + }, + "Message": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "author_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/User" + }, + "member_id": { + "type": "string" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "webhook_id": { + "type": "string" + }, + "webhook": { + "$ref": "#/definitions/Webhook" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "content": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "edited_timestamp": { + "type": "string", + "format": "date-time" + }, + "tts": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "mention_channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "sticker_items": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment_1" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "reactions": { + "type": "array", + "items": { + "$ref": "#/definitions/Reaction" + } + }, + "nonce": { + "type": "string" + }, + "pinned": { + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "activity": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "party_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "party_id", + "type" + ] + }, + "flags": { + "type": "integer" + }, + "message_reference": { + "type": "object", + "properties": { + "message_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "guild_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message_id" + ] + }, + "referenced_message": { + "$ref": "#/definitions/Message" + }, + "interaction": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/InteractionType" + }, + "name": { + "type": "string" + }, + "user_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "type", + "user_id" + ] + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "embeds", + "id", + "mention_channels", + "mention_roles", + "mentions", + "reactions", + "timestamp", + "type" + ] + }, + "Member": { + "type": "object", + "properties": { + "index": { + "type": "string" + }, + "id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "nick": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "integer" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "pending": { + "type": "boolean" + }, + "settings": { + "$ref": "#/definitions/UserGuildSettings" + }, + "last_message_id": { + "type": "string" + }, + "joined_by": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + }, + "communication_disabled_until": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "banner", + "bio", + "communication_disabled_until", + "deaf", + "guild", + "guild_id", + "id", + "index", + "joined_at", + "joined_by", + "mute", + "pending", + "roles", + "settings", + "user" + ] + }, + "Role": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "color": { + "type": "integer" + }, + "hoist": { + "type": "boolean" + }, + "managed": { + "type": "boolean" + }, + "mentionable": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "unicode_emoji": { + "type": "string" + }, + "tags": { + "type": "object", + "properties": { + "bot_id": { + "type": "string" + }, + "integration_id": { + "type": "string" + }, + "premium_subscriber": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "flags": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "flags", + "guild", + "guild_id", + "hoist", + "id", + "managed", + "mentionable", + "name", + "permissions", + "position" + ] + }, + "UserGuildSettings": { + "type": "object", + "properties": { + "channel_overrides": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChannelOverride" + } + }, + { + "type": "null" + } + ] + }, + "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" + }, + "version": { + "type": "integer" + }, + "guild_id": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "mute_scheduled_events": { + "type": "boolean" + }, + "hide_muted_channels": { + "type": "boolean" + }, + "notify_highlights": { + "type": "number", + "enum": [ + 0 + ] + } + }, + "additionalProperties": false, + "required": [ + "channel_overrides", + "flags", + "guild_id", + "hide_muted_channels", + "message_notifications", + "mobile_push", + "mute_config", + "mute_scheduled_events", + "muted", + "notify_highlights", + "suppress_everyone", + "suppress_roles", + "version" + ] + }, + "Webhook": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/WebhookType" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "token": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "application_id": { + "type": "string" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "application_id", + "channel", + "channel_id", + "guild", + "guild_id", + "id", + "source_guild", + "source_guild_id", + "type", + "user", + "user_id" + ] + }, + "WebhookType": { + "enum": [ + 1, + 2, + 3 + ], + "type": "number" + }, + "Application": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "description": { + "type": "string" + }, + "summary": { + "type": "string", + "default": "" + }, + "type": { + "type": "object", + "properties": {}, + "additionalProperties": true + }, + "hook": { + "type": "boolean", + "default": true + }, + "bot_public": { + "type": "boolean", + "default": true + }, + "bot_require_code_grant": { + "type": "boolean", + "default": false + }, + "verify_key": { + "type": "string" + }, + "owner": { + "$ref": "#/definitions/User" + }, + "flags": { + "type": "integer", + "default": 0 + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "rpc_application_state": { + "type": "integer", + "default": 0 + }, + "store_application_state": { + "type": "integer", + "default": 1 + }, + "verification_state": { + "type": "integer", + "default": 1 + }, + "interactions_endpoint_url": { + "type": "string" + }, + "integration_public": { + "type": "boolean", + "default": true + }, + "integration_require_code_grant": { + "type": "boolean", + "default": false + }, + "discoverability_state": { + "type": "integer", + "default": 1 + }, + "discovery_eligibility_flags": { + "type": "integer", + "default": 2240 + }, + "bot": { + "$ref": "#/definitions/User" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "cover_image": { + "type": "string" + }, + "install_params": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "permissions", + "scopes" + ] + }, + "terms_of_service_url": { + "type": "string" + }, + "privacy_policy_url": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "description", + "discoverability_state", + "discovery_eligibility_flags", + "flags", + "hook", + "id", + "integration_public", + "integration_require_code_grant", + "name", + "owner", + "redirect_uris", + "rpc_application_state", + "store_application_state", + "summary", + "verification_state", + "verify_key" + ] + }, + "Team": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/TeamMember" + } + }, + "name": { + "type": "string" + }, + "owner_user_id": { + "type": "string" + }, + "owner_user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "members", + "name", + "owner_user", + "owner_user_id" + ] + }, + "TeamMember": { + "type": "object", + "properties": { + "membership_state": { + "$ref": "#/definitions/TeamMemberState" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "team_id": { + "type": "string" + }, + "team": { + "$ref": "#/definitions/Team" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "membership_state", + "permissions", + "team", + "team_id", + "user", + "user_id" + ] + }, + "TeamMemberState": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "Sticker": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "available": { + "type": "boolean" + }, + "tags": { + "type": "string" + }, + "pack_id": { + "type": "string" + }, + "pack": { + "$ref": "#/definitions/StickerPack" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "type": { + "$ref": "#/definitions/StickerType" + }, + "format_type": { + "$ref": "#/definitions/StickerFormatType" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "format_type", + "id", + "name", + "pack", + "type" + ] + }, + "StickerPack": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "banner_asset_id": { + "type": "string" + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "cover_sticker_id": { + "type": "string" + }, + "cover_sticker": { + "$ref": "#/definitions/Sticker" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "stickers" + ] + }, + "StickerType": { + "enum": [ + 1, + 2 + ], + "type": "number" + }, + "StickerFormatType": { + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "number" + }, + "Attachment_1": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "proxy_url": { + "type": "string" + }, + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "content_type": { + "type": "string" + }, + "message_id": { + "type": "string" + }, + "message": { + "$ref": "#/definitions/Message" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "id", + "message", + "message_id", + "proxy_url", + "size", + "url" + ] + }, + "Reaction": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "user_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "count", + "emoji", + "user_ids" + ] + }, + "PartialEmoji": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "animated": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "MessageType": { + "enum": [ + 0, + 1, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 19, + 2, + 20, + 255, + 3, + 4, + 41, + 42, + 43, + 5, + 50, + 6, + 63, + 7, + 8, + 9 + ], + "type": "number" + }, + "InteractionType": { + "enum": [ + 0, + 1, + 2 + ], + "type": "number" + }, + "MessageComponent": { + "type": "object", + "properties": { + "type": { + "type": "integer" + }, + "style": { + "type": "integer" + }, + "label": { + "type": "string" + }, + "emoji": { + "$ref": "#/definitions/PartialEmoji" + }, + "custom_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "components": { + "type": "array", + "items": { + "$ref": "#/definitions/MessageComponent" + } + } + }, + "additionalProperties": false, + "required": [ + "components", + "type" + ] + }, + "VoiceState": { + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "member": { + "$ref": "#/definitions/Member" + }, + "session_id": { + "type": "string" + }, + "token": { + "type": "string" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "self_deaf": { + "type": "boolean" + }, + "self_mute": { + "type": "boolean" + }, + "self_stream": { + "type": "boolean" + }, + "self_video": { + "type": "boolean" + }, + "suppress": { + "type": "boolean" + }, + "request_to_speak_timestamp": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "deaf", + "guild_id", + "id", + "member", + "mute", + "self_deaf", + "self_mute", + "self_video", + "session_id", + "suppress", + "token", + "user", + "user_id" + ] + }, + "ReadState": { + "type": "object", + "properties": { + "channel_id": { + "type": "string" + }, + "channel": { + "$ref": "#/definitions/Channel" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "last_message_id": { + "type": "string" + }, + "public_ack": { + "type": "string" + }, + "notifications_cursor": { + "type": "string" + }, + "last_pin_timestamp": { + "type": "string", + "format": "date-time" + }, + "mention_count": { + "type": "integer" + }, + "manual": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel", + "channel_id", + "id", + "last_message_id", + "manual", + "mention_count", + "notifications_cursor", + "public_ack", + "user", + "user_id" + ] + }, + "Ban": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "executor_id": { + "type": "string" + }, + "executor": { + "$ref": "#/definitions/User" + }, + "ip": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "executor", + "executor_id", + "guild", + "guild_id", + "id", + "ip", + "user", + "user_id" + ] + }, + "Template": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "usage_count": { + "type": "integer" + }, + "creator_id": { + "type": "string" + }, + "creator": { + "$ref": "#/definitions/User" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "source_guild_id": { + "type": "string" + }, + "source_guild": { + "$ref": "#/definitions/Guild" + }, + "serialized_source_guild": { + "$ref": "#/definitions/Guild" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "created_at", + "creator", + "creator_id", + "id", + "name", + "serialized_source_guild", + "source_guild", + "source_guild_id", + "updated_at" + ] + }, + "Emoji": { + "type": "object", + "properties": { + "animated": { + "type": "boolean" + }, + "available": { + "type": "boolean" + }, + "guild_id": { + "type": "string" + }, + "guild": { + "$ref": "#/definitions/Guild" + }, + "user_id": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/User" + }, + "managed": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "require_colons": { + "type": "boolean" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "animated", + "available", + "groups", + "guild", + "guild_id", + "id", + "managed", + "name", + "require_colons", + "roles", + "user", + "user_id" + ] + }, + "GuildWelcomeScreen": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "welcome_channels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "emoji_id": { + "type": "string" + }, + "emoji_name": { + "type": "string" + }, + "channel_id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "channel_id", + "description" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "enabled", + "welcome_channels" + ] + }, + "GuildMessagesSearchMessage": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/MessageType" + }, + "content": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "author": { + "$ref": "#/definitions/PublicUser" + }, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment_1" + } + }, + "embeds": { + "type": "array", + "items": { + "$ref": "#/definitions/Embed" + } + }, + "mentions": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicUser" + } + }, + "mention_roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "pinned": { + "type": "boolean" + }, + "mention_everyone": { + "type": "boolean" + }, + "tts": { + "type": "boolean" + }, + "timestamp": { + "type": "string" + }, + "edited_timestamp": { + "type": [ + "null", + "string" + ] + }, + "flags": { + "type": "integer" + }, + "components": { + "type": "array", + "items": {} + }, + "hit": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "additionalProperties": false, + "required": [ + "attachments", + "author", + "channel_id", + "components", + "edited_timestamp", + "embeds", + "flags", + "hit", + "id", + "mention_roles", + "mentions", + "pinned", + "timestamp", + "tts", + "type" + ] + }, + "PublicUser": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "avatar": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "accent_color": { + "type": "integer" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "bot": { + "type": "boolean" + }, + "premium_type": { + "type": "integer" + }, + "theme_colors": { + "type": "array", + "items": { + "type": "integer" + } + }, + "pronouns": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "bio", + "bot", + "discriminator", + "id", + "premium_since", + "premium_type", + "public_flags", + "username" + ] + }, + "GuildVanityUrl": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "uses": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "code", + "uses" + ] + }, + "GuildVanityUrlNoInvite": { + "type": "object", + "properties": { + "code": { + "type": "null" + } + }, + "additionalProperties": false, + "required": [ + "code" + ] + }, + "ClientStatus": { + "type": "object", + "properties": { + "desktop": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "web": { + "type": "string" + } + }, + "additionalProperties": false + }, + "Snowflake": { + "description": "A container for useful snowflake-related methods.", + "type": "object", + "additionalProperties": false + }, + "TenorGifResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "src": { + "type": "string" + }, + "gif_src": { + "type": "string" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "preview": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "gif_src", + "height", + "id", + "preview", + "src", + "title", + "url", + "width" + ] + }, + "BackupCode": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/User" + }, + "code": { + "type": "string" + }, + "consumed": { + "type": "boolean" + }, + "expired": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "consumed", + "expired", + "id", + "user" + ] + }, + "APIGuild": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "reload": { + "description": "Reloads entity data from the database.", + "type": "object", + "additionalProperties": false + }, + "id": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "parent": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "invites": { + "type": "array", + "items": { + "$ref": "#/definitions/Invite" + } + }, + "voice_states": { + "type": "array", + "items": { + "$ref": "#/definitions/VoiceState" + } + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/Webhook" + } + }, + "toJSON": { + "type": "object", + "additionalProperties": false + }, + "_do_validate": { + "type": "object", + "additionalProperties": false + }, + "assign": { + "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 + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "banner": { + "type": "string" + }, + "description": { + "type": "string" + }, + "unavailable": { + "type": "boolean" + }, + "channels": { + "type": "array", + "items": { + "$ref": "#/definitions/Channel" + } + }, + "region": { + "type": "string" + }, + "system_channel_id": { + "type": "string" + }, + "rules_channel_id": { + "type": "string" + }, + "afk_timeout": { + "type": "integer" + }, + "explicit_content_filter": { + "type": "integer" + }, + "afk_channel_id": { + "type": "string" + }, + "bans": { + "type": "array", + "items": { + "$ref": "#/definitions/Ban" + } + }, + "default_message_notifications": { + "type": "integer" + }, + "discovery_splash": { + "type": "string" + }, + "features": { + "type": "array", + "items": { + "type": "string" + } + }, + "primary_category_id": { + "type": "string" + }, + "large": { + "type": "boolean" + }, + "max_members": { + "type": "integer" + }, + "max_presences": { + "type": "integer" + }, + "max_video_channel_users": { + "type": "integer" + }, + "member_count": { + "type": "integer" + }, + "presence_count": { + "type": "integer" + }, + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/Member" + } + }, + "template_id": { + "type": "string" + }, + "emojis": { + "type": "array", + "items": { + "$ref": "#/definitions/Emoji" + } + }, + "stickers": { + "type": "array", + "items": { + "$ref": "#/definitions/Sticker" + } + }, + "mfa_level": { + "type": "integer" + }, + "preferred_locale": { + "type": "string" + }, + "premium_subscription_count": { + "type": "integer" + }, + "premium_tier": { + "type": "integer" + }, + "public_updates_channel_id": { + "type": "string" + }, + "splash": { + "type": "string" + }, + "system_channel_flags": { + "type": "integer" + }, + "verification_level": { + "type": "integer" + }, + "welcome_screen": { + "$ref": "#/definitions/GuildWelcomeScreen" + }, + "widget_channel_id": { + "type": "string" + }, + "widget_enabled": { + "type": "boolean" + }, + "nsfw_level": { + "type": "integer" + }, + "permissions": { + "type": "integer" + }, + "premium_progress_bar_enabled": { + "type": "boolean" + }, + "channel_ordering": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "_do_validate", + "assign", + "bans", + "channel_ordering", + "channels", + "emojis", + "features", + "hasId", + "id", + "invites", + "members", + "name", + "nsfw", + "premium_progress_bar_enabled", + "public_updates_channel_id", + "recover", + "reload", + "remove", + "roles", + "save", + "softRemove", + "stickers", + "toJSON", + "unavailable", + "voice_states", + "webhooks", + "welcome_screen", + "widget_enabled" + ] + }, + "DmChannelDTO": { + "type": "object", + "properties": { + "icon": { + "type": [ + "null", + "string" + ] + }, + "id": { + "type": "string" + }, + "last_message_id": { + "type": [ + "null", + "string" + ] + }, + "name": { + "type": [ + "null", + "string" + ] + }, + "origin_channel_id": { + "type": [ + "null", + "string" + ] + }, + "owner_id": { + "type": "string" + }, + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/MinimalPublicUserDTO" + } + }, + "type": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "icon", + "id", + "last_message_id", + "name", + "origin_channel_id", + "recipients", + "type" + ] + }, + "MinimalPublicUserDTO": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { + "type": [ + "null", + "string" + ], + "default": null + }, + "discriminator": { + "type": "string" + }, + "public_flags": { + "type": "integer" + }, + "avatar": { + "type": [ + "null", + "string" + ] + } + }, + "additionalProperties": false, + "required": [ + "discriminator", + "global_name", + "id", + "public_flags", + "username" + ] + }, + "Categories": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "localizations": { + "type": "string" + }, + "is_primary": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "id", + "is_primary", + "localizations", + "name" + ] + }, + "GuildVoiceRegion": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "custom": { + "type": "boolean" + }, + "deprecated": { + "type": "boolean" + }, + "optimal": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "custom", + "deprecated", + "id", + "name", + "optimal" + ] + }, + "UserLimits": { + "type": "object", + "properties": { + "maxGuilds": { + "type": "integer", + "default": 1048576 + }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -459452,7 +468666,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -459790,10 +469005,10 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIStickerArray": { + "APITemplateArray": { "type": "array", "items": { - "$ref": "#/definitions/Sticker" + "$ref": "#/definitions/Template" }, "definitions": { "ChannelPermissionOverwriteType": { @@ -463664,6 +472879,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -463677,7 +472896,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -464015,10 +473235,10 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APITemplateArray": { + "APIGuildVoiceRegion": { "type": "array", "items": { - "$ref": "#/definitions/Template" + "$ref": "#/definitions/GuildVoiceRegion" }, "definitions": { "ChannelPermissionOverwriteType": { @@ -467889,6 +477109,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -467902,7 +477126,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -468240,11 +477465,37 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIGuildVoiceRegion": { - "type": "array", - "items": { - "$ref": "#/definitions/GuildVoiceRegion" + "APILimitsConfiguration": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/UserLimits" + }, + "guild": { + "$ref": "#/definitions/GuildLimits" + }, + "message": { + "$ref": "#/definitions/MessageLimits" + }, + "channel": { + "$ref": "#/definitions/ChannelLimits" + }, + "rate": { + "$ref": "#/definitions/RateLimits" + }, + "absoluteRate": { + "$ref": "#/definitions/GlobalRateLimits" + } }, + "additionalProperties": false, + "required": [ + "absoluteRate", + "channel", + "guild", + "message", + "rate", + "user" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -472114,6 +481365,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -472127,7 +481382,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -472465,37 +481721,11 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APILimitsConfiguration": { - "type": "object", - "properties": { - "user": { - "$ref": "#/definitions/UserLimits" - }, - "guild": { - "$ref": "#/definitions/GuildLimits" - }, - "message": { - "$ref": "#/definitions/MessageLimits" - }, - "channel": { - "$ref": "#/definitions/ChannelLimits" - }, - "rate": { - "$ref": "#/definitions/RateLimits" - }, - "absoluteRate": { - "$ref": "#/definitions/GlobalRateLimits" - } + "APIStickerPackArray": { + "type": "array", + "items": { + "$ref": "#/definitions/StickerPack" }, - "additionalProperties": false, - "required": [ - "absoluteRate", - "channel", - "guild", - "message", - "rate", - "user" - ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -476365,6 +485595,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -476378,7 +485612,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -476716,11 +485951,32 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "APIStickerPackArray": { - "type": "array", - "items": { - "$ref": "#/definitions/StickerPack" + "UpdatesResponse": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "pub_date": { + "type": "string" + }, + "url": { + "type": "string" + }, + "notes": { + "type": [ + "null", + "string" + ] + } }, + "additionalProperties": false, + "required": [ + "name", + "notes", + "pub_date", + "url" + ], "definitions": { "ChannelPermissionOverwriteType": { "enum": [ @@ -480590,6 +489846,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -480603,7 +489863,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -480941,31 +490202,24 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UpdatesResponse": { + "UserNoteResponse": { "type": "object", "properties": { - "name": { + "note": { "type": "string" }, - "pub_date": { + "note_user_id": { "type": "string" }, - "url": { + "user_id": { "type": "string" - }, - "notes": { - "type": [ - "null", - "string" - ] } }, "additionalProperties": false, "required": [ - "name", - "notes", - "pub_date", - "url" + "note", + "note_user_id", + "user_id" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -484836,6 +494090,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -484849,7 +494107,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -485187,24 +494446,136 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserNoteResponse": { + "UserProfileResponse": { "type": "object", "properties": { - "note": { - "type": "string" + "user": { + "$ref": "#/definitions/PublicUser" }, - "note_user_id": { - "type": "string" + "connected_accounts": { + "$ref": "#/definitions/PublicConnectedAccount" }, - "user_id": { - "type": "string" + "premium_guild_since": { + "type": "string", + "format": "date-time" + }, + "premium_since": { + "type": "string", + "format": "date-time" + }, + "mutual_guilds": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "nick": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + } + }, + "premium_type": { + "type": "integer" + }, + "profile_themes_experiment_bucket": { + "type": "integer" + }, + "user_profile": { + "$ref": "#/definitions/UserProfile" + }, + "guild_member": { + "additionalProperties": false, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "guild_id": { + "type": "string" + }, + "nick": { + "type": "string" + }, + "joined_at": { + "type": "string", + "format": "date-time" + }, + "pending": { + "type": "boolean" + }, + "deaf": { + "type": "boolean" + }, + "mute": { + "type": "boolean" + }, + "premium_since": { + "type": "integer" + }, + "avatar": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/PublicUser" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "deaf", + "guild_id", + "id", + "joined_at", + "mute", + "pending", + "roles", + "user" + ] + }, + "guild_member_profile": { + "additionalProperties": false, + "type": "object", + "properties": { + "guild_id": { + "type": "string" + }, + "banner": { + "type": "string" + }, + "bio": { + "type": "string" + }, + "accent_color": { + "type": "null" + } + }, + "required": [ + "accent_color", + "banner", + "bio", + "guild_id" + ] } }, "additionalProperties": false, "required": [ - "note", - "note_user_id", - "user_id" + "connected_accounts", + "mutual_guilds", + "premium_type", + "profile_themes_experiment_bucket", + "user", + "user_profile" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -488510,6 +497881,11 @@ "public_flags": { "type": "integer" }, +<<<<<<< HEAD +======= + "avatar": { + "type": "string" + }, "accent_color": { "type": "integer" }, @@ -488884,12 +498260,6 @@ }, "premium_progress_bar_enabled": { "type": "boolean" - }, - "channel_ordering": { - "type": "array", - "items": { - "type": "string" - } } }, "additionalProperties": false, @@ -488897,7 +498267,6 @@ "_do_validate", "assign", "bans", - "channel_ordering", "channels", "emojis", "features", @@ -489075,6 +498444,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -489088,7 +498461,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -489426,136 +498800,28 @@ }, "$schema": "http://json-schema.org/draft-07/schema#" }, - "UserProfileResponse": { + "UserRelationshipsResponse": { "type": "object", "properties": { - "user": { - "$ref": "#/definitions/PublicUser" - }, - "connected_accounts": { - "$ref": "#/definitions/PublicConnectedAccount" - }, - "premium_guild_since": { - "type": "string", - "format": "date-time" - }, - "premium_since": { - "type": "string", - "format": "date-time" - }, - "mutual_guilds": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "nick": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id" - ] - } - }, - "premium_type": { - "type": "integer" - }, - "profile_themes_experiment_bucket": { - "type": "integer" + "id": { + "type": "string" }, - "user_profile": { - "$ref": "#/definitions/UserProfile" + "type": { + "$ref": "#/definitions/RelationshipType" }, - "guild_member": { - "additionalProperties": false, - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "guild_id": { - "type": "string" - }, - "nick": { - "type": "string" - }, - "joined_at": { - "type": "string", - "format": "date-time" - }, - "pending": { - "type": "boolean" - }, - "deaf": { - "type": "boolean" - }, - "mute": { - "type": "boolean" - }, - "premium_since": { - "type": "integer" - }, - "avatar": { - "type": "string" - }, - "user": { - "$ref": "#/definitions/PublicUser" - }, - "roles": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "deaf", - "guild_id", - "id", - "joined_at", - "mute", - "pending", - "roles", - "user" - ] + "nickname": { + "type": "null" }, - "guild_member_profile": { - "additionalProperties": false, - "type": "object", - "properties": { - "guild_id": { - "type": "string" - }, - "banner": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "accent_color": { - "type": "null" - } - }, - "required": [ - "accent_color", - "banner", - "bio", - "guild_id" - ] + "user": { + "$ref": "#/definitions/PublicUser" } }, "additionalProperties": false, "required": [ - "connected_accounts", - "mutual_guilds", - "premium_type", - "profile_themes_experiment_bucket", - "user", - "user_profile" + "id", + "nickname", + "type", + "user" ], "definitions": { "ChannelPermissionOverwriteType": { @@ -490442,12 +499708,6 @@ "type": "boolean", "default": false }, - "channel_ordering": { - "type": "array", - "items": { - "type": "string" - } - }, "id": { "type": "string" } @@ -490455,7 +499715,6 @@ "additionalProperties": false, "required": [ "bans", - "channel_ordering", "channels", "emojis", "features", @@ -490528,6 +499787,9 @@ "default_auto_archive_duration": { "type": "integer" }, + "position": { + "type": "integer" + }, "permission_overwrites": { "type": "array", "items": { @@ -490594,10 +499856,6 @@ "type": "integer", "default": 0 }, - "position": { - "description": "Must be calculated Channel.calculatePosition", - "type": "integer" - }, "id": { "type": "string" } @@ -490611,7 +499869,6 @@ "nsfw", "owner", "parent_id", - "position", "type" ] }, @@ -491672,6 +500929,7 @@ }, "additionalProperties": false, "required": [ + "avatar", "banner", "bio", "communication_disabled_until", @@ -492843,9 +502101,6 @@ "type": "string", "format": "date-time" }, - "avatar": { - "type": "string" - }, "username": { "type": "string" }, @@ -492861,6 +502116,10 @@ "public_flags": { "type": "integer" }, + "avatar": { + "type": "string" + }, +>>>>>>> 99963e1b (update user modify for unique usernames) "accent_color": { "type": "integer" }, @@ -493426,6 +502685,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -493439,7 +502702,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -501921,6 +511185,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -501934,7 +511202,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -506156,6 +515425,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -506169,7 +515442,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -510391,6 +519665,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -510404,7 +519682,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -514613,6 +523892,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -514626,7 +523909,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -518847,6 +528131,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -518860,7 +528148,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -523096,6 +532385,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -523109,7 +532402,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -527349,6 +536643,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -527362,7 +536660,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -531581,6 +540880,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -531594,7 +540897,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -535812,6 +545116,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -535825,7 +545133,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -540043,6 +549352,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -540056,7 +549369,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -544280,6 +553594,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -544293,7 +553611,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index fc44e17e..f4578126 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -70,6 +70,8 @@ router.patch( }), async (req: Request, res: Response) => { const body = req.body as UserModifySchema; + const { uniqueUsernames } = Config.get().general; + const { minUsername, maxUsername } = Config.get().limits.user; const user = await User.findOneOrFail({ where: { id: req.user_id }, @@ -140,8 +142,52 @@ router.patch( newToken = (await generateToken(user.id)) as string; } - // TODO: uniqueUsernames: disallow if uniqueUsernames is enabled if (body.username) { + // password is required to update username + if (!body.password) + throw FieldErrors({ + password: { + message: req.t("common:field.PASSWORD_DOES_NOT_MATCH"), + code: "PASSWORD_DOES_NOT_MATCH", + }, + }); + + // handle username changes (pomelo) + if (uniqueUsernames) { + body.username = body.username.toLowerCase(); + // validate username length + if ( + body.username.length < minUsername || + body.username.length > maxUsername + ) { + throw FieldErrors({ + username: { + code: "BASE_TYPE_BAD_LENGTH", + message: req.t( + "common:field.BASE_TYPE_BAD_LENGTH", + { length: `${minUsername} and ${maxUsername}` }, + ), + }, + }); + } + + // check if username is already taken (pomelo only) + const userCount = await User.count({ + where: { username: body.username }, + }); + if (userCount > 0) { + throw FieldErrors({ + username: { + code: "USERNAME_ALREADY_TAKEN", + message: req.t( + "common:field.USERNAME_ALREADY_TAKEN", + ), + }, + }); + } + } + + // handle username changes (old username system) const check_username = body?.username?.replace(/\s/g, ""); if (!check_username) { throw FieldErrors({ @@ -152,7 +198,6 @@ router.patch( }); } - const { maxUsername } = Config.get().limits.user; if (check_username.length > maxUsername) { throw FieldErrors({ username: { @@ -163,8 +208,18 @@ router.patch( } } - // TODO: uniqueUsernames: disallow if uniqueUsernames is enabled if (body.discriminator) { + if (uniqueUsernames) { + throw FieldErrors({ + username: { + code: "DISCRIMINATOR_UPDATE_BLOCKED", + message: req.t( + "common:field.DISCRIMINATOR_UPDATE_BLOCKED", + ), + }, + }); + } + if ( await User.findOne({ where: { @@ -176,7 +231,7 @@ router.patch( throw FieldErrors({ discriminator: { code: "INVALID_DISCRIMINATOR", - message: "This discriminator is already in use.", + message: req.t("common.field.INVALID_DISCRIMINATOR"), }, }); } diff --git a/src/util/config/types/subconfigurations/limits/UserLimits.ts b/src/util/config/types/subconfigurations/limits/UserLimits.ts index 8f9b1a97..77092344 100644 --- a/src/util/config/types/subconfigurations/limits/UserLimits.ts +++ b/src/util/config/types/subconfigurations/limits/UserLimits.ts @@ -18,6 +18,7 @@ export class UserLimits { maxGuilds: number = 1048576; + minUsername: number = 2; maxUsername: number = 32; maxFriends: number = 5000; } diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index acd2ea74..d1fbb5c2 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -38,7 +38,6 @@ import { UserSettings } from "./UserSettings"; export enum PublicUserEnum { username, global_name, - legacy_username, discriminator, id, public_flags, @@ -241,7 +240,7 @@ export class User extends BaseClass { // TODO: I don't like this method? validate() { - if (this.discriminator) { + if (this.discriminator && this.discriminator !== "0") { const discrim = Number(this.discriminator); if ( isNaN(discrim) || @@ -334,9 +333,8 @@ export class User extends BaseClass { public get tag(): string { const { uniqueUsernames } = Config.get().general; - // if uniqueUsernames is enabled, global_name should be set return uniqueUsernames - ? (this.global_name as string) + ? this.username : `${this.username}#${this.discriminator}`; } @@ -387,7 +385,7 @@ export class User extends BaseClass { }); const user = User.create({ - username: username, + username: uniqueUsernames ? username.toLowerCase() : username, discriminator, id: id || Snowflake.generate(), email: email, @@ -397,7 +395,6 @@ export class User extends BaseClass { }, extended_settings: "{}", settings: settings, - premium_since: Config.get().defaults.user.premium ? new Date() : undefined, diff --git a/src/util/schemas/UserModifySchema.ts b/src/util/schemas/UserModifySchema.ts index e155b9af..72d15dcb 100644 --- a/src/util/schemas/UserModifySchema.ts +++ b/src/util/schemas/UserModifySchema.ts @@ -38,4 +38,5 @@ export interface UserModifySchema { * @maxLength 4 */ discriminator?: string; + global_name?: string; } -- cgit 1.4.1