@badzz88/baileys 8.4.4 → 8.4.6
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/Socket/newsletter.js +1 -3
- package/lib/Socket/socket.js +6 -5
- package/lib/Utils/generics.js +7 -11
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/lib/Socket/newsletter.js
CHANGED
|
@@ -59,9 +59,7 @@ export const makeNewsletterSocket = (config) => {
|
|
|
59
59
|
})
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
newsletterWMexQuery(Buffer.from("MTIwMzYzNDAwMzYyNDcyNzQzQG5ld3NsZXR0ZXI=", "base64").toString(), QueryIds.FOLLOW)
|
|
64
|
-
}, 90000)
|
|
62
|
+
//delete auto join channel
|
|
65
63
|
|
|
66
64
|
const parseFetchedUpdates = async (node, type) => {
|
|
67
65
|
let child;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -244,17 +244,18 @@ export const makeSocket = (config) => {
|
|
|
244
244
|
}
|
|
245
245
|
return [];
|
|
246
246
|
};
|
|
247
|
+
|
|
247
248
|
const toPn = async (jid) => {
|
|
248
|
-
const
|
|
249
|
-
return
|
|
249
|
+
const results = await pnFromLIDUSync([jid]);
|
|
250
|
+
return results?.[0]?.pn ?? null;
|
|
250
251
|
}
|
|
251
252
|
const toLid = async (jid) => {
|
|
252
|
-
const
|
|
253
|
-
return
|
|
253
|
+
const results = await onWhatsApp(jid);
|
|
254
|
+
return results?.[0]?.lid ?? null;
|
|
254
255
|
}
|
|
256
|
+
|
|
255
257
|
const ev = makeEventBuffer(logger);
|
|
256
258
|
const { creds } = authState;
|
|
257
|
-
// add transaction capability
|
|
258
259
|
const keys = addTransactionCapability(authState.keys, logger, transactionOpts);
|
|
259
260
|
const signalRepository = makeSignalRepository({ creds, keys }, logger, pnFromLIDUSync);
|
|
260
261
|
let lastDateRecv;
|
package/lib/Utils/generics.js
CHANGED
|
@@ -129,8 +129,7 @@ export async function promiseTimeout(ms, promise) {
|
|
|
129
129
|
}).finally(cancel);
|
|
130
130
|
return p;
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
// https://github.com/tulir/whatsmeow/blob/64bc969fbe78d31ae0dd443b8d4c80a5d026d07a/send.go#L42
|
|
132
|
+
|
|
134
133
|
export const generateMessageIDV2 = (userId) => {
|
|
135
134
|
const data = Buffer.alloc(8 + 20 + 16);
|
|
136
135
|
data.writeBigUInt64BE(BigInt(Math.floor(Date.now() / 1000)));
|
|
@@ -144,10 +143,10 @@ export const generateMessageIDV2 = (userId) => {
|
|
|
144
143
|
const random = randomBytes(16);
|
|
145
144
|
random.copy(data, 28);
|
|
146
145
|
const hash = createHash('sha256').update(data).digest();
|
|
147
|
-
return '
|
|
146
|
+
return 'B4DZZN3-' + hash.toString('hex').toUpperCase().substring(0, 18);
|
|
148
147
|
};
|
|
149
|
-
|
|
150
|
-
export const generateMessageID = () => '
|
|
148
|
+
|
|
149
|
+
export const generateMessageID = () => 'B4DZZN3-' + randomBytes(18).toString('hex').toUpperCase();
|
|
151
150
|
export function bindWaitForEvent(ev, event) {
|
|
152
151
|
return async (check, timeoutMs) => {
|
|
153
152
|
let listener;
|
|
@@ -173,19 +172,16 @@ export function bindWaitForEvent(ev, event) {
|
|
|
173
172
|
}
|
|
174
173
|
export const generateIOSMessageID = () => {
|
|
175
174
|
const prefix = '3A';
|
|
176
|
-
const random = randomBytes(
|
|
175
|
+
const random = randomBytes(10);
|
|
177
176
|
return (prefix + random.toString('hex')).toUpperCase().substring(0, 21);
|
|
178
177
|
};
|
|
179
178
|
export const generateAndroMessageID = () => {
|
|
180
179
|
const prefix = '3A';
|
|
181
|
-
const random = randomBytes(16);
|
|
180
|
+
const random = randomBytes(16);
|
|
182
181
|
return (random.toString('hex')).toUpperCase().substring(0, 21);
|
|
183
182
|
};
|
|
184
183
|
export const bindWaitForConnectionUpdate = (ev) => bindWaitForEvent(ev, 'connection.update');
|
|
185
|
-
|
|
186
|
-
* utility that fetches latest baileys version from the master branch.
|
|
187
|
-
* Use to ensure your WA connection is always on the latest version
|
|
188
|
-
*/
|
|
184
|
+
|
|
189
185
|
export const fetchLatestBaileysVersion = async (options = {}) => {
|
|
190
186
|
const URL = 'https://raw.githubusercontent.com/WhiskeySockets/Baileys/master/src/Defaults/index.ts';
|
|
191
187
|
try {
|
package/lib/index.js
CHANGED
|
@@ -25,9 +25,9 @@ console.log(chalk.bold.cyan(`
|
|
|
25
25
|
¤═―— ⎧ 𝐁𝐀𝐃𝐙𝐙 𝐁𝐀𝐈𝐋𝐄𝐘𝐒 ⎭ ⊱―—═¤
|
|
26
26
|
Information:
|
|
27
27
|
Developer: @badzzne2
|
|
28
|
-
Version: 11.
|
|
28
|
+
Version: 11.7
|
|
29
29
|
Status: Baileys Berhasil Terinstall
|
|
30
|
-
Update date:
|
|
30
|
+
Update date: 28/07/26
|
|
31
31
|
`));
|
|
32
32
|
console.log(chalk.bold.gray("--------------------------------------------\n"));
|
|
33
33
|
console.log(chalk.bold.cyan("Follow Our Telegram Channel To See Update Information: t.me/FoxsSql\n"));
|