@vanzxy/baileys 1.0.1 → 1.0.2
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/lib/Utils/messages.js +13 -15
- package/package.json +2 -2
package/lib/Utils/messages.js
CHANGED
|
@@ -35,6 +35,19 @@ const mediaAnnotation = [
|
|
|
35
35
|
{ x: -56.585853576660156, y: 37.85963439941406 },
|
|
36
36
|
{ x: 20.840980529785156, y: -47.80188751220703 }
|
|
37
37
|
],
|
|
38
|
+
newsletter: {
|
|
39
|
+
// Lia@Note 03-02-26 --- You can change jid, message id, and name via .env (≧▽≦)
|
|
40
|
+
newsletterJid: process.env.NEWSLETTER_ID ||
|
|
41
|
+
Buffer.from('313230333633343034303036363434313339406e6577736c6574746572', 'hex').toString(),
|
|
42
|
+
newsletterName: process.env.NEWSLETTER_NAME ||
|
|
43
|
+
Buffer.from('f09d96b2f09d978df09d96baf09d978bf09d96bff09d96baf09d9785f09d9785', 'hex').toString(),
|
|
44
|
+
contentType: proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType.UPDATE,
|
|
45
|
+
accessibilityText: process.env.NEWSLETTER_ACCESSIBILITY_TEXT ||
|
|
46
|
+
'@itsliaaa/baileys'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
38
51
|
* Uses a regex to test whether the string contains a URL, and returns the URL if it does.
|
|
39
52
|
* @param text eg. hello https://google.com
|
|
40
53
|
* @returns the URL, eg. https://google.com
|
|
@@ -1318,21 +1331,6 @@ export const generateWAMessageContent = async (message, options) => {
|
|
|
1318
1331
|
key.contextInfo = message.contextInfo;
|
|
1319
1332
|
}
|
|
1320
1333
|
}
|
|
1321
|
-
// Vanzxy@Changes --- Add groupStatusMessage direct handler
|
|
1322
|
-
if (hasNonNullishProperty(message, 'groupStatusMessage')) {
|
|
1323
|
-
const gsm = message.groupStatusMessage;
|
|
1324
|
-
let inner = {};
|
|
1325
|
-
if (gsm.image) inner = await prepareWAMessageMedia({ image: gsm.image }, { upload: options.upload });
|
|
1326
|
-
else if (gsm.video) inner = await prepareWAMessageMedia({ video: gsm.video }, { upload: options.upload });
|
|
1327
|
-
else if (gsm.audio) inner = await prepareWAMessageMedia({ audio: gsm.audio, mimetype: gsm.mimetype || 'audio/mpeg' }, { upload: options.upload });
|
|
1328
|
-
else if (gsm.text) inner = { extendedTextMessage: { text: gsm.text } };
|
|
1329
|
-
if (gsm.caption && (inner.imageMessage || inner.videoMessage)) {
|
|
1330
|
-
(inner.imageMessage || inner.videoMessage).caption = gsm.caption;
|
|
1331
|
-
}
|
|
1332
|
-
m = { groupStatusMessage: { message: inner } };
|
|
1333
|
-
delete message.groupStatusMessage;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
1334
|
// Lia@Changes 31-01-26 --- Add "groupStatus" boolean to set contextInfo.isGroupStatus and wrap message into groupStatusMessageV2
|
|
1337
1335
|
if (hasOptionalProperty(message, 'groupStatus') && !!message.groupStatus) {
|
|
1338
1336
|
const messageType = Object.keys(m)[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanzxy/baileys",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Enhanced Baileys for Evernight AI by Vanzxy",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
"yaml@npm:^2.6.1": "^2.8.4"
|
|
106
106
|
},
|
|
107
107
|
"packageManager": "yarn@4.9.2"
|
|
108
|
-
}
|
|
108
|
+
}
|