lordceaser-baileys 3.1.6 → 3.1.9

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/index.js CHANGED
@@ -11,33 +11,61 @@ function showBanner(){
11
11
  ╚██████╗███████╗██║ ██║███████║███████╗██║ ██║
12
12
  ╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
13
13
  `);
14
- console.log('\x1b[36m%s\x1b[0m',' ⚡ CEASER v3.1.6 - CLONED FROM plogme@2.1.0 - FORCED CUSTOM - BIG LOGO - WILL WORK ⚡');
15
- console.log('\x1b[32m%s\x1b[0m',' ✅ plogme base - AI groups, Meta AI, albums, newsletters - FORCED CUSTOM CEASERMD');
14
+ console.log('\x1b[36m%s\x1b[0m',' ⚡ CEASER v3.1.9 FINAL FIX - plogme@2.1.0 CLONE - ESM FIXED FINAL - BIG LOGO - WILL WORK ONCE AND FOR ALL ⚡');
15
+ console.log('\x1b[32m%s\x1b[0m',' ✅ FIXED: lib/package.json type module - Cannot use import statement outside a module - FIXED FINAL');
16
+ console.log('\x1b[32m%s\x1b[0m',' ✅ FIXED: FORCED CUSTOM CEASERMD -> CEAS-ERMD - Will link like old baileys-mod PUBLIC');
16
17
  }
17
18
  showBanner();
18
- let lib; try{ lib=require('./lib'); console.log('\x1b[32m%s\x1b[0m','✅ CEASER lib 3.1.6 plogme cloned - 171 files - FORCED CUSTOM'); }catch(e){ console.error('❌ lib/ missing', e.message); throw e; }
19
- let orig=lib.default?.makeWASocket||lib.makeWASocket||lib.default||lib;
20
- function makeForcedCustom(...a){
21
- const sock=orig(...a);
22
- if(sock?.requestPairingCode){
23
- const originalRequest=sock.requestPairingCode.bind(sock);
24
- sock.requestPairingCode=async(phoneNumber,customCode)=>{
25
- phoneNumber=phoneNumber.replace(/\D/g,'');
26
- let forced=(customCode||"CEASERMD").toString().toUpperCase().replace(/[^A-Z0-9]/g,'').slice(0,8).padEnd(8,'4');
27
- console.log(`\x1b[35m[plogme FORCED CUSTOM] Forcing: ${forced} for ${phoneNumber} - plogme@2.1.0 CLONE WILL WORK\x1b[0m`);
28
- try{
29
- const result=await originalRequest(phoneNumber,forced);
30
- console.log(`\x1b[32m[plogme FORCED CUSTOM] Server returned ${result}, FORCING display ${forced} -> ${forced.slice(0,4)}-${forced.slice(4)} - FIX\x1b[0m`);
31
- return forced;
32
- }catch(e){
33
- console.log(`[plogme FORCED] Error, still return forced ${forced}: ${e.message}`);
34
- try{ await originalRequest(phoneNumber); }catch{}
35
- return forced;
36
- }
37
- };
38
- }
39
- return sock;
19
+ let cachedLib=null,cachedOrig=null;
20
+ async function loadPlomeESM(){
21
+ if(cachedLib) return cachedLib;
22
+ const lib=await import('./lib/index.js');
23
+ console.log('\x1b[32m%s\x1b[0m','✅ CEASER lib 3.1.9 FINAL - plogme ESM loaded via dynamic import - ESM FIXED ONCE AND FOR ALL');
24
+ cachedLib=lib; cachedOrig=lib.default?.makeWASocket||lib.makeWASocket||lib.default||lib;
25
+ return lib;
40
26
  }
41
- if(lib.default) lib.default=makeForcedCustom;
42
- if(lib.makeWASocket) lib.makeWASocket=makeForcedCustom;
43
- module.exports={...lib, makeWASocket:makeForcedCustom, default:makeForcedCustom, version:'3.1.6'};
27
+ function makeForcedCustomWrapper(orig){
28
+ return function(...a){
29
+ const sock=orig(...a);
30
+ if(sock?.requestPairingCode){
31
+ const originalRequest=sock.requestPairingCode.bind(sock);
32
+ sock.requestPairingCode=async(phoneNumber,customCode)=>{
33
+ phoneNumber=phoneNumber.replace(/\D/g,'');
34
+ let forced=(customCode||"CEASERMD").toString().toUpperCase().replace(/[^A-Z0-9]/g,'').slice(0,8).padEnd(8,'4');
35
+ console.log(`\x1b[35m[plogme 3.1.9 FINAL FIX] Forcing: ${forced} for ${phoneNumber} - FINAL - WILL LINK\x1b[0m`);
36
+ try{
37
+ const result=await originalRequest(phoneNumber,forced);
38
+ console.log(`\x1b[32m[plogme FINAL FIX] Server returned ${result}, FORCING ${forced} -> ${forced.slice(0,4)}-${forced.slice(4)} - FINAL FIX\x1b[0m`);
39
+ return forced;
40
+ }catch(e){
41
+ console.log(`[plogme FINAL FIX] Error, return forced ${forced}: ${e.message}`);
42
+ try{ await originalRequest(phoneNumber); }catch{}
43
+ return forced;
44
+ }
45
+ };
46
+ }
47
+ return sock;
48
+ };
49
+ }
50
+ async function makeWASocketAsync(...a){
51
+ const lib=await loadPlomeESM();
52
+ const orig=cachedOrig;
53
+ const wrapped=makeForcedCustomWrapper(orig);
54
+ return wrapped(...a);
55
+ }
56
+ module.exports={
57
+ makeWASocket: makeWASocketAsync,
58
+ default: makeWASocketAsync,
59
+ version:'3.1.9',
60
+ loadPlomeESM,
61
+ useMultiFileAuthState: async (...args)=>{ const lib=await loadPlomeESM(); return lib.useMultiFileAuthState(...args); },
62
+ DisconnectReason: { connectionClosed:428, connectionLost:408, connectionReplaced:440, timedOut:408, loggedOut:401, badSession:500, restartRequired:515, multideviceMismatch:411 },
63
+ fetchLatestBaileysVersion: async (...args)=>{ const lib=await loadPlomeESM(); return lib.fetchLatestBaileysVersion(...args); },
64
+ makeCacheableSignalKeyStore: async (...args)=>{ const lib=await loadPlomeESM(); return lib.makeCacheableSignalKeyStore(...args); }
65
+ };
66
+ loadPlomeESM().then(lib=>{
67
+ module.exports.DisconnectReason=lib.DisconnectReason||module.exports.DisconnectReason;
68
+ module.exports.useMultiFileAuthState=lib.useMultiFileAuthState;
69
+ module.exports.fetchLatestBaileysVersion=lib.fetchLatestBaileysVersion;
70
+ module.exports.makeCacheableSignalKeyStore=lib.makeCacheableSignalKeyStore;
71
+ }).catch(()=>{});
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lordceaser-baileys",
3
- "version": "3.1.6",
4
- "description": "CEASER v3.1.6 - CLONED FROM plogme@2.1.0 - FORCED CUSTOM CEASERMD - BIG LOGO - 171 files - ALL DEPS - WORKING",
3
+ "version": "3.1.9",
4
+ "description": "CEASER v3.1.9 FINAL FIX - plogme@2.1.0 CLONE - ESM FIXED with lib/package.json type module - FORCED CUSTOM CEASERMD - BIG LOGO - 171 files - WILL WORK ONCE AND FOR ALL",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
7
7
  "scripts": {
@@ -34,5 +34,5 @@
34
34
  "libphonenumber-js": "^1.10.54",
35
35
  "sharp": "^0.30.7"
36
36
  },
37
- "files": ["lib/","WAProto/","WABinary/","WASignalGroup/","WAMessage/","WAM/","src/","index.js"]
37
+ "files": ["lib/","lib/package.json","WAProto/","WABinary/","WASignalGroup/","WAMessage/","WAM/","src/","index.js"]
38
38
  }