summary refs log tree commit diff
path: root/util/src/entities/Webhook.ts
blob: 54233638dd158a98151e15a7dc1cd0ac9c09c982 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;
}