mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 08:28:36 +00:00
feat(bridge): send read receipts (blue ticks) for incoming messages
Mark each incoming WhatsApp message as read via sock.readMessages() right after the startup-timestamp filter. Wrapped in try/catch so a failed receipt never blocks message processing.
This commit is contained in:
parent
3f41605ddc
commit
51bd3337ef
@ -181,6 +181,14 @@ export class WhatsAppClient {
|
||||
const msgTimestamp = msg.messageTimestamp as number;
|
||||
if (msgTimestamp && msgTimestamp < startupTimestamp) continue;
|
||||
|
||||
// Send read receipt (blue check) immediately
|
||||
try {
|
||||
await this.sock!.readMessages([msg.key]);
|
||||
} catch (e) {
|
||||
// Non-fatal: log but don't block message processing
|
||||
console.error('Failed to send read receipt:', (e as Error).message);
|
||||
}
|
||||
|
||||
const unwrapped = baileysExtractMessageContent(msg.message);
|
||||
if (!unwrapped) continue;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user