summary refs log tree commit diff
path: root/util/src/entities/Webhook.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Webhook.ts')
-rw-r--r--util/src/entities/Webhook.ts40
1 files changed, 40 insertions, 0 deletions
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;
+}