From 5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 13 Aug 2022 02:00:50 +0200 Subject: restructure to single project --- src/util/entities/Role.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/util/entities/Role.ts (limited to 'src/util/entities/Role.ts') diff --git a/src/util/entities/Role.ts b/src/util/entities/Role.ts new file mode 100644 index 00000000..4b721b5b --- /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; + }; +} -- cgit 1.4.1