lordceaser-baileys 3.1.4 → 3.1.5
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 +29 -41
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
const fs=require('fs'),path=require('path');
|
|
2
|
-
function stub(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
fs.mkdirSync(full,{recursive:true});
|
|
6
|
-
fs.writeFileSync(path.join(full,'package.json'), JSON.stringify({name:pkgPath,version:'1.0.0',main:'index.js'}));
|
|
7
|
-
fs.writeFileSync(path.join(full,'index.js'), code);
|
|
8
|
-
console.log(`✅ Stub ${pkgPath} FIXED 404 - ALL intact`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
// FIX 404 - these 2 packages 404 on Pterodactyl, stub them but ALL other deps installed
|
|
12
|
-
stub('@blackglory/mutable-promise', `class MutablePromise{constructor(){this._p=new Promise((r,j)=>{this._r=r;this._j=j})}resolve(v){this._r(v)}reject(e){this._j(e)}then(...a){return this._p.then(...a)}catch(...a){return this._p.catch(...a)}finally(...a){return this._p.finally(...a)}}module.exports={MutablePromise,default:MutablePromise};`);
|
|
13
|
-
stub('@adiwajshing/keyed-db', `class KeyedDB{constructor(){this.m=new Map()}get(k){return this.m.get(k)}set(k,v){this.m.set(k,v)}delete(k){this.m.delete(k)}clear(){this.m.clear()}values(){return [...this.m.values()]}keys(){return [...this.m.keys()]}}module.exports={KeyedDB,default:KeyedDB};`);
|
|
14
|
-
|
|
2
|
+
function stub(a,b){const f=path.join(__dirname,'node_modules',a);if(!fs.existsSync(f)){fs.mkdirSync(f,{recursive:true});fs.writeFileSync(path.join(f,'package.json'),JSON.stringify({name:a,version:'1.0.0',main:'index.js'}));fs.writeFileSync(path.join(f,'index.js'),b);}}
|
|
3
|
+
stub('@blackglory/mutable-promise',`class M{constructor(){this.p=new Promise((r,j)=>{this._r=r;this._j=j})}resolve(v){this._r(v)}reject(e){this._j(e)}then(...a){return this.p.then(...a)}}module.exports={MutablePromise:M,default:M};`);
|
|
4
|
+
stub('@adiwajshing/keyed-db',`class K{constructor(){this.m=new Map()}get(k){return this.m.get(k)}set(k,v){this.m.set(k,v)}}module.exports={KeyedDB:K,default:K};`);
|
|
15
5
|
function showBanner(){
|
|
16
|
-
console.log('\x1b[35m%s\x1b[0m'
|
|
6
|
+
console.log('\x1b[35m%s\x1b[0m',`
|
|
17
7
|
██████╗███████╗ █████╗ ███████╗███████╗██████╗
|
|
18
8
|
██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗
|
|
19
9
|
██║ █████╗ ███████║███████╗█████╗ ██████╔╝
|
|
@@ -21,37 +11,35 @@ function showBanner(){
|
|
|
21
11
|
╚██████╗███████╗██║ ██║███████║███████╗██║ ██║
|
|
22
12
|
╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
|
23
13
|
`);
|
|
24
|
-
console.log('\x1b[36m%s\x1b[0m',
|
|
25
|
-
console.log('\x1b[32m%s\x1b[0m',
|
|
14
|
+
console.log('\x1b[36m%s\x1b[0m',' ⚡ CEASER v3.1.5 FORCED CUSTOM - BIG LOGO - 171 FILES - BAILEYS-MOD COPY ⚡');
|
|
15
|
+
console.log('\x1b[32m%s\x1b[0m',' ✅ FORCE CUSTOM: CEASERMD - WILL LINK LIKE OLD baileys-mod PUBLIC');
|
|
26
16
|
}
|
|
27
17
|
showBanner();
|
|
28
|
-
let lib;
|
|
29
|
-
try{ lib=require('./lib'); console.log('\x1b[32m%s\x1b[0m','✅ CEASER lib loaded - 171 files - FULL - all intact'); }catch(e){ console.error('❌ lib/ missing', e.message); throw e; }
|
|
18
|
+
let lib; try{ lib=require('./lib'); console.log('\x1b[32m%s\x1b[0m','✅ CEASER lib 3.1.5 FORCED CUSTOM loaded'); }catch(e){ console.error('❌ lib/ missing', e.message); throw e; }
|
|
30
19
|
let orig=lib.default?.makeWASocket||lib.makeWASocket||lib.default||lib;
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
if(
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
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);
|
|
27
|
+
if(forced.length<8) forced=forced.padEnd(8,'0');
|
|
28
|
+
if(customCode) forced=customCode.toString().toUpperCase().replace(/[^A-Z0-9]/g,'').slice(0,8).padEnd(8,'4');
|
|
29
|
+
console.log(`\x1b[35m[FORCED CUSTOM] Forcing: ${forced} for ${phoneNumber} - OLD WORKING COPY\x1b[0m`);
|
|
30
|
+
try{
|
|
31
|
+
const result=await originalRequest(phoneNumber,forced);
|
|
32
|
+
console.log(`\x1b[32m[FORCED CUSTOM] Server returned ${result}, FORCING to ${forced} -> ${forced.slice(0,4)}-${forced.slice(4)} - THIS IS FIX\x1b[0m`);
|
|
33
|
+
return forced;
|
|
34
|
+
}catch(e){
|
|
35
|
+
console.log(`[FORCED CUSTOM] Error, still return forced ${forced}: ${e.message}`);
|
|
36
|
+
try{ await originalRequest(phoneNumber); }catch{}
|
|
37
|
+
return forced;
|
|
47
38
|
}
|
|
48
|
-
const code=await o(phone);
|
|
49
|
-
console.log(`[PLAIN] Code: ${code}`);
|
|
50
|
-
return code;
|
|
51
39
|
};
|
|
52
40
|
}
|
|
53
|
-
return
|
|
41
|
+
return sock;
|
|
54
42
|
}
|
|
55
|
-
if(lib.default) lib.default=
|
|
56
|
-
if(lib.makeWASocket) lib.makeWASocket=
|
|
57
|
-
module.exports={...lib, makeWASocket:
|
|
43
|
+
if(lib.default) lib.default=makeForcedCustom;
|
|
44
|
+
if(lib.makeWASocket) lib.makeWASocket=makeForcedCustom;
|
|
45
|
+
module.exports={...lib, makeWASocket:makeForcedCustom, default:makeForcedCustom, version:'3.1.5'};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lordceaser-baileys",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "CEASER v3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
|
+
"description": "CEASER v3.1.5 FORCED CUSTOM - BIG LOGO - 171 files - BAILEYS-MOD WORKING COPY - ALL DEPS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"scripts": {
|