@wahooks/channel 0.9.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -335,7 +335,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
335
335
|
const chatId = toChatId(args.to);
|
|
336
336
|
const media = resolveMedia(args);
|
|
337
337
|
const endpoint = req.params.name.replace("wahooks_", "").replace("_", "-");
|
|
338
|
-
// Human-like: typing → delay → stop typing → send
|
|
338
|
+
// Human-like: typing → delay → stop typing → send (skipPresence to avoid API doubling)
|
|
339
339
|
await api("POST", `/connections/${connectionId}/typing`, { chatId }).catch(() => { });
|
|
340
340
|
await new Promise((r) => setTimeout(r, 1500 + Math.random() * 2000));
|
|
341
341
|
await api("POST", `/connections/${connectionId}/typing/stop`, { chatId }).catch(() => { });
|
|
@@ -344,6 +344,7 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
344
344
|
...media,
|
|
345
345
|
caption: args.caption,
|
|
346
346
|
filename: args.filename,
|
|
347
|
+
skipPresence: true,
|
|
347
348
|
});
|
|
348
349
|
const type = endpoint.replace("send-", "");
|
|
349
350
|
return { content: [{ type: "text", text: `${type} sent to ${args.to}` }] };
|