diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-27 11:11:16 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-27 11:11:16 +0200 |
commit | 845e77eed21d5e03994978ddee0ca0c613234b3f (patch) | |
tree | 75beee1614c80f1c8acd744aaeb02db68f46b2ac /util/src/entities/User.ts | |
parent | :construction: api (diff) | |
download | server-845e77eed21d5e03994978ddee0ca0c613234b3f.tar.xz |
:construction: typeorm
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r-- | util/src/entities/User.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts index bdf0d35f..03cb3af4 100644 --- a/util/src/entities/User.ts +++ b/util/src/entities/User.ts @@ -29,8 +29,8 @@ export class User extends BaseClass { setDiscriminator(val: string) { const number = Number(val); if (isNaN(number)) throw new Error("invalid discriminator"); - if (number > 0 && number < 10000) throw new Error("discriminator must be between 1 and 9999"); - this.discriminator = val; + if (number <= 0 || number > 10000) throw new Error("discriminator must be between 1 and 9999"); + this.discriminator = val.toString(); } @Column() |