diff --git a/assets/locales/en/common.json b/assets/locales/en/common.json index edcafa1da..dcb97ec0b 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 1dac24744..93631abcf 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 aa32c6037..7ad7ae00f 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -4035,6 +4035,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -4047,7 +4051,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -5807,6 +5812,9 @@ "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } } }, diff --git a/assets/schemas.json b/assets/schemas.json index 9dc1d5d60..4a1da0d8a 100644 --- a/assets/schemas.json +++ b/assets/schemas.json @@ -4222,6 +4222,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -4235,7 +4239,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -8450,6 +8455,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -8463,7 +8472,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -12678,6 +12688,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -12691,7 +12705,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -16901,6 +16916,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -16914,7 +16933,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -21160,6 +21180,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -21173,7 +21197,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -25388,6 +25413,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -25401,7 +25430,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -29607,6 +29637,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -29620,7 +29654,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -33829,6 +33864,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -33842,7 +33881,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -38060,6 +38100,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -38073,7 +38117,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -42279,6 +42324,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -42292,7 +42341,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -46498,6 +46548,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -46511,7 +46565,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -50736,6 +50791,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -50749,7 +50808,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -54958,6 +55018,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -54971,7 +55035,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -59240,6 +59305,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -59253,7 +59322,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -63481,6 +63551,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -63494,7 +63568,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -67863,6 +67938,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -67876,7 +67955,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -72103,6 +72183,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -72116,7 +72200,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -76353,6 +76438,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -76366,7 +76455,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -80585,6 +80675,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -80598,7 +80692,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -84823,6 +84918,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -84836,7 +84935,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -89051,6 +89151,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -89064,7 +89168,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -93267,6 +93372,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -93280,7 +93389,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -97594,6 +97704,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -97607,7 +97721,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -101918,6 +102033,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -101931,7 +102050,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -106137,6 +106257,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -106150,7 +106274,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -110364,6 +110489,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -110377,7 +110506,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -114584,6 +114714,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -114597,7 +114731,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -118804,6 +118939,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -118817,7 +118956,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -123059,6 +123199,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -123072,7 +123216,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -127279,6 +127424,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -127292,7 +127441,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -131498,6 +131648,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -131511,7 +131665,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -135732,6 +135887,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -135745,7 +135904,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -139955,6 +140115,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -139968,7 +140132,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -144252,6 +144417,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -144265,7 +144434,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -148471,6 +148641,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -148484,7 +148658,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -152690,6 +152865,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -152703,7 +152882,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -156906,6 +157086,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -156919,7 +157103,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -161128,6 +161313,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -161141,7 +161330,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -165360,6 +165550,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -165373,7 +165567,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -169576,6 +169771,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -169589,7 +169788,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -173841,6 +174041,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -173854,7 +174058,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -174235,6 +174440,9 @@ "minLength": 4, "maxLength": 4, "type": "string" + }, + "global_name": { + "type": "string" } }, "additionalProperties": false, @@ -178092,6 +178300,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -178105,7 +178317,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -182308,6 +182521,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -182321,7 +182538,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -186549,6 +186767,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -186562,7 +186784,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -190879,6 +191102,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -190892,7 +191119,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -195094,6 +195322,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -195107,7 +195339,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -199348,6 +199581,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -199361,7 +199598,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -203590,6 +203828,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -203603,7 +203845,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -207884,6 +208127,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -207897,7 +208144,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -212100,6 +212348,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -212113,7 +212365,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -216324,6 +216577,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -216337,7 +216594,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -220538,6 +220796,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -220551,7 +220813,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -224758,6 +225021,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -224771,7 +225038,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -228978,6 +229246,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -228991,7 +229263,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -233198,6 +233471,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -233211,7 +233488,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -237450,6 +237728,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -237463,7 +237745,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -241674,6 +241957,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -241687,7 +241974,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -245888,6 +246176,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -245901,7 +246193,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -250108,6 +250401,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -250121,7 +250418,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -254339,6 +254637,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -254352,7 +254654,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -258584,6 +258887,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -258597,7 +258904,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -262800,6 +263108,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -262813,7 +263125,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -267019,6 +267332,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -267032,7 +267349,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -271270,6 +271588,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -271283,7 +271605,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -275486,6 +275809,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -275499,7 +275826,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -279781,6 +280109,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -279794,7 +280126,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -284004,6 +284337,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -284017,7 +284354,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -288220,6 +288558,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -288233,7 +288575,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -292436,6 +292779,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -292449,7 +292796,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -296659,6 +297007,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -296672,7 +297024,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -300879,6 +301232,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -300892,7 +301249,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -305095,6 +305453,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -305108,7 +305470,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -309393,6 +309756,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -309406,7 +309773,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -313620,6 +313988,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -313633,7 +314005,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -317848,6 +318221,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -317861,7 +318238,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -322126,6 +322504,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -322139,7 +322521,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -326363,6 +326746,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -326376,7 +326763,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -330606,6 +330994,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -330619,7 +331011,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -334843,6 +335236,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -334856,7 +335253,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -339059,6 +339457,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -339072,7 +339474,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -343303,6 +343706,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -343316,7 +343723,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -347559,6 +347967,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -347572,7 +347984,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -351769,6 +352182,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -351782,7 +352199,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -355989,6 +356407,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -356002,7 +356424,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -360205,6 +360628,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -360218,7 +360645,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -364428,6 +364856,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -364441,7 +364873,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -368848,6 +369281,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -368861,7 +369298,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -373055,6 +373493,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -373068,7 +373510,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -377362,6 +377805,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -377375,7 +377822,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -381572,6 +382020,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -381585,7 +382037,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -385782,6 +386235,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -385795,7 +386252,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -389992,6 +390450,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -390005,7 +390467,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -394302,6 +394765,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -394315,7 +394782,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -398510,6 +398978,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -398523,7 +398995,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -402718,6 +403191,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -402731,7 +403208,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -406926,6 +407404,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -406939,7 +407421,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -411136,6 +411619,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -411149,7 +411636,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -415346,6 +415834,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -415359,7 +415851,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -419556,6 +420049,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -419569,7 +420066,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -423766,6 +424264,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -423779,7 +424281,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -427976,6 +428479,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -427989,7 +428496,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -432255,6 +432763,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -432268,7 +432780,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -436465,6 +436978,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -436478,7 +436995,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -440675,6 +441193,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -440688,7 +441210,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -444885,6 +445408,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -444898,7 +445425,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -446398,6 +446926,12 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -446563,6 +447097,9 @@ "$ref": "#/definitions/SecurityKey" } }, + "tag": { + "type": "string" + }, "id": { "type": "string" } @@ -446597,6 +447134,7 @@ "sessions", "settings", "system", + "tag", "username", "verified", "webauthn_enabled" @@ -448556,6 +449094,12 @@ "username": { "type": "string" }, + "global_name": { + "type": "string" + }, + "legacy_username": { + "type": "string" + }, "discriminator": { "type": "string" }, @@ -449029,28 +449573,36 @@ "MinimalPublicUserDTO": { "type": "object", "properties": { - "avatar": { + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "global_name": { "type": [ "null", "string" - ] + ], + "default": null }, "discriminator": { "type": "string" }, - "id": { - "type": "string" - }, "public_flags": { "type": "integer" }, - "username": { - "type": "string" + "avatar": { + "type": [ + "null", + "string" + ] } }, "additionalProperties": false, "required": [ "discriminator", + "global_name", "id", "public_flags", "username" @@ -449115,6 +449667,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -449128,7 +449684,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -453554,6 +454111,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -453567,7 +454128,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -457764,6 +458326,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -457777,7 +458343,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -461974,6 +462541,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -461987,7 +462558,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -466184,6 +466756,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -466197,7 +466773,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -470394,6 +470971,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -470407,7 +470988,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -474630,6 +475212,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -474643,7 +475229,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -478840,6 +479427,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -478853,7 +479444,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -483071,6 +483663,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -483084,7 +483680,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -487295,6 +487892,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -487308,7 +487909,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -491628,6 +492230,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -491641,7 +492247,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -495856,6 +496463,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -495869,7 +496480,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -500093,6 +500705,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -500106,7 +500722,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -504313,6 +504930,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -504326,7 +504947,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -508533,6 +509155,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -508546,7 +509172,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -512740,6 +513367,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -512753,7 +513384,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -516959,6 +517591,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -516972,7 +517608,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -521193,6 +521830,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -521206,7 +521847,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -525431,6 +526073,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -525444,7 +526090,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -529648,6 +530295,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -529661,7 +530312,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -533864,6 +534516,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -533877,7 +534533,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -538080,6 +538737,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -538093,7 +538754,8 @@ "required": [ "maxFriends", "maxGuilds", - "maxUsername" + "maxUsername", + "minUsername" ] }, "GuildLimits": { @@ -542302,6 +542964,10 @@ "type": "integer", "default": 1048576 }, + "minUsername": { + "type": "integer", + "default": 2 + }, "maxUsername": { "type": "integer", "default": 32 @@ -542315,7 +542981,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 fc44e17e9..f4578126c 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 8f9b1a97f..77092344c 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 acd2ea748..d1fbb5c2b 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 e155b9af4..72d15dcb6 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; }