summary refs log tree commit diff
path: root/util/src/entities/Role.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/Role.ts')
-rw-r--r--util/src/entities/Role.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/util/src/entities/Role.ts b/util/src/entities/Role.ts
new file mode 100644
index 00000000..7bb144cc
--- /dev/null
+++ b/util/src/entities/Role.ts
@@ -0,0 +1,41 @@
+import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
+import { BaseClass } from "./BaseClass";
+import { Guild } from "./Guild";
+
+@Entity("roles")
+export class Role extends BaseClass {
+	@Column()
+	guild_id: string;
+
+	@JoinColumn({ name: "guild_id" })
+	@ManyToOne(() => Guild, (guild: Guild) => guild.id)
+	guild: Guild;
+
+	@Column()
+	color: number;
+
+	@Column()
+	hoist: boolean;
+
+	@Column()
+	managed: boolean;
+
+	@Column()
+	mentionable: boolean;
+
+	@Column()
+	name: string;
+
+	@Column({ type: "bigint" })
+	permissions: bigint;
+
+	@Column()
+	position: number;
+
+	@Column({ type: "simple-json" })
+	tags?: {
+		bot_id?: string;
+		integration_id?: string;
+		premium_subscriber?: boolean;
+	};
+}