summary refs log tree commit diff
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2025-12-18 21:39:14 +0100
committerCyberL1 <cyber.hf18@gmail.com>2025-12-18 21:39:14 +0100
commit4553b1d12691b8722d65813fa430f64a3b4b6c53 (patch)
tree6a98cbdbd8b6b89fcc10358f8436f7585f2e0c32
parentfeat: add message forwards (normal messages only) (diff)
downloadserver-ts-4553b1d12691b8722d65813fa430f64a3b4b6c53.tar.xz
chore: run prettier
-rw-r--r--scripts/schemaExclusions.json14
-rw-r--r--src/schemas/api/messages/Message.ts30
-rw-r--r--src/schemas/uncategorised/MessageCreateSchema.ts2
-rw-r--r--src/util/entities/Message.ts4
-rw-r--r--src/util/migration/postgres/1765185286988-message-snapshots.ts14
5 files changed, 29 insertions, 35 deletions
diff --git a/scripts/schemaExclusions.json b/scripts/schemaExclusions.json

index 64e2bbf0..b2847670 100644 --- a/scripts/schemaExclusions.json +++ b/scripts/schemaExclusions.json
@@ -1,10 +1,6 @@ { - "include": [ - "MessageInteractionSchema" - ], - "includeRe": [ - "^MessageComponentType\\..*" - ], + "include": ["MessageInteractionSchema"], + "includeRe": ["^MessageComponentType\\..*"], "manual": [ "DefaultSchema", "Schema", @@ -87,9 +83,7 @@ "^Job" ], "manualWarn": [], - "manualWarnRe": [ - ".*<.*>$" - ], + "manualWarnRe": [".*<.*>$"], "auto": [ { "value": "StringSchema", @@ -412,4 +406,4 @@ "reason": "Schema with only uppercase properties" } ] -} \ No newline at end of file +} diff --git a/src/schemas/api/messages/Message.ts b/src/schemas/api/messages/Message.ts
index a100f266..a46c8f10 100644 --- a/src/schemas/api/messages/Message.ts +++ b/src/schemas/api/messages/Message.ts
@@ -97,19 +97,19 @@ export interface AllowedMentions { } export interface MessageSnapshot { - message: { - content: string; - timestamp: Date; - edited_timestamp?: Date | null; - mentions: Snowflake[]; - mention_roles: Snowflake[]; - attachments?: Attachment[]; - embeds: Embed[]; - type: MessageType; - flags: number; - components?: MessageComponent[]; - resolved?: object[]; - sticker_items?: Sticker[]; - // soundboard_sounds?: object[]; // TODO: when soundboard is done - } + message: { + content: string; + timestamp: Date; + edited_timestamp?: Date | null; + mentions: Snowflake[]; + mention_roles: Snowflake[]; + attachments?: Attachment[]; + embeds: Embed[]; + type: MessageType; + flags: number; + components?: MessageComponent[]; + resolved?: object[]; + sticker_items?: Sticker[]; + // soundboard_sounds?: object[]; // TODO: when soundboard is done + }; } diff --git a/src/schemas/uncategorised/MessageCreateSchema.ts b/src/schemas/uncategorised/MessageCreateSchema.ts
index d9442e2f..345be32c 100644 --- a/src/schemas/uncategorised/MessageCreateSchema.ts +++ b/src/schemas/uncategorised/MessageCreateSchema.ts
@@ -53,7 +53,7 @@ export interface MessageCreateSchema { channel_id?: string; guild_id?: string; fail_if_not_exists?: boolean; - type?: number; + type?: number; }; payload_json?: string; file?: { filename: string }; diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts
index 73d46cb1..508ffd8c 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts
@@ -202,8 +202,8 @@ export class Message extends BaseClass { @Column({ nullable: true }) avatar?: string; - @Column({ default: "[]", type: "simple-json" }) - message_snapshots: MessageSnapshot[]; + @Column({ default: "[]", type: "simple-json" }) + message_snapshots: MessageSnapshot[]; toJSON(): Message { return { diff --git a/src/util/migration/postgres/1765185286988-message-snapshots.ts b/src/util/migration/postgres/1765185286988-message-snapshots.ts
index c9047fc2..ca0c33ee 100644 --- a/src/util/migration/postgres/1765185286988-message-snapshots.ts +++ b/src/util/migration/postgres/1765185286988-message-snapshots.ts
@@ -1,13 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MessageSnapshots1765185286988 implements MigrationInterface { - name = "MessageSnapshots1765185286988"; + name = "MessageSnapshots1765185286988"; - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "messages" ADD "message_snapshots" text NOT NULL DEFAULT '[]'`); - } + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "messages" ADD "message_snapshots" text NOT NULL DEFAULT '[]'`); + } - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "message_snapshots"`); - } + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "message_snapshots"`); + } }