1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 18:32:29 +01:00

Fix typo in user validation

This commit is contained in:
Madeline 2022-10-26 18:45:25 +11:00
parent 3e9ead8b5e
commit f210344b07
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -221,21 +221,21 @@ export class User extends BaseClass {
const discrim = Number(this.discriminator);
if (this.discriminator.length > 4)
throw FieldErrors({
email: {
discriminator: {
message: "Discriminator cannot be more than 4 digits.",
code: "DISCRIMINATOR_INVALID",
},
});
if (isNaN(discrim))
throw FieldErrors({
email: {
discriminator: {
message: "Discriminator must be a number.",
code: "DISCRIMINATOR_INVALID",
},
});
if (discrim <= 0 || discrim >= 10000)
throw FieldErrors({
email: {
discriminator: {
message: "Discriminator must be a number.",
code: "DISCRIMINATOR_INVALID",
},