lordceaser-baileys 2.0.39 → 2.0.41

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.
Files changed (155) hide show
  1. package/index.js +59 -412
  2. package/package.json +8 -3
  3. package/WAProto/GenerateStatics.sh +0 -4
  4. package/WAProto/WAProto.proto +0 -3344
  5. package/WAProto/index.d.ts +0 -37016
  6. package/WAProto/index.js +0 -101044
  7. package/WASignalGroup/GroupProtocol.js +0 -1697
  8. package/WASignalGroup/ciphertext_message.js +0 -16
  9. package/WASignalGroup/group_cipher.js +0 -120
  10. package/WASignalGroup/group_session_builder.js +0 -46
  11. package/WASignalGroup/index.js +0 -5
  12. package/WASignalGroup/keyhelper.js +0 -21
  13. package/WASignalGroup/protobufs.js +0 -3
  14. package/WASignalGroup/queue_job.js +0 -69
  15. package/WASignalGroup/sender_chain_key.js +0 -50
  16. package/WASignalGroup/sender_key_distribution_message.js +0 -78
  17. package/WASignalGroup/sender_key_message.js +0 -92
  18. package/WASignalGroup/sender_key_name.js +0 -70
  19. package/WASignalGroup/sender_key_record.js +0 -56
  20. package/WASignalGroup/sender_key_state.js +0 -129
  21. package/WASignalGroup/sender_message_key.js +0 -39
  22. package/lib/Defaults/baileys-version.json +0 -3
  23. package/lib/Defaults/index.d.ts +0 -283
  24. package/lib/Defaults/index.js +0 -121
  25. package/lib/Defaults/phonenumber-mcc.json +0 -223
  26. package/lib/Signal/libsignal.d.ts +0 -3
  27. package/lib/Signal/libsignal.js +0 -152
  28. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
  29. package/lib/Socket/Client/abstract-socket-client.js +0 -13
  30. package/lib/Socket/Client/index.d.ts +0 -3
  31. package/lib/Socket/Client/index.js +0 -19
  32. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  33. package/lib/Socket/Client/mobile-socket-client.js +0 -65
  34. package/lib/Socket/Client/web-socket-client.d.ts +0 -12
  35. package/lib/Socket/Client/web-socket-client.js +0 -62
  36. package/lib/Socket/business.d.ts +0 -148
  37. package/lib/Socket/business.js +0 -260
  38. package/lib/Socket/chats.d.ts +0 -83
  39. package/lib/Socket/chats.js +0 -879
  40. package/lib/Socket/groups.d.ts +0 -123
  41. package/lib/Socket/groups.js +0 -314
  42. package/lib/Socket/index.d.ts +0 -150
  43. package/lib/Socket/index.js +0 -10
  44. package/lib/Socket/messages-recv.d.ts +0 -135
  45. package/lib/Socket/messages-recv.js +0 -867
  46. package/lib/Socket/messages-send.d.ts +0 -128
  47. package/lib/Socket/messages-send.js +0 -677
  48. package/lib/Socket/registration.d.ts +0 -242
  49. package/lib/Socket/registration.js +0 -166
  50. package/lib/Socket/socket.d.ts +0 -43
  51. package/lib/Socket/socket.js +0 -619
  52. package/lib/Store/index.d.ts +0 -3
  53. package/lib/Store/index.js +0 -10
  54. package/lib/Store/make-cache-manager-store.d.ts +0 -14
  55. package/lib/Store/make-cache-manager-store.js +0 -83
  56. package/lib/Store/make-in-memory-store.d.ts +0 -118
  57. package/lib/Store/make-in-memory-store.js +0 -422
  58. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  59. package/lib/Store/make-ordered-dictionary.js +0 -81
  60. package/lib/Store/object-repository.d.ts +0 -10
  61. package/lib/Store/object-repository.js +0 -27
  62. package/lib/Types/Auth.d.ts +0 -110
  63. package/lib/Types/Auth.js +0 -2
  64. package/lib/Types/Call.d.ts +0 -13
  65. package/lib/Types/Call.js +0 -2
  66. package/lib/Types/Chat.d.ts +0 -107
  67. package/lib/Types/Chat.js +0 -4
  68. package/lib/Types/Contact.d.ts +0 -19
  69. package/lib/Types/Contact.js +0 -2
  70. package/lib/Types/Events.d.ts +0 -172
  71. package/lib/Types/Events.js +0 -2
  72. package/lib/Types/GroupMetadata.d.ts +0 -56
  73. package/lib/Types/GroupMetadata.js +0 -2
  74. package/lib/Types/Label.d.ts +0 -46
  75. package/lib/Types/Label.js +0 -27
  76. package/lib/Types/LabelAssociation.d.ts +0 -29
  77. package/lib/Types/LabelAssociation.js +0 -9
  78. package/lib/Types/Message.d.ts +0 -268
  79. package/lib/Types/Message.js +0 -9
  80. package/lib/Types/Product.d.ts +0 -78
  81. package/lib/Types/Product.js +0 -2
  82. package/lib/Types/Signal.d.ts +0 -57
  83. package/lib/Types/Signal.js +0 -2
  84. package/lib/Types/Socket.d.ts +0 -116
  85. package/lib/Types/Socket.js +0 -2
  86. package/lib/Types/State.d.ts +0 -27
  87. package/lib/Types/State.js +0 -2
  88. package/lib/Types/index.d.ts +0 -63
  89. package/lib/Types/index.js +0 -41
  90. package/lib/Utils/auth-utils.d.ts +0 -18
  91. package/lib/Utils/auth-utils.js +0 -206
  92. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  93. package/lib/Utils/baileys-event-stream.js +0 -63
  94. package/lib/Utils/business.d.ts +0 -22
  95. package/lib/Utils/business.js +0 -234
  96. package/lib/Utils/chat-utils.d.ts +0 -71
  97. package/lib/Utils/chat-utils.js +0 -740
  98. package/lib/Utils/crypto.d.ts +0 -41
  99. package/lib/Utils/crypto.js +0 -153
  100. package/lib/Utils/decode-wa-message.d.ts +0 -20
  101. package/lib/Utils/decode-wa-message.js +0 -188
  102. package/lib/Utils/event-buffer.d.ts +0 -35
  103. package/lib/Utils/event-buffer.js +0 -520
  104. package/lib/Utils/generics.d.ts +0 -89
  105. package/lib/Utils/generics.js +0 -394
  106. package/lib/Utils/history.d.ts +0 -19
  107. package/lib/Utils/history.js +0 -94
  108. package/lib/Utils/index.d.ts +0 -17
  109. package/lib/Utils/index.js +0 -33
  110. package/lib/Utils/link-preview.d.ts +0 -21
  111. package/lib/Utils/link-preview.js +0 -93
  112. package/lib/Utils/logger.d.ts +0 -4
  113. package/lib/Utils/logger.js +0 -7
  114. package/lib/Utils/lt-hash.d.ts +0 -12
  115. package/lib/Utils/lt-hash.js +0 -51
  116. package/lib/Utils/make-mutex.d.ts +0 -7
  117. package/lib/Utils/make-mutex.js +0 -43
  118. package/lib/Utils/messages-media.d.ts +0 -107
  119. package/lib/Utils/messages-media.js +0 -674
  120. package/lib/Utils/messages.d.ts +0 -77
  121. package/lib/Utils/messages.js +0 -758
  122. package/lib/Utils/noise-handler.d.ts +0 -21
  123. package/lib/Utils/noise-handler.js +0 -155
  124. package/lib/Utils/process-message.d.ts +0 -42
  125. package/lib/Utils/process-message.js +0 -354
  126. package/lib/Utils/signal.d.ts +0 -32
  127. package/lib/Utils/signal.js +0 -161
  128. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -12
  129. package/lib/Utils/use-multi-file-auth-state.js +0 -93
  130. package/lib/Utils/validate-connection.d.ts +0 -11
  131. package/lib/Utils/validate-connection.js +0 -205
  132. package/lib/WABinary/constants.d.ts +0 -27
  133. package/lib/WABinary/constants.js +0 -40
  134. package/lib/WABinary/decode.d.ts +0 -7
  135. package/lib/WABinary/decode.js +0 -254
  136. package/lib/WABinary/encode.d.ts +0 -3
  137. package/lib/WABinary/encode.js +0 -232
  138. package/lib/WABinary/generic-utils.d.ts +0 -15
  139. package/lib/WABinary/generic-utils.js +0 -110
  140. package/lib/WABinary/index.d.ts +0 -5
  141. package/lib/WABinary/index.js +0 -21
  142. package/lib/WABinary/jid-utils.d.ts +0 -31
  143. package/lib/WABinary/jid-utils.js +0 -62
  144. package/lib/WABinary/types.d.ts +0 -18
  145. package/lib/WABinary/types.js +0 -2
  146. package/lib/WAM/BinaryInfo.d.ts +0 -17
  147. package/lib/WAM/BinaryInfo.js +0 -13
  148. package/lib/WAM/constants.d.ts +0 -38
  149. package/lib/WAM/constants.js +0 -15350
  150. package/lib/WAM/encode.d.ts +0 -3
  151. package/lib/WAM/encode.js +0 -155
  152. package/lib/WAM/index.d.ts +0 -3
  153. package/lib/WAM/index.js +0 -19
  154. package/lib/index.d.ts +0 -11
  155. package/lib/index.js +0 -30
package/index.js CHANGED
@@ -1,417 +1,64 @@
1
- /**
2
- * C⁴ SOCIETY MD — WhatsApp Bot (Baileys - Pairing Code)
3
- * Developer: ¿[ℓσя∂ ƒαмσυѕ тнє ƒαтнєя σƒ ∂υαℓ gσ∂ѕ]?[⁰⁰¹] σƒ C⁴
4
- * Creator: +2348058314787
5
- */
6
-
7
- const { default: makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion } = require("@whiskeysockets/baileys");
8
- const { Boom } = require("@hapi/boom");
9
- const axios = require("axios");
10
- const path = require("path");
11
- const fs = require("fs");
12
- const pino = require("pino");
13
- require("dotenv").config();
14
-
15
- const readline = require("readline");
16
-
17
- const BOT_NAME = "C⁴ SOCIETY MD";
18
- const DEVELOPER = "¿[ℓσя∂ ƒαмσυѕ тнє ƒαтнєя σƒ ∂υαℓ gσ∂ѕ]?[⁰⁰¹] σƒ C⁴";
19
- const CREATOR = "+2348058314787";
20
-
21
- function getOwnerNumber() {
22
- return (process.env.OWNER_NUMBER || "").replace(/\D/g, "").replace(/^0+/, "");
1
+ // lordceaser-baileys v2.0.41 FINAL - ONCE AND FOR ALL - Pterodactyl FIXED
2
+ console.log('\x1b[35m%s\x1b[0m', `
3
+ ██████╗███████╗ █████╗ ███████╗███████╗██████╗
4
+ ██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗
5
+ ██║ █████╗ ███████║███████╗█████╗ ██████╔╝
6
+ ██║ ██╔══╝ ██╔══██║╚════██║██╔══╝ ██╔══██╗
7
+ ╚██████╗███████╗██║ ██║███████║███████╗██║ ██║
8
+ ╚═════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
9
+ `);
10
+ console.log('\x1b[36m ⚡ CEASER v2.0.41 FINAL - CJS 157 files - All deps - Pterodactyl FIXED ONCE AND FOR ALL ⚡\x1b[0m');
11
+ let lib;
12
+ try {
13
+ lib = require('./lib');
14
+ console.log('\x1b[32m✅ CEASER lib loaded - 157 files CJS - Pterodactyl fixed\x1b[0m');
15
+ } catch (e) {
16
+ console.error('❌ Failed./lib', e.message);
17
+ throw e;
23
18
  }
24
-
25
- const MENU_IMAGE = path.join(__dirname, "assets", "menu.jpg");
26
-
27
- // ---------- Access control ----------
28
- let privateMode = "public";
29
- const whitelist = new Set();
30
-
31
- function normalize(jid) { return jid.replace(/[^0-9]/g, ""); }
32
-
33
- function canUseBot(senderJid, ownerJid) {
34
- if (senderJid === ownerJid) return true;
35
- if (privateMode === "public") return true;
36
- if (privateMode === "self") return false;
37
- if (privateMode === "whitelist") return whitelist.has(normalize(senderJid));
38
- return false;
39
- }
40
-
41
- // ---------- Content ----------
42
- const JOKES = [
43
- "Why do programmers prefer dark mode? Because light attracts bugs.",
44
- "I told my computer I needed a break — it said no problem, it'll go to sleep too.",
45
- "There are 10 types of people: those who understand binary, and those who don't.",
46
- ];
47
- const QUOTES = [
48
- '"The only way to do great work is to love what you do." — Steve Jobs',
49
- '"Success is not final, failure is not fatal." — Winston Churchill',
50
- '"Stay hungry, stay foolish." — Steve Jobs',
51
- ];
52
- const FAQ = {
53
- hours: "We're available 9 AM – 6 PM, Monday to Saturday.",
54
- pricing: "Please tell us what product/service you're asking about.",
55
- contact: "Reply here and our support team will get back to you ASAP.",
56
- location: "We're online-only — no physical location.",
57
- };
58
-
59
- function pickRandom(arr) { return arr[Math.floor(Math.random() * arr.length)]; }
60
-
61
- function helpText() {
62
- return (
63
- `*${BOT_NAME}*\n` +
64
- `Developer: ${DEVELOPER}\n` +
65
- `Creator: ${CREATOR}\n\n` +
66
- "*Commands (everyone):*\n" +
67
- "!help — show this menu\n" +
68
- "!joke — random joke\n" +
69
- "!quote — random quote\n" +
70
- "!roll — roll a dice (1–6)\n" +
71
- "!flip — flip a coin\n" +
72
- "!faq hours / pricing / contact / location\n" +
73
- "!ai <question> — ask the AI assistant\n" +
74
- "Send image with caption *!sticker* to convert it\n\n" +
75
- "*Download commands:*\n" +
76
- "!ytmp3 <url> — download YouTube audio (mp3)\n" +
77
- "!ytmp4 <url> — download YouTube video (mp4)\n" +
78
- "!tiktok <url> — download TikTok video (no watermark)\n" +
79
- "!ig <url> — download Instagram video/photo\n" +
80
- "!fb <url> — download Facebook video\n\n" +
81
- "*Group commands (admin only):*\n" +
82
- "!tag <message> — mention every member\n" +
83
- "!kick — reply to a member's msg to kick them\n" +
84
- "!welcome on / off — toggle welcome message\n\n" +
85
- "*Owner only:*\n" +
86
- "!self — lock bot to owner only\n" +
87
- "!self off — unlock back to public\n" +
88
- "!whitelist add 234... — whitelist a number\n" +
89
- "!whitelist remove 234... — remove a number\n" +
90
- "!whitelist list — show whitelisted numbers\n" +
91
- "!whitelist on / off — toggle whitelist mode\n\n" +
92
- `*Current mode:* ${privateMode}`
93
- );
94
- }
95
-
96
- async function askAI(prompt) {
97
- try {
98
- const res = await axios.post(
99
- "https://api.openai.com/v1/chat/completions",
100
- { model: "gpt-4o-mini", messages: [{ role: "user", content: prompt }] },
101
- { headers: { Authorization: `Bearer ${process.env.AI_API_KEY}`, "Content-Type": "application/json" } }
102
- );
103
- return res.data.choices[0].message.content;
104
- } catch (err) {
105
- return "Sorry, couldn't reach the AI service right now.";
106
- }
107
- }
108
-
109
- // ---------- Downloader functions ----------
110
-
111
- async function downloadYT(url, type) {
112
- try {
113
- const api = `https://api.ryzendesu.vip/api/downloader/${type === "mp3" ? "ytmp3" : "ytmp4"}?url=${encodeURIComponent(url)}`;
114
- const res = await axios.get(api, { timeout: 30000 });
115
- return res.data?.url || res.data?.link || res.data?.download || null;
116
- } catch (err) {
117
- return null;
118
- }
119
- }
120
-
121
- async function downloadTikTok(url) {
122
- try {
123
- const res = await axios.get(`https://api.ryzendesu.vip/api/downloader/ttdl?url=${encodeURIComponent(url)}`, { timeout: 30000 });
124
- return res.data?.video || res.data?.url || null;
125
- } catch (err) {
126
- return null;
127
- }
128
- }
129
-
130
- async function downloadIG(url) {
131
- try {
132
- const res = await axios.get(`https://api.ryzendesu.vip/api/downloader/igdl?url=${encodeURIComponent(url)}`, { timeout: 30000 });
133
- const items = res.data?.data || res.data?.result || [];
134
- return items[0]?.url || null;
135
- } catch (err) {
136
- return null;
137
- }
138
- }
139
-
140
- async function downloadFB(url) {
141
- try {
142
- const res = await axios.get(`https://api.ryzendesu.vip/api/downloader/fbdl?url=${encodeURIComponent(url)}`, { timeout: 30000 });
143
- return res.data?.hd || res.data?.sd || res.data?.url || null;
144
- } catch (err) {
145
- return null;
19
+ const originalMakeWASocket = lib.default || lib.makeWASocket || lib;
20
+ function normalizeButtons(c){
21
+ if(!c) return c;
22
+ if(c.interactiveButtons && Array.isArray(c.interactiveButtons)) return c;
23
+ if(c.nativeFlow && Array.isArray(c.nativeFlow)){
24
+ const f=c.nativeFlow.map(b=>{
25
+ if(b.url) return {name:"cta_url",buttonParamsJson:JSON.stringify({display_text:b.text||b.displayText||"Channel",url:b.url})};
26
+ if(b.id) return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:b.text||b.displayText||"Button",id:b.id})};
27
+ if(b.text) return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:b.text,id:b.text.toLowerCase().replace(/\s+/g,'_')})};
28
+ return null;
29
+ }).filter(Boolean);
30
+ const n={...c}; delete n.nativeFlow; n.interactiveButtons=f; return n;
146
31
  }
147
- }
148
-
149
- async function sendDownload(sock, from, msg, downloadUrl, type, caption) {
150
- try {
151
- const response = await axios.get(downloadUrl, { responseType: "arraybuffer", timeout: 60000 });
152
- const buffer = Buffer.from(response.data);
153
- if (type === "audio") {
154
- await sock.sendMessage(from, { audio: buffer, mimetype: "audio/mp4", fileName: "audio.mp3" }, { quoted: msg });
155
- } else {
156
- await sock.sendMessage(from, { video: buffer, caption }, { quoted: msg });
157
- }
158
- } catch (err) {
159
- await sock.sendMessage(from, { text: "❌ Failed to send file. The file may be too large or the link expired." }, { quoted: msg });
160
- }
161
- }
162
-
163
- const welcomeSettings = new Map();
164
-
165
- // ---------- Main ----------
166
- async function startBot() {
167
- const { state, saveCreds } = await useMultiFileAuthState("auth_info");
168
- const { version } = await fetchLatestBaileysVersion();
169
-
170
- // Always ask for the number to pair
171
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
172
- const phoneNumber = await new Promise((resolve) => {
173
- rl.question("\n📱 Enter the WhatsApp number to link (with country code, no + sign):\n> ", (ans) => {
174
- rl.close();
175
- resolve(ans.replace(/\D/g, "").replace(/^0+/, ""));
32
+ if(c.buttons && Array.isArray(c.buttons)){
33
+ const f=c.buttons.map(b=>{
34
+ const t=b.buttonText?.displayText||b.displayText||b.text||"Button";
35
+ const id=b.buttonId||b.id||t.toLowerCase().replace(/\s+/g,'_');
36
+ if(b.type===2||b.url) return {name:"cta_url",buttonParamsJson:JSON.stringify({display_text:t,url:b.url||"https://whatsapp.com/channel/0029VbDdSaV5PO0ukeNIwY1T"})};
37
+ return {name:"quick_reply",buttonParamsJson:JSON.stringify({display_text:t,id:id})};
176
38
  });
177
- });
178
-
179
- const OWNER_JID = (process.env.OWNER_NUMBER || phoneNumber).replace(/\D/g, "") + "@s.whatsapp.net";
180
- console.log(`\n✅ Linking number: ${phoneNumber}`);
181
-
182
- const sock = makeWASocket({
183
- version,
184
- auth: state,
185
- logger: pino({ level: "silent" }),
186
- printQRInTerminal: false,
187
- browser: ["C⁴ SOCIETY MD", "Chrome", "1.0.0"],
188
- syncFullHistory: false,
189
- markOnlineOnConnect: false,
190
- });
191
-
192
- // ---- PAIRING CODE ----
193
- if (!sock.authState.creds.registered) {
194
- console.log(`\n⏳ Requesting pairing code for: ${phoneNumber} ...\n`);
195
- setTimeout(async () => {
196
- try {
197
- const code = await sock.requestPairingCode(phoneNumber);
198
- const formatted = code.match(/.{1,4}/g)?.join("-") || code;
199
- console.log("\n╔══════════════════════════════════════╗");
200
- console.log("║ C⁴ SOCIETY MD — PAIRING ║");
201
- console.log("╠══════════════════════════════════════╣");
202
- console.log(`║ Code: ${formatted.padEnd(30)}║`);
203
- console.log("╠══════════════════════════════════════╣");
204
- console.log("║ Steps: ║");
205
- console.log("║ 1. Open WhatsApp on your phone ║");
206
- console.log("║ 2. Go to Linked Devices ║");
207
- console.log("║ 3. Tap Link a Device ║");
208
- console.log("║ 4. Tap Link with phone number ║");
209
- console.log("║ 5. Enter the code above QUICKLY ║");
210
- console.log("║ (code expires in 60 seconds) ║");
211
- console.log("╚══════════════════════════════════════╝\n");
212
- } catch (err) {
213
- console.error("❌ Pairing code error:", err.message);
214
- console.log("➡ Delete the auth_info folder and restart");
215
- console.log("➡ Make sure the number has country code, no + sign");
216
- console.log("➡ Example: 2348058314787");
217
- }
218
- }, 5000);
39
+ const n={...c}; delete n.buttons; delete n.headerType; n.interactiveButtons=f; return n;
219
40
  }
220
-
221
- sock.ev.on("creds.update", saveCreds);
222
-
223
- sock.ev.on("connection.update", ({ connection, lastDisconnect }) => {
224
- if (connection === "close") {
225
- const shouldReconnect = new Boom(lastDisconnect?.error)?.output?.statusCode !== DisconnectReason.loggedOut;
226
- console.log("Connection closed. Reconnecting:", shouldReconnect);
227
- if (shouldReconnect) startBot();
228
- } else if (connection === "open") {
229
- console.log(`✅ ${BOT_NAME} connected successfully!`);
230
- }
231
- });
232
-
233
- sock.ev.on("group-participants.update", async ({ id, participants, action }) => {
234
- if (action !== "add") return;
235
- if (!(welcomeSettings.get(id) ?? true)) return;
236
- const groupMeta = await sock.groupMetadata(id);
237
- for (const participant of participants) {
238
- await sock.sendMessage(id, {
239
- text: `👋 Welcome @${participant.split("@")[0]} to *${groupMeta.subject}*!`,
240
- mentions: [participant],
241
- });
242
- }
243
- });
244
-
245
- sock.ev.on("messages.upsert", async ({ messages, type }) => {
246
- if (type !== "notify") return;
247
- const msg = messages[0];
248
- if (!msg.message || msg.key.fromMe) return;
249
-
250
- const from = msg.key.remoteJid;
251
- const sender = msg.key.participant || msg.key.remoteJid;
252
- const isGroup = from.endsWith("@g.us");
253
- const isOwner = sender === OWNER_NUMBER;
254
- const body = msg.message?.conversation || msg.message?.extendedTextMessage?.text || "";
255
- const text = body.trim();
256
- const lower = text.toLowerCase();
257
- const imageMsg = msg.message?.imageMessage;
258
-
259
- const reply = (text) => sock.sendMessage(from, { text }, { quoted: msg });
260
-
261
- // Access control for private chats
262
- if (!isGroup && !canUseBot(sender)) {
263
- return reply(
264
- privateMode === "self"
265
- ? "🔒 Bot is in *self mode* — only the owner can use it."
266
- : "🔒 Your number is not whitelisted to use this bot."
267
- );
268
- }
269
-
270
- // Sticker from image
271
- if (imageMsg && imageMsg.caption?.trim().toLowerCase() === "!sticker") {
272
- const buffer = await sock.downloadMediaMessage(msg);
273
- await sock.sendMessage(from, { sticker: buffer }, { quoted: msg });
274
- return;
275
- }
276
-
277
- // Help with image
278
- if (lower === "!help") {
279
- const imageBuffer = fs.readFileSync(MENU_IMAGE);
280
- await sock.sendMessage(from, { image: imageBuffer, caption: helpText() });
281
- return;
282
- }
283
-
284
- // Fun commands
285
- if (lower === "!joke") return reply(pickRandom(JOKES));
286
- if (lower === "!quote") return reply(pickRandom(QUOTES));
287
- if (lower === "!roll") return reply(`🎲 You rolled a ${1 + Math.floor(Math.random() * 6)}`);
288
- if (lower === "!flip") return reply(`🪙 ${Math.random() < 0.5 ? "Heads" : "Tails"}`);
289
-
290
- if (lower.startsWith("!faq")) {
291
- const topic = lower.replace("!faq", "").trim();
292
- return reply(FAQ[topic] || `Available topics: ${Object.keys(FAQ).join(", ")}\nUse: !faq <topic>`);
293
- }
294
-
295
- if (lower.startsWith("!ai ")) {
296
- return reply(await askAI(text.slice(4).trim()));
297
- }
298
-
299
- // ---------- Download commands ----------
300
- if (lower.startsWith("!ytmp3 ")) {
301
- const url = text.slice(7).trim();
302
- if (!url) return reply("Usage: !ytmp3 <YouTube URL>");
303
- await reply("⏳ Downloading audio, please wait...");
304
- const dlUrl = await downloadYT(url, "mp3");
305
- if (!dlUrl) return reply("❌ Couldn't download. Check the URL and try again.");
306
- return sendDownload(sock, from, msg, dlUrl, "audio", "🎵 Here's your audio!");
307
- }
308
- if (lower.startsWith("!ytmp4 ")) {
309
- const url = text.slice(7).trim();
310
- if (!url) return reply("Usage: !ytmp4 <YouTube URL>");
311
- await reply("⏳ Downloading video, please wait...");
312
- const dlUrl = await downloadYT(url, "mp4");
313
- if (!dlUrl) return reply("❌ Couldn't download. Check the URL and try again.");
314
- return sendDownload(sock, from, msg, dlUrl, "video", "🎬 Here's your video!");
315
- }
316
- if (lower.startsWith("!tiktok ")) {
317
- const url = text.slice(8).trim();
318
- if (!url) return reply("Usage: !tiktok <TikTok URL>");
319
- await reply("⏳ Downloading TikTok video...");
320
- const dlUrl = await downloadTikTok(url);
321
- if (!dlUrl) return reply("❌ Couldn't download. Check the URL and try again.");
322
- return sendDownload(sock, from, msg, dlUrl, "video", "🎵 Here's your TikTok!");
323
- }
324
- if (lower.startsWith("!ig ")) {
325
- const url = text.slice(4).trim();
326
- if (!url) return reply("Usage: !ig <Instagram URL>");
327
- await reply("⏳ Downloading Instagram media...");
328
- const dlUrl = await downloadIG(url);
329
- if (!dlUrl) return reply("❌ Couldn't download. Make sure the post is public.");
330
- return sendDownload(sock, from, msg, dlUrl, "video", "📸 Here's your Instagram media!");
331
- }
332
- if (lower.startsWith("!fb ")) {
333
- const url = text.slice(4).trim();
334
- if (!url) return reply("Usage: !fb <Facebook URL>");
335
- await reply("⏳ Downloading Facebook video...");
336
- const dlUrl = await downloadFB(url);
337
- if (!dlUrl) return reply("❌ Couldn't download. Make sure the video is public.");
338
- return sendDownload(sock, from, msg, dlUrl, "video", "📘 Here's your Facebook video!");
339
- }
340
-
341
- // Owner: !self
342
- if (lower === "!self") {
343
- if (!isOwner) return reply("⛔ Only the owner can use this command.");
344
- privateMode = "self";
345
- return reply("🔒 *Self mode ON* — only you can use the bot in private chats.");
346
- }
347
- if (lower === "!self off") {
348
- if (!isOwner) return reply("⛔ Only the owner can use this command.");
349
- privateMode = "public";
350
- return reply("🔓 *Self mode OFF* — bot is public again.");
351
- }
352
-
353
- // Owner: !whitelist
354
- if (lower.startsWith("!whitelist")) {
355
- if (!isOwner) return reply("⛔ Only the owner can manage the whitelist.");
356
- const args = text.slice(10).trim().split(/\s+/);
357
- const action = args[0];
358
- const numArg = args[1] ? normalize(args[1]) : null;
359
-
360
- if (action === "on") { privateMode = "whitelist"; return reply("✅ *Whitelist mode ON.*"); }
361
- if (action === "off") { privateMode = "public"; return reply("🔓 *Whitelist mode OFF.*"); }
362
- if (action === "add" && numArg) {
363
- whitelist.add(numArg);
364
- privateMode = "whitelist";
365
- return reply(`✅ *${numArg}* added to whitelist.\nWhitelist mode is now ON.`);
366
- }
367
- if (action === "remove" && numArg) {
368
- whitelist.delete(numArg);
369
- return reply(`✅ *${numArg}* removed from whitelist.`);
370
- }
371
- if (action === "list") {
372
- return reply(whitelist.size === 0 ? "📋 Whitelist is empty." : `📋 *Whitelisted:*\n${[...whitelist].join("\n")}`);
373
- }
374
- return reply("Usage:\n!whitelist add 234...\n!whitelist remove 234...\n!whitelist list\n!whitelist on\n!whitelist off");
375
- }
376
-
377
- // Group admin commands
378
- if (isGroup) {
379
- const groupMeta = await sock.groupMetadata(from);
380
- const isAdmin = groupMeta.participants.find(p => p.id === sender)?.admin != null;
381
-
382
- if (lower.startsWith("!tag")) {
383
- if (!isAdmin) return reply("Only group admins can use !tag.");
384
- const tagMsg = text.slice(4).trim() || "📢 Attention everyone!";
385
- const mentions = groupMeta.participants.map(p => p.id);
386
- return sock.sendMessage(from, { text: tagMsg, mentions });
387
- }
388
-
389
- if (lower === "!kick") {
390
- if (!isAdmin) return reply("Only group admins can use !kick.");
391
- const quoted = msg.message?.extendedTextMessage?.contextInfo?.participant;
392
- if (!quoted) return reply("Reply to a member's message with !kick to remove them.");
393
- try {
394
- await sock.groupParticipantsUpdate(from, [quoted], "remove");
395
- return reply("✅ Member removed.");
396
- } catch {
397
- return reply("Couldn't remove — make sure I'm an admin in this group.");
398
- }
399
- }
400
-
401
- if (lower.startsWith("!welcome")) {
402
- if (!isAdmin) return reply("Only group admins can change this setting.");
403
- const setting = lower.replace("!welcome", "").trim();
404
- if (setting === "on") { welcomeSettings.set(from, true); return reply("✅ Welcome messages ON."); }
405
- if (setting === "off") { welcomeSettings.set(from, false); return reply("✅ Welcome messages OFF."); }
406
- return reply("Use: !welcome on or !welcome off");
407
- }
408
- }
409
-
410
- // Default auto-reply
411
- if (!text.startsWith("!")) {
412
- return reply(`Thanks for your message! This is *${BOT_NAME}* 🤖\nSend *!help* to see what I can do.`);
413
- }
414
- });
41
+ return c;
42
+ }
43
+ function patchSocket(s){
44
+ if(!s||s._ceaserPatched) return s;
45
+ const o=s.sendMessage.bind(s);
46
+ s.sendMessage=async(j,c,op)=>{
47
+ try{
48
+ let n=normalizeButtons(c);
49
+ if(n&&(n.image||n.video)&&n.interactiveButtons){if(!n.footer) n.footer="C4 Society • Ping Executed"}
50
+ return await o(j,n,op);
51
+ }catch(e){return await o(j,c,op)}
52
+ };
53
+ s._ceaserPatched=true; return s;
415
54
  }
416
-
417
- startBot();
55
+ function makeWASocketFixed(...a){return patchSocket(originalMakeWASocket(...a))}
56
+ if(lib.default) lib.default=makeWASocketFixed;
57
+ if(lib.makeWASocket) lib.makeWASocket=makeWASocketFixed;
58
+ module.exports=lib;
59
+ module.exports.CEASER=true;
60
+ module.exports.version='2.0.41';
61
+ module.exports.makeWASocket=makeWASocketFixed;
62
+ if(lib.default) module.exports.default=makeWASocketFixed;
63
+ for(const k in lib){if(!(k in module.exports)) module.exports[k]=lib[k]}
64
+ console.log("\x1b[32m✅ lordceaser-baileys v2.0.41 FINAL - 157 files CJS - ONCE AND FOR ALL FIXED\x1b[0m");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lordceaser-baileys",
3
- "version": "2.0.39",
4
- "description": "CEASER v2.0.39 FINAL 406 files CJS - Pterodactyl fixed - Baileys v6.7.8 CommonJS no ESM error - Same as 2.0.22-2.0.26 perfect",
3
+ "version": "2.0.41",
4
+ "description": "CEASER v2.0.41 FINAL ONCE AND FOR ALL - Pterodactyl fixed - 157 files CJS v6.7.8 - All deps futoin-hkdf included - Same as perfect 2.0.26",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
7
7
  "license": "MIT",
@@ -12,8 +12,11 @@
12
12
  "@cacheable/node-cache": "^1.1.4",
13
13
  "@hapi/boom": "^9.1.4",
14
14
  "async-mutex": "^0.4.0",
15
+ "axios": "^1.6.0",
15
16
  "cache-manager": "^3.6.3",
16
17
  "fflate": "^0.8.2",
18
+ "futoin-hkdf": "^1.5.1",
19
+ "jimp": "^0.22.10",
17
20
  "libsignal": "^2.0.1",
18
21
  "long": "^5.2.3",
19
22
  "lru-cache": "^7.18.3",
@@ -24,7 +27,9 @@
24
27
  "ws": "^8.14.2",
25
28
  "qrcode-terminal": "^0.12.0",
26
29
  "lodash": "^4.17.21",
27
- "mysql2": "^3.9.7"
30
+ "mysql2": "^3.9.7",
31
+ "node-cache": "^5.1.2",
32
+ "file-type": "^16.5.4"
28
33
  },
29
34
  "files": ["lib/","WAProto/","WABinary/","WASignalGroup/","WAMessage/","index.js","README.md","LICENSE"]
30
35
  }
@@ -1,4 +0,0 @@
1
- yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
2
- yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
3
-
4
- #protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;