Skip to content

Commit 9e1f700

Browse files
authored
𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
1 parent a0a9bf3 commit 9e1f700

File tree

4 files changed

+357
-0
lines changed

4 files changed

+357
-0
lines changed

clintplugins/clear.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const { zokou } = require("../framework/zokou");
2+
3+
// 𝐔𝐭𝐢𝐥𝐢𝐭𝐢𝐞𝐳 𝐌𝐨𝐝𝐮𝐥𝐞
4+
// 𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
5+
6+
zokou(
7+
{
8+
nomCom: "clear",
9+
categorie: "Utilities",
10+
reaction: "🧹",
11+
},
12+
async (dest, zk, commandeOptions) => {
13+
const { repondre, ms } = commandeOptions;
14+
15+
try {
16+
repondre(`𝐂𝐥𝐞𝐚𝐫𝐢𝐧𝐠 𝐛𝐨𝐭 𝐦𝐞𝐳𝐳𝐚𝐠𝐞𝐳 𝐢𝐧 𝐭𝐡𝐢𝐳 𝐜𝐡𝐚𝐭...`);
17+
18+
// Fetch recent messages (assuming Zokou supports this; adjust limit as needed)
19+
const messages = await zk.fetchMessages(dest, { limit: 50 }); // Hypothetical method
20+
if (!messages || messages.length === 0) {
21+
return repondre(`𝐍𝐨 𝐛𝐨𝐭 𝐦𝐞𝐳𝐳𝐚𝐠𝐞𝐳 𝐟𝐨𝐮𝐧𝐝 𝐭𝐨 𝐜𝐥𝐞𝐚𝐫!`);
22+
}
23+
24+
// Filter for bot messages and delete them
25+
const botId = zk.user.id; // Bot's JID
26+
let deletedCount = 0;
27+
28+
for (const msg of messages) {
29+
if (msg.key.fromMe || msg.key.remoteJid === botId) { // Check if sent by bot
30+
await zk.sendMessage(dest, { delete: msg.key });
31+
deletedCount++;
32+
// Small delay to avoid rate limits (optional)
33+
await new Promise((resolve) => setTimeout(resolve, 100));
34+
}
35+
}
36+
37+
repondre(
38+
`𝐒𝐮𝐜𝐜𝐞𝐻𝐇𝐟𝐮𝐥𝐥𝐲 𝐜𝐥𝐞𝐚𝐫𝐞𝐝 ${deletedCount} 𝐛𝐨𝐭 𝐦𝐞𝐻𝐇𝐚𝐠𝐞${deletedCount === 1 ? "" : "𝐳"}!\n\n𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧`
39+
);
40+
} catch (error) {
41+
console.error("Error clearing messages:", error);
42+
repondre(
43+
`𝐀𝐧 𝐞𝐫𝐫𝐨𝐫 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐝 𝐰𝐡𝐢𝐥𝐞 𝐜𝐥𝐞𝐚𝐫𝐢𝐧𝐠 𝐦𝐞𝐻𝐇𝐚𝐠𝐞𝐻𝐡: ${error.message}`
44+
);
45+
}
46+
}
47+
);
48+
49+
module.exports = { zokou };

clintplugins/gcinspect.js

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
const { zokou } = require("../framework/zokou");
2+
3+
// 𝐔𝐭𝐢𝐥𝐢𝐭𝐢𝐞𝐬 𝐌𝐨𝐝𝐮𝐥𝐞
4+
// 𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
5+
6+
const linkRegex = /chat\.whatsapp\.com\/(?:invite\/)?([0-9A-Za-z]{20,24})/i;
7+
8+
zokou(
9+
{
10+
nomCom: "inspect",
11+
categorie: "Utilities",
12+
reaction: "🔍",
13+
},
14+
async (dest, zk, commandeOptions) => {
15+
const { repondre, ms, arg, prefixe } = commandeOptions;
16+
17+
// Check for link
18+
if (!arg || arg.length === 0) {
19+
return repondre(
20+
`𝐄𝐱𝐚𝐦𝐩𝐥𝐞: ${prefixe}𝐢𝐧𝐳𝐩𝐞𝐜𝐭 <𝐜𝐡𝐚𝐭.𝐰𝐡𝐚𝐭𝐳𝐚𝐩𝐩.𝐜𝐨𝐦/𝐥𝐢𝐧𝐤>\n\n𝐏𝐥𝐞𝐚𝐳𝐞 𝐩𝐫𝐨𝐯𝐢𝐝𝐞 𝐚 𝐖𝐡𝐚𝐭𝐳𝐚𝐩𝐩 𝐠𝐫𝐨𝐮𝐩 𝐥𝐢𝐧𝐤 𝐭𝐨 𝐢𝐧𝐻𝐩𝐞𝐜𝐭!`
21+
);
22+
}
23+
24+
const text = arg.join(" ");
25+
const [, code] = text.match(linkRegex) || [];
26+
if (!code) {
27+
return repondre(`𝐈𝐧𝐯𝐚𝐥𝐢𝐝 𝐥𝐢𝐧𝐤! 𝐏𝐥𝐞𝐚𝐳𝐞 𝐮𝐻𝐞 𝐚 𝐯𝐚𝐥𝐢𝐝 𝐖𝐡𝐚𝐭𝐻𝐚𝐩𝐩 𝐠𝐫𝐨𝐮𝐩 𝐥𝐢𝐧𝐤.`);
28+
}
29+
30+
try {
31+
repondre(`𝐈𝐧𝐻𝐩𝐞𝐜𝐭𝐢𝐧𝐠 𝐠𝐫𝐨𝐮𝐩 𝐥𝐢𝐧𝐭𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧...`);
32+
33+
// Fetch group info (assuming Zokou supports this; adjust if needed)
34+
const res = await zk.groupGetInviteInfo(code); // Hypothetical Zokou method
35+
if (!res) throw new Error("Failed to fetch group info");
36+
37+
// Format group details
38+
const caption = `
39+
━━━━━━━━━━━━━━━━━━━
40+
🔍 𝐆𝐫𝐨𝐮𝐩 𝐋𝐢𝐧𝐤 𝐈𝐧𝐻𝐩𝐞𝐜𝐭𝐨𝐫 ⚡️
41+
42+
${res.id}
43+
*𝐓𝐢𝐭𝐥𝐞:* ${res.subject}
44+
*𝐂𝐫𝐞𝐚𝐭𝐞𝐝* 𝐛𝐲 @${res.id.split('-')[0]} 𝐨𝐧 *${formatDate(res.creation * 1000)}*${res.subjectOwner ? `
45+
*𝐓𝐢𝐭𝐥𝐞 𝐜𝐡𝐚𝐧𝐠𝐞𝐝* 𝐛𝐲 @${res.subjectOwner.split`@`[0]} 𝐨𝐧 *${formatDate(res.subjectTime * 1000)}*` : ""}${res.descOwner ? `
46+
*𝐃𝐞𝐻𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧 𝐜𝐡𝐚𝐧𝐠𝐞�{d* 𝐛𝐲 @${res.descOwner.split`@`[0]} 𝐨𝐧 *${formatDate(res.descTime * 1000)}*` : ""}
47+
*𝐌𝐞𝐦𝐛𝐞𝐫 𝐂𝐨𝐮𝐧𝐭:* ${res.size}
48+
*𝐊𝐧𝐨𝐰𝐧 𝐌𝐞𝐦𝐛𝐞𝐫𝐻 𝐉𝐨𝐢𝐧𝐞𝐝*: ${res.participants ? "\n" + res.participants.map((user, i) => `${++i}. @${user.id.split`@`[0]}`).join("\n").trim() : "𝐍𝐨𝐧𝐞"}
49+
${res.desc ? `*𝐃𝐞𝐻𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧:*\n${res.desc}` : "*𝐍�{o 𝐃𝐞𝐻𝐜𝐫𝐢𝐩𝐭𝐢𝐨𝐧*"}
50+
51+
*𝐉𝐒𝐎𝐍 𝐕𝐞𝐫𝐻𝐢𝐨𝐧*
52+
\`\`\`${JSON.stringify(res, null, 1)}\`\`\`
53+
54+
━━━━━━━━━━━━━━━━━━━
55+
𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
56+
𝐎𝐰𝐧𝐞𝐫: 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨�{n
57+
`.trim();
58+
59+
// Attempt to fetch profile picture
60+
let pp;
61+
try {
62+
pp = await zk.profilePictureUrl(res.id, "image"); // Zokou/Baileys method
63+
if (pp) {
64+
await zk.sendMessage(
65+
dest,
66+
{ image: { url: pp }, caption: "𝐆𝐫𝐨𝐮𝐩 𝐏𝐫𝐨𝐟𝐢𝐥𝐞 𝐏𝐢𝐜𝐭𝐮𝐫𝐞" },
67+
{ quoted: ms }
68+
);
69+
}
70+
} catch (e) {
71+
console.error("Error fetching profile picture:", e);
72+
}
73+
74+
// Send group info
75+
await zk.sendMessage(
76+
dest,
77+
{ text: caption },
78+
{
79+
quoted: ms,
80+
contextInfo: { mentionedJid: parseMention(caption) },
81+
}
82+
);
83+
} catch (error) {
84+
console.error("Error inspecting group link:", error);
85+
repondre(
86+
`𝐄𝐫𝐫𝐨𝐫 𝐢𝐧𝐻𝐩𝐞𝐜𝐭𝐢𝐧𝐠 𝐠𝐫𝐨𝐮𝐩 𝐥𝐢𝐧𝐤: ${error.message}\n\n𝐏𝐥𝐞𝐚𝐻𝐞 𝐩𝐫𝐨𝐯𝐢𝐝𝐞 𝐚 𝐯𝐚𝐥𝐢𝐝 𝐥𝐢𝐧𝐤 𝐚𝐧𝐝 𝐭𝐫𝐲 𝐚𝐠𝐚𝐢𝐧!`
87+
);
88+
}
89+
}
90+
);
91+
92+
module.exports = { zokou };
93+
94+
// Helper function to parse mentions
95+
function parseMention(text) {
96+
return [...text.matchAll(/@([0-9]{5,16}|0)/g)].map((v) => v[1] + "@s.whatsapp.net");
97+
}
98+
99+
// Format date function (English)
100+
function formatDate(n, locale = "en") {
101+
let d = new Date(n);
102+
return d.toLocaleDateString(locale, {
103+
weekday: "long",
104+
day: "numeric",
105+
month: "long",
106+
year: "numeric",
107+
hour: "numeric",
108+
minute: "numeric",
109+
second: "numeric",
110+
});
111+
}

clintplugins/leavegc.js

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
const { zokou } = require("../framework/zokou");
2+
3+
// 𝐆𝐫𝐨𝐮𝐩 𝐌𝐨𝐝𝐮𝐥𝐞
4+
// 𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
5+
6+
zokou(
7+
{
8+
nomCom: "leave",
9+
categorie: "Group",
10+
reaction: "👋",
11+
},
12+
async (dest, zk, commandeOptions) => {
13+
const { repondre, ms, arg, prefixe, isOwner } = commandeOptions;
14+
15+
// Owner-only check for leaving all groups
16+
const ownerNumber = "254735342808@s.whatsapp.net";
17+
const sender = ms.key.participant || ms.key.remoteJid;
18+
19+
// Handle .leaveall
20+
if (arg[0] === "all") {
21+
if (sender !== ownerNumber && !isOwner) {
22+
return repondre(
23+
`𝐎𝐰𝐧𝐞𝐫 𝐎𝐧𝐥𝐲!\n\n𝐓𝐡𝐢𝐇 𝐜𝐨𝐦𝐦𝐚𝐧𝐝 𝐢𝐇 𝐫𝐞𝐇𝐭𝐫𝐢𝐜𝐭𝐞𝐝 𝐭𝐨 𝐭𝐡𝐞 𝐛𝐨𝐭 𝐨𝐰𝐧𝐞𝐫 (@${ownerNumber.split("@")[0]}).`
24+
);
25+
}
26+
27+
try {
28+
repondre(`𝐁𝐲𝐞 𝐞𝐯𝐞𝐫𝐲𝐨𝐧𝐞! 𝐓𝐡𝐞 𝐛𝐨𝐭 𝐰𝐢𝐥𝐥 𝐥𝐞𝐚𝐯𝐞 𝐚𝐥𝐥 𝐠𝐫𝐨𝐮𝐩𝐇...`);
29+
30+
// Fetch all group chats (assumed method; adjust if needed)
31+
const chats = await zk.chats; // Hypothetical; replace with Zokou's method
32+
const groupChats = Object.values(chats).filter(
33+
(chat) => chat.id.endsWith("g.us") && !chat.readOnly
34+
);
35+
36+
for (let i = 0; i < groupChats.length; i++) {
37+
await zk.sendMessage(
38+
groupChats[i].id,
39+
{ text: "𝐁𝐲𝐞 𝐞𝐯𝐞𝐫𝐲𝐨𝐧𝐞! 𝐓𝐡𝐞 𝐛𝐨𝐭 𝐢𝐇 𝐥𝐞𝐚𝐯𝐢𝐧𝐠 𝐭𝐡𝐢𝐇 𝐠𝐫𝐨𝐮𝐩." },
40+
{ quoted: ms }
41+
);
42+
await zk.groupLeave(groupChats[i].id);
43+
await delay(i * 2000); // 2-second delay between leaves
44+
}
45+
46+
repondre(`𝐒𝐮𝐜𝐜𝐞𝐇𝐇! 𝐋𝐞𝐟𝐭 𝐚𝐥𝐥 𝐠𝐫𝐨𝐮𝐩𝐇.`);
47+
} catch (error) {
48+
console.error("Error leaving all groups:", error);
49+
repondre(`𝐄𝐫𝐫𝐨𝐫 𝐥𝐞𝐚𝐯𝐢𝐧𝐠 𝐚𝐥𝐥 𝐠𝐫𝐨𝐮𝐩𝐇: ${error.message}`);
50+
}
51+
return;
52+
}
53+
54+
// Handle specific group JID
55+
if (arg.length > 0) {
56+
const groupJid = arg[0];
57+
if (!groupJid.endsWith("g.us")) {
58+
return repondre(
59+
`𝐈𝐧𝐯𝐚𝐥𝐢𝐝 𝐠𝐫𝐨𝐮𝐩 𝐉𝐈𝐃! 𝐔𝐇𝐞 𝐚 𝐟𝐨𝐫𝐦𝐚𝐭 𝐥𝐢𝐤𝐞 𝟏𝟐𝟑𝟒𝟓𝟔@g.us`
60+
);
61+
}
62+
63+
try {
64+
// Check if bot is in the group (assumed method)
65+
const chats = await zk.chats;
66+
const groupExists = Object.values(chats).some(
67+
(chat) => chat.id === groupJid
68+
);
69+
if (!groupExists) {
70+
return repondre(
71+
`𝐁𝐨𝐭 𝐢𝐇 𝐧𝐨𝐭 𝐢𝐧 𝐭𝐡𝐚𝐭 𝐠𝐫𝐨𝐮𝐩 (${groupJid})!`
72+
);
73+
}
74+
75+
await zk.sendMessage(
76+
groupJid,
77+
{ text: "𝐁𝐲𝐞 𝐞𝐯𝐞𝐫𝐲𝐨𝐧𝐞! 𝐓𝐡𝐞 � b𝐨𝐭 𝐢𝐇 𝐥𝐞𝐚𝐯𝐢𝐧� g 𝐭𝐡𝐢� H � g𝐫𝐨𝐮𝐩." },
78+
{ quoted: ms }
79+
);
80+
await zk.groupLeave(groupJid);
81+
repondre(`𝐒𝐮𝐜𝐜𝐞𝐇𝐇! 𝐋𝐞𝐟𝐭 𝐭𝐡𝐞 𝐠𝐫𝐨𝐮𝐩 ${groupJid}.`);
82+
} catch (error) {
83+
console.error("Error leaving specific group:", error);
84+
repondre(`𝐄𝐫𝐫𝐨𝐫 𝐥𝐞𝐚𝐯𝐢𝐧� g � g𝐫𝐨𝐮𝐩 ${groupJid}: ${error.message}`);
85+
}
86+
return;
87+
}
88+
89+
// Leave current group (default)
90+
if (!ms.key.remoteJid.endsWith("g.us")) {
91+
return repondre(
92+
`𝐓𝐡𝐢� H 𝐜𝐨𝐦𝐦𝐚𝐧𝐝 𝐜𝐚𝐧 𝐨𝐧𝐥𝐲 𝐛𝐞 𝐮� H𝐞𝐝 𝐢𝐧 � g𝐫𝐨𝐮𝐩� H!`
93+
);
94+
}
95+
96+
try {
97+
await zk.sendMessage(
98+
dest,
99+
{ text: "𝐁𝐲𝐞 𝐞𝐯� e𝐫𝐲𝐨𝐧𝐞! 𝐓𝐡� e 𝐛𝐨𝐭 𝐢� H 𝐥𝐞𝐚𝐯𝐢𝐧� g 𝐭𝐡𝐢� H � g𝐫𝐨𝐮𝐩." },
100+
{ quoted: ms }
101+
);
102+
await zk.groupLeave(dest);
103+
} catch (error) {
104+
console.error("Error leaving current group:", error);
105+
repondre(
106+
`𝐄𝐫𝐫𝐨𝐫 𝐥𝐞𝐚𝐯𝐢𝐧� g 𝐭𝐡𝐢� H � g𝐫𝐨𝐮𝐩: ${error.message}`
107+
);
108+
}
109+
}
110+
);
111+
112+
module.exports = { zokou };
113+
114+
const delay = (time) => new Promise((res) => setTimeout(res, time));

clintplugins/tohd.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const { zokou } = require("../framework/zokou");
2+
const fetch = require("node-fetch");
3+
const FormData = require("form-data");
4+
5+
// 𝐔𝐭𝐢𝐥𝐢𝐭𝐢𝐞𝐳 𝐌𝐨𝐝𝐮𝐥𝐞
6+
// 𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧
7+
8+
zokou(
9+
{
10+
nomCom: "tohd",
11+
categorie: "Utilities",
12+
reaction: "📸",
13+
},
14+
async (dest, zk, commandeOptions) => {
15+
const { repondre, ms, quoted, prefixe } = commandeOptions;
16+
17+
// Check if an image is quoted
18+
if (!quoted) {
19+
return repondre(
20+
`𝐄𝐱𝐚𝐦𝐩𝐥𝐞: ${prefixe}𝐭𝐨𝐡𝐝 <𝐫𝐞𝐩𝐥𝐲 𝐭𝐨 𝐢𝐦𝐚𝐠𝐞>\n\n𝐏𝐥𝐞𝐚𝐻𝐞 𝐫𝐞𝐩𝐥𝐲 𝐭𝐨 𝐚𝐧 𝐢𝐦𝐚𝐠𝐞 𝐭𝐨 𝐞𝐧𝐡𝐚𝐧𝐜𝐞 𝐭𝐨 𝐇𝐃!`
21+
);
22+
}
23+
24+
const mime = quoted.mtype || "";
25+
if (!/imageMessage/.test(mime)) {
26+
return repondre(
27+
`𝐍𝐨 𝐢𝐦𝐚𝐠𝐞 𝐟𝐨𝐮𝐧𝐝! 𝐏𝐥𝐞𝐚𝐻𝐞 𝐫𝐞𝐩𝐥𝐲 𝐭𝐨 𝐚𝐧 𝐢𝐦𝐚𝐠𝐞 (𝐣𝐩𝐞𝐠/𝐩𝐧𝐠).`
28+
);
29+
}
30+
31+
if (!/image\/(jpe?g|png)/.test(quoted.mime)) {
32+
return repondre(
33+
`𝐔𝐧𝐻𝐮𝐩𝐩𝐨𝐫𝐭𝐞𝐝 𝐟𝐨𝐫𝐦𝐚𝐭: ${quoted.mime}. 𝐔𝐇𝐞 𝐣𝐩𝐞𝐠 𝐨𝐫 𝐩𝐧𝐠 𝐨𝐧𝐥𝐲!`
34+
);
35+
}
36+
37+
try {
38+
repondre(`𝐄𝐧𝐡𝐚𝐧𝐜𝐢𝐧𝐠 𝐲𝐨𝐮𝐫 𝐢𝐦𝐚𝐠𝐞 𝐭𝐨 𝐇𝐃...`);
39+
40+
// Download the quoted image
41+
const img = await zk.downloadMediaMessage(quoted);
42+
43+
// Prepare form data
44+
const body = new FormData();
45+
body.append("image", img, "image");
46+
47+
// Send to API
48+
const res = await fetch(
49+
"http://max-image-resolution-enhancer.codait-prod-41208c73af8fca213512856c7a09db52-0000.us-east.containers.appdomain.cloud/model/predict",
50+
{
51+
method: "POST",
52+
body,
53+
}
54+
);
55+
56+
if (!res.ok) {
57+
const errorData = await res.json();
58+
throw new Error(JSON.stringify(errorData));
59+
}
60+
61+
// Get the enhanced image buffer
62+
const hdImage = await res.buffer();
63+
64+
// Send the enhanced image
65+
await zk.sendMessage(
66+
dest,
67+
{
68+
image: hdImage,
69+
caption: `𝐇𝐞𝐫𝐞'𝐻 𝐲𝐨𝐮𝐫 𝐇𝐃 𝐢𝐮𝐚𝐠𝐞!\n\n𝐏𝐨𝐰𝐞𝐫𝐞𝐝 𝐛𝐲 𝐱𝐡_𝐜𝐥𝐢𝐧𝐭𝐨𝐧`,
70+
mimetype: "image/jpeg",
71+
},
72+
{ quoted: ms }
73+
);
74+
} catch (error) {
75+
console.error("Error enhancing image:", error);
76+
repondre(
77+
`𝐄𝐫𝐫𝐨𝐫 𝐞𝐧𝐡𝐚𝐧𝐜𝐢𝐧𝐠 𝐢𝐮𝐚𝐠𝐞 𝐭𝐨 𝐇𝐃: ${error.message}`
78+
);
79+
}
80+
}
81+
);
82+
83+
module.exports = { zokou };

0 commit comments

Comments
 (0)