zappyzep/backend/src/data/entities/ScheduledPost.ts
Dragory c7751a9da1
Centralize periodic checks for mutes, tempbans, vcalerts, reminders, and scheduled posts
This should result in a significant performance improvement.
The new method is also more precise than the old one, allowing
the aforementioned checks to be performed with second-precision.
2021-09-25 21:34:07 +03:00

34 lines
926 B
TypeScript

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;
@Column("simple-json") attachments: MessageAttachment[];
@Column({ type: String, nullable: true }) post_at: string | null;
/**
* How often to post the message, in milliseconds
*/
@Column({ type: String, nullable: true }) repeat_interval: number | null;
@Column({ type: String, nullable: true }) repeat_until: string | null;
@Column({ type: String, nullable: true }) repeat_times: number | null;
@Column() enable_mentions: boolean;
}