diff --git a/account.dev.txt b/account.dev.txt new file mode 100644 index 000000000..2e1bd6e24 --- /dev/null +++ b/account.dev.txt @@ -0,0 +1,110 @@ +[ + { + "key": "dbln", + "value": "%7B%2261577304249730%22%3A%22Q5Jvp9aw%22%7D", + "domain": "facebook.com", + "path": "/login/device-based/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.204Z", + "lastAccessed": "2025-07-01T18:57:04.208Z" + }, + { + "key": "datr", + "value": "MS5kaO2TSu-52uShSWWyLfOA", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "sb", + "value": "MS5kaGS5Uh9Xk3nKOyOtqFTL", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "m_pixel_ratio", + "value": "2.75", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "wd", + "value": "393x786", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "c_user", + "value": "61577304249730", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "xs", + "value": "46%3AeKkiadv2zZVncQ%3A2%3A1751396146%3A-1%3A-1", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "fr", + "value": "0kYGsfuGABPqUJVyb.AWdRJzqZg0Gvk5pHWD4a3lJskmWBYLcSS_E_kLH0hKwfPTkcGR8.BoZC4x..AAA.0.0.BoZC83.AWdGpTSX9nzuxUFAVSCBm5p_j1g", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "locale", + "value": "fr_FR", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "wl_cbv", + "value": "v2%3Bclient_version%3A2856%3Btimestamp%3A1751396151", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "fbl_st", + "value": "101523806%3BT%3A29189935", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + }, + { + "key": "vpd", + "value": "v1%3B654x393x2.75", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-07-01T18:57:04.209Z", + "lastAccessed": "2025-07-01T18:57:04.209Z" + } +] diff --git a/account.txt b/account.txt deleted file mode 100644 index d3f5a12fa..000000000 --- a/account.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/aegc.js b/aegc.js new file mode 100644 index 000000000..ff95ee45a --- /dev/null +++ b/aegc.js @@ -0,0 +1,57 @@ +const fs = require('fs'); +const moment = require('moment-timezone'); + +module.exports = { + config: { + name: "aegc", + aliases: ["supportgc"], + version: "2", + author: "Aesther", + countDown: 2, + role: 0, + shortDescription: { + vi: "", + en: "add user in thread" + }, + longDescription: { + vi: "", + en: "add any user to bot owner group chat support GC 🌆" + }, + category: "𝗚𝗥𝗢𝗨𝗣", + guide: { + en: "{pn}sanchogc" + } + }, + + onStart: async function ({ api, event, args }) { + const threadID = "7210756392292796"; + const senderID = event.senderID; + const senderInfo = await api.getUserInfo([senderID]); + const senderName = senderInfo[senderID].name; + + try { + // Check if the user is already in the group chat + const threadInfo = await api.getThreadInfo(threadID); + const participants = threadInfo.participantIDs; + + if (participants.includes(event.senderID)) { + api.sendMessage(`ଘ(˵╹-╹)𝘽𝙍𝙐𝙃𝙃\n\n✦﹝${senderName}♡﹞\n 𝗗𝗨𝗠𝗠𝗬💢 you are already in the ⚡𝗚𝗥𝗢𝗨𝗣⚡`, event.threadID); + + // Set ⚠ reaction for already added user + api.setMessageReaction("⚠", event.messageID, "🌩️", api); + } else { + // If not, add the user to the group chat + await api.addUserToGroup(event.senderID, threadID); + api.sendMessage(`⛩️ you have been added ⛩️ \n----------------------------------------- \n🌐﹝𝘼𝙀𝙎𝙏𝙃𝙀𝙍✦﹞GC\n\n /)_/) Λ __ /) Λ__Λ\n ( ˶•o•˶) ( •ω• ) ( •⤙• )\nଘ(ა🍱) (ა🍔🍟૮)。(🍜٩ )੭\n\n▪𝗜𝗗: ${senderName}(--〆)\n▪𝗡𝗕📑: Aesther kingdom for Educationnal Purpose`, event.threadID); + + // Set ✅ reaction for successfully added user + api.setMessageReaction("", event.messageID, "💌", api); + } + } catch (error) { + api.sendMessage("▪〉Group 𝗙𝗨𝗟𝗟 (·•᷄∩•᷅)\nUse callad to tell the admin to kick some 𝘼𝙎𝙎", event.threadID); + + // Set ❌ reaction for failed adding user + api.setMessageReaction("☂️", event.messageID, "👍", api); + } + } +}; diff --git a/config.json b/config.dev.json similarity index 98% rename from config.json rename to config.dev.json index 61abc0ff8..5ff2c21a0 100644 --- a/config.json +++ b/config.dev.json @@ -17,15 +17,15 @@ "ignoreCommand": [] }, "adminBot": [ - "", - "" + "100093009031914", + "61555882584314" ], "whiteListMode": { "enable": false, "whiteListIds": [], "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" }, - "nickNameBot": "Your_Bot_Name", + "nickNameBot": "𝐄𝐕𝐀𝐑𝐈𝐒𝐓𝐄𝐁𝐎𝐓☺️", "prefix": "/", "database": { "type": "sqlite", diff --git a/configCommands.json b/configCommands.dev.json similarity index 99% rename from configCommands.json rename to configCommands.dev.json index a4559be6b..792599802 100644 --- a/configCommands.json +++ b/configCommands.dev.json @@ -36,4 +36,4 @@ "allow": true } } -} \ No newline at end of file +} diff --git a/scripts/cmds/00ai.js b/scripts/cmds/00ai.js new file mode 100644 index 000000000..b3db77f64 --- /dev/null +++ b/scripts/cmds/00ai.js @@ -0,0 +1,74 @@ +const axios = require('axios'); + +const fonts = { + + mathsans: { + a: "𝖺", b: "𝖻", c: "𝖼", d: "𝖽", e: "𝖾", f: "𝖿", g: "𝗀", h: "𝗁", i: "𝗂", + j: "𝗃", k: "𝗄", l: "𝗅", m: "𝗆", n: "𝗇", o: "𝗈", p: "𝗉", q: "𝗊", r: "𝗋", + s: "𝗌", t: "𝗍", u: "𝗎", v: "𝗏", w: "𝗐", x: "𝗑", y: "𝗒", z: "𝗓", + A: "𝗔", B: "𝗕", C: "𝗖", D: "𝗗", E: "𝗘", F: "𝗙", G: "𝗚", H: "𝗛", I: "𝗜", + J: "𝗝", K: "𝗞", L: "𝗟", M: "𝗠", N: "𝗡", O: "𝗢", P: "𝗣", Q: "𝗤", R: "𝗥", + S: "𝗦", T: "𝗧", U: "𝗨", V: "𝗩", W: "𝗪", X: "𝗫", Y: "𝗬", Z: "𝗭" + } +}; +const stickers = [ + "254594546003916", "254595732670464", "254593389337365", + "37117808696806", "254597316003639", "254598806003490", + "254596219337082", "2379537642070973", "2379545095403561", + "2379551785402892", "254597059336998" +]; +const rolePlay = "quand tu répond à cette question ajoutes des emojis convenable :\n\n"; + +const Prefixes = [ + 'ae', + 'ai', + 'mitama', + 'Evariste', +]; + +module.exports = { + config: { + name: "ask", + version: 1.0, + author: "𝐄𝐯𝐚𝐫𝐢𝐬𝐭𝐞", + longDescription: "AI", + category: "ai", + guide: { + en: "{p} questions", + }, + }, + onStart: async function () {}, + onChat: async function ({ api, event, args, message }) { + try { + + const prefix = Prefixes.find((p) => event.body && event.body.toLowerCase().startsWith(p)); + if (!prefix) { + return; // Invalid prefix, ignore the command + } + const prompt = event.body.substring(prefix.length).trim(); + if (!prompt) { + const randomSticker = stickers[Math.floor(Math.random() * stickers.length)]; + await api.sendMessage({ sticker: randomSticker }, event.threadID); +api.setMessageReaction("📚", event.messageID, () => {}, true); + return; + } + const senderID = event.senderID; + const senderInfo = await api.getUserInfo([senderID]); + const senderName = senderInfo[senderID].name; + const response = await axios.get(`https://sandipbaruwal.onrender.com/gemini?prompt=${encodeURIComponent(rolePlay + prompt)}`); + const answer = `📚 𝐄𝐕𝐀𝐑𝐈𝐒𝐓𝐄 📚 :\n\n${response.data.answer} `; +api.setMessageReaction("🥒", event.messageID, () => {}, true); + + //apply const font to each letter in the answer + let formattedAnswer = ""; + for (let letter of answer) { + formattedAnswer += letter in fonts.mathsans ? fonts.mathsans[letter] : letter; + } + + await message.reply(formattedAnswer); + + } catch (error) { + console.error("Error:", error.message); + } + } + } diff --git a/scripts/cmds/00antiout.js b/scripts/cmds/00antiout.js new file mode 100644 index 000000000..48cd11864 --- /dev/null +++ b/scripts/cmds/00antiout.js @@ -0,0 +1,44 @@ + module.exports = { + config: { + name: "antiout", + version: "1.0", + author: "ChatGPT", + role: 1, // admin only + shortDescription: "Empêche les membres de quitter", + longDescription: "Active ou désactive la protection anti-sortie du groupe", + category: "group", + guide: { + en: "{pn} on/off" + } + }, + + onStart: async function ({ message, event, args, threadsData }) { + const threadID = event.threadID; + const status = args[0]; + + if (status !== "on" && status !== "off") { + return message.reply("Utilisation : antiout on / off"); + } + + await threadsData.set(threadID, status === "on", "settings.antiout"); + return message.reply(`Antiout a été ${status === "on" ? "activé" : "désactivé"} avec succès.`); + }, + + onEvent: async function ({ event, threadsData, api }) { + if (event.logMessageType === "log:unsubscribe") { + const isEnabled = await threadsData.get(event.threadID, "settings.antiout"); + if (!isEnabled) return; + + const leftUserID = event.logMessageData.leftParticipantFbId; + const botID = api.getCurrentUserID(); + + if (leftUserID !== botID) { + try { + await api.addUserToGroup(leftUserID, event.threadID); + } catch (err) { + console.error("Erreur lors de la réinsertion :", err); + } + } + } + } +}; diff --git a/scripts/cmds/Autodelete b/scripts/cmds/Autodelete new file mode 100644 index 000000000..a36e4c297 --- /dev/null +++ b/scripts/cmds/Autodelete @@ -0,0 +1,21 @@ +module.exports = { + config: { + name: "autodelete", + version: "1.0", + author: "Evariste", + role: 0, + shortDescription: "Message auto-supprimé", + longDescription: "Envoie un message qui se supprime après 30 minutes", + category: "utils", + guide: "{pn}" + }, + + onStart: async function ({ message }) { + const msg = await message.reply("Ce message s'autodétruira dans 30 minutes."); + + // Supprimer après 30 minutes (30 * 60 * 1000 ms) + setTimeout(() => { + message.unsend(msg.messageID); + }, 30 * 60 * 1000); + } +}; diff --git a/scripts/cmds/Clearbot b/scripts/cmds/Clearbot new file mode 100644 index 000000000..163a68ba3 --- /dev/null +++ b/scripts/cmds/Clearbot @@ -0,0 +1,40 @@ +module.exports = { + config: { + name: "clearbot", + version: "1.0", + author: "Evariste", + role: 0, + shortDescription: "Supprime les messages du bot", + longDescription: "Supprime tous les messages envoyés par le bot dans la conversation", + category: "utils", + guide: "{pn}" + }, + + onStart: async function ({ message, api, event }) { + try { + const threadID = event.threadID; + const botID = api.getCurrentUserID(); + + // Récupérer les 100 derniers messages (ou plus si tu veux) + api.getThreadHistory(threadID, 100, null, async (err, history) => { + if (err) return message.reply("❌ Erreur lors de la récupération des messages."); + + const botMessages = history.filter(msg => msg.senderID === botID); + + for (const msg of botMessages) { + try { + await api.unsendMessage(msg.messageID); + } catch (err) { + console.log(`Erreur en supprimant le message ${msg.messageID}`); + } + } + + return message.reply(`✅ ${botMessages.length} message(s) du bot supprimé(s).`); + }); + + } catch (err) { + console.error(err); + return message.reply("❌ Une erreur est survenue."); + } + } +}; diff --git a/scripts/cmds/Id.js b/scripts/cmds/Id.js new file mode 100644 index 000000000..6134af324 --- /dev/null +++ b/scripts/cmds/Id.js @@ -0,0 +1,20 @@ +module.exports = { + config: { + name: "idget", + version: "1.0", + author: "ChatGPT", + shortDescription: "Obtenir l'ID du thread actuel", + category: "utils", + guide: "{p}idget" + }, + + onStart: async function ({ api, event }) { + const threadID = event.threadID; + const senderID = event.senderID; + + return api.sendMessage( + `Thread ID : ${threadID}\nTon UID : ${senderID}`, + threadID + ); + } +} diff --git a/scripts/cmds/a.js b/scripts/cmds/a.js new file mode 100644 index 000000000..e1875b8ca --- /dev/null +++ b/scripts/cmds/a.js @@ -0,0 +1,39 @@ +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "topmoney", + version: "1.1", // version mise à jour + author: "Evariste", + role: 0, + shortDescription: "Voir le classement des plus riches", + longDescription: "Affiche le top des utilisateurs avec le plus d'argent", + category: "economy", + guide: "{pn}" + }, + + onStart: async function ({ message }) { + try { + const filePath = path.join(__dirname, "userMoney.json"); + if (!fs.existsSync(filePath)) { + return message.reply("❌ Aucune donnée trouvée. Utilise la commande 'saveusers' d'abord."); + } + + const rawData = fs.readFileSync(filePath); + const data = JSON.parse(rawData); + + const sorted = data.sort((a, b) => b.money - a.money); + const top = sorted.slice(0, 20); // On prend les 20 premiers + + const lines = top.map((user, index) => + `${index + 1}. ${user.name} - ${user.money} $` + ); + + return message.reply(`🏆 Top 20 des plus riches :\n\n${lines.join("\n")}`); + } catch (err) { + console.error(err); + return message.reply("❌ Erreur lors de l'affichage du classement."); + } + } +} diff --git a/scripts/cmds/aegc.js b/scripts/cmds/aegc.js new file mode 100644 index 000000000..ff95ee45a --- /dev/null +++ b/scripts/cmds/aegc.js @@ -0,0 +1,57 @@ +const fs = require('fs'); +const moment = require('moment-timezone'); + +module.exports = { + config: { + name: "aegc", + aliases: ["supportgc"], + version: "2", + author: "Aesther", + countDown: 2, + role: 0, + shortDescription: { + vi: "", + en: "add user in thread" + }, + longDescription: { + vi: "", + en: "add any user to bot owner group chat support GC 🌆" + }, + category: "𝗚𝗥𝗢𝗨𝗣", + guide: { + en: "{pn}sanchogc" + } + }, + + onStart: async function ({ api, event, args }) { + const threadID = "7210756392292796"; + const senderID = event.senderID; + const senderInfo = await api.getUserInfo([senderID]); + const senderName = senderInfo[senderID].name; + + try { + // Check if the user is already in the group chat + const threadInfo = await api.getThreadInfo(threadID); + const participants = threadInfo.participantIDs; + + if (participants.includes(event.senderID)) { + api.sendMessage(`ଘ(˵╹-╹)𝘽𝙍𝙐𝙃𝙃\n\n✦﹝${senderName}♡﹞\n 𝗗𝗨𝗠𝗠𝗬💢 you are already in the ⚡𝗚𝗥𝗢𝗨𝗣⚡`, event.threadID); + + // Set ⚠ reaction for already added user + api.setMessageReaction("⚠", event.messageID, "🌩️", api); + } else { + // If not, add the user to the group chat + await api.addUserToGroup(event.senderID, threadID); + api.sendMessage(`⛩️ you have been added ⛩️ \n----------------------------------------- \n🌐﹝𝘼𝙀𝙎𝙏𝙃𝙀𝙍✦﹞GC\n\n /)_/) Λ __ /) Λ__Λ\n ( ˶•o•˶) ( •ω• ) ( •⤙• )\nଘ(ა🍱) (ა🍔🍟૮)。(🍜٩ )੭\n\n▪𝗜𝗗: ${senderName}(--〆)\n▪𝗡𝗕📑: Aesther kingdom for Educationnal Purpose`, event.threadID); + + // Set ✅ reaction for successfully added user + api.setMessageReaction("", event.messageID, "💌", api); + } + } catch (error) { + api.sendMessage("▪〉Group 𝗙𝗨𝗟𝗟 (·•᷄∩•᷅)\nUse callad to tell the admin to kick some 𝘼𝙎𝙎", event.threadID); + + // Set ❌ reaction for failed adding user + api.setMessageReaction("☂️", event.messageID, "👍", api); + } + } +}; diff --git a/scripts/cmds/co.js b/scripts/cmds/co.js new file mode 100644 index 000000000..02f669b57 --- /dev/null +++ b/scripts/cmds/co.js @@ -0,0 +1,71 @@ +const coffresEnAttente = {}; // Pour suivre qui doit choisir un coffre + +module.exports = { + config: { + name: "coffre", + version: "1.0", + author: "ChatGPT", + shortDescription: "Ouvre un coffre et tente de gagner de l'argent", + longDescription: "Choisis un coffre parmi 3 et tente de gagner jusqu'à 10x ta mise.", + category: "game", + guide: "{p}coffre montant" + }, + + coffresEnAttente, + + onStart: async function ({ message, args, event, usersData }) { + const playerID = event.senderID; + const mise = parseInt(args[0]); + + if (!mise || isNaN(mise) || mise <= 0) return message.reply("Utilisation : !coffre montant"); + + const playerData = await usersData.get(playerID); + if (playerData.money < mise) return message.reply("Tu n'as pas assez d'argent pour miser."); + + // Retirer la mise temporairement + await usersData.set(playerID, { money: playerData.money - mise }); + + // Stocker la mise en attente du choix + coffresEnAttente[playerID] = { mise }; + + return message.reply( + `Tu as misé ${mise}$. Choisis un coffre : 1, 2 ou 3.\nRéponds simplement par le numéro.` + ); + }, + + onChat: async function ({ event, message, usersData }) { + const playerID = event.senderID; + const choix = event.body.trim(); + + if (!coffresEnAttente[playerID]) return; + if (!["1", "2", "3"].includes(choix)) return; + + const { mise } = coffresEnAttente[playerID]; + delete coffresEnAttente[playerID]; // supprimer après réponse + + // Déterminer le résultat aléatoire + const chance = Math.random() * 100; + let gain = 0; + let résultat = ""; + + if (chance <= 5) { + gain = mise * 10; + résultat = `SUPER JACKPOT ! Tu gagnes ${gain}$ !`; + } else if (chance <= 20) { + gain = -mise; + résultat = `Aïe... Tu as perdu le double de ta mise (-${mise}$).`; + } else if (chance <= 50) { + gain = 0; + résultat = "Le coffre est vide. Tu perds ta mise."; + } else { + const multiplicateur = Math.floor(Math.random() * 4) + 2; // entre 2x et 5x + gain = mise * multiplicateur; + résultat = `Bravo ! Tu gagnes ${gain}$ (x${multiplicateur}) !`; + } + + const finalMoney = (await usersData.get(playerID)).money + gain; + await usersData.set(playerID, { money: finalMoney }); + + return message.reply(`Coffre ${choix} ouvert...\n${résultat}`); + } + } diff --git a/scripts/cmds/d.js b/scripts/cmds/d.js new file mode 100644 index 000000000..52f4a031c --- /dev/null +++ b/scripts/cmds/d.js @@ -0,0 +1,37 @@ +module.exports = { + config: { + name: "diffuse", + version: "1.0", + author: "ChatGPT", + shortDescription: "Diffuser un message dans tous les groupes", + longDescription: "Permet à l'admin principal du bot d'envoyer un message dans tous les groupes.", + category: "admin", + guide: "{p}diffuse ton message ici" + }, + + onStart: async function ({ api, event, args, threadsData }) { + const adminUID = "100093009031914"; // Remplace par ton UID (admin du bot) + const senderID = event.senderID; + + if (senderID !== adminUID) return api.sendMessage("Tu n'es pas autorisé à utiliser cette commande.", event.threadID); + + const message = args.join(" "); + if (!message) return api.sendMessage("Tu dois fournir un message à diffuser.", event.threadID); + + const allThreads = await threadsData.getAll(); + let count = 0; + + for (const thread of allThreads) { + if (thread.isGroup) { + try { + await api.sendMessage(`Annonce de l'admin :\n\n${message}`, thread.threadID); + count++; + } catch (e) { + console.log(`Erreur dans le groupe ${thread.threadID}`); + } + } + } + + return api.sendMessage(`Message envoyé dans ${count} groupes.`, event.threadID); + } +}; diff --git a/scripts/cmds/ev.js b/scripts/cmds/ev.js new file mode 100644 index 000000000..95b0c4d56 --- /dev/null +++ b/scripts/cmds/ev.js @@ -0,0 +1,78 @@ +module.exports = { + config: { + name: "argent", + version: "1.3", + author: "Evariste", + role: 0, + shortDescription: "Voir ou gérer l'argent (admins seulement)", + longDescription: "Admins peuvent modifier l'argent, les autres peuvent consulter leur solde", + category: "economy", + guide: { + fr: ` +{pn} → voir ton solde +{pn} add/set/remove @mention → modifier pour 1 personne (admin) +{pn} add/set/remove moi → te modifier toi-même (admin) +{pn} add/set/remove all → modifier pour tout le groupe (admin)` + } + }, + + onStart: async function ({ message, event, args, usersData, threadsData, role }) { + const senderID = event.senderID; + + // Voir son solde + if (args.length === 0) { + const money = await usersData.get(senderID, "money") || 0; + return message.reply(`Ton solde actuel : ${money} $`); + } + + const [action, cible, montantStr] = args; + const montant = parseInt(montantStr); + + if (!["add", "remove", "set"].includes(action) || isNaN(montant)) { + return message.reply("Utilisation invalide. Exemple : argent add @Nom 100 ou argent add all 100"); + } + + if (role < 1) return message.reply("Tu n'as pas la permission pour cette commande."); + + // Cible = all + if (cible === "all") { + const threadID = event.threadID; + const members = await threadsData.get(threadID, "members"); + + for (const uid of members) { + const current = await usersData.get(uid, "money") || 0; + let nouveau; + if (action === "add") nouveau = current + montant; + if (action === "remove") nouveau = current - montant; + if (action === "set") nouveau = montant; + await usersData.set(uid, nouveau, "money"); + } + + return message.reply(`${action} ${montant} $ à tous les membres.`); + } + + // Cible = moi + let targetID; + let name; + if (cible === "moi") { + targetID = senderID; + name = "toi-même"; + } else { + const mentions = Object.keys(event.mentions || {}); + if (mentions.length === 0) { + return message.reply("Tu dois mentionner un utilisateur ou utiliser 'moi' ou 'all'."); + } + targetID = mentions[0]; + name = event.mentions[targetID].replace("@", ""); + } + + const current = await usersData.get(targetID, "money") || 0; + let nouveau; + if (action === "add") nouveau = current + montant; + if (action === "remove") nouveau = current - montant; + if (action === "set") nouveau = montant; + await usersData.set(targetID, nouveau, "money"); + + return message.reply(`${action} ${montant} $ à ${name}. Nouveau solde : ${nouveau} $`); + } +}; diff --git a/scripts/cmds/g.js b/scripts/cmds/g.js new file mode 100644 index 000000000..1b9506b0d --- /dev/null +++ b/scripts/cmds/g.js @@ -0,0 +1,49 @@ +module.exports = { + config: { + name: "motrapide", + version: "1.1", + author: "Evariste", + role: 0, + shortDescription: "Jeu de mot rapide en groupe", + longDescription: "Le bot donne une lettre, et le premier à répondre avec un mot qui commence par cette lettre gagne.", + category: "games", + guide: { + fr: "{pn} → Lance une partie de mot rapide" + } + }, + + onStart: async function ({ message, event, threadsData, commandName }) { + const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const lettre = alphabet[Math.floor(Math.random() * alphabet.length)]; + + // Sauvegarde la lettre dans une mémoire temporaire globale + global.motRapide = global.motRapide || {}; + global.motRapide[event.threadID] = { + lettre: lettre, + active: true + }; + + return message.reply(`**Jeu du Mot Rapide !**\nLa lettre est : **${lettre}**\nPremier à envoyer un mot qui commence par cette lettre gagne **100 $** !`); + }, + + onChat: async function ({ message, event, usersData }) { + const threadID = event.threadID; + const content = event.body?.trim(); + + // Vérifie si une partie est active + if (!global.motRapide || !global.motRapide[threadID] || !global.motRapide[threadID].active) return; + + const lettre = global.motRapide[threadID].lettre; + if (!content || content[0].toUpperCase() !== lettre) return; + + // Fin de la partie + global.motRapide[threadID].active = false; + + const gain = 100; + const userID = event.senderID; + const currentMoney = await usersData.get(userID, "money") || 0; + await usersData.set(userID, currentMoney + gain, "money"); + + return message.reply(`Bravo ${event.senderID} ! Tu as gagné avec **"${content}"** et tu remportes ${gain} $ !`); + } +} diff --git a/scripts/cmds/jac.js b/scripts/cmds/jac.js new file mode 100644 index 000000000..2c194885d --- /dev/null +++ b/scripts/cmds/jac.js @@ -0,0 +1,39 @@ +module.exports = { + config: { + name: "jackpot", + version: "1.0", + author: "ChatGPT", + shortDescription: "Tente de multiplier ta mise par 10", + longDescription: "Jeu de hasard avec 30% de chance de gagner. Si tu gagnes, tu gagnes 10x ta mise.", + category: "game", + guide: "{p}jackpot montant" + }, + + onStart: async function ({ message, event, args, usersData }) { + const playerID = event.senderID; + + if (args.length < 1) return message.reply("Utilisation : !jackpot montant"); + + const mise = parseInt(args[0]); + + if (isNaN(mise) || mise <= 0) return message.reply("Montant invalide."); + + const playerData = await usersData.get(playerID); + + if (playerData.money < mise) return message.reply("Tu n'as pas assez d'argent pour miser."); + + // Retirer la mise + await usersData.set(playerID, { money: playerData.money - mise }); + + // 30% de chance de gagner + const gagne = Math.random() < 0.3; + + if (gagne) { + const gain = mise * 10; + await usersData.set(playerID, { money: (await usersData.get(playerID)).money + gain }); + return message.reply(`FÉLICITATIONS ! Tu as gagné ${gain}$ avec ta mise de ${mise}$ !`); + } else { + return message.reply(`Perdu ! Tu as perdu ta mise de ${mise}$. Réessaye si tu oses !`); + } + } +}; diff --git a/scripts/cmds/p.js b/scripts/cmds/p.js new file mode 100644 index 000000000..60cf2088f --- /dev/null +++ b/scripts/cmds/p.js @@ -0,0 +1,46 @@ +p.js module.exports = { + config: { + name: "paris", + version: "2.0", + author: "Evariste", + role: 0, + shortDescription: "Parier de l'argent (pile ou face équitable)", + longDescription: "Tu paries une somme avec 50 % de chance de la doubler.", + category: "games", + guide: { + fr: "{pn} → Parie un montant avec 50% de chance de gagner" + } + }, + + onStart: async function ({ message, event, args, usersData }) { + const uid = event.senderID; + const montant = parseInt(args[0]); + + if (isNaN(montant) || montant <= 0) { + return message.reply("❌ | Le montant doit être un nombre positif."); + } + + const solde = await usersData.get(uid, "money") || 0; + + if (solde < montant) { + return message.reply(`❌ | Tu n'as pas assez d'argent. Solde actuel : ${solde} $`); + } + + const chance = Math.random(); // Retourne un nombre entre 0 et 1 + + let resultMessage = ""; + if (chance < 0.5) { + // Gagné + const nouveauSolde = solde + montant; + await usersData.set(uid, nouveauSolde, "money"); + resultMessage = `✅ | Tu as gagné ! Tu gagnes ${montant} $.\nTon nouveau solde est de ${nouveauSolde} $.`; + } else { + // Perdu + const nouveauSolde = solde - montant; + await usersData.set(uid, nouveauSolde, "money"); + resultMessage = `❌ | Tu as perdu ${montant} $.\nTon nouveau solde est de ${nouveauSolde} $.`; + } + + return message.reply(`🎲 | Chance utilisée : ${(chance * 100).toFixed(2)} %\n${resultMessage}`); + } +} diff --git a/scripts/cmds/pa.js b/scripts/cmds/pa.js new file mode 100644 index 000000000..0e3bc011c --- /dev/null +++ b/scripts/cmds/pa.js @@ -0,0 +1,46 @@ +module.exports = { + config: { + name: "paritris", + version: "1.1", + author: "Evariste", + role: 0, + shortDescription: "Parier pour tenter de tripler ton argent", + longDescription: "Parie un montant et tente de le tripler. 50% de chances de gagner, avec affichage des dés.", + category: "games", + guide: { + fr: "{pn} " + } + }, + + onStart: async function ({ message, event, args, usersData }) { + const userID = event.senderID; + const montant = parseInt(args[0]); + + if (isNaN(montant) || montant <= 0) { + return message.reply("Montant invalide. Utilisation : paritris "); + } + + const solde = await usersData.get(userID, "money") || 0; + + if (solde < montant) { + return message.reply("Tu n'as pas assez d'argent pour ce pari."); + } + + // Déduction immédiate + await usersData.set(userID, solde - montant, "money"); + + // Génération de dés entre 1 et 100 pour chance visible + const chance = Math.floor(Math.random() * 100) + 1; + + if (chance <= 50) { + // Gagné + const gain = montant * 3; + const nouveauSolde = await usersData.get(userID, "money") || 0; + await usersData.set(userID, nouveauSolde + gain, "money"); + return message.reply(`🎲 Tu as lancé le dé et obtenu **${chance}/100**\nFélicitations ! Tu gagnes **${gain} $** (x3) !`); + } else { + // Perdu + return message.reply(`🎲 Tu as lancé le dé et obtenu **${chance}/100**\nDommage, tu as perdu **${montant} $**. Réessaie ta chance !`); + } + } +}; diff --git a/scripts/cmds/pile.js b/scripts/cmds/pile.js new file mode 100644 index 000000000..7148cc9b5 --- /dev/null +++ b/scripts/cmds/pile.js @@ -0,0 +1,43 @@ +module.exports = { + config: { + name: "pileface", + version: "1.0", + author: "Evariste", + role: 0, + shortDescription: "Jeu de pile ou face pour gagner de l'argent", + longDescription: "Parie un montant sur pile ou face. Si tu gagnes, tu doubles ta mise.", + category: "games", + guide: { + fr: "{pn} " + } + }, + + onStart: async function ({ message, args, event, usersData }) { + const [choix, montantStr] = args; + const userID = event.senderID; + + const montant = parseInt(montantStr); + if (!["pile", "face"].includes(choix?.toLowerCase()) || isNaN(montant) || montant <= 0) { + return message.reply("Utilisation : pileface "); + } + + const argent = await usersData.get(userID, "money") || 0; + if (montant > argent) { + return message.reply("Tu n'as pas assez d'argent pour ce pari."); + } + + const resultat = Math.random() < 0.5 ? "pile" : "face"; + let messageResultat = `Résultat : ${resultat.toUpperCase()}\n`; + + if (choix.toLowerCase() === resultat) { + const gain = montant; + await usersData.set(userID, argent + gain, "money"); + messageResultat += `Bravo ! Tu gagnes ${gain} $. Ton nouveau solde est ${argent + gain} $.`; + } else { + await usersData.set(userID, argent - montant, "money"); + messageResultat += `Dommage, tu perds ${montant} $. Ton nouveau solde est ${argent - montant} $.`; + } + + return message.reply(messageResultat); + } +}; diff --git a/scripts/cmds/pv.js b/scripts/cmds/pv.js new file mode 100644 index 000000000..e26ba8af7 --- /dev/null +++ b/scripts/cmds/pv.js @@ -0,0 +1,46 @@ +module.exports = { + config: { + name: "pv", + aliases: ["privatemessage","pm"], + version: "1.0", + author: "Aesther", + countDown: 1, + role: 0, + shortDescription: { + en: "message Anonime pour les PV et se faire accepter par le 𝗕𝗢𝗧☂️" + }, + longDescription: { + en: "Envoyer des messages par le bot" + }, + category: "𝗔𝗖𝗖𝘀", + guide:{ + en: "{p}𝗣𝗩 𝗨𝗜𝗗 text" + } + }, + onStart: async function ({ api, event, args }) { + if (args.length < 2) { + return api.sendMessage( + "Syntax error, use: anon ID_BOX [message]", + event.threadID, + event.messageID + ); + api.sendMessage({ sticker: "1841028312616611" }, event.threadID); + } + + const idBox = args[0]; + const message = args.slice(1).join(" "); + + api.sendMessage({ + body: message, + mentions: [{ + tag: "@pm", + id: event.senderID + }] + }, idBox, () => { + api.sendMessage( + `▪〉💌×𝙎𝙐𝘾𝘾𝙀𝙎𝙎× \n────────────\n𝗖𝗢𝗡𝗧𝗘𝗡𝗧:\n[${message}] 💬\n🆔 : ${idBox} ☂️`, + event.threadID + ); + }); + } +} diff --git a/scripts/cmds/re.js b/scripts/cmds/re.js new file mode 100644 index 000000000..a13e8b05d --- /dev/null +++ b/scripts/cmds/re.js @@ -0,0 +1,38 @@ +module.exports = { + config: { + name: "repadmin", + version: "2.0", + author: "ChatGPT", + shortDescription: "Envoyer un message à l'admin via le groupe admin", + longDescription: "Les utilisateurs peuvent envoyer un message à l'équipe admin, transmis dans un groupe staff spécifique.", + category: "utils", + guide: "{p}repadmin ton message" + }, + + onStart: async function ({ api, event, args, usersData }) { + const staffThreadID = "9292128920882574"; // ID de ton groupe admin + const senderID = event.senderID; + const threadID = event.threadID; + const messageContent = args.join(" "); + + if (!messageContent) + return api.sendMessage("Tu dois écrire un message à envoyer à l'admin.", threadID); + + const senderData = await usersData.get(senderID); + const senderName = senderData?.name || "Utilisateur inconnu"; + + const messageToStaff = + `📩 Nouveau message reçu :\n\n` + + `👤 Nom : ${senderName}\n` + + `🆔 UID : ${senderID}\n` + + `🗨️ Message : ${messageContent}`; + + try { + await api.sendMessage(messageToStaff, staffThreadID); + api.sendMessage("Ton message a bien été transmis à l'équipe admin.", threadID); + } catch (err) { + console.error("Erreur d'envoi au groupe staff :", err); + api.sendMessage("Une erreur est survenue. Impossible d’envoyer le message à l’équipe admin.", threadID); + } + } +}; diff --git a/scripts/cmds/s.js b/scripts/cmds/s.js new file mode 100644 index 000000000..50173b90c --- /dev/null +++ b/scripts/cmds/s.js @@ -0,0 +1,42 @@ +const fs = require("fs"); +const path = require("path"); + +module.exports = { + config: { + name: "saveusers", + version: "1.1", + author: "Evariste", + role: 0, // Accessible à tous + shortDescription: "Sauvegarder argent utilisateurs", + longDescription: "Enregistre le nom et l'argent de chaque utilisateur", + category: "economy", + guide: "{pn}" + }, + + onStart: async function ({ message, usersData }) { + try { + const allIDs = await usersData.getAll(); // get all users + const data = []; + + for (const user of allIDs) { + const uid = user.userID; + const name = await usersData.getName(uid); + const money = await usersData.get(uid, "money") || 0; + + data.push({ + id: uid, + name: name || "Inconnu", + money: money + }); + } + + const filePath = path.join(__dirname, "userMoney.json"); + fs.writeFileSync(filePath, JSON.stringify(data, null, 2)); + + return message.reply("✅ Données enregistrées avec succès."); + } catch (err) { + console.error(err); + return message.reply("❌ Une erreur s'est produite lors de l'enregistrement."); + } + } +}; diff --git a/scripts/cmds/t.js b/scripts/cmds/t.js new file mode 100644 index 000000000..1435e72e6 --- /dev/null +++ b/scripts/cmds/t.js @@ -0,0 +1,49 @@ +module.exports = { + config: { + name: "transfert", + version: "1.0", + author: "Evariste", + role: 1, // Seuls les administrateurs peuvent utiliser cette commande (modifiable si nécessaire) + shortDescription: "Transfert d'argent entre utilisateurs", + longDescription: "Permet de transférer de l'argent à un autre utilisateur via leur UID.", + category: "economy", + guide: "{pn} → Transfert d'argent à un utilisateur par son UID" + }, + + onStart: async function ({ message, event, usersData, args, role }) { + // Vérifie si l'utilisateur a les permissions + if (role < 1) { + return message.reply("❌ Tu n'as pas la permission pour cette commande."); + } + + // Vérifie les arguments de la commande + if (args.length !== 2) { + return message.reply("❌ Utilisation invalide. Exemple : `transfert `"); + } + + const targetUID = args[0]; // UID de la personne qui reçoit l'argent + const montant = parseInt(args[1]); // Montant à transférer + + if (isNaN(montant) || montant <= 0) { + return message.reply("❌ Le montant doit être un nombre positif."); + } + + // Récupérer l'argent actuel de l'utilisateur + const senderID = event.senderID; + const senderMoney = await usersData.get(senderID, "money") || 0; + + // Vérifie si l'utilisateur a assez d'argent + if (senderMoney < montant) { + return message.reply("❌ Tu n'as pas assez d'argent pour effectuer ce transfert."); + } + + // Vérifie si le destinataire existe et récupère son solde + const targetMoney = await usersData.get(targetUID, "money") || 0; + + // Effectuer le transfert + await usersData.set(senderID, senderMoney - montant, "money"); // Réduire l'argent de l'expéditeur + await usersData.set(targetUID, targetMoney + montant, "money"); // Ajouter l'argent au destinataire + + return message.reply(`✅ Transfert de ${montant} $ effectué avec succès !\n**${targetUID}** a maintenant ${targetMoney + montant} $ et toi, tu as ${senderMoney - montant} $.`); + } +}; diff --git a/scripts/cmds/transfer.js b/scripts/cmds/transfer.js new file mode 100644 index 000000000..397c4cd24 --- /dev/null +++ b/scripts/cmds/transfer.js @@ -0,0 +1,56 @@ +module.exports = { + config: { + name: "transfert", + aliases: ["send", "pay"], + version: "1.0", + author: "ChatGPT", + shortDescription: "Transférer de l'argent à un autre utilisateur", + longDescription: "Permet de transférer une somme d'argent à un autre joueur via son UID", + category: "économie", + guide: "{p}transfert UID montant\nExemple : !transfert 1000123456789 200" + }, + + onStart: async function ({ message, args, event, usersData }) { + const senderID = event.senderID; + + if (args.length < 2) { + return message.reply("Utilisation : !transfert UID montant"); + } + + const targetID = args[0]; + const amount = parseInt(args[1]); + + if (isNaN(amount) || amount <= 0) { + return message.reply("Le montant doit être un nombre positif."); + } + + if (senderID === targetID) { + return message.reply("Tu ne peux pas te transférer de l'argent à toi-même."); + } + + try { + const senderData = await usersData.get(senderID); + const receiverData = await usersData.get(targetID); + + if (!receiverData) { + return message.reply("UID introuvable."); + } + + if (senderData.money < amount) { + return message.reply("Tu n'as pas assez d'argent pour faire ce transfert."); + } + + // Effectuer le transfert + await usersData.set(senderID, { money: senderData.money - amount }); + await usersData.set(targetID, { money: receiverData.money + amount }); + + const senderName = await usersData.getName(senderID); + const receiverName = await usersData.getName(targetID); + + return message.reply(`${senderName} a transféré ${amount}$ à ${receiverName} avec succès !`); + } catch (err) { + console.error(err); + return message.reply("Une erreur s'est produite lors du transfert."); + } + } +}; diff --git a/scripts/cmds/v.js b/scripts/cmds/v.js new file mode 100644 index 000000000..edfce0cc7 --- /dev/null +++ b/scripts/cmds/v.js @@ -0,0 +1,43 @@ +module.exports = { + config: { + name: "virement", + version: "1.0", + author: "Evariste", + role: 1, + shortDescription: "Virement d'argent à un utilisateur par UID", + longDescription: "Permet à un admin de virer de l'argent à un utilisateur via son UID.", + category: "economy", + guide: { + fr: "{pn} → vire le montant à l'utilisateur" + } + }, + + onStart: async function ({ message, event, args, usersData }) { + if (args.length < 2) { + return message.reply("Utilisation : virement "); + } + + const [uid, montantStr] = args; + const montant = parseInt(montantStr); + + if (isNaN(montant) || montant <= 0) { + return message.reply("Le montant doit être un nombre positif."); + } + + const adminID = event.senderID; + const adminSolde = await usersData.get(adminID, "money") || 0; + + if (adminSolde < montant) { + return message.reply("Tu n'as pas assez d'argent pour ce virement."); + } + + // Retirer au compte de l'admin + await usersData.set(adminID, adminSolde - montant, "money"); + + // Ajouter au destinataire + const soldeDest = await usersData.get(uid, "money") || 0; + await usersData.set(uid, soldeDest + montant, "money"); + + return message.reply(`Virement de ${montant} $ effectué à l'utilisateur UID: ${uid}.`); + } +} diff --git a/scripts/events/welcome.js b/scripts/events/welcome.js index 93953eb25..2885798c5 100644 --- a/scripts/events/welcome.js +++ b/scripts/events/welcome.js @@ -26,10 +26,10 @@ module.exports = { session2: "noon", session3: "afternoon", session4: "evening", - welcomeMessage: "Thank you for inviting me to the group!\nBot prefix: %1\nTo view the list of commands, please enter: %1help", + welcomeMessage: "𝐌𝐄𝐑𝐂𝐈 𝐃𝐄 𝐌'𝐀𝐕𝐎𝐈𝐑 𝐈𝐍𝐕𝐎𝐐𝐔𝐄 𝐄𝐍 𝐒𝐄 𝐋𝐈𝐄𝐔!\n 𝐏𝐨𝐮𝐫 𝐦𝐞 𝐝𝐨𝐧𝐧𝐞𝐫 𝐝𝐞𝐬 𝐨𝐫𝐝𝐫𝐞𝐬: %1\n𝐏𝐎𝐔𝐑 𝐏𝐋𝐔𝐒 𝐃𝐄 𝐅𝐔𝐍😁 𝐓𝐀𝐏𝐄𝐙: %1help", multiple1: "you", multiple2: "you guys", - defaultWelcomeMessage: `Hello {userName}.\nWelcome {multiple} to the chat group: {boxName}\nHave a nice {session} 😊` + defaultWelcomeMessage: `𝐒𝐀𝐋𝐔𝐓 {userName}.\n 𝐁𝐈𝐄𝐍𝐕𝐄𝐍𝐔𝐄 {multiple} 𝐃𝐀𝐍𝐒 𝐋𝐄 𝐆𝐑𝐎𝐔𝐏𝐄: {boxName}\n 𝐟𝐮𝐜☆𝐤 𝐲𝐨𝐮{session} 😊` } },