alipclutch-baileys 8.6.2 → 8.6.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.
- package/README.md +2 -2
- package/lib/Utils/messages.js +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<h1 align="center"
|
|
1
|
+
<h1 align="center">🎀 Clutch Baileys</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<img src="https://qu.ax/MoDGQ.jpg" width="450" style="border-radius:12px; box-shadow: 0 4px 8px rgba(0,0,0,0.2);">
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 👾 Overview
|
|
21
21
|
**Clutch Baileys** adalah versi modifikasi dari *Baileys library* yang dioptimalkan untuk kebutuhan bisnis dan integrasi skala besar. Mendukung berbagai fitur pesan interaktif terbaru dari WhatsApp Business API yang tidak tersedia di library standar.
|
package/lib/Utils/messages.js
CHANGED
|
@@ -198,17 +198,19 @@ const prepareWAMessageMedia = async (message, options) => {
|
|
|
198
198
|
}
|
|
199
199
|
})(),
|
|
200
200
|
])
|
|
201
|
-
|
|
201
|
+
.finally(() => {
|
|
202
202
|
if (!Buffer.isBuffer(encWriteStream)) {
|
|
203
203
|
encWriteStream.destroy();
|
|
204
204
|
}
|
|
205
|
-
|
|
206
205
|
if (didSaveToTmpPath && bodyPath) {
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
const delayMs = 120000;
|
|
207
|
+
setTimeout(() => {
|
|
208
|
+
fs_1.promises.unlink(bodyPath).catch(() => {});
|
|
209
|
+
logger === null || logger === void 0 ? void 0 : logger.debug(`Removed temp file after ${delayMs/1000}s delay`);
|
|
210
|
+
}, delayMs);
|
|
209
211
|
}
|
|
212
|
+
return Promise.resolve();
|
|
210
213
|
});
|
|
211
|
-
|
|
212
214
|
const obj = Types_1.WAProto.Message.fromObject({
|
|
213
215
|
[`${mediaType}Message`]: MessageTypeProto[mediaType].fromObject({
|
|
214
216
|
url: handle ? undefined : mediaUrl,
|
|
@@ -775,7 +777,7 @@ const downloadMediaMessage = async (message, type, options, ctx) => {
|
|
|
775
777
|
let mediaType = contentType === null || contentType === void 0 ? void 0 : contentType.replace('Message', '');
|
|
776
778
|
const media = mContent[contentType];
|
|
777
779
|
if (!media || typeof media !== 'object' || (!('url' in media) && !('thumbnailDirectPath' in media))) {
|
|
778
|
-
throw new boom_1.Boom(`"${contentType}" message is not a media message
|
|
780
|
+
throw new boom_1.Boom(`"${contentType}" message is not a media message`, { statusCode: 400, data: content });
|
|
779
781
|
}
|
|
780
782
|
let download;
|
|
781
783
|
if ('thumbnailDirectPath' in media && !('url' in media)) {
|
|
@@ -813,4 +815,4 @@ const assertMediaContent = (content) => {
|
|
|
813
815
|
}
|
|
814
816
|
return mediaContent;
|
|
815
817
|
};
|
|
816
|
-
exports.assertMediaContent = assertMediaContent;
|
|
818
|
+
exports.assertMediaContent = assertMediaContent;
|