diff options
Diffstat (limited to 'util/src/entities/RateLimit.ts')
-rw-r--r-- | util/src/entities/RateLimit.ts | 25 |
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; +} |