@skyzopedia/baileys-mod 5.0.2 → 5.0.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 TsmXeuka
3
+ Copyright (c) 2025 Skyzopedia
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -210,6 +210,27 @@ export const makeSocket = (config) => {
210
210
  const { creds } = authState;
211
211
  const keys = addTransactionCapability(authState.keys, logger, transactionOpts);
212
212
  const signalRepository = makeSignalRepository({ creds, keys }, logger, pnFromLIDUSync);
213
+ const toLid = async (pn) => {
214
+ if (pn.includes("@lid")) return pn
215
+ try {
216
+ return signalRepository.lidMapping.getLIDForPN(pn)
217
+ } catch (err) {
218
+ logger.error({ err }, "error jid unknown");
219
+ return pn
220
+ }
221
+ }
222
+ const toPn = async (pn) => {
223
+ if (pn.includes("@s.whatsapp.net")) return pn
224
+ try {
225
+ const jid = await signalRepository.lidMapping.getPNForLID(pn)
226
+ const server = "@" + jid.split("@")[1]
227
+ const pN = jid.split(":")[0] + server
228
+ return pN.toString()
229
+ } catch (err) {
230
+ logger.error({ err }, "error pn unknown");
231
+ return pn
232
+ }
233
+ }
213
234
  let lastDateRecv;
214
235
  let epoch = 1;
215
236
  let keepAliveReq;
@@ -769,7 +790,9 @@ export const makeSocket = (config) => {
769
790
  waitForConnectionUpdate: bindWaitForConnectionUpdate(ev),
770
791
  sendWAMBuffer,
771
792
  executeUSyncQuery,
772
- onWhatsApp
793
+ onWhatsApp,
794
+ toLid,
795
+ toPn
773
796
  };
774
797
  };
775
798
  //=======================================================//
package/lib/index.js CHANGED
@@ -1,9 +1,14 @@
1
1
  //=======================================================//
2
2
 
3
+ import gradient from "gradient-string";
4
+
5
+ console.log();
6
+ console.log(gradient.vice('## Baileys Mod by Skyzopedia'));
7
+ console.log(gradient.vice('Thank you for using Baileys, enjoy!'));
3
8
  console.log();
4
- console.log("## Baileys Mod by Skyzopedia");
5
- console.log("• https://t.me/Xskycode");
6
- console.log("• https://whatsapp.com/channel/0029Vb6gF6kGU3BM8hcDW322");
9
+ console.log(gradient.vice('## My Sosial Media'));
10
+ console.log(gradient.vice('Telegram: https://t.me/Xskycode'));
11
+ console.log(gradient.vice('Youtube: https://youtube.com/@skyzopedia-0xf'));
7
12
  console.log();
8
13
 
9
14
  import makeWASocket from "./Socket/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyzopedia/baileys-mod",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "Websocket Whatsapp API for Node.js",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -46,6 +46,7 @@
46
46
  "async-mutex": "*",
47
47
  "@hapi/boom": "*",
48
48
  "pbjs": "^0.0.14",
49
+ "gradient-string": "*",
49
50
  "protobufjs": "*",
50
51
  "lru-cache": "*",
51
52
  "readline": "*",