@pontalabs/baileys 1.2.2 → 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.
|
@@ -1016,6 +1016,9 @@ export const makeMessagesSocket = (config) => {
|
|
|
1016
1016
|
messageRetryManager.clear();
|
|
1017
1017
|
}
|
|
1018
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;
|
|
1019
1022
|
return {
|
|
1020
1023
|
...sock,
|
|
1021
1024
|
userDevicesCache,
|
|
@@ -1126,7 +1129,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1126
1129
|
}
|
|
1127
1130
|
return album;
|
|
1128
1131
|
},
|
|
1129
|
-
sendMessage: async (jid, content, options = {}) => {
|
|
1132
|
+
sendMessage: sendMessageImpl = async (jid, content, options = {}) => {
|
|
1130
1133
|
const userJid = authState.creds.me.id;
|
|
1131
1134
|
|
|
1132
1135
|
// `buildDelay` sends each item in `content.items` as its own Rich AI
|
|
@@ -1140,7 +1143,7 @@ export const makeMessagesSocket = (config) => {
|
|
|
1140
1143
|
const results = [];
|
|
1141
1144
|
for (let index = 0; index < content.items.length; index++) {
|
|
1142
1145
|
if (index > 0) await delay(buildDelay);
|
|
1143
|
-
results.push(await
|
|
1146
|
+
results.push(await sendMessageImpl(jid, content.items[index], sendOptions));
|
|
1144
1147
|
}
|
|
1145
1148
|
return results;
|
|
1146
1149
|
}
|
package/package.json
CHANGED