zappyzep/backend/src/data/entities/ScheduledPost.ts

35 lines
926 B
TypeScript
Raw Normal View History

2021-05-31 21:12:24 +02:00
import { MessageAttachment } from "discord.js";
import { Column, Entity, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
import { StrictMessageContent } from "../../utils";
@Entity("scheduled_posts")
export class ScheduledPost {
@PrimaryGeneratedColumn()
id: number;
@Column() guild_id: string;
@Column() author_id: string;
@Column() author_name: string;
@Column() channel_id: string;
@Column("simple-json") content: StrictMessageContent;
2021-05-31 21:12:24 +02:00
@Column("simple-json") attachments: MessageAttachment[];
@Column({ type: String, nullable: true }) post_at: string | null;
2019-12-01 23:23:34 +02:00
/**
* How often to post the message, in milliseconds
*/
@Column({ type: String, nullable: true }) repeat_interval: number | null;
2019-12-01 23:23:34 +02:00
@Column({ type: String, nullable: true }) repeat_until: string | null;
2019-12-01 23:23:34 +02:00
@Column({ type: String, nullable: true }) repeat_times: number | null;
2019-12-01 23:23:34 +02:00
@Column() enable_mentions: boolean;
}