lordceaser-baileys 2.0.52 → 2.0.54
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 +11 -42
- package/package.json +7 -8
- package/WAMessage/BinaryInfo.d.ts +0 -17
- package/WAMessage/BinaryInfo.js +0 -13
- package/WAMessage/constants.d.ts +0 -38
- package/WAMessage/constants.js +0 -15350
- package/WAMessage/encode.d.ts +0 -3
- package/WAMessage/encode.js +0 -155
- package/WAMessage/index.d.ts +0 -3
- package/WAMessage/index.js +0 -19
package/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
function showBanner()
|
|
2
|
-
|
|
3
|
-
console.log('\x1b[35m%s\x1b[0m', `
|
|
1
|
+
function showBanner(){
|
|
2
|
+
console.log('\x1b[35m%s\x1b[0m', `
|
|
4
3
|
██████╗███████╗ █████╗ ███████╗███████╗██████╗
|
|
5
4
|
██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗
|
|
6
5
|
██║ █████╗ ███████║███████╗█████╗ ██████╔╝
|
|
@@ -8,19 +7,11 @@ function showBanner() {
|
|
|
8
7
|
╚██████╗███████╗██║ ██║███████║███████╗██║ ██║
|
|
9
8
|
╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
|
|
10
9
|
`);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} catch {}
|
|
10
|
+
console.log('\x1b[36m ⚡ CEASER v2.0.54 FINAL - BIG LOGO on install - CUSTOM CEASERMD - PAIRING FIXED ⚡\x1b[0m');
|
|
11
|
+
console.log('\x1b[32m ✅ Pterodactyl FIXED • Pairing FIXED • Logo on install FIXED\x1b[0m');
|
|
14
12
|
}
|
|
15
13
|
showBanner();
|
|
16
|
-
let lib;
|
|
17
|
-
try {
|
|
18
|
-
lib = require('./lib');
|
|
19
|
-
console.log('\x1b[32m✅ CEASER lib loaded - 171 files CJS - v2.0.52\x1b[0m');
|
|
20
|
-
} catch (e) {
|
|
21
|
-
console.error('\x1b[31m❌ lib/ missing!\x1b[0m', e.message);
|
|
22
|
-
throw e;
|
|
23
|
-
}
|
|
14
|
+
let lib; try{ lib=require('./lib'); console.log('\x1b[32m✅ CEASER lib loaded - 171 files\x1b[0m'); }catch(e){ console.error('❌ lib/ missing!', e.message); throw e; }
|
|
24
15
|
const originalMakeWASocket = lib.default || lib.makeWASocket || lib;
|
|
25
16
|
function normalizeButtons(c){
|
|
26
17
|
if(!c) return c;
|
|
@@ -29,33 +20,17 @@ function normalizeButtons(c){
|
|
|
29
20
|
const f=c.nativeFlow.map(b=>{
|
|
30
21
|
if(b.url) return {name:"cta_url",buttonParamsJson:JSON.stringify({display_text:b.text||b.displayText||"Channel",url:b.url})};
|
|
31
22
|
if(b.id) return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:b.text||b.displayText||"Button",id:b.id})};
|
|
32
|
-
if(b.text) return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:b.text,id:b.text.toLowerCase().replace(/\s+/g,'_')})};
|
|
33
23
|
return null;
|
|
34
24
|
}).filter(Boolean);
|
|
35
25
|
const n={...c}; delete n.nativeFlow; n.interactiveButtons=f; return n;
|
|
36
26
|
}
|
|
37
|
-
if(c.buttons && Array.isArray(c.buttons)){
|
|
38
|
-
const f=c.buttons.map(b=>{
|
|
39
|
-
const t=b.buttonText?.displayText||b.displayText||b.text||"Button";
|
|
40
|
-
const id=b.buttonId||b.id||t.toLowerCase().replace(/\s+/g,'_');
|
|
41
|
-
if(b.type===2||b.url) return {name:"cta_url",buttonParamsJson:JSON.stringify({display_text:t,url:b.url||"https://whatsapp.com/channel/0029VbDdSaV5PO0ukeNIwY1T"})};
|
|
42
|
-
return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:t,id:id})};
|
|
43
|
-
});
|
|
44
|
-
const n={...c}; delete n.buttons; delete n.headerType; n.interactiveButtons=f; return n;
|
|
45
|
-
}
|
|
46
27
|
return c;
|
|
47
28
|
}
|
|
48
29
|
function patchSocket(sock){
|
|
49
30
|
if(!sock||sock._ceaserPatched) return sock;
|
|
50
31
|
const o=sock.sendMessage.bind(sock);
|
|
51
32
|
const origPair=sock.requestPairingCode?sock.requestPairingCode.bind(sock):null;
|
|
52
|
-
sock.sendMessage=async(j,c,op)=>{
|
|
53
|
-
try{
|
|
54
|
-
let n=normalizeButtons(c);
|
|
55
|
-
if(n&&(n.image||n.video)&&n.interactiveButtons){if(!n.footer) n.footer="C4 Society • Ping Executed"; if(n.image&&!n.caption&&n.text){n.caption=n.text; delete n.text;}}
|
|
56
|
-
return await o(j,n,op);
|
|
57
|
-
}catch(e){return await o(j,c,op)}
|
|
58
|
-
};
|
|
33
|
+
sock.sendMessage=async(j,c,op)=>{ try{ let n=normalizeButtons(c); if(n&&(n.image||n.video)&&n.interactiveButtons){ if(!n.footer) n.footer="C4 Society • Ping Executed"; } return await o(j,n,op); }catch(e){ return await o(j,c,op) } };
|
|
59
34
|
if(origPair){
|
|
60
35
|
sock.requestPairingCode=async(phoneNumber,customCode)=>{
|
|
61
36
|
const clean=phoneNumber.toString().replace(/[^0-9]/g,'');
|
|
@@ -64,11 +39,7 @@ function patchSocket(sock){
|
|
|
64
39
|
console.log('📲 Pairing: '+clean+(custom?' CUSTOM='+custom:''));
|
|
65
40
|
const orig=await origPair(clean);
|
|
66
41
|
if(custom){
|
|
67
|
-
if(sock.authState&&sock.authState.creds){
|
|
68
|
-
sock.authState.creds.pairingCode=custom;
|
|
69
|
-
try{const{jidEncode}=require('./lib/WABinary/jid-utils'); sock.authState.creds.me={id:jidEncode(clean,'s.whatsapp.net'),name:'~'};}catch{sock.authState.creds.me={id:clean+'@s.whatsapp.net',name:'~'};}
|
|
70
|
-
console.log('✅ Custom '+custom+' active - enter '+custom.match(/.{1,4}/g).join('-'));
|
|
71
|
-
}
|
|
42
|
+
if(sock.authState&&sock.authState.creds){ sock.authState.creds.pairingCode=custom; console.log('✅ Custom '+custom+' active - enter '+custom.match(/.{1,4}/g).join('-')); }
|
|
72
43
|
return custom;
|
|
73
44
|
}
|
|
74
45
|
return orig;
|
|
@@ -76,9 +47,7 @@ function patchSocket(sock){
|
|
|
76
47
|
}
|
|
77
48
|
sock._ceaserPatched=true; return sock;
|
|
78
49
|
}
|
|
79
|
-
function makeFixed(...a){return patchSocket(originalMakeWASocket(...a));}
|
|
80
|
-
if(lib.default) lib.default=makeFixed;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
for(const k in lib){if(!(k in module.exports)) module.exports[k]=lib[k];}
|
|
84
|
-
console.log("✅ v2.0.52 FINAL - CUSTOM CEASERMD + BIG LOGO + PAIRING FIXED");
|
|
50
|
+
function makeFixed(...a){ return patchSocket(originalMakeWASocket(...a)); }
|
|
51
|
+
if(lib.default) lib.default=makeFixed; if(lib.makeWASocket) lib.makeWASocket=makeFixed;
|
|
52
|
+
module.exports={...lib, makeWASocket: makeFixed, default: makeFixed, version:'2.0.54'};
|
|
53
|
+
for(const k in lib){ if(!(k in module.exports)) module.exports[k]=lib[k]; }
|
package/package.json
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lordceaser-baileys",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "CEASER v2.0.
|
|
3
|
+
"version": "2.0.54",
|
|
4
|
+
"description": "CEASER v2.0.54 FINAL - BIG LOGO on install + CUSTOM CEASERMD + PAIRING FIXED - 171 files",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"author": "Lord Ceaser Himself",
|
|
9
|
-
"keywords": ["whatsapp","baileys","ceaser","bot"],
|
|
10
7
|
"scripts": {
|
|
11
|
-
"postinstall": "node -e \"try{require('./index.js')}catch(e){console.log('CEASER installed
|
|
8
|
+
"postinstall": "node -e \"try{require('./index.js')}catch(e){console.log('CEASER installed')}\""
|
|
12
9
|
},
|
|
13
10
|
"dependencies": {
|
|
14
11
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
15
12
|
"@cacheable/node-cache": "^1.1.4",
|
|
16
13
|
"@hapi/boom": "^9.1.4",
|
|
14
|
+
"async-lock": "^1.4.1",
|
|
17
15
|
"async-mutex": "^0.4.0",
|
|
18
16
|
"axios": "^1.6.0",
|
|
19
17
|
"cache-manager": "^3.6.3",
|
|
@@ -32,7 +30,8 @@
|
|
|
32
30
|
"lodash": "^4.17.21",
|
|
33
31
|
"mysql2": "^3.9.7",
|
|
34
32
|
"node-cache": "^5.1.2",
|
|
35
|
-
"file-type": "^16.5.4"
|
|
33
|
+
"file-type": "^16.5.4",
|
|
34
|
+
"uuid": "^11.0.0"
|
|
36
35
|
},
|
|
37
|
-
"files": ["lib/","WAProto/","WABinary/","WASignalGroup/","WAMessage/","index.js"
|
|
36
|
+
"files": ["lib/","WAProto/","WABinary/","WASignalGroup/","WAMessage/","index.js"]
|
|
38
37
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export declare class BinaryInfo {
|
|
3
|
-
protocolVersion: number;
|
|
4
|
-
sequence: number;
|
|
5
|
-
events: {
|
|
6
|
-
[x: string]: {
|
|
7
|
-
props: {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
};
|
|
10
|
-
globals: {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}[];
|
|
15
|
-
buffer: Buffer[];
|
|
16
|
-
constructor(options?: Partial<BinaryInfo>);
|
|
17
|
-
}
|
package/WAMessage/BinaryInfo.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BinaryInfo = void 0;
|
|
4
|
-
class BinaryInfo {
|
|
5
|
-
constructor(options = {}) {
|
|
6
|
-
this.protocolVersion = 5;
|
|
7
|
-
this.sequence = 0;
|
|
8
|
-
this.events = [];
|
|
9
|
-
this.buffer = [];
|
|
10
|
-
Object.assign(this, options);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.BinaryInfo = BinaryInfo;
|
package/WAMessage/constants.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare const WEB_EVENTS: Event[];
|
|
2
|
-
export declare const WEB_GLOBALS: Global[];
|
|
3
|
-
export declare const FLAG_BYTE = 8, FLAG_GLOBAL = 0, FLAG_EVENT = 1, FLAG_FIELD = 2, FLAG_EXTENDED = 4;
|
|
4
|
-
export type Event = {
|
|
5
|
-
name: string;
|
|
6
|
-
id: number;
|
|
7
|
-
props: {
|
|
8
|
-
[key: string]: [number, string | {
|
|
9
|
-
[key: string]: number;
|
|
10
|
-
}];
|
|
11
|
-
};
|
|
12
|
-
weight: number;
|
|
13
|
-
wamChannel: string;
|
|
14
|
-
privateStatsIdInt: number;
|
|
15
|
-
};
|
|
16
|
-
export type Global = {
|
|
17
|
-
name: string;
|
|
18
|
-
id: number;
|
|
19
|
-
type: string | {
|
|
20
|
-
[key: string]: number;
|
|
21
|
-
};
|
|
22
|
-
validator?: string;
|
|
23
|
-
channels: string[];
|
|
24
|
-
};
|
|
25
|
-
type EventByName<T extends Event['name']> = Extract<Event, {
|
|
26
|
-
name: T;
|
|
27
|
-
}>;
|
|
28
|
-
export type EventInputType = {
|
|
29
|
-
[key in Event['name']]: {
|
|
30
|
-
props: {
|
|
31
|
-
[k in keyof EventByName<key>['props']]: any;
|
|
32
|
-
};
|
|
33
|
-
globals: {
|
|
34
|
-
[x: string]: any;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
} & {};
|
|
38
|
-
export {};
|