summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-10-06 03:25:11 +0200
committerRory& <root@rory.gay>2025-10-06 03:25:11 +0200
commit62016a80431344cffbf39be2d006e2733e8ba3ae (patch)
treed121948848ec307b0fdfe0e3e642754bb2ac79d9 /src
parentWhy wasnt this included? (diff)
downloadserver-ts-62016a80431344cffbf39be2d006e2733e8ba3ae.tar.xz
Try to fix sending messages with discord-go
Diffstat (limited to 'src')
-rw-r--r--src/api/util/handlers/Message.ts1
-rw-r--r--src/util/schemas/MessageCreateSchema.ts4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index 8356ee61..1504faae 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -89,6 +89,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { reactions: opts.reactions || [], type: opts.type ?? 0, mentions: [], + components: opts.components ?? undefined, // Fix Discord-Go? }); if (cloudAttachments && cloudAttachments.length > 0) { diff --git a/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts
index 7e590467..f5037d66 100644 --- a/src/util/schemas/MessageCreateSchema.ts +++ b/src/util/schemas/MessageCreateSchema.ts
@@ -60,8 +60,8 @@ export interface MessageCreateSchema { TODO: OpenWAAO<-->attachment-style metadata conversion **/ attachments?: (MessageCreateAttachment | MessageCreateCloudAttachment)[]; - sticker_ids?: string[]; - components?: ActionRowComponent[]; + sticker_ids?: string[] | null; // null check: fixes Discord-Go + components?: ActionRowComponent[] | null; // null check: fixes Discord-Go // TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled poll?: PollCreationSchema; enforce_nonce?: boolean; // For Discord compatibility, it's the default behavior here