From 1e5ed285141de779be3df51b7737400a57e12a8d Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 24 Aug 2021 16:34:46 +0200 Subject: :sparkles: typeorm entities --- util/src/entities/Webhook.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 util/src/entities/Webhook.ts (limited to 'util/src/entities/Webhook.ts') diff --git a/util/src/entities/Webhook.ts b/util/src/entities/Webhook.ts new file mode 100644 index 00000000..54233638 --- /dev/null +++ b/util/src/entities/Webhook.ts @@ -0,0 +1,40 @@ +import { Column, Entity, JoinColumn } from "typeorm"; +import { BaseClass } from "./BaseClass"; + +export enum WebhookType { + Incoming = 1, + ChannelFollower = 2, +} + +@Entity("webhooks") +export class Webhook extends BaseClass { + @Column() + id: string; + + @Column({ type: "simple-enum", enum: WebhookType }) + type: WebhookType; + + @Column() + name?: string; + + @Column() + avatar?: string; + + @Column() + token?: string; + + @JoinColumn() + guild?: string; + + @JoinColumn() + channel: string; + + @JoinColumn() + application?: string; + + @JoinColumn() + user?: string; + + @JoinColumn() + source_guild: string; +} -- cgit 1.5.1