contrition/src/entity/Guild.ts

38 lines
778 B
TypeScript

2021-09-23 04:06:30 +07:00
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from "typeorm"
@Entity({ name: 'guilds' })
export class Guild extends BaseEntity {
@PrimaryGeneratedColumn("uuid")
id: string
@Column()
name: string
@Column()
guild: string
@Column()
channel: string
@Column()
staffRole: string
@Column()
defaultExpiry?: string
constructor(name: string, guild: string, channel: string, staffRole: string, jailedRole: string, defaultExpiry: string) {
super()
this.name = name
this.guild = guild
this.channel = channel
this.staffRole = staffRole
this.defaultExpiry = defaultExpiry
}
static async all(): Promise<Array<Guild>> {
return await this.find()
}
}