summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-11 00:55:09 +0100
committerRory& <root@rory.gay>2026-03-21 08:22:27 +0100
commit27d2ba5a10ca73f200249017d31b3b43d74932c8 (patch)
tree5a6ade2cb7be1b865922ac161d5428cbf519403d
parentMessage toJSON -> null vs undefined (diff)
downloadserver-ts-27d2ba5a10ca73f200249017d31b3b43d74932c8.tar.xz
More schema stuff
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/index.ts2
-rw-r--r--src/schemas/uncategorised/MessageCreateSchema.ts17
2 files changed, 4 insertions, 15 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts

index a4abc8b4..e69818b1 100644 --- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -212,7 +212,7 @@ router.put( author_id: req.user_id, id: message_id, embeds, - channel_id, + channel_id: channel_id!, attachments, edited_timestamp: undefined, timestamp: new Date(snowflake.timestamp), diff --git a/src/schemas/uncategorised/MessageCreateSchema.ts b/src/schemas/uncategorised/MessageCreateSchema.ts
index ae506ecc..5afbfe2a 100644 --- a/src/schemas/uncategorised/MessageCreateSchema.ts +++ b/src/schemas/uncategorised/MessageCreateSchema.ts
@@ -17,7 +17,7 @@ */ import { InteractionType, Snowflake } from "@spacebar/util"; -import { ApplicationCommandType, BaseMessageComponents, Embed, PollAnswer, PollMedia, PublicUser } from "@spacebar/schemas"; +import { AllowedMentions, MessageReference, ApplicationCommandType, BaseMessageComponents, Embed, PollAnswer, PollMedia, PublicUser } from "@spacebar/schemas"; export type MessageCreateAttachment = { id: string; @@ -42,19 +42,8 @@ export interface MessageCreateSchema { embeds?: Embed[] | null; embed?: Embed | null; // TODO: ^ embed is deprecated in favor of embeds (https://discord.com/developers/docs/resources/channel#message-object) - allowed_mentions?: { - parse?: string[] | null; - roles?: string[] | null; - users?: string[] | null; - replied_user?: boolean; - } | null; - message_reference?: { - message_id?: string; - channel_id?: string; - guild_id?: string; - fail_if_not_exists?: boolean; - type?: number; - } | null; + allowed_mentions?: AllowedMentions | null; + message_reference?: MessageReference | null; payload_json?: string; file?: { filename: string }; // TODO: we should create an interface for attachments