summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-18 01:24:35 +0200
committerRory& <root@rory.gay>2026-04-18 18:26:34 +0200
commit74b6c03c52660bf3a39602050f4ce44ddb73c6ea (patch)
treede4b1f10283334fc58c4038407fcac9a69cc449b /src
parentRemove irrelevant TODO (diff)
downloadserver-ts-74b6c03c52660bf3a39602050f4ce44ddb73c6ea.tar.xz
Attachment -> PublicAttachment in schemas
Diffstat (limited to 'src')
-rw-r--r--src/schemas/api/messages/Message.ts4
-rw-r--r--src/schemas/responses/AccountStandingResponse.ts5
-rw-r--r--src/schemas/responses/GuildMessagesSearchResponse.ts5
-rw-r--r--src/util/entities/Message.ts2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/schemas/api/messages/Message.ts b/src/schemas/api/messages/Message.ts

index ee2b9a8b..f99f2b1b 100644 --- a/src/schemas/api/messages/Message.ts +++ b/src/schemas/api/messages/Message.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Attachment, Sticker } from "@spacebar/util"; +import { Sticker } from "@spacebar/util"; import { Embed, MessageActivity, MessageComponent, PartialUser, Poll, PublicChannel, Snowflake } from "@spacebar/schemas"; import { PublicAttachment } from "./Attachments"; @@ -151,7 +151,7 @@ export interface MessageSnapshot { edited_timestamp?: Date | null; mentions: PartialUser[]; mention_roles: Snowflake[]; - attachments?: Attachment[]; + attachments?: PublicAttachment[]; embeds: Embed[]; type: MessageType; flags: number; diff --git a/src/schemas/responses/AccountStandingResponse.ts b/src/schemas/responses/AccountStandingResponse.ts
index 6f29ebef..c1f603bd 100644 --- a/src/schemas/responses/AccountStandingResponse.ts +++ b/src/schemas/responses/AccountStandingResponse.ts
@@ -16,8 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -// TODO: remove dependency on entities... -import { Attachment } from "@spacebar/util"; +import { PublicAttachment } from "../api/messages/Attachments"; export enum AccountStandingState { ALL_GOOD = 100, @@ -114,7 +113,7 @@ export interface FlaggedContent { type: "message"; id: string; content: string; - attachments: Attachment[]; + attachments: PublicAttachment[]; } export interface Classification { diff --git a/src/schemas/responses/GuildMessagesSearchResponse.ts b/src/schemas/responses/GuildMessagesSearchResponse.ts
index 8627b3fc..e498f8bc 100644 --- a/src/schemas/responses/GuildMessagesSearchResponse.ts +++ b/src/schemas/responses/GuildMessagesSearchResponse.ts
@@ -17,8 +17,9 @@ */ // TODO: remove dependency on entities -import { Attachment, Role } from "@spacebar/util"; +import { Role } from "@spacebar/util"; import { BaseMessageComponents, Embed, MessageType, Poll, PublicUser } from "@spacebar/schemas"; +import { PublicAttachment } from "../api/messages/Attachments"; export interface GuildMessagesSearchMessage { id: string; @@ -26,7 +27,7 @@ export interface GuildMessagesSearchMessage { content?: string; channel_id: string; author: PublicUser; - attachments: Attachment[]; + attachments: PublicAttachment[]; embeds: Embed[]; mentions: PublicUser[]; mention_roles: Role[]; diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts
index 217f1da0..c2628e2c 100644 --- a/src/util/entities/Message.ts +++ b/src/util/entities/Message.ts
@@ -331,7 +331,7 @@ export class Message extends BaseClass { toSnapshot(): MessageSnapshot { return { message: { - attachments: this.attachments, + attachments: this.attachments?.map((x) => x.toJSON()), components: this.components, content: this.content!, edited_timestamp: this.edited_timestamp,