summary refs log tree commit diff
path: root/src/util/entities/Role.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 18:24:21 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 23:35:18 +1000
commit0d23eaba09a4878520bf346af4cead90d76829fc (patch)
treed930eacceff0b407b44abe55f01d8e3c5dfbfa34 /src/util/entities/Role.ts
parentAllow edited_timestamp to passthrough in handleMessage (diff)
downloadserver-0d23eaba09a4878520bf346af4cead90d76829fc.tar.xz
Refactor to mono-repo + upgrade packages
Diffstat (limited to 'src/util/entities/Role.ts')
-rw-r--r--src/util/entities/Role.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/util/entities/Role.ts b/src/util/entities/Role.ts
new file mode 100644
index 00000000..d87b835f
--- /dev/null
+++ b/src/util/entities/Role.ts
@@ -0,0 +1,51 @@
+import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
+
+import { BaseClass } from "./BaseClass";
+import { Guild } from "./Guild";
+
+@Entity("roles")
+export class Role extends BaseClass {
+	@Column({ nullable: true })
+	@RelationId((role: Role) => role.guild)
+	guild_id: string;
+
+	@JoinColumn({ name: "guild_id" })
+	@ManyToOne(() => Guild, {
+		onDelete: "CASCADE",
+	})
+	guild: Guild;
+
+	@Column()
+	color: number;
+
+	@Column()
+	hoist: boolean;
+
+	@Column()
+	managed: boolean;
+
+	@Column()
+	mentionable: boolean;
+
+	@Column()
+	name: string;
+
+	@Column()
+	permissions: string;
+
+	@Column()
+	position: number;
+
+	@Column({ nullable: true })
+	icon?: string;
+
+	@Column({ nullable: true })
+	unicode_emoji?: string;
+
+	@Column({ type: "simple-json", nullable: true })
+	tags?: {
+		bot_id?: string;
+		integration_id?: string;
+		premium_subscriber?: boolean;
+	};
+}