From feb6b2c134ba0a3d8d756ec1bc76ae9814c3cb80 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:33:40 +0100 Subject: [PATCH 01/15] Update and rename account.txt to account.dev.txt --- account.dev.txt | 129 ++++++++++++++++++++++++++++++++++++++++++++++++ account.txt | 1 - 2 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 account.dev.txt delete mode 100644 account.txt diff --git a/account.dev.txt b/account.dev.txt new file mode 100644 index 000000000..813793e7f --- /dev/null +++ b/account.dev.txt @@ -0,0 +1,129 @@ + +[ + { + "key": "dbln", + "value": "%7B%2261555776220826%22%3A%22UjED42FG%22%7D", + "domain": "facebook.com", + "path": "/login/device-based/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.253Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "datr", + "value": "vqr4Z06azjEsXMjRDyN9XEUv", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "sb", + "value": "vqr4ZwzYpLdXlY5lgLtw1r96", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "locale", + "value": "fr_FR", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "ps_l", + "value": "1", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "ps_n", + "value": "1", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "vpd", + "value": "v1%3B654x393x2.75", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "c_user", + "value": "61555776220826", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "fr", + "value": "0WiB3PuLM0LXZhxAf.AWeE6jktherMt46fxaQ466qLpRd3ILnAXTcQSghu-yMAyRXnyDs.Bn-Kq-..AAA.0.0.Bn-OZm.AWfY06CLexQFQpA4FbtSdgIJF3A", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "xs", + "value": "35%3APQThuO5ASZPg6g%3A2%3A1744365158%3A-1%3A7715", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "wd", + "value": "393x654", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "fbl_st", + "value": "101327848%3BT%3A29073031", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "wl_cbv", + "value": "v2%3Bclient_version%3A2785%3Btimestamp%3A1744381871", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + }, + { + "key": "ar_debug", + "value": "1", + "domain": "facebook.com", + "path": "/", + "hostOnly": false, + "creation": "2025-04-11T14:33:16.266Z", + "lastAccessed": "2025-04-11T14:33:16.266Z" + } +] diff --git a/account.txt b/account.txt deleted file mode 100644 index d3f5a12fa..000000000 --- a/account.txt +++ /dev/null @@ -1 +0,0 @@ - From d9ea8a33df075cabdeb6e86347a54ac35f9f6624 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:39:18 +0100 Subject: [PATCH 02/15] Rename configCommands.json to configCommands.dev.json --- configCommands.json => configCommands.dev.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename configCommands.json => configCommands.dev.json (99%) 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 +} From a5ac1f547d948c8ce9fd0d586c78cad4b5216a6a Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:42:18 +0100 Subject: [PATCH 03/15] Update and rename config.json to config.dev.json --- config.json => config.dev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename config.json => config.dev.json (98%) diff --git a/config.json b/config.dev.json similarity index 98% rename from config.json rename to config.dev.json index 61abc0ff8..592ff70e2 100644 --- a/config.json +++ b/config.dev.json @@ -17,7 +17,7 @@ "ignoreCommand": [] }, "adminBot": [ - "", + "100093009031914", "" ], "whiteListMode": { @@ -25,7 +25,7 @@ "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", From 43f1ea4a1c31f24d774c3635d30d0c62e08bb5a4 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:47:11 +0100 Subject: [PATCH 04/15] Create 00ai.js --- scripts/cmds/00ai.js | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 scripts/cmds/00ai.js diff --git a/scripts/cmds/00ai.js b/scripts/cmds/00ai.js new file mode 100644 index 000000000..c4aaf83d4 --- /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 = [ + 'salut', + '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); + } + } + } From 708344dd3288e4bf0072b00412ef32076c7f2a83 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:48:30 +0100 Subject: [PATCH 05/15] Update callad.js --- scripts/cmds/callad.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmds/callad.js b/scripts/cmds/callad.js index eaa631787..49025c055 100644 --- a/scripts/cmds/callad.js +++ b/scripts/cmds/callad.js @@ -188,4 +188,4 @@ module.exports = { } } } -}; \ No newline at end of file +}; From 44b35ec6b3b85cc2f2b49750d66fd23dc3b9d3cc Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 15:58:14 +0100 Subject: [PATCH 06/15] Update welcome.js --- scripts/events/welcome.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/events/welcome.js b/scripts/events/welcome.js index 93953eb25..014e0c1ae 100644 --- a/scripts/events/welcome.js +++ b/scripts/events/welcome.js @@ -26,10 +26,13 @@ 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: "merci de m'avoir ajouté dans ce groupe!\nBot prefix: %1\npour me poser une question dites ai suivi de la question et pour avoir mes fonctions taper: %1help", multiple1: "you", multiple2: "you guys", - defaultWelcomeMessage: `Hello {userName}.\nWelcome {multiple} to the chat group: {boxName}\nHave a nice {session} 😊` + defaultWelcomeMessage: `salut {userName}.\nBienvenue {multiple} dans le groupe ! +On est ravi de t’avoir parmi nous ! +Prépare-toi à vivre de bons moments ensemble ! +Bienvenue à bord !: {boxName}\nHave a nice {session} 😊` } }, From 0641b131d242ab06fdcb28ba4be3339f204d63c4 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:00:57 +0100 Subject: [PATCH 07/15] Create 00antiout.js --- scripts/cmds/00antiout.js | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/cmds/00antiout.js diff --git a/scripts/cmds/00antiout.js b/scripts/cmds/00antiout.js new file mode 100644 index 000000000..c30e5168e --- /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); + } + } + } + } +} From 341c7eeca68ae9500d8e0df92f6f6d9790839e27 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:02:02 +0100 Subject: [PATCH 08/15] Create v.js --- scripts/cmds/v.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/cmds/v.js diff --git a/scripts/cmds/v.js b/scripts/cmds/v.js new file mode 100644 index 000000000..e8a73a978 --- /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}.`); + } +}; From 003eadd492ac47423039c23e6f1977efd8706011 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:03:08 +0100 Subject: [PATCH 09/15] Create s.js --- scripts/cmds/s.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 scripts/cmds/s.js diff --git a/scripts/cmds/s.js b/scripts/cmds/s.js new file mode 100644 index 000000000..ea34fac8b --- /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: 1, + 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."); + } + } +}; From 3ec457f5bbe5b4b6d003fa3954d5f12afcb276fb Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:07:19 +0100 Subject: [PATCH 10/15] Create a.js --- scripts/cmds/a.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 scripts/cmds/a.js diff --git a/scripts/cmds/a.js b/scripts/cmds/a.js new file mode 100644 index 000000000..4e297818c --- /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.0", + 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, 10); + + const lines = top.map((user, index) => + `${index + 1}. ${user.name} - ${user.money} $` + ); + + return message.reply(`🏆 Top des plus riches :\n\n${lines.join("\n")}`); + } catch (err) { + console.error(err); + return message.reply("❌ Erreur lors de l'affichage du classement."); + } + } +}; From 1de6fd3c8b2e53bf294e26506266d8708ddf209f Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:10:23 +0100 Subject: [PATCH 11/15] Create top.js --- scripts/cmds/top.js | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 scripts/cmds/top.js diff --git a/scripts/cmds/top.js b/scripts/cmds/top.js new file mode 100644 index 000000000..c02290eb6 --- /dev/null +++ b/scripts/cmds/top.js @@ -0,0 +1,66 @@ +module.exports = { config: { name: "argent", version: "1.4", author: "Evariste", role: 0, shortDescription: "Gérer l'argent et voir le classement global", longDescription: "Afficher le solde et le top 100 des utilisateurs du bot.", category: "economy", guide: { fr: {pn} → voir ton solde {pn} add/set/remove @mention → modifier (admin) {pn} add/set/remove moi → te modifier toi-même (admin) {pn} add/set/remove all → modifier pour tout le monde (admin) {pn} top → voir le top 100 des plus riches } }, + +onStart: async function ({ message, event, args, usersData, threadsData, role }) { const senderID = event.senderID; + +if (args.length === 0) { + const money = await usersData.get(senderID, "money") || 0; + return message.reply(`Ton solde actuel : ${money} $`); +} + +if (args[0] === "top") { + const allUsers = await usersData.getAll(); + const usersWithMoney = allUsers + .map(user => ({ id: user.userID, name: user.name, money: user.data.money || 0 })) + .sort((a, b) => b.money - a.money) + .slice(0, 100); + + if (usersWithMoney.length === 0) return message.reply("Aucun utilisateur trouvé avec de l'argent."); + + const lines = usersWithMoney.map((u, i) => `${i + 1}. ${u.name} - ${u.money} $`); + return message.reply("🏆 Classement global des plus riches :\n\n" + lines.join("\n")); +} + +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."); + +if (cible === "all") { + const allUsers = await usersData.getAll(); + for (const user of allUsers) { + const current = user.data.money || 0; + let nouveau; + if (action === "add") nouveau = current + montant; + if (action === "remove") nouveau = current - montant; + if (action === "set") nouveau = montant; + await usersData.set(user.userID, nouveau, "money"); + } + return message.reply(`${action} ${montant} $ à tous les utilisateurs.`); +} + +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} $`); + +} }; From f766c48199e50d56579047ad91decf770190c09c Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:42:49 +0100 Subject: [PATCH 12/15] Delete scripts/cmds/a.js --- scripts/cmds/a.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 scripts/cmds/a.js diff --git a/scripts/cmds/a.js b/scripts/cmds/a.js deleted file mode 100644 index 4e297818c..000000000 --- a/scripts/cmds/a.js +++ /dev/null @@ -1,39 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -module.exports = { - config: { - name: "topmoney", - version: "1.0", - 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, 10); - - const lines = top.map((user, index) => - `${index + 1}. ${user.name} - ${user.money} $` - ); - - return message.reply(`🏆 Top des plus riches :\n\n${lines.join("\n")}`); - } catch (err) { - console.error(err); - return message.reply("❌ Erreur lors de l'affichage du classement."); - } - } -}; From f6e911f85b1a06015ad1e92b14dd2377b912e602 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:43:49 +0100 Subject: [PATCH 13/15] Delete scripts/cmds/s.js --- scripts/cmds/s.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 scripts/cmds/s.js diff --git a/scripts/cmds/s.js b/scripts/cmds/s.js deleted file mode 100644 index ea34fac8b..000000000 --- a/scripts/cmds/s.js +++ /dev/null @@ -1,42 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -module.exports = { - config: { - name: "saveusers", - version: "1.1", - author: "Evariste", - role: 1, - 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."); - } - } -}; From ba4c71cc4a9926d443d37d4b61bbff375d435344 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:45:38 +0100 Subject: [PATCH 14/15] Delete scripts/cmds/top.js --- scripts/cmds/top.js | 66 --------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 scripts/cmds/top.js diff --git a/scripts/cmds/top.js b/scripts/cmds/top.js deleted file mode 100644 index c02290eb6..000000000 --- a/scripts/cmds/top.js +++ /dev/null @@ -1,66 +0,0 @@ -module.exports = { config: { name: "argent", version: "1.4", author: "Evariste", role: 0, shortDescription: "Gérer l'argent et voir le classement global", longDescription: "Afficher le solde et le top 100 des utilisateurs du bot.", category: "economy", guide: { fr: {pn} → voir ton solde {pn} add/set/remove @mention → modifier (admin) {pn} add/set/remove moi → te modifier toi-même (admin) {pn} add/set/remove all → modifier pour tout le monde (admin) {pn} top → voir le top 100 des plus riches } }, - -onStart: async function ({ message, event, args, usersData, threadsData, role }) { const senderID = event.senderID; - -if (args.length === 0) { - const money = await usersData.get(senderID, "money") || 0; - return message.reply(`Ton solde actuel : ${money} $`); -} - -if (args[0] === "top") { - const allUsers = await usersData.getAll(); - const usersWithMoney = allUsers - .map(user => ({ id: user.userID, name: user.name, money: user.data.money || 0 })) - .sort((a, b) => b.money - a.money) - .slice(0, 100); - - if (usersWithMoney.length === 0) return message.reply("Aucun utilisateur trouvé avec de l'argent."); - - const lines = usersWithMoney.map((u, i) => `${i + 1}. ${u.name} - ${u.money} $`); - return message.reply("🏆 Classement global des plus riches :\n\n" + lines.join("\n")); -} - -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."); - -if (cible === "all") { - const allUsers = await usersData.getAll(); - for (const user of allUsers) { - const current = user.data.money || 0; - let nouveau; - if (action === "add") nouveau = current + montant; - if (action === "remove") nouveau = current - montant; - if (action === "set") nouveau = montant; - await usersData.set(user.userID, nouveau, "money"); - } - return message.reply(`${action} ${montant} $ à tous les utilisateurs.`); -} - -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} $`); - -} }; From 54d1f0a3d0b522b2f3e5f86792ab4b41fdc81268 Mon Sep 17 00:00:00 2001 From: Evabot Date: Fri, 11 Apr 2025 16:47:00 +0100 Subject: [PATCH 15/15] Delete scripts/cmds/v.js --- scripts/cmds/v.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 scripts/cmds/v.js diff --git a/scripts/cmds/v.js b/scripts/cmds/v.js deleted file mode 100644 index e8a73a978..000000000 --- a/scripts/cmds/v.js +++ /dev/null @@ -1,43 +0,0 @@ -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}.`); - } -};