@@ -483,24 +483,23 @@ export const buildTelegramMessageContext = async ({
|
483 | 483 | const ackReactionEmoji = |
484 | 484 | ackReaction && isTelegramSupportedReactionEmoji(ackReaction) ? ackReaction : undefined; |
485 | 485 | const removeAckAfterReply = cfg.messages?.removeAckAfterReply ?? false; |
486 | | -const shouldAckReaction = () => |
487 | | -Boolean( |
488 | | -ackReaction && |
489 | | -shouldAckReactionGate({ |
490 | | -scope: ackReactionScope, |
491 | | -isDirect: !isGroup, |
492 | | - isGroup, |
493 | | -isMentionableGroup: isGroup, |
494 | | -requireMention: Boolean(requireMention), |
495 | | -canDetectMention: bodyResult.canDetectMention, |
496 | | -effectiveWasMentioned: bodyResult.effectiveWasMentioned, |
497 | | -shouldBypassMention: bodyResult.shouldBypassMention, |
498 | | -}), |
499 | | -); |
| 486 | +const shouldSendAckReaction = Boolean( |
| 487 | +ackReaction && |
| 488 | +shouldAckReactionGate({ |
| 489 | +scope: ackReactionScope, |
| 490 | +isDirect: !isGroup, |
| 491 | + isGroup, |
| 492 | +isMentionableGroup: isGroup, |
| 493 | +requireMention: Boolean(requireMention), |
| 494 | +canDetectMention: bodyResult.canDetectMention, |
| 495 | +effectiveWasMentioned: bodyResult.effectiveWasMentioned, |
| 496 | +shouldBypassMention: bodyResult.shouldBypassMention, |
| 497 | +}), |
| 498 | +); |
500 | 499 | // Status Reactions controller (lifecycle reactions) |
501 | 500 | const statusReactionsConfig = cfg.messages?.statusReactions; |
502 | 501 | const statusReactionsEnabled = |
503 | | -statusReactionsConfig?.enabled === true && Boolean(reactionApi) && shouldAckReaction(); |
| 502 | +statusReactionsConfig?.enabled === true && Boolean(reactionApi) && shouldSendAckReaction; |
504 | 503 | const resolvedStatusReactionEmojis = statusReactionsEnabled |
505 | 504 | ? resolveTelegramStatusReactionEmojis({ |
506 | 505 | initialEmoji: ackReaction, |
@@ -562,13 +561,13 @@ export const buildTelegramMessageContext = async ({
|
562 | 561 | |
563 | 562 | // When status reactions are enabled, setQueued() replaces the simple ack reaction |
564 | 563 | const ackReactionPromise: Promise<boolean> | null = statusReactionController |
565 | | - ? shouldAckReaction() |
| 564 | + ? shouldSendAckReaction |
566 | 565 | ? Promise.resolve(statusReactionController.setQueued()).then( |
567 | 566 | () => true, |
568 | 567 | () => false, |
569 | 568 | ) |
570 | 569 | : null |
571 | | - : shouldAckReaction() && msg.message_id && reactionApi && ackReactionEmoji |
| 570 | + : shouldSendAckReaction && msg.message_id && reactionApi && ackReactionEmoji |
572 | 571 | ? withTelegramApiErrorLogging({ |
573 | 572 | operation: "setMessageReaction", |
574 | 573 | fn: () => |
|