summary refs log tree commit diff
path: root/util/src/entities/User.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-27 11:11:16 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-27 11:11:16 +0200
commit845e77eed21d5e03994978ddee0ca0c613234b3f (patch)
tree75beee1614c80f1c8acd744aaeb02db68f46b2ac /util/src/entities/User.ts
parent:construction: api (diff)
downloadserver-845e77eed21d5e03994978ddee0ca0c613234b3f.tar.xz
:construction: typeorm
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r--util/src/entities/User.ts4
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()