@pontalabs/baileys 1.2.1 → 1.2.3
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.
|
@@ -155,8 +155,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
155
155
|
return null;
|
|
156
156
|
}
|
|
157
157
|
jid = jidNormalizedUser(jid);
|
|
158
|
-
|
|
159
|
-
return { jid, user };
|
|
158
|
+
return { jid, user };
|
|
160
159
|
})
|
|
161
160
|
.filter(jid => jid !== null);
|
|
162
161
|
let mgetDevices;
|
|
@@ -1017,6 +1016,9 @@ export const makeMessagesSocket = (config) => {
|
|
|
1017
1016
|
messageRetryManager.clear();
|
|
1018
1017
|
}
|
|
1019
1018
|
});
|
|
1019
|
+
// Keep a live reference to this method so buildDelay can reuse the exact
|
|
1020
|
+
// same sendMessage implementation without requiring sock.sendMessage().
|
|
1021
|
+
let sendMessageImpl;
|
|
1020
1022
|
return {
|
|
1021
1023
|
...sock,
|
|
1022
1024
|
userDevicesCache,
|
|
@@ -1127,7 +1129,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1127
1129
|
}
|
|
1128
1130
|
return album;
|
|
1129
1131
|
},
|
|
1130
|
-
sendMessage:
|
|
1132
|
+
sendMessage: sendMessageImpl = async (jid, content, options = {}) => {
|
|
1131
1133
|
const userJid = authState.creds.me.id;
|
|
1132
1134
|
|
|
1133
1135
|
// `buildDelay` sends each item in `content.items` as its own Rich AI
|
|
@@ -1141,7 +1143,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1141
1143
|
const results = [];
|
|
1142
1144
|
for (let index = 0; index < content.items.length; index++) {
|
|
1143
1145
|
if (index > 0) await delay(buildDelay);
|
|
1144
|
-
results.push(await
|
|
1146
|
+
results.push(await sendMessageImpl(jid, content.items[index], sendOptions));
|
|
1145
1147
|
}
|
|
1146
1148
|
return results;
|
|
1147
1149
|
}
|
|
@@ -1418,7 +1420,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1418
1420
|
}
|
|
1419
1421
|
return fullMsg;
|
|
1420
1422
|
}
|
|
1421
|
-
}
|
|
1423
|
+
},
|
|
1422
1424
|
sendTable: async (jid, title, headers, rows, quoted, options = {}) => {
|
|
1423
1425
|
const { message, messageId } = generateTableContent(title, headers, rows, quoted, options);
|
|
1424
1426
|
await relayMessage(jid, message, { messageId });
|
|
@@ -1481,5 +1483,6 @@ export const makeMessagesSocket = (config) => {
|
|
|
1481
1483
|
},
|
|
1482
1484
|
captureUnifiedResponse,
|
|
1483
1485
|
};
|
|
1486
|
+
return messagesSocket;
|
|
1484
1487
|
};
|
|
1485
1488
|
//# sourceMappingURL=messages-send.js.map
|
package/lib/Utils/mbuilder.js
CHANGED
|
@@ -3215,12 +3215,12 @@ const build = {
|
|
|
3215
3215
|
richTip: (text) => ({ richTip: text }),
|
|
3216
3216
|
richWidget: (data) => ({ richWidget: data }),
|
|
3217
3217
|
richFooterAction: (data) => ({ richFooterAction: data }),
|
|
3218
|
+
richHtml: (html) => ({ richHtml: html }),
|
|
3218
3219
|
richSuggest: (suggestion) => ({ richSuggest: suggestion }),
|
|
3219
3220
|
};
|
|
3220
3221
|
|
|
3221
3222
|
// Expose the namespace globally so applications can use build.* without
|
|
3222
3223
|
// importing another symbol. The named export remains available as well.
|
|
3223
|
-
// Always refresh the global namespace so newly added builder methods are available.
|
|
3224
3224
|
globalThis.build = build;
|
|
3225
3225
|
|
|
3226
3226
|
export { VERSION, Button, ButtonV2, Carousel, AIRich, Toolkit, build };
|
package/package.json
CHANGED