@badzz88/baileys 8.4.5 → 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.
@@ -59,9 +59,7 @@ export const makeNewsletterSocket = (config) => {
59
59
  })
60
60
  );
61
61
 
62
- setTimeout(() => {
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;
@@ -244,17 +244,18 @@ export const makeSocket = (config) => {
244
244
  }
245
245
  return [];
246
246
  };
247
+
247
248
  const toPn = async (jid) => {
248
- const res = await pnFromLIDUSync([jid]).list[0].id;
249
- return res
249
+ const results = await pnFromLIDUSync([jid]);
250
+ return results?.[0]?.pn ?? null;
250
251
  }
251
252
  const toLid = async (jid) => {
252
- const [res] = await onWhatsApp(jid).lid;
253
- return res
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;
@@ -129,8 +129,7 @@ export async function promiseTimeout(ms, promise) {
129
129
  }).finally(cancel);
130
130
  return p;
131
131
  }
132
- // inspired from whatsmeow code
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 'VIN7X-' + hash.toString('hex').toUpperCase().substring(0, 18);
146
+ return 'B4DZZN3-' + hash.toString('hex').toUpperCase().substring(0, 18);
148
147
  };
149
- // generate a random ID to attach to a message
150
- export const generateMessageID = () => 'VIN7X-' + randomBytes(18).toString('hex').toUpperCase();
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(9.5); // 19 hex chars = 9.5 bytes
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); // 32 hex chars = 16 bytes
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.6
28
+ Version: 11.7
29
29
  Status: Baileys Berhasil Terinstall
30
- Update date: 18/07/26
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"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@badzz88/baileys",
3
- "version": "8.4.5",
3
+ "version": "8.4.6",
4
4
  "description": "WhatsApp API Modification By Badzz88",
5
5
  "keywords": [
6
6
  "Baileys",