Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
2981563
Update tools-game.js
Kgtech-cmr Feb 4, 2025
2f2f9c2
Update url.js
Kgtech-cmr Feb 4, 2025
38bef8b
Update tools-game.js
Kgtech-cmr Feb 4, 2025
8355023
Update tools-game.js
Kgtech-cmr Feb 4, 2025
b99e281
Update tools-game.js
Kgtech-cmr Feb 4, 2025
19248dc
Update autoreply.json
Kgtech-cmr Feb 4, 2025
45f1243
Create diary.js
Kgtech-cmr Feb 4, 2025
2cdf6cd
Update diary.js
Kgtech-cmr Feb 4, 2025
2425939
Create diary.json
Kgtech-cmr Feb 4, 2025
3b63a0f
Update diary.js
Kgtech-cmr Feb 4, 2025
3f46fe2
Update diary.js
Kgtech-cmr Feb 4, 2025
6c68a3e
Update diary.js
Kgtech-cmr Feb 4, 2025
2581aae
Update diary.js
Kgtech-cmr Feb 4, 2025
c57605b
Update diary.js
Kgtech-cmr Feb 4, 2025
3701dbd
Update diary.js
Kgtech-cmr Feb 4, 2025
cc9ba67
Update diary.js
Kgtech-cmr Feb 4, 2025
eb5da0c
Update diary.js
Kgtech-cmr Feb 4, 2025
3b6621f
Update diary.js
Kgtech-cmr Feb 4, 2025
db5f8c1
Update game.js
Kgtech-cmr Feb 4, 2025
fc63f39
Update game.js
Kgtech-cmr Feb 4, 2025
beac430
Update game.js
Kgtech-cmr Feb 4, 2025
0629dbd
Update game.js
Kgtech-cmr Feb 4, 2025
c20af7f
Update game.js
Kgtech-cmr Feb 4, 2025
093b225
Update index.js
Kgtech-cmr Feb 4, 2025
9d19cf3
Update game.js
Kgtech-cmr Feb 4, 2025
28b03f9
Update index.js
Kgtech-cmr Feb 4, 2025
515ee64
Update index.js
Kgtech-cmr Feb 4, 2025
268b795
Update index.js
Kgtech-cmr Feb 4, 2025
6c5f6f5
Update index.js
Kgtech-cmr Feb 4, 2025
2e21b64
Update index.js
Kgtech-cmr Feb 4, 2025
5dde75f
Update game.js
Kgtech-cmr Feb 4, 2025
fe92251
Update game.js
Kgtech-cmr Feb 4, 2025
c2cb920
Update game.js
Kgtech-cmr Feb 4, 2025
0306008
Update game.js
Kgtech-cmr Feb 4, 2025
ae110bc
Update ping.js
Kgtech-cmr Feb 4, 2025
7526bfa
Update autoreply.json
Kgtech-cmr Feb 5, 2025
42031ef
Create pdf-convert.js
Kgtech-cmr Feb 5, 2025
873e01e
Create notfound.js
Kgtech-cmr Feb 5, 2025
e92fa0c
Create notfound.json
Kgtech-cmr Feb 5, 2025
5382b69
Update notfound.js
Kgtech-cmr Feb 5, 2025
23fefd8
Add files via upload
Kgtech-cmr Feb 5, 2025
48f6a22
Delete AUDIO-2025-02-05-10-03-01.mp3
Kgtech-cmr Feb 5, 2025
ee3e69c
Add files via upload
Kgtech-cmr Feb 5, 2025
8a79a4f
Update notfound.json
Kgtech-cmr Feb 5, 2025
401a722
Create js
Kgtech-cmr Feb 5, 2025
03e8625
Add files via upload
Kgtech-cmr Feb 5, 2025
6194824
Delete AUDIO directory
Kgtech-cmr Feb 5, 2025
bbf6b69
Create jdk
Kgtech-cmr Feb 5, 2025
5980ab7
Add files via upload
Kgtech-cmr Feb 5, 2025
38b3e46
Delete Kerm.mp3
Kgtech-cmr Feb 5, 2025
90b78e4
Delete voice/jdk
Kgtech-cmr Feb 5, 2025
f47c6f3
Create us
Kgtech-cmr Feb 5, 2025
ebf92dc
Update notfound.json
Kgtech-cmr Feb 5, 2025
8e9a8cf
Delete voice directory
Kgtech-cmr Feb 5, 2025
c80f32d
Delete plugins/notfound.js
Kgtech-cmr Feb 5, 2025
902cdf3
Delete my_data/notfound.json
Kgtech-cmr Feb 5, 2025
3baf2c1
Delete plugins/pdf-convert.js
Kgtech-cmr Feb 5, 2025
f4a9a85
Update package.json
Kgtech-cmr Feb 5, 2025
40fc68b
Create pdf-convert.js
Kgtech-cmr Feb 5, 2025
cffe6ab
Update index.js
Kgtech-cmr Feb 5, 2025
b4c051e
Update index.js
Kgtech-cmr Feb 5, 2025
8d239e1
Update index.js
Kgtech-cmr Feb 5, 2025
baac793
Update pdf-convert.js
Kgtech-cmr Feb 5, 2025
0baf468
Update pdf-convert.js
Kgtech-cmr Feb 5, 2025
53dc17a
Update ping.js
itx-ali-raza Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const express = require("express");
const app = express();
const port = process.env.PORT || 9090;

//=============================================

async function connectToWA() {
console.log("CONNECTING KERM_MD-V1🧬...");
Expand Down
11 changes: 5 additions & 6 deletions my_data/autoreply.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"hi":"*ʜɪɪ ᴍʏ ғʀɪᴇɴᴅ ʜᴏᴡ ᴄᴀɴ ɪ ʜᴇʟᴘ ʏᴏᴜ* 👑❤️",
"silent":"*ʏᴇᴀsʜ sɪʟᴇɴᴛ ɪs ʜᴇʀᴇ ᴍᴏʟɴɪɴɢ ᴅᴇᴀʀ* 🥹🩷",
"usman":"*ʏᴇᴀsʜ ᴊᴀᴀɴ*☺️",
"kerm":"*Yeah Am Kerm*☺️",
"ok":"*HMMM*😊♥️",
"Okey":"*AHMM*💙🥲",
".sad":"MEIN L LIKHA TENU WR JAYY😁",
". Sad":"MEIN L LIKHA TENU WR JAYY😁",
".SAD":"MEIN L LIKHA TENU WR JAYY😁",
". SAD":"MEIN L LIKHA TENU WR JAYY😁"
"sad":"MEIN L LIKHA TENU WR JAYY😁",
"Sad":"MEIN L LIKHA TENU WR JAYY😁",
"SAD":"MEIN L LIKHA TENU WR JAYY😁",
"SAD":"MEIN L LIKHA TENU WR JAYY😁"
}
1 change: 1 addition & 0 deletions my_data/diary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@sl-code-lords/wabetainfo": "1.2.0",
"@tobyg74/tiktok-api-dl": "1.0.13",
"@vitalets/google-translate-api": "9.2.0",
"@whiskeysockets/baileys": "git+https://github.com/prabathLK/Baileys-6.0.0.git#master",
"@whiskeysockets/baileys": "6.6.0",
"api-dylux": "latest",
"aptoide-scraper": "1.0.1",
"awesome-phonenumber": "6.2.0",
Expand Down Expand Up @@ -122,4 +122,4 @@
"mrnima-moviedl":"1.0.0"

}
}
}
190 changes: 190 additions & 0 deletions plugins/diary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/*
_ ______ _____ _____ _____ _ _
| |/ / ___| |_ _| ____/___ | | | |
| ' / | _ | | | _|| | | |_| |
| . \ |_| | | | | |__| |___| _ |
|_|\_\____| |_| |_____\____|_| |_|

ANYWAY, YOU MUST GIVE CREDIT TO MY CODE WHEN COPY IT
CONTACT ME HERE +237656520674
YT: KermHackTools
Github: Kgtech-cmr
*/

const fs = require("fs");
const path = require("path");
const { cmd } = require("../command");

const diaryFile = path.join(__dirname, "../my_data/diary.json");
let diaries = fs.existsSync(diaryFile) ? JSON.parse(fs.readFileSync(diaryFile, 'utf8')) : {};

// Function to save diaries to file
const saveDiaries = () => {
fs.writeFileSync(diaryFile, JSON.stringify(diaries, null, 2));
};

// URL of the image (replace with a valid URL)
const ALIVE_IMG = "https://i.ibb.co/4Zq1jCNP/lordkerm.jpg";

// ---------------------
// .diary command (open or create diary)
// ---------------------
cmd({
pattern: "diary",
desc: "Open or create a secret diary (Owner only).",
category: "private",
filename: __filename
}, async (conn, mek, m, { reply, q, from, isOwner, sender }) => {
// Check if the user is the owner
if (!isOwner) return reply("❌ Only the bot owner can use this command.");

const userId = m.sender;

if (!diaries[userId]) {
if (!q) {
return reply("📖 You don't have a diary yet. To create one, use:\n\n`.diary yourpassword`");
}
diaries[userId] = { password: q.trim(), entries: [] };
saveDiaries();
return reply(`✅ Your secret diary has been created!\nTo add an entry, use \`.setdiary your message\`\nTo open your diary, use \`.diary yourpassword\``);
}

if (!q) {
return reply("🔒 You already have a diary. To open it, enter your password like this:\n\n`.diary yourpassword`");
}

if (q.trim() !== diaries[userId].password) {
return reply("❌ Incorrect password! Please try again.");
}

if (diaries[userId].entries.length === 0) {
return reply("📖 Your diary is empty. Add entries using `.setdiary your message`.");
}

let formattedInfo = `📖 *Your Diary Entries:*\n\n`;
diaries[userId].entries.forEach((entry) => {
formattedInfo += `📅 *${entry.date}* 🕒 *${entry.time}*\n📝 ${entry.text}\n\n`;
});

// Send the image with the diary entries
await conn.sendMessage(from, {
image: { url: ALIVE_IMG },
caption: formattedInfo,
contextInfo: {
mentionedJid: [m.sender],
forwardingScore: 999,
isForwarded: true,
forwardedNewsletterMessageInfo: {
newsletterJid: '120363321386877609@newsletter',
newsletterName: '𝐊𝐄𝐑𝐌 𝐃𝐈𝐀𝐑𝐘',
serverMessageId: 143
}
}
}, { quoted: mek });
});

// ---------------------
// .setdiary command (add a new diary entry)
// ---------------------
cmd({
pattern: "setdiary",
desc: "Write a new diary entry (Owner only).",
category: "private",
filename: __filename
}, async (conn, mek, m, { reply, q, isOwner, sender }) => {
if (!isOwner) return reply("❌ Only the bot owner can use this command.");
const userId = m.sender;
if (!diaries[userId]) {
return reply("❌ You don't have a diary. Create one using `.diary yourpassword`.");
}
if (!q) {
return reply("✍️ Please provide the text you want to add to your diary.");
}

const now = new Date();
const date = now.toLocaleDateString('fr-FR'); // Date format (France)
const time = now.toLocaleTimeString('fr-FR', { hour12: false }); // 24h format

diaries[userId].entries.push({ date, time, text: q.trim() });
saveDiaries();

reply("✅ Your diary entry has been saved!");
});

// ---------------------
// .resetdiary command (delete all diary entries)
// ---------------------
cmd({
pattern: "resetdiary",
desc: "Reset your diary (delete all entries) (Owner only).",
category: "private",
filename: __filename
}, async (conn, mek, m, { reply, q, isOwner, sender }) => {
if (!isOwner) return reply("❌ Only the bot owner can use this command.");
const userId = m.sender;

if (!diaries[userId]) {
return reply("❌ You don't have a diary to reset.");
}

if (!q) {
return reply("⚠️ To reset your diary, use `.resetdiary yourpassword` to confirm your identity.");
}

if (q.trim() !== diaries[userId].password) {
return reply("❌ Incorrect password! Diary reset aborted.");
}

delete diaries[userId];
saveDiaries();

reply("✅ Your diary has been successfully reset!");
});

// ---------------------
// .resetpassword command (reset diary password; Owner only)
// ---------------------
const generateCode = () => Math.floor(100000 + Math.random() * 900000).toString(); // 6-digit code
let resetRequests = {};

cmd({
pattern: "resetpassword",
desc: "Reset your diary password (Owner only).",
category: "private",
filename: __filename
}, async (conn, mek, m, { reply, q, isOwner, sender }) => {
if (!isOwner) return reply("❌ Only the bot owner can use this command.");
const userId = m.sender;

if (!diaries[userId]) {
return reply("❌ You don't have a diary. Create one using `.diary yourpassword`.");
}

// If no argument is provided, send a reset code
if (!q) {
const resetCode = generateCode();
// Store the reset code with an expiration time of 5 minutes
resetRequests[userId] = { code: resetCode, expires: Date.now() + 5 * 60 * 1000 };

await conn.sendMessage(userId, {
text: `🔐 Your password reset code: *${resetCode}*\n\nThis code expires after 5 minutes.\nEnter this code with \'.resetpassword *code* newpassword\' to confirm.`
});
return reply("📩 A reset code has been sent to your private chat. Use it to reset your password.");
}

const args = q.split(" ");
if (args.length !== 2) {
return reply("⚠️ Incorrect format! Use:\n\n`.resetpassword code newpassword`");
}

const [code, newPassword] = args;
if (!resetRequests[userId] || resetRequests[userId].code !== code || Date.now() > resetRequests[userId].expires) {
return reply("❌ Invalid or expired code! Request a new one with `.resetpassword`.");
}

diaries[userId].password = newPassword.trim();
saveDiaries();
delete resetRequests[userId];

reply("✅ Your diary password has been successfully reset!");
});
107 changes: 107 additions & 0 deletions plugins/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,111 @@ YT: KermHackTools
Github: Kgtech-cmr
*/

const { delay } = require("@whiskeysockets/baileys");
const { cmd } = require("../command");

cmd({
pattern: "squidgame",
desc: "Lancer le jeu Squid Game dans un groupe",
category: "fun",
filename: __filename
}, async (conn, mek, m, { isAdmin, isOwner, participants, reply }) => {
try {
if (!m.isGroup) return reply("❌ Cette commande ne peut être utilisée que dans les groupes.");
if (!isAdmin && !isOwner) return reply("❌ Seuls les admins peuvent utiliser cette commande.");

let groupMembers = participants.filter(p => !p.admin); // Exclure les admins
if (groupMembers.length < 5) return reply("⚠️ Il faut au moins 5 membres non-admins pour jouer.");

let gameCreator = "@" + m.sender.split("@")[0];

// Message d'annonce du jeu
let gameMessage = `🔴 *Squid Game: Red Light,🟢Green Light*\n\n🎭 *Front Man*: (${gameCreator})\n`;
gameMessage += groupMembers.map(m => "@" + m.id.split("@")[0]).join("\n") + "\n\n";
gameMessage += "Tous les autres membres du groupe sont ajoutés comme joueurs ! Le jeu commence dans 50 secondes.";

await conn.sendMessage(m.chat, { text: gameMessage, mentions: groupMembers.map(m => m.id) });

await delay(50000); // Attente de 50s avant de sélectionner les joueurs

// Sélectionner 50 joueurs aléatoires
let players = groupMembers.sort(() => 0.5 - Math.random()).slice(0, 5);

let playersList = players.map((p, i) => `${i + 1}. @${p.id.split("@")[0]}`).join("\n");

await conn.sendMessage(m.chat, {
text: `🎮 *Liste des joueurs:*\n${playersList}\n\n🔔 Le jeu commence maintenant !`,
mentions: players.map(p => p.id)
});

await delay(3000);

// Explication des règles
let rulesMessage = `📜 *Règles du Squid Game:*\n\n`
+ `1️⃣ Pendant 🟥 *Red Light*, les joueurs qui envoient un message seront *éliminés* et *expulsés* du groupe.\n\n`
+ `2️⃣ Pendant 🟩 *Green Light*, les joueurs doivent envoyer un message. Ceux qui restent silencieux seront éliminés.\n\n`
+ `3️⃣ Le jeu se termine lorsqu'il ne reste plus qu'un seul joueur.\n\n`
+ `🏆 Survis pour devenir le *gagnant* !`;

await conn.sendMessage(m.chat, { text: rulesMessage });

await delay(5000);

let remainingPlayers = [...players];
while (remainingPlayers.length > 1) {
let isGreenLight = Math.random() > 0.5;
let lightMessage = isGreenLight ? "🟩 *Green Light*" : "🟥 *Red Light*";
await conn.sendMessage(m.chat, { text: `🔔 ${lightMessage}` });

await delay(5000); // Délai de 5s entre chaque phase

let playersToKick = [];
let spokenPlayers = new Set(); // Stocke ceux qui ont parlé

conn.ev.on("messages.upsert", (msg) => {
let sender = msg.messages[0].key.remoteJid;
if (remainingPlayers.find(p => p.id === sender)) spokenPlayers.add(sender);
});

if (isGreenLight) {
// Vérifier qui ne parle pas
for (let player of remainingPlayers) {
if (!spokenPlayers.has(player.id)) {
playersToKick.push(player);
}
}
} else {
// Vérifier qui parle
for (let player of remainingPlayers) {
if (spokenPlayers.has(player.id)) {
playersToKick.push(player);
}
}
}

for (let player of playersToKick) {
await conn.groupParticipantsUpdate(m.chat, [player.id], "remove");
let eliminationMessage = isGreenLight
? `❌ @${player.id.split("@")[0]} est resté silencieux pendant 🟩 *Green Light* et a été éliminé et expulsé du groupe.`
: `❌ @${player.id.split("@")[0]} a écrit pendant 🟥 *Red Light* et a été éliminé et expulsé du groupe.`;

await conn.sendMessage(m.chat, {
text: eliminationMessage,
mentions: [player.id]
});
}

remainingPlayers = remainingPlayers.filter(p => !playersToKick.includes(p));
}

if (remainingPlayers.length === 1) {
await conn.sendMessage(m.chat, {
text: `🏆 *Félicitations @${remainingPlayers[0].id.split("@")[0]} !*\nTu as survécu et remporté le Squid Game ! 🎉`,
mentions: [remainingPlayers[0].id]
});
}
} catch (error) {
console.error("Erreur dans la commande .squidgame:", error);
reply("❌ Une erreur s'est produite lors du lancement du Squid Game.");
}
});
Loading