feat: unify provider reaction tools

This commit is contained in:
Peter Steinberger
2026-01-07 04:10:13 +01:00
parent 551a8d5683
commit 3afef2d504
41 changed files with 1169 additions and 82 deletions

View File

@@ -558,6 +558,30 @@ export async function monitorWebInbox(options: {
});
return { messageId: result?.key?.id ?? "unknown" };
},
/**
* Send a reaction (emoji) to a specific message.
* Pass an empty string for emoji to remove the reaction.
*/
sendReaction: async (
chatJid: string,
messageId: string,
emoji: string,
fromMe: boolean,
participant?: string,
): Promise<void> => {
const jid = toWhatsappJid(chatJid);
await sock.sendMessage(jid, {
react: {
text: emoji,
key: {
remoteJid: jid,
id: messageId,
fromMe,
participant,
},
},
});
},
/**
* Send typing indicator ("composing") to a chat.
* Used after IPC send to show more messages are coming.

View File

@@ -100,10 +100,11 @@ export async function sendReactionWhatsApp(
verbose: boolean;
fromMe?: boolean;
participant?: string;
accountId?: string;
},
): Promise<void> {
const correlationId = randomUUID();
const active = getActiveWebListener();
const active = getActiveWebListener(options.accountId);
if (!active) {
throw new Error(
"No active gateway listener. Start the gateway before sending WhatsApp reactions.",