From e8d3f655a399a8ac5870e0d2612e2e23d87ae6b3 Mon Sep 17 00:00:00 2001 From: Zane Helton Date: Sat, 28 Jun 2025 09:57:34 -0400 Subject: [PATCH] Preserve reactions when a message is edited Resolves #1241 --- src/api/util/handlers/Message.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index 30fa5491..41e55000 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -46,6 +46,7 @@ import { handleFile, Permissions, normalizeUrl, + Reaction, } from "@spacebar/util"; import { HTTPError } from "lambert-server"; import { In } from "typeorm"; @@ -76,7 +77,7 @@ export async function handleMessage(opts: MessageOptions): Promise { channel_id: opts.channel_id, attachments: opts.attachments || [], embeds: opts.embeds || [], - reactions: /*opts.reactions ||*/ [], + reactions: opts.reactions || [], type: opts.type ?? 0, }); @@ -436,6 +437,7 @@ interface MessageOptions extends MessageCreateSchema { webhook_id?: string; application_id?: string; embeds?: Embed[]; + reactions?: Reaction[]; channel_id?: string; attachments?: Attachment[]; edited_timestamp?: Date;