From c928df7237f682fcea2bc4fd1cad8296030df3b3 Mon Sep 17 00:00:00 2001 From: sheeek Date: Sat, 10 Jan 2026 01:04:13 +0100 Subject: [PATCH] fix: remove any casts in backward compat code --- src/web/auto-reply.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/web/auto-reply.ts b/src/web/auto-reply.ts index 3f6a4df0a..5cdac0f46 100644 --- a/src/web/auto-reply.ts +++ b/src/web/auto-reply.ts @@ -1153,9 +1153,15 @@ export async function monitorWebProvider( // Send ack reaction immediately upon message receipt if (msg.id) { const ackConfig = cfg.whatsapp?.ackReaction; - // Backward compatibility: support old messages.ackReaction format - const legacyEmoji = (cfg.messages as any)?.ackReaction; - const legacyScope = (cfg.messages as any)?.ackReactionScope; + // Backward compatibility: support old messages.ackReaction format (legacy, undocumented) + const messages = cfg.messages as + | undefined + | (typeof cfg.messages & { + ackReaction?: string; + ackReactionScope?: string; + }); + const legacyEmoji = messages?.ackReaction; + const legacyScope = messages?.ackReactionScope; let emoji = (ackConfig?.emoji ?? "").trim(); let directEnabled = ackConfig?.direct ?? true; let groupMode = ackConfig?.group ?? "mentions";