38 lines
778 B
TypeScript
38 lines
778 B
TypeScript
|
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()
|
||
|
}
|
||
|
}
|