mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-16 18:34:18 +00:00
fix(telegram): gate media dedup on visible delivery
This commit is contained in:
@@ -1,9 +1,3 @@
|
||||
/**
|
||||
* Deduplicate media URLs in a final-reply payload against media already
|
||||
* delivered via block replies. Returns the deduplicated payload, or
|
||||
* undefined if the payload should be skipped entirely (all media already
|
||||
* sent and no text remains).
|
||||
*/
|
||||
export function deduplicateBlockSentMedia<
|
||||
T extends { mediaUrl?: string; mediaUrls?: string[]; text?: string },
|
||||
>(payload: T, sentBlockMediaUrls: ReadonlySet<string>): T | undefined {
|
||||
|
||||
@@ -1166,10 +1166,6 @@ export const dispatchTelegramMessage = async ({
|
||||
recordInboundSession: context.turn.recordInboundSession,
|
||||
record: context.turn.record,
|
||||
runDispatch: () => {
|
||||
// Track media URLs delivered via block replies so final replies
|
||||
// can skip duplicates. Without this, non-streaming Telegram
|
||||
// delivers each MEDIA: attachment twice — once from the
|
||||
// media-only block reply and once from the final reply.
|
||||
const sentBlockMediaUrls = new Set<string>();
|
||||
|
||||
return telegramDeps.dispatchReplyWithBufferedBlockDispatcher({
|
||||
|
||||
Reference in New Issue
Block a user