fix: remove any casts in backward compat code
This commit is contained in:
committed by
Peter Steinberger
parent
30b4c14296
commit
c928df7237
@@ -1153,9 +1153,15 @@ export async function monitorWebProvider(
|
|||||||
// Send ack reaction immediately upon message receipt
|
// Send ack reaction immediately upon message receipt
|
||||||
if (msg.id) {
|
if (msg.id) {
|
||||||
const ackConfig = cfg.whatsapp?.ackReaction;
|
const ackConfig = cfg.whatsapp?.ackReaction;
|
||||||
// Backward compatibility: support old messages.ackReaction format
|
// Backward compatibility: support old messages.ackReaction format (legacy, undocumented)
|
||||||
const legacyEmoji = (cfg.messages as any)?.ackReaction;
|
const messages = cfg.messages as
|
||||||
const legacyScope = (cfg.messages as any)?.ackReactionScope;
|
| undefined
|
||||||
|
| (typeof cfg.messages & {
|
||||||
|
ackReaction?: string;
|
||||||
|
ackReactionScope?: string;
|
||||||
|
});
|
||||||
|
const legacyEmoji = messages?.ackReaction;
|
||||||
|
const legacyScope = messages?.ackReactionScope;
|
||||||
let emoji = (ackConfig?.emoji ?? "").trim();
|
let emoji = (ackConfig?.emoji ?? "").trim();
|
||||||
let directEnabled = ackConfig?.direct ?? true;
|
let directEnabled = ackConfig?.direct ?? true;
|
||||||
let groupMode = ackConfig?.group ?? "mentions";
|
let groupMode = ackConfig?.group ?? "mentions";
|
||||||
|
|||||||
Reference in New Issue
Block a user