summary refs log tree commit diff
path: root/util/src/entities/RateLimit.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-24 16:34:46 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-24 16:34:46 +0200
commitb86032a001b45d3f345820b84ba4489981116919 (patch)
treec583ad6608be9393e88ea85f4aeb3f747e72c1d3 /util/src/entities/RateLimit.ts
parentgenerate schema (diff)
downloadserver-b86032a001b45d3f345820b84ba4489981116919.tar.xz
:sparkles: typeorm entities
Diffstat (limited to 'util/src/entities/RateLimit.ts')
-rw-r--r--util/src/entities/RateLimit.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/util/src/entities/RateLimit.ts b/util/src/entities/RateLimit.ts
new file mode 100644
index 00000000..374a0759
--- /dev/null
+++ b/util/src/entities/RateLimit.ts
@@ -0,0 +1,25 @@
+import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
+import { BaseClass } from "./BaseClass";
+import { User } from "./User";
+
+@Entity("rate_limits")
+export class RateLimit extends BaseClass {
+	@Column()
+	id: "global" | "error" | string; // channel_239842397 | guild_238927349823 | webhook_238923423498
+
+	@Column()
+	user_id: string;
+
+	@JoinColumn({ name: "user_id" })
+	@ManyToOne(() => User, (user) => user.id)
+	user: User;
+
+	@Column()
+	hits: number;
+
+	@Column()
+	blocked: boolean;
+
+	@Column()
+	expires_at: Date;
+}