diff --git a/abcd.png b/abcd.png new file mode 100644 index 00000000..fa800c5b Binary files /dev/null and b/abcd.png differ diff --git a/account.dev.txt b/account.dev.txt index 92b8ed7d..f1823f16 100644 --- a/account.dev.txt +++ b/account.dev.txt @@ -1,57 +1,48 @@ [ { "key": "dbln", - "value": "%7B%2261557109594457%22%3A%2238DPiBij%22%7D", + "value": "%7B%2261555839935630%22%3A%22KeCSlf2T%22%7D", "domain": "facebook.com", "path": "/login/device-based/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.564Z", - "lastAccessed": "2024-03-10T08:26:22.564Z" - }, - { - "key": "datr", - "value": "UffVZZZCuolPGwYIK1YdfYN6", - "domain": "facebook.com", - "path": "/", - "hostOnly": false, - "creation": "2024-03-10T08:26:22.564Z", - "lastAccessed": "2024-03-10T08:26:22.564Z" + "creation": "2024-04-25T14:57:35.208Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { "key": "sb", - "value": "UffVZTRlBPauz4yChMA4BNJR", + "value": "sMH7ZcLU9ayYUuzahOOfWOk3", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "ps_l", - "value": "0", + "key": "datr", + "value": "al8TZv-LHNUSxtmcqdTOKizi", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { "key": "ps_n", - "value": "0", + "value": "1", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "vpd", - "value": "v1%3B662x360x2", + "key": "ps_l", + "value": "1", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { "key": "locale", @@ -59,79 +50,79 @@ "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "m_pixel_ratio", - "value": "2", + "key": "vpd", + "value": "v1%3B662x360x2", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "fr", - "value": "0758sfviYo6FLoRc2.AWW3xE22lMySq6LZ53NgZwXzFTY.Bl1fdR..AAA.0.0.Bl7VhL.AWWZQrEOFBo", + "key": "zsh", + "value": "AST4ccgXRkvPtcddyPmHkgxhSYNUa3xM1kdf-YuhFLhB5-EVNO2lTXCqmP1YuGxdPo7Pr-yiNd58854XbqgOIjz1qTw6777s9DSBNcy88ytHt0Gum6g2-Gw5OEsVtekL8YwKISXvX4VAfdM3F36lVSQvK2TSz3kukxHv6bFzQp05xqltqDJGqirG-T1898M1iIsEGuhibtKDMJ019CpiBXL6mWPWyUeo0KrzH-epBSGLULyxid32XLXf8F8LylWEoeL3DjyoTIOpdP6qGVq88hKbDIOqwW8nBCO48HVDPTql6AA4XTQUV3lr4izPS4xS1TY9uY9ojZsbvMcrn3vGUo1WDAqvV-iJtOA", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "c_user", - "value": "61557109594457", + "key": "wd", + "value": "360x662", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "xs", - "value": "33%3Aw8FYJREv_Wli1g%3A2%3A1710053459%3A-1%3A-1", + "key": "c_user", + "value": "61555839935630", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "m_page_voice", - "value": "61557109594457", + "key": "xs", + "value": "11%3AtFD5RLIpfJFbaw%3A2%3A1714056220%3A-1%3A7867", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "x-referer", - "value": "eyJyIjoiL2NvbmZpcm1lbWFpbC5waHA%2FbmV4dD1odHRwcyUzQSUyRiUyRm0uZmFjZWJvb2suY29tJTJGJTNGcGFpcHYlM0QwJTI2ZWF2JTNEQWZiTUJYVXlPZnI4RWFXSHJTWVZ0b2JCeTNiM1J6aGtVNFZpOTBFQWNnMHdPTXhBQzdtdEdjbWNxUkRNZDM5QkM2ayUyNnd0c2lkJTNEcmRyXzBxMEN5bkl0YzNvbk9NRGowJnBhaXB2PTAmZWF2PUFmYjVzcDJJcTlwek5PNkx6TERaT25UcWZLQXlmRjhvSXhXejZSNmVUQ09Pa2xvcHJmUFFpRGpxem5EaVYtN3VpOTgmc29mdD1oamsiLCJoIjoiL2NvbmZpcm1lbWFpbC5waHA%2FbmV4dD1odHRwcyUzQSUyRiUyRm0uZmFjZWJvb2suY29tJTJGJTNGcGFpcHYlM0QwJTI2ZWF2JTNEQWZiTUJYVXlPZnI4RWFXSHJTWVZ0b2JCeTNiM1J6aGtVNFZpOTBFQWNnMHdPTXhBQzdtdEdjbWNxUkRNZDM5QkM2ayUyNnd0c2lkJTNEcmRyXzBxMEN5bkl0YzNvbk9NRGowJnBhaXB2PTAmZWF2PUFmYjVzcDJJcTlwek5PNkx6TERaT25UcWZLQXlmRjhvSXhXejZSNmVUQ09Pa2xvcHJmUFFpRGpxem5EaVYtN3VpOTgmc29mdD1oamsiLCJzIjoibSJ9", + "key": "fr", + "value": "0e0yJN7gWWYNLbTRS.AWUdD-Y-L6fEVsH7KY_vM7bqP-c.BmE19q..AAA.0.0.BmKmwd.AWWIti-_C-o", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { - "key": "wd", - "value": "360x662", + "key": "fbl_st", + "value": "100631220%3BT%3A28567613", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" }, { "key": "wl_cbv", - "value": "v2%3Bclient_version%3A2431%3Btimestamp%3A1710053497", + "value": "v2%3Bclient_version%3A2479%3Btimestamp%3A1714056788", "domain": "facebook.com", "path": "/", "hostOnly": false, - "creation": "2024-03-10T08:26:22.565Z", - "lastAccessed": "2024-03-10T08:26:22.565Z" + "creation": "2024-04-25T14:57:35.209Z", + "lastAccessed": "2024-04-25T14:57:35.209Z" } ] diff --git a/bank.json b/bank.json index 0c311202..a3b5110b 100644 --- a/bank.json +++ b/bank.json @@ -1 +1,96 @@ -{"100005954550355":{"bank":0,"lastInterestClaimed":1696939723634},"100084485171781":{"bank":0,"lastInterestClaimed":1696939774148},"100012690883448":{"bank":140995.24279452054,"lastInterestClaimed":1697620702359},"100093664421932":{"bank":0,"lastInterestClaimed":1697031200452},"100083130505351":{"bank":40266.62915068493,"lastInterestClaimed":1697034971447},"100078271041226":{"bank":98145.75390318889,"lastInterestClaimed":1697249418390},"100054040669856":{"bank":0,"lastInterestClaimed":1697068563473},"100075058221244":{"bank":628338.9491164006,"lastInterestClaimed":1697883766188},"100093951790366":{"bank":120000,"lastInterestClaimed":1697073628423},"100064692591777":{"bank":0,"lastInterestClaimed":1697083052069},"100036061530474":{"bank":95686,"lastInterestClaimed":1697089245341,"loan":20000,"loanDueDate":1698195513620},"100034921401210":{"bank":0,"lastInterestClaimed":1697089378767},"100067752075661":{"bank":0,"lastInterestClaimed":1697249766615},"100077426222842":{"bank":0,"lastInterestClaimed":1697590580160},"100021237822089":{"bank":59936,"lastInterestClaimed":1697621175781,"lastHeistTime":1697621206895},"100080678810923":{"bank":311,"lastInterestClaimed":1697881755120,"lastHeistTime":1697881863469},"100036775728233":{"bank":248,"lastInterestClaimed":1697881809325,"lastHeistTime":1697881809348},"61550517180775":{"bank":127,"lastInterestClaimed":1697881825087,"lastHeistTime":1697881825101},"100042968351648":{"bank":0,"lastInterestClaimed":1697881981554},"61550835737306":{"bank":0,"lastInterestClaimed":1698743845763},"100091933309618":{"bank":0,"lastInterestClaimed":1698762283534},"100048169458564":{"bank":0,"lastInterestClaimed":1699106761618},"100079514436333":{"bank":0,"lastInterestClaimed":1698873678090},"100069505863268":{"bank":0,"lastInterestClaimed":1699106895487},"61550873045314":{"bank":0,"lastInterestClaimed":1699106923417},"100068434233610":{"bank":0,"lastInterestClaimed":1699107402568},"61551150205653":{"bank":0,"lastInterestClaimed":1700143571195},"100095358518323":{"bank":0,"lastInterestClaimed":1702142966338},"61550967061246":{"bank":10000,"lastInterestClaimed":1702192561959,"loan":10000,"loanDueDate":1702797417807},"100020441437585":{"bank":0,"lastInterestClaimed":1702285165975},"100041661710115":{"bank":10246.810082247513,"lastInterestClaimed":1702589191887},"61553661041441":{"bank":200.0292778648436,"lastInterestClaimed":1702788589948,"loan":1000000,"loanDueDate":1703343723814},"100029024432341":{"bank":4395033.856493748,"lastInterestClaimed":1703297923406},"100093661777030":{"bank":0,"lastInterestClaimed":1702727105513},"100023557714497":{"bank":4742554.704537082,"lastInterestClaimed":1702788646547,"loan":1000000,"loanDueDate":1703336644835},"100093235443040":{"bank":1478100,"lastInterestClaimed":1702735395347},"100093104616694":{"bank":0,"lastInterestClaimed":1702740839911},"100033051497228":{"bank":0,"lastInterestClaimed":1702768468216},"100085545943439":{"bank":50000,"lastInterestClaimed":1702786113078},"100065086460397":{"bank":300,"lastInterestClaimed":1702873938994},"100089815675320":{"bank":-200,"lastInterestClaimed":1702942672045},"100053703280242":{"bank":220000,"lastInterestClaimed":1703220155148},"100068605818563":{"bank":0,"lastInterestClaimed":1703228406095},"100085397060119":{"bank":0,"lastInterestClaimed":1703245459677},"61553736616654":{"bank":0,"lastInterestClaimed":1703245578904},"100074240805149":{"bank":20000,"lastInterestClaimed":1703297115811,"loan":10000,"loanDueDate":1704018082730},"100070290960764":{"bank":0,"lastInterestClaimed":1703523582508}} \ No newline at end of file +{ + "100005954550355": { + "bank": 0, + "lastInterestClaimed": 1696939723634 + }, + "100084485171781": { + "bank": 0, + "lastInterestClaimed": 1696939774148 + }, + "100012690883448": { + "bank": 140995.24279452054, + "lastInterestClaimed": 1697620702359 + }, + "100093664421932": { + "bank": 0, + "lastInterestClaimed": 1697031200452 + }, + "100083130505351": { + "bank": 40266.62915068493, + "lastInterestClaimed": 1697034971447 + }, + "100078271041226": { + "bank": 98145.75390318889, + "lastInterestClaimed": 1697249418390 + }, + "100054040669856": { + "bank": 0, + "lastInterestClaimed": 1697068563473 + }, + "100075058221244": { + "bank": 628438.9491164006, + "lastInterestClaimed": 1697883766188 + }, + "100093951790366": { + "bank": 120000, + "lastInterestClaimed": 1697073628423 + }, + "100064692591777": { + "bank": 0, + "lastInterestClaimed": 1697083052069 + }, + "100036061530474": { + "bank": 95686, + "lastInterestClaimed": 1697089245341, + "loan": 20000, + "loanDueDate": 1698195513620 + }, + "100034921401210": { + "bank": 0, + "lastInterestClaimed": 1697089378767 + }, + "100067752075661": { + "bank": 0, + "lastInterestClaimed": 1697249766615 + }, + "100077426222842": { + "bank": 0, + "lastInterestClaimed": 1697590580160 + }, + "100021237822089": { + "bank": 59936, + "lastInterestClaimed": 1697621175781, + "lastHeistTime": 1697621206895 + }, + "100080678810923": { + "bank": 311, + "lastInterestClaimed": 1697881755120, + "lastHeistTime": 1697881863469 + }, + "100036775728233": { + "bank": 248, + "lastInterestClaimed": 1697881809325, + "lastHeistTime": 1697881809348 + }, + "61550517180775": { + "bank": 127, + "lastInterestClaimed": 1697881825087, + "lastHeistTime": 1697881825101 + }, + "100042968351648": { + "bank": 0, + "lastInterestClaimed": 1697881981554 + }, + "61550835737306": { + "bank": 0, + "lastInterestClaimed": 1698743845763 + }, + "100091933309618": { + "bank": 0, + "lastInterestClaimed": 1698762283534 + }, + "61550037082227": { + "bank": 3000, + "lastInterestClaimed": 1701305929113 + } +} diff --git a/config.dev.json b/config.dev.json index 08d293d2..640cc09c 100644 --- a/config.dev.json +++ b/config.dev.json @@ -24,7 +24,7 @@ "whiteListIds": [], "notes": "if you enable this feature, only the ids in the whiteListIds section can use the bot" }, - "nickNameBot": "Jay", + "nickNameBot": "", "prefix": "/", "database": { "type": "sqlite", diff --git a/fak.png b/fak.png new file mode 100644 index 00000000..32f6cb71 Binary files /dev/null and b/fak.png differ diff --git a/omg.mp4 b/omg.mp4 new file mode 100644 index 00000000..114f9a9d Binary files /dev/null and b/omg.mp4 differ diff --git a/propose.png b/propose.png new file mode 100644 index 00000000..a1623248 Binary files /dev/null and b/propose.png differ diff --git a/scripts/cmds/0RequestMain.js b/scripts/cmds/0RequestMain.js new file mode 100644 index 00000000..2eba2975 --- /dev/null +++ b/scripts/cmds/0RequestMain.js @@ -0,0 +1,78 @@ +const fs = require("fs"); +const path = require("path"); +const { config } = global.GoatBot; + +const pendingIDsPath = path.join(__dirname, "assist_json", "pending_main.json"); +const approvedIDsPath = path.join(__dirname, "assist_json", "approved_main.json"); + +module.exports = { + config: { + name: "requestMAIN", + version: "1.1", + author: "SiAM", + countDown: 5, + category: "Utility", + role: 0, + guide: { + en: "{pn} Your " + } + }, + + onStart: async function ({ api, args, event, threadsData }) { + const { getPrefix } = global.utils; + const p = getPrefix(event.threadID); + const threadID = event.threadID; + const senderID = event.senderID; + const threadInfo = await api.getThreadInfo(threadID); + + // Check if the thread ID is already approved + if (fs.existsSync(approvedIDsPath)) { + const approvedIDs = JSON.parse(fs.readFileSync(approvedIDsPath)); + if (approvedIDs.includes(threadID)) { + const approvalMsg = "No need for approval. This thread is already approved to use all main command from the bot.\n\n If you don't know how to use this bot then join the Marin support Box \nType : $support \nto join."; + api.sendMessage(approvalMsg, threadID); + return; + } + } + + // Check if the thread ID is already pending + if (fs.existsSync(pendingIDsPath)) { + const pendingIDs = JSON.parse(fs.readFileSync(pendingIDsPath)); + if (pendingIDs.includes(threadID)) { + const pendingMsg = "Your request to use bot main cmds is already in pending.... \nPlease contact Loid Butter for fast approval.\n\n Facebook:https://www.facebook.com/profile.php?id=100082741664058\n\n also you can join Marin support Box for help\nType : $support \nto join."; + api.sendMessage(pendingMsg, threadID); + return; + } + } else { + // If the file doesn't exist, create an empty array + fs.writeFileSync(pendingIDsPath, "[]"); + } + + // Check if the user provided a message for the admin + const userMessage = args.join(" "); + if (!userMessage) { + const messageReminder = `Please add a message for the admin. \n\nExample:\n ${p} requestMAIN yourmessage`; + api.sendMessage(messageReminder, threadID); + return; + } + + // Store the thread ID in the pending list + const pendingIDs = JSON.parse(fs.readFileSync(pendingIDsPath)); + pendingIDs.push(threadID); + fs.writeFileSync(pendingIDsPath, JSON.stringify(pendingIDs)); + + const msg = `------MAIN BoT RQ------\n\nThread ID: ${threadID}\nThread Type: ${threadInfo.isGroup ? "Group" : "User"}\n${threadInfo.isGroup ? `Group Name: ${threadInfo.name}\n\nRequester ID: ${senderID}\nRequester Name: ${await getUserName(api, senderID)}` : `User Name: ${await getUserName(api, senderID)}`}\n\nMessage: ${userMessage}`; +for (const adminID of config.adminBot) { + api.sendMessage(msg, adminID); +} + + + const notifyMsg = `✅Your approval request for using Bot's main cmds has been sent to admin SiAM with this\nmessage: ${userMessage}.\n\n I will notify you if your thread is approved. Please wait until then.\n\n join the Marin support Box if you facing any problem\nType : $support \nto join.`; + api.sendMessage(notifyMsg, threadID); + } +}; + +async function getUserName(api, userID) { + const user = await api.getUserInfo(userID); + return user[userID].name; +} diff --git a/scripts/cmds/0RequestNSFW.js b/scripts/cmds/0RequestNSFW.js new file mode 100644 index 00000000..f75ac336 --- /dev/null +++ b/scripts/cmds/0RequestNSFW.js @@ -0,0 +1,78 @@ +const fs = require("fs"); +const path = require("path"); +const { config } = global.GoatBot; + +const pendingIDsPath = path.join(__dirname, "assist_json", "pending_ids.json"); +const approvedIDsPath = path.join(__dirname, "assist_json", "approved_ids.json"); + +module.exports = { + config: { + name: "requestNSFW", + version: "1.1", + author: "SiAM", + countDown: 5, + category: "Utility", + role: 0, + guide: { + en: "{pn} Your " + } + }, + + onStart: async function ({ api, args, event, threadsData }) { + const { getPrefix } = global.utils; + const p = getPrefix(event.threadID); + const threadID = event.threadID; + const senderID = event.senderID; + const threadInfo = await api.getThreadInfo(threadID); + + // Check if the thread ID is already approved + if (fs.existsSync(approvedIDsPath)) { + const approvedIDs = JSON.parse(fs.readFileSync(approvedIDsPath)); + if (approvedIDs.includes(threadID)) { + const approvalMsg = "No need for approval. This thread is already approved to use the NSFW command.\n\n If you don't know how to use this bot then join the Marin support Box \nType : $support \nto join."; + api.sendMessage(approvalMsg, threadID); + return; + } + } + + // Check if the thread ID is already pending + if (fs.existsSync(pendingIDsPath)) { + const pendingIDs = JSON.parse(fs.readFileSync(pendingIDsPath)); + if (pendingIDs.includes(threadID)) { + const pendingMsg = "Your request is already in pending.... \nPlease contact Loid Butter for fast approval.\n\n Facebook:https://www.facebook.com/profile.php?id=100082741664058\n\n or join the Marin support box for help \nType : /support\nto join"; + api.sendMessage(pendingMsg, threadID); + return; + } + } else { + // If the file doesn't exist, create an empty array + fs.writeFileSync(pendingIDsPath, "[]"); + } + + // Check if the user provided a message for the admin + const userMessage = args.join(" "); + if (!userMessage) { + const messageReminder = `Please add a message for the admin. \n\nExample: ${p} requestNSFW yourmessage`; + api.sendMessage(messageReminder, threadID); + return; + } + + // Store the thread ID in the pending list + const pendingIDs = JSON.parse(fs.readFileSync(pendingIDsPath)); + pendingIDs.push(threadID); + fs.writeFileSync(pendingIDsPath, JSON.stringify(pendingIDs)); + + const msg = `------NSFW Request------\n\nThread ID: ${threadID}\nThread Type: ${threadInfo.isGroup ? "Group" : "User"}\n${threadInfo.isGroup ? `Group Name: ${threadInfo.name}\n\nRequester ID: ${senderID}\nRequester Name: ${await getUserName(api, senderID)}` : `User Name: ${await getUserName(api, senderID)}`}\n\nMessage: ${userMessage}`; +for (const adminID of config.adminBot) { + api.sendMessage(msg, adminID); +} + + + const notifyMsg = `✅Your approval request has been sent to admin Loid Butter with this\nmessage: ${userMessage}.\n\n I will notify you if your thread is approved. Please wait until then.\n\n join the Marin support box for fast approve \ntype : $support\nto join`; + api.sendMessage(notifyMsg, threadID); + } +}; + +async function getUserName(api, userID) { + const user = await api.getUserInfo(userID); + return user[userID].name; + } diff --git a/scripts/cmds/0TruthOrDare.js b/scripts/cmds/0TruthOrDare.js new file mode 100644 index 00000000..1fcaf7c4 --- /dev/null +++ b/scripts/cmds/0TruthOrDare.js @@ -0,0 +1,43 @@ +const fs = require('fs'); + +module.exports = { + config: { + name: "TruthorDare", + version: "1.0", + author: "SiAM", + countDown: 5, + role: 0, + shortDescription: "This command allows users to play the Truth or Dare game.", + longDescription: "This command enables users to play the classic Truth or Dare game. They can choose either 'Truth' or 'Dare' and receive a randomly selected question or challenge.", + category: "Games", + guide: { + en: "To play the Truth or Dare game, use the command '{pn} truth' for a truth question or '{pn} dare' for a dare challenge." + } + }, + + onStart: async function ({ api, args, message }) { + + const [arg1] = args; + + if (!arg1) { + message.reply("If you want to play Truth or Dare, please specify either 'truth' or 'dare'."); + return; + } + + if (arg1.toLowerCase() === 'truth') { + const truthQuestions = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/TRUTHQN.json`)); + const randomIndex = Math.floor(Math.random() * truthQuestions.length); + const randomQuestion = truthQuestions[randomIndex]; + + message.reply(`Here's your truth question: ${randomQuestion}`); + } else if (arg1.toLowerCase() === 'dare') { + const dareChallenges = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/DAREQN.json`)); + const randomIndex = Math.floor(Math.random() * dareChallenges.length); + const randomChallenge = dareChallenges[randomIndex]; + + message.reply(`Here's your dare challenge: ${randomChallenge}`); + } else { + message.reply("Invalid input. Please use '/T&D truth' for a truth question or '/T&D dare' for a dare challenge."); + } + } +}; diff --git a/scripts/cmds/0bannedlist.js b/scripts/cmds/0bannedlist.js new file mode 100644 index 00000000..59b50db2 --- /dev/null +++ b/scripts/cmds/0bannedlist.js @@ -0,0 +1,31 @@ +module.exports.config = { + name: "bannedlist", + version: "1.0.1", + aliases: ["banned"], + author: { + name: "NTKhang", + contacts: "" + }, + cooldowns: 5, + role: 1, + shortDescription: "see list of banned groups/users", + longDescription: "see list of banned groups/users", + category: "owner", + guide: "{p}{n} [thread|user]" +}; + +module.exports.onStart = async function({ api, event, args, usersData, threadsData }) { + let target, type; + if (["thread", "-t"].includes(args[0])) { + target = await threadsData.getAll(); + type = "group"; + } else if (["user", "-u"].includes(args[0])) { + target = await usersData.getAll(); + type = "user"; + } else return api.sendMessage("Syntax error! Please use {p}bannedlist [thread|user]", event.threadID); + + const bannedList = target.filter(item => item.banned.status); + const msg = bannedList.reduce((i, item) => i += `Name: ${item.name}\nID: ${item.id}\nReason: ${item.banned.reason}\nTime: ${item.banned.date}\n\n`, ""); + + api.sendMessage(msg ? `Currently ${bannedList.length} \n${type}(s) have been banned from using the bot:\n${msg}` : `There are no \n${type}(s) who are prohibited from using the bot.`, event.threadID); + } diff --git a/scripts/cmds/0game.js b/scripts/cmds/0game.js new file mode 100644 index 00000000..145c9bbd --- /dev/null +++ b/scripts/cmds/0game.js @@ -0,0 +1,268 @@ +module.exports = { + config: { + name: "game", + aliases: ["gm", "gam"], + version: "1.1", + author: "Samuel", + countDown: 5, + role: 0, + shortDescription: { + vi: "", + en: "" + }, + longDescription: { + vi: "", + en: "" + }, + category: "", + guide: "", + + }, + +onStart: async function ({ event, message, api, usersData, args}) { + const mention = Object.keys(event.mentions); + + if(args[0] == "close") { +if(!global.game.hasOwnProperty(event.threadID) || global.game[event.threadID].on == false ){ message.reply("There is no game running in this group") + } else { +if(event.senderID == global.game[event.threadID].player1.id || event.senderID == global.game[event.threadID].player2.id ){ + if(event.senderID == global.game[event.threadID].player1.id){ + message.reply({body:`What a cry baby. ${global.game[event.threadID].player1.name} left the game.\nWinner is ${global.game[event.threadID].player2.name}.`, mentions: [{ + tag: global.game[event.threadID].player1.name, + id: global.game[event.threadID].player1.id, + + }, { + tag: global.game[event.threadID].player2.name, + id: global.game[event.threadID].player2.id, + + }] + + + }) + } else { + message.reply({body:`What a cry baby. ${global.game[event.threadID].player2.name} left the game.\nWinner is ${global.game[event.threadID].player1.name}.`, mentions: [{ + tag: global.game[event.threadID].player1.name, + id: global.game[event.threadID].player1.id, + + }, { + tag: global.game[event.threadID].player2.name, + id: global.game[event.threadID].player2.id, + + }] + + + }) + } + global.game[event.threadID].on = false +} else{ + message.reply("You don’t have any game running in this group") +} + + + + + } + + + } else{ + + + if(mention.length == 0) return message.reply("Please mention someone or say game close to close any existing game"); + if(!global.game.hasOwnProperty(event.threadID) || global.game[event.threadID].on == false ){ + global.game[event.threadID] = { + on:true, + board:"🔲🔲🔲\n🔲🔲🔲\n🔲🔲🔲", + bid:"", + board2:"123456789", + avcell: ["1", "2","3","4","5","6","7","8","9"], + turn: mention[0], + player1: {id:mention[0],name:await usersData.getName(mention[0])}, + player2: {id:event.senderID, name: await usersData.getName(event.senderID)}, + bidd:"❌", + bid:"", + ttrns: [], + counting:0 + } + message.send(global.game[event.threadID].board, (err, info) =>{global.game[event.threadID].bid = info.messageID; + global.fff.push(info.messageID) }) + }else{message.reply(" A game is already on this group")} + + } + +}, + onChat: async function ({ event, message, api, args}){ + +if(event.type =="message" && event.body.includes("-,-")){ + message.reply({body:" hehe baka fak u",attachment:await global.utils.getStreamFromURL("https://scontent.xx.fbcdn.net/v/t1.15752-9/316181740_667600474745895_5536856546858630902_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=ae9488&_nc_ohc=bR-GcvE6RHMAX_YE5bu&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent.xx&oh=03_AdQk45VA6QO5_X5vTQJYdXF4nH45UeESYppxrFbZdRlJMw&oe=63A3009D")}) +} + + + +if(event.type == "message_reply" && global.game[event.threadID] && global.game[event.threadID].on == true){ + +if(event.messageReply.messageID === global.game[event.threadID].bid){ + console.log("bal") +if(global.game[event.threadID].turn === event.senderID){ + console.log("sal") + if(["1", "2","3","4","5","6","7","8","9"].includes(event.body)){ +if(global.game[event.threadID].avcell.includes(event.body)){ +global.game[event.threadID].avcell.splice(global.game[event.threadID].avcell.indexOf(event.body), 1) + +let input2 = event.body*2 + +global.game[event.threadID].ttrns.map(e => { + if(e {global.game[event.threadID].bid = infos.messageID + global.fff.push(infos.messageID)} + ) + //ttrns.pus + + let winncomb = [ + (global.game[event.threadID].board2[0] === global.game[event.threadID].bidd && global.game[event.threadID].board2[1] === global.game[event.threadID].bidd && global.game[event.threadID].board2[2] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[3] === global.game[event.threadID].bidd && global.game[event.threadID].board2[4] === global.game[event.threadID].bidd && global.game[event.threadID].board2[5] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[6] === global.game[event.threadID].bidd && global.game[event.threadID].board2[7] === global.game[event.threadID].bidd && global.game[event.threadID].board2[8] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[0] === global.game[event.threadID].bidd && global.game[event.threadID].board2[3] === global.game[event.threadID].bidd && global.game[event.threadID].board2[6] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[1] === global.game[event.threadID].bidd && global.game[event.threadID].board2[4] === global.game[event.threadID].bidd && global.game[event.threadID].board2[7] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[2] === global.game[event.threadID].bidd && global.game[event.threadID].board2[5] === global.game[event.threadID].bidd && global.game[event.threadID].board2[8] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[0] === global.game[event.threadID].bidd && global.game[event.threadID].board2[4] === global.game[event.threadID].bidd && global.game[event.threadID].board2[8] === global.game[event.threadID].bidd ) , ( global.game[event.threadID].board2[2] === global.game[event.threadID].bidd && global.game[event.threadID].board2[4] === global.game[event.threadID].bidd && global.game[event.threadID].board2[6] === global.game[event.threadID].bidd) ] + + +let winncomb2 = +[ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 1, + 4, + 7 + ], + [ + 2, + 5, + 8 + ], + [ + 3, + 6, + 9 + ], + [ + 1, + 5, + 9 + ], + [ + 3, + 5, + 7 + ] +] + +let cbid = {"❌":"❎", "⭕":" 🚫"} + + if(winncomb.includes(true)) { +message.unsend(event.messageReply.messageID) + +let winl = winncomb2[winncomb.indexOf(true)] + +winl.forEach(fn => { + +let input2 = fn*2 + +global.game[event.threadID].ttrns.map(e => { + if(e from) { return this.slice(0, from) + this.slice(from).replace(search, replace); } return this; } diff --git a/scripts/cmds/Guys.js b/scripts/cmds/Guys.js new file mode 100644 index 00000000..e1a1fefd --- /dev/null +++ b/scripts/cmds/Guys.js @@ -0,0 +1,20 @@ +module.exports = { + config: { + name: "Guys", + version: "1.0", + author: "Jay", + countDown: 5, + role: 0, + shortDescription: "No Prefix", + longDescription: "No Prefix", + category: "reply", + }, +onStart: async function(){}, +onChat: async function({ + event, + message, + getLang +}) { + if (event.body && event.body.toLowerCase() == "guys") return message.reply("Don't Call Me Guys Cuz I AM Yours😊"); +} +}; diff --git a/scripts/cmds/Jay.js b/scripts/cmds/Jay.js index 7abee63d..013f7979 100644 --- a/scripts/cmds/Jay.js +++ b/scripts/cmds/Jay.js @@ -1,12 +1,12 @@ module.exports = { config: { - name: "jay", + name: "Jay", version: "1.0", author: "Jay Senpai", countDown: 5, role: 0, - shortDescription: "sarcasm", - longDescription: "sarcasm", + shortDescription: "hindi ito command", + longDescription: "hindi ito command", category: "reply", }, onStart: async function(){}, @@ -16,10 +16,10 @@ module.exports = { getLang }) { const lowerCaseBody = event.body.toLowerCase(); - if (lowerCaseBody.includes("jay") || lowerCaseBody.includes("jay d bohol") || -lowerCaseBody.includes("bohol") || -lowerCaseBody.includes("Jay D Bohol")) { - return message.reply(`busy pa master ko`); + if (lowerCaseBody.includes("Jay") || lowerCaseBody.includes("Lyn") || +lowerCaseBody.includes("jay") || +lowerCaseBody.includes("Jay Bohol")) { + return message.reply(`Master koyan`); } } }; diff --git a/scripts/cmds/ai.js b/scripts/cmds/ai.js index a5b28818..e83235d1 100644 --- a/scripts/cmds/ai.js +++ b/scripts/cmds/ai.js @@ -1,61 +1,66 @@ -const axios = require('axios'); - -const GPT_API_URL = 'https://sandipapi.onrender.com/gpt'; -const PREFIXES = ['ai']; -const horizontalLine = "━━━━━━━━━━━━━━━"; - -module.exports = { - config: { - name: "ai", - version: 1.0, - author: "OtinXSandip", - longDescription: "AI", - category: "ai", - guide: { - en: "{p} questions", - }, - }, - onStart: async function () { - // Initialization logic if needed - }, - 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 defaultMessage = getCenteredHeader("") + "\n" + horizontalLine + "\nProvide a Question\n" + horizontalLine; - await message.reply(defaultMessage); - return; - } - - const answer = await getGPTResponse(prompt); - - // Adding header and horizontal lines to the answer - const answerWithHeader = getCenteredHeader("") + "\n" + horizontalLine + "\n" + answer + "\n" + horizontalLine; - - await message.reply(answerWithHeader); - } catch (error) { - console.error("Error:", error.message); - // Additional error handling if needed - } - } -}; - -function getCenteredHeader(header) { - const totalWidth = 32; // Adjust the total width as needed - const padding = Math.max(0, Math.floor((totalWidth - header.length) / 2)); - return " ".repeat(padding) + header; +const { getPrefix, getStreamFromURL, uploadImgbb } = global.utils; +async function ai({ message: m, event: e, args: a, usersData: u }) { + var p = [`${await getPrefix(e.threadID)}${this.config.name}`, +`${this.config.name}` +/*"ai","Athena" +*you can add more prefix here +*/ +]; + if (p.some(b => a[0].toLowerCase().startsWith(b))) { +try { +let prompt = ""; +if (e.type === "message_reply" && e.messageReply.attachments && e.messageReply.attachments[0]?.type === "photo") { + const b = await uploadImgbb(e.messageReply.attachments[0].url); +prompt = a.slice(1).join(" ") + ' ' + b.image.url; +} else { + prompt = a.slice(1).join(" "); } - -async function getGPTResponse(prompt) { - // Implement caching logic here - - const response = await axios.get(`${GPT_API_URL}?prompt=${encodeURIComponent(prompt)}`); - return response.data.answer; + var __ = [{ id: e.senderID, tag: await u.getName(e.senderID) }]; + const r = await require("axios").post(`https://test-ai-ihc6.onrender.com/api`, { + prompt: prompt, + apikey: "GayKey-oWHmMb1t8ASljhpgSSUI", + name: __[0]['tag'], + id: __[0]['id'], + }); +var _ = r.data.result.replace(/{name}/g, __[0]['tag']).replace(/{pn}/g, p[0]); + if (r.data.av) { + if (Array.isArray(r.data.av)) { + const avs = r.data.av.map(url => getStreamFromURL(url)); + const avss = await Promise.all(avs); + m.reply({ + body: _, + mentions: __, + attachment: avss + }); + } else { + m.reply({ + body: _, + mentions: __, +attachment: await getStreamFromURL(r.data.av) + }); + } + } else { +m.reply({ +body: _, +mentions: __ + }); + } + } catch (error) { + m.reply("Error " + error); + } + } } +module.exports = { +config: { + name: "ai", +aliases: ["Athena"], +version: 1.6, +author: "Jun", +role: 0, + shortDescription: "An AI that can do various tasks", + guide: "{pn} ", + category: "AI", + }, + onStart: function() {}, + onChat: ai +}; diff --git a/scripts/cmds/antiout b/scripts/cmds/antiout new file mode 100644 index 00000000..85194042 --- /dev/null +++ b/scripts/cmds/antiout @@ -0,0 +1,48 @@ +module.exports = { + config: { + name: "antiout", + version: "1.0", + author: "AceGun", + countDown: 5, + role: 0, + shortDescription: "Enable or disable antiout", + longDescription: "", + category: "boxchat", + guide: "{pn} {{[on | off]}}", + envConfig: { + deltaNext: 5 + } + }, + onStart: async function({ message, event, threadsData, args }) { + let antiout = await threadsData.get(event.threadID, "settings.antiout"); + if (antiout === undefined) { + await threadsData.set(event.threadID, true, "settings.antiout"); + antiout = true; + } + if (!["on", "off"].includes(args[0])) { + return message.reply("Please use 'on' or 'off' as an argument"); + } + await threadsData.set(event.threadID, args[0] === "on", "settings.antiout"); + return message.reply(`Antiout has been ${args[0] === "on" ? "enabled" : "disabled"}.`); + }, + onEvent: async function({ api, event, threadsData }) { + const antiout = await threadsData.get(event.threadID, "settings.antiout"); + if (antiout && event.logMessageData && event.logMessageData.leftParticipantFbId) { + // A user has left the chat, get their user ID + const userId = event.logMessageData.leftParticipantFbId; + + // Check if the user is still in the chat + const threadInfo = await api.getThreadInfo(event.threadID); + const userIndex = threadInfo.participantIDs.indexOf(userId); + if (userIndex === -1) { + // The user is not in the chat, add them back + const addUser = await api.addUserToGroup(userId, event.threadID); + if (addUser) { + console.log(`User ${userId} was added back to the chat.`); + } else { + console.log(`Failed to add user ${userId} back to the chat.`); + } + } + } + } +}; diff --git a/scripts/cmds/approved.js b/scripts/cmds/approved.js new file mode 100644 index 00000000..a6e17822 --- /dev/null +++ b/scripts/cmds/approved.js @@ -0,0 +1,96 @@ +const fs = require("fs"); + +module.exports = { + config: { + name: "approved", + author: "Jun", + countDown: 5, + role: 0, + category: "owner", + shortDescription: { + en: "" + } + }, + + onLoad: async function() { + const dataPath = __dirname + "/cache/approvedThreads.json"; + const pendingPath = __dirname + "/cache/pendingThreads.json"; + + if (!fs.existsSync(dataPath)) { + fs.writeFileSync(dataPath, JSON.stringify([])); + } + + if (!fs.existsSync(pendingPath)) { + fs.writeFileSync(pendingPath, JSON.stringify([])); + } + }, + + onStart: async function({ event, api, args }) { + const { threadID, messageID, senderID } = event; + const dataPath = __dirname + "/cache/approvedThreads.json"; + const pendingPath = __dirname + "/cache/pendingThreads.json"; + let data = JSON.parse(fs.readFileSync(dataPath)); + let pending = JSON.parse(fs.readFileSync(pendingPath)); + let msg = ""; + let idBox = args[0] || threadID; + + if (args[0] == "list") { + msg = "LIST OF APPROVED BOXES! "; + let count = 0; + + for (const e of data) { + msg += `${count += 1}. ID: ${e}`; + } + + api.sendMessage(msg, threadID, messageID); + } else if (args[0] == "del") { + idBox = args[1] || event.threadID; + + if (isNaN(parseInt(idBox))) { + api.sendMessage("Not a number.", threadID, messageID); + return; + } + + if (!data.includes(idBox)) { + api.sendMessage("The box was not approved before! ", threadID, messageID); + return; + } + + api.sendMessage(`Box ${idBox} has been removed from bot permission list `, threadID, () => { + if (!pending.includes(idBox)) { + pending.push(idBox); + } + + data.splice(data.indexOf(idBox), 1); + fs.writeFileSync(dataPath, JSON.stringify(data, null, 2)); + fs.writeFileSync(pendingPath, JSON.stringify(pending, null, 2)); + }, messageID); + } else if(args[0] == "pending") { + msg = "DANH SÁCH CÁC BOX CHỜ ĐƯỢC DUYỆT!"; + let count = 0; + + for (const e of pending) { + const name = (await api.getThreadInfo(e)).name || "Nhóm Chat"; + msg += `${count += 1}. ${name}\ID: ${e}`; + } + + api.sendMessage(msg, threadID, messageID); + } else if (isNaN(parseInt(idBox))) { + api.sendMessage("Invalid ID entered ", threadID, messageID); + } else if (data.includes(idBox)) { + api.sendMessage(`ID ${idBox} was approved before! `, threadID, messageID); + } else { + api.sendMessage("» Box has been approved by admin.\Use help to see more commands.", idBox, (error, info) => { + if (error) { + api.sendMessage("An error occurred, make sure that the ID you entered is valid and the bot is in the box! ", threadID, messageID); + } else { + data.push(idBox); + pending.splice(pending.indexOf(idBox), 1); + fs.writeFileSync(dataPath, JSON.stringify(data, null, 2)); + fs.writeFileSync(pendingPath, JSON.stringify(pending, null, 2)); + api.sendMessage(`» Box approval successful:\${idBox}`, threadID, messageID); + } + }); + } + } +}; diff --git a/scripts/cmds/appstore.js b/scripts/cmds/appstore.js new file mode 100644 index 00000000..ddea13f2 --- /dev/null +++ b/scripts/cmds/appstore.js @@ -0,0 +1,72 @@ +const itunes = require("searchitunes"); +const { getStreamFromURL } = global.utils; + +module.exports = { + config: { + name: "appstore", + version: "1.1", + author: "NTKhang", + countDown: 5, + role: 0, + shortDescription: { + vi: "Tìm app trên appstore", + en: "Search app on appstore" + }, + longDescription: { + vi: "Tìm app trên appstore", + en: "Search app on appstore" + }, + category: "software", + guide: " {pn}: " + + "\n - Example:" + + "\n {pn} PUBG", + envConfig: { + limitResult: 3 + } + }, + + langs: { + vi: { + missingKeyword: "Bạn chưa nhập từ khóa", + noResult: "Không tìm thấy kết quả nào cho từ khóa %1" + }, + en: { + missingKeyword: "You haven't entered any keyword", + noResult: "No result found for keyword %1" + } + }, + + onStart: async function ({ message, args, commandName, envCommands, getLang }) { + if (!args[0]) + return message.reply(getLang("missingKeyword")); + let results = []; + try { + results = (await itunes({ + entity: "software", + country: "VN", + term: args.join(" "), + limit: envCommands[commandName].limitResult + })).results; + } + catch (err) { + return message.reply(getLang("noResult", args.join(" "))); + } + + if (results.length > 0) { + let msg = ""; + const pedningImages = []; + for (const result of results) { + msg += `\n\n- ${result.trackCensoredName} by ${result.artistName}, ${result.formattedPrice} and rated ${"🌟".repeat(result.averageUserRating)} (${result.averageUserRating.toFixed(1)}/5)` + + `\n- ${result.trackViewUrl}`; + pedningImages.push(await getStreamFromURL(result.artworkUrl512 || result.artworkUrl100 || result.artworkUrl60)); + } + message.reply({ + body: msg, + attachment: await Promise.all(pedningImages) + }); + } + else { + message.reply(getLang("noResult", args.join(" "))); + } + } +}; diff --git a/scripts/cmds/arrest.js b/scripts/cmds/arrest.js new file mode 100644 index 00000000..ce1acee3 --- /dev/null +++ b/scripts/cmds/arrest.js @@ -0,0 +1,49 @@ +const axios = require('axios'); +const jimp = require("jimp"); +const fs = require("fs") + +module.exports = { + config: { + name: "arrest", + aliases: ["arrest"], + version: "1.0", + author: "milan-says", + countDown: 5, + role: 0, + shortDescription: "arret the rapist", + longDescription: "", + category: "image", + guide: { + vi: "{pn} [@tag]", + en: "{pn} [@tag]" + } + }, + + onStart: async function ({ message, args,api , event, user }) { + const mention = Object.keys(event.mentions); + if (mention.length == 0) return message.reply("please mention someone"); + else if (mention.length == 1) { + const one = event.senderID, two = mention[0]; + bal(one, two).then(ptth => { message.reply({ body: "You are under arrest", attachment: fs.createReadStream(ptth) }) }) + } else { + const one = mention[1], two = mention[0]; + bal(one, two).then(ptth => { message.reply({ body: "You are under arrest", attachment: fs.createReadStream(ptth) }) }) + } + } + + +}; + +async function bal(one, two) { + + let avone = await jimp.read(`https://graph.facebook.com/${one}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`) + avone.circle() + let avtwo = await jimp.read(`https://graph.facebook.com/${two}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`) + avtwo.circle() + let pth = "fak.png" + let img = await jimp.read("https://i.imgur.com/ep1gG3r.png") + img.resize(500, 500).composite(avone.resize(100, 100), 375, 9).composite(avtwo.resize(100, 100), 160, 92); + + await img.writeAsync(pth) + return pth + } diff --git a/scripts/cmds/assist_json/DAREQN.json b/scripts/cmds/assist_json/DAREQN.json new file mode 100644 index 00000000..cff73780 --- /dev/null +++ b/scripts/cmds/assist_json/DAREQN.json @@ -0,0 +1,46 @@ +[ + "Do the chicken dance in public.", + "Sing a song in a funny voice.", + "Eat a spoonful of a condiment you dislike.", + "Do 10 push-ups right now.", + "Wear your clothes inside out for the next hour.", + "Talk like a pirate for the rest of the day.", + "Do a handstand against the wall.", + "Ask a stranger for their autograph.", + "Dance like nobody is watching.", + "Wear a funny hat for the next hour.", + "Make up a rap about the person to your right.", + "Speak in a foreign accent for the next 10 minutes.", + "Do a silly walk down the street.", + "Give yourself a funny makeover using household items.", + "Text a friend with your nose.", + "Do the moonwalk across the room.", + "Sing a popular song backwards.", + "Try to lick your elbow.", + "Put ice cubes down your shirt and dance.", + "Talk for 3 minutes without stopping.", + "Do a cartwheel right now.", + "Take a selfie with a stranger.", + "Eat a spoonful of hot sauce.", + "Balance a spoon on your nose for 1 minute.", + "Make a funny face and take a selfie.", + ": Propose your crush and send me ss!", + "Change your Facebook status to “Feeling horny . . .”", + "Change your Facebook status to “I’m coming . . . I’m coming . . .” Then, one minute later, change it to “I just came.”", + "Go hide somewhere in the house until the next round starts. No one is going to come find you, but you must remain hidden.", + "Put a bra on your head and pretend you’re a DJ rocking it really hard for one minute.", + "You have to leave an R-rated voicemail for an ex.", + "Dance like Michael Jackson for a slow song.", + "I dare you to do 10 burpees while shouting your favorite quote.", + "Clean the floor with your shirt.", + "Can you message someone you haven’t talked to for at least one year on Facebook or Instagram and take a screenshot then send it hare ☠️.", + "Place five ice cubes on your head until it melts?", + "Kiss your elbow for 30 seconds and smell it", + "Go to your neighbour’s house and ask for some toilet paper.", + "Put your hand in the dustbin and smell it.", + "Stand in front of the mirror and sing “Happy Birthday Song” along with your name.", + "Take a video of yourself scratching your butt and send it to your parents.", + "Get a shower with all your clothes on.", + "Post an embarrassing picture of yourself online.", + "Log into Facebook and like every picture for the past year of the first person you see." +] diff --git a/scripts/cmds/assist_json/TRUTHQN.json b/scripts/cmds/assist_json/TRUTHQN.json new file mode 100644 index 00000000..351be44e --- /dev/null +++ b/scripts/cmds/assist_json/TRUTHQN.json @@ -0,0 +1,73 @@ +[ + "Have you ever lied to a friend?", + "What is your biggest fear?", + "What is the most embarrassing thing you've ever done?", + "Have you ever cheated on a test?", + "What is your most embarrassing nickname?", + "Have you ever stolen something?", + "What is the most adventurous thing you've ever done?", + "Have you ever eavesdropped on a conversation?", + "What is your guilty pleasure?", + "Have you ever pretended to be sick to skip school?", + "What is your favorite childhood memory?", + "Have you ever had a crush on a teacher?", + "What is your most annoying habit?", + "Have you ever been in love?", + "What is the most trouble you've ever been in?", + "Have you ever cheated in a game?", + "What is your biggest pet peeve?", + "Have you ever skipped a family gathering to do something else?", + "What is your secret talent?", + "Have you ever sent a text to the wrong person?", + "What is the most embarrassing thing your parents have caught you doing?", + "Have you ever been caught in a lie?", + "What is the most daring thing you've ever done?", + "Have you ever snuck out of the house?", + "What is the weirdest dream you've ever had?", + "Have you ever broken a bone?", + "Have you ever kissed someone?", + "Do you love someone?", + "If you get chance, which celebrity will you marry?", + "Why aren't you getting married?", + "are you gay?", + "Are you lonely?", + "Do you have any spicy pictures or videos saved on your phone?", + "Have you ever done it in a car?", + "How many people have you slept with?", + "If you got to have a threesome with people in this room, who would you do it with and why?", + "What is the most sexually adventurous thing you’d want someone to do to you?", + "What would be more thrilling: angry sex or make-up sex?", + "What’s the most number of times you’ve done it in one day?", + "What’s your favorite body part on a girl?", + "When did you lose your virginity?", + "When was the first time you came?", + "Who do you most want to sleep with, out of everyone here?", + "What is the weirdest punishment you’ve ever taken in your school/college?", + "Have you ever stolen money from your father’s wallet?", + "How many times have you copied from your friend during exams and gotten caught?", + "What do you do when a romantic scene airs while watching a movie with your parents?", + "What is that one thing you do, if you were the opposite sex/gender?", + "Do you have a weird collection of anything?", + "Who are you jealous of?", + "What is the most embarrassing gift you ever received?", + "Have you ever farted in an elevator?", + "Have you ever peed in a pool?", + "Have you ever picked your nose and eaten it?", + "How many days have you ever gone without taking a shower?", + "What was the most disgusting joke ever played with someone?", + "What’s something stupid you’ve done that you’re most proud of?", + "Who here are you most jealous of?", + "What is the biggest lie you have ever told?", + "Who did you learn to have sex for the first time?", + "How many girls/boys are you having sex with in your dreams?", + "Does your family know that you are crazy?", + "How was the fun the first time?", + "Who do you love more?", + "how many ex do you have?", + "What was the biggest mistake in life?", + "In what year will you get married?", + "What is your Facebook password?\n(Unsend after 5 sec)", + "What is the name of your favorite movie?", + "Anime or H£ntai?", + "What will you ask your Husband/wife on the wedding night?" +] diff --git a/scripts/cmds/assist_json/approved_ids.json b/scripts/cmds/assist_json/approved_ids.json new file mode 100644 index 00000000..a76e7cdb --- /dev/null +++ b/scripts/cmds/assist_json/approved_ids.json @@ -0,0 +1 @@ +["2928338393","6092643370790329","5640645835999676","6571875302845011","9253372948037130","100082918282666","6215353978526234","6005695306132330","5447526188687166","6238171502943692","6524005327610928","6696060480425921","6401920786595049","6166610400085039","61550037082227","6173187622736411","5152367364854751","100073674949437","6522178654480811","6094084594010104","9189923067716147","6144291872275154","100091551402394","6181631395277867"] diff --git a/scripts/cmds/assist_json/approved_main.json b/scripts/cmds/assist_json/approved_main.json new file mode 100644 index 00000000..3d7bacf1 --- /dev/null +++ b/scripts/cmds/assist_json/approved_main.json @@ -0,0 +1 @@ +["100073361735971","5919391568081355","6529954973718802","5640645835999676","5447526188687166","6663346860342184","5640645835999676","9253372948037130","6092643370790329","6238171502943692","6571875302845011","6696060480425921","100086517907696","100090702122064","100071387772115","100056591808277","6253289271374721","6166610400085039","6401920786595049","6208734919158778","6294261617299005","8280189902052806","6144291872275154","61550037082227","6232493473501563","6173187622736411","5152367364854751","100073674949437","5592500437540074","6522178654480811","100067749700655","100038775967596","6213718995342876","5407972845996371","6094084594010104","9189923067716147","6381571138577028","100091551402394","6181631395277867"] diff --git a/scripts/cmds/assist_json/bible.json b/scripts/cmds/assist_json/bible.json new file mode 100644 index 00000000..41b13cd6 --- /dev/null +++ b/scripts/cmds/assist_json/bible.json @@ -0,0 +1,22 @@ +[ +"Pagka nasa daliri mo ang itinuturo, hindi mo na ito mapagmamalabisan. - Kawikaan 3:27", +"Walang kaginhawahan, walang ligaya na hindi galing sa Diyos.- Santiago 1:17", +"Huwag kayong mawalan ng pag-asa, sapagkat sa tamang panahon, aanihin ninyo ang inyong pinag-sisikapan. - Galacia 6:9", +"Ang pag-ibig ay matiyaga at magandang-loob, hindi naiinggit, hindi nagmamapuri, hindi nagmamataas.- 1 Corinto 13:4", +"Magtiwala ka sa Panginoon ng buong puso mo, at huwag kang manalig sa iyong sariling pang-unawa.- Kawikaan 3:5", +"Ang masama ay kinakailangang maglagpak, ngunit ang matuwid ay matatatag magpakailanman. - Kawikaan 10:25", +"Hangga't kayo'y mamuhay, magsipakawang-gawa kayo: mayaman man, mahirap; matanda man, bata. - Galacia 6:10", +"Huwag kayong matakot, sapagkat kasama ninyo ang Panginoon, ang inyong Diyos.- Josue 1:9", +"Huwag kayong maaawa sa masama; kundi pangilinin ninyo siya sa Anghel ng Panginoon na siyang paparusahan sa kanya. - Kawikaan 19:25", +"Kung mayroon kayong kahilingan sa akin, siya ay papasa-dahin ninyo sa pamamagitan ng pananalangin at pasasalamat. - Filipos 4:6", +"Ang kaluwalhatian ng Diyos ay tao ang mukha, at isusuot mo ang Panginoon Hesus.- 2 Corinto 3:18", +"Walang ibang makapagsasabi sa kanyang sariling bahay maliban sa mga bata, ang kanilang mga magulang. - 1 Timoteo 5:8", +"Ang takot sa Panginoon ay simula ng kaalaman, ngunit ang mga mangmang ay walang katalinuhan at kahatulan.- Kawikaan 1:7", +"Kahit ang mga kababalaghan na ito ay gagawin nila, pinayamangka pagkatapos ay babawasan.- Mateo 24:24", +"Maging mapagmahal at mabait, magpasensiya at magpatawad sa isa't isa, kung paanong kayo rin ay pinatawad ng Panginoon. - Colosas 3:13", +"Sa bawat batang lalake at babaeng Israel, tinawag mo ang kanilang pangalan.- Mga Awit 147:4", +"Ang Diyos ay ang ating kanlungan at lakas, laging handang saklolo sa mga kabiguan. - Salmo 46:1", +"Itanim ninyo sa kasamaan, kayo'y aani sa kasamaan; itanim ninyo sa kasakiman, kayo'y aani sa kasakiman. - Galacia 6:8", +"Ang Diyos ay aming tagapag-aliw, aming lakas, aming kaligtasan sa oras ng sorrows.- Awit 46:1", +"Magsikap kang aralin ang katotohanan, at huwag mong padalus-dalusan kahit layuan. - Timoteo 2:15" +] diff --git a/scripts/cmds/assist_json/bypass_id.json b/scripts/cmds/assist_json/bypass_id.json new file mode 100644 index 00000000..7af2f151 --- /dev/null +++ b/scripts/cmds/assist_json/bypass_id.json @@ -0,0 +1 @@ +[ "","100088275903520" ] diff --git a/scripts/cmds/assist_json/hentaivid.json b/scripts/cmds/assist_json/hentaivid.json new file mode 100644 index 00000000..fd52d336 --- /dev/null +++ b/scripts/cmds/assist_json/hentaivid.json @@ -0,0 +1,79 @@ + [ + "https://drive.google.com/file/d/13scYfN0D49l-KjHO004Ho28i2kpQv8xn/view", + "https://drive.google.com/file/d/13pM75Pkqp6VeMUlYbXawljw8EGvPsovq/view", + "https://drive.google.com/file/d/13Fs_POMQvMm4YY22WpQSUfXl0qLt6j_F/view", + "https://drive.google.com/file/d/13Fban8OchdNavUzRvYFJcHXpxZt-WJuD/view", + "https://drive.google.com/file/d/13FEP9Y2MDT5INNMPWQQrlzO_y-fJI5V5/view", + "https://drive.google.com/file/d/12Fo8cdqmcpml-zQtaECYfa0VDUwPr8xE/view", + "https://drive.google.com/file/d/12F6BotRmkTXQNTJyyAusEI3jGPF4Cblz/view", + "https://drive.google.com/file/d/129ozyxXSlXe9GpTjtbXxP2b9Nq1Ef7t0/view", + "https://drive.google.com/file/d/11yJYuHrIHjJWILT3xIgyOBb8WEyfVAhU/view", + "https://drive.google.com/file/d/11xgux0HZoSLy5fqtRCE2a1VpBHiPHJHf/view", + "https://drive.google.com/file/d/1-_gAiQxDnJC-rjz6JKwS5R09f6LpnTTi/view", + "https://drive.google.com/file/d/1-W1V2HXKGAG3WTOwsQuqV5UVc4R4iiWd/view", + "https://drive.google.com/file/d/1-DSg4wFySICF_MD0iqAA9ujv223WfPG8/view", + "https://drive.google.com/file/d/12OyOoIx3ifM5v3i2m3iqwFKVLcitGsyh/view", + "https://drive.google.com/file/d/12NbR1Ql2yvzgzjSzFRwAfCDLSAP7NT22/view", + "https://drive.google.com/file/d/12IGNWKp-WKyBrvmHlb09p7PQ1q9MggEz/view", + "https://drive.google.com/file/d/1-AFuP5PRM7KM6rSCUciRFTpAPa_XwG8M/view", + "https://drive.google.com/file/d/13oWmLfzwRm5b15Ki2m_haho0rD1IiDwV/view", + "https://drive.google.com/file/d/13aUccLbbuPWiXzL0ty-3TktNuF2WfeVf/view", + "https://drive.google.com/file/d/1-A0wO-7JFNyyzpjkQnZJthW3gDZHtPEI/view", + "https://drive.google.com/file/d/1-xPVNRzi2QSsatjq_93C2usyGFbZjwVG/view", + "https://drive.google.com/file/d/12GtRvz66LET28WxKUvLHrjo1PlVvLsz9/view", + "https://drive.google.com/file/d/12GhxV-dklxk7BXTuAwRJgIMU43Blj2Hb/view", + "https://drive.google.com/file/d/1-x5enGz65vUHfl59Xzrc178akxjXZTpM/view", + "https://drive.google.com/file/d/1-s3f1W5A-nzQI1_Fm_-G0M4QY8OA-Lab/view", + "https://drive.google.com/file/d/13_Wu_4jjGW90q4kSIie7Q5n-f5jomCdh/view", + + "https://drive.google.com/file/d/1-gByplyjNHVhUOje6w28VFf_n5MOfMkS/view", + "https://drive.google.com/file/d/1-fjAa_q9Huzs-BrjWm4MAq-5sRGKy0c7/view", + "https://drive.google.com/file/d/10S5_cxy3qvOH0QwrSnGgaONREn8yQ2mZ/view", + "https://drive.google.com/file/d/10NfWvzFQS7q8oXXb4gSW4rso9BZRS2qf/view", + "https://drive.google.com/file/d/104op2Bc-YV7Ci8MQ4aq6KMPIH0O-eW6M/view", + "https://drive.google.com/file/d/131ZHORxaerKzTtSqKlYmvcPCWpMgritd/view", + "https://drive.google.com/file/d/12iZXl6g_gEZ4kMuw68FE5-NmOayqn6st/view", + "https://drive.google.com/file/d/101ME3v6nDcvSzBnRVxuQtFLcOYZS1sB7/view", + "https://drive.google.com/file/d/13YAVudGYX9QSp8x2cAsOAr5P2NnqdcXS/view", + "https://drive.google.com/file/d/10-nO9kGTR93eoqAn46nUDwzPKi0vzj5o/view", + "https://drive.google.com/file/d/11EItEy65-fTCfBMl96m0sodOUdlJDCY8/view", + "https://drive.google.com/file/d/10mF3kcahvrXp3mOXNK3qVxYqgkA547xZ/view", + "https://drive.google.com/file/d/12QdqYSD9g5H-Hgrw5lnrdQaD_uOUfUDj/view", + "https://drive.google.com/file/d/10YTHQOhg9qssD6omRBeUU4Q4NOUpp-RQ/view", + "https://drive.google.com/file/d/13MjKXGGNyiHTh8WQBOfDtoOxF1I824Ui/view", + "https://drive.google.com/file/d/13MVIUjGLedDIH4PUr7pHKxW_BnMUovpA/view", + "https://drive.google.com/file/d/14GidFF_WuAMX_cHhFSjBgjyRIXhwkt23/view", + "https://drive.google.com/file/d/14GJ1Fn0sOkEnp53HbvnH2WmrGEq4xUa9/view", + "https://drive.google.com/file/d/13MPVcPJUYjkJvyuGZbRd5REnXXBBdhVx/view", + "https://drive.google.com/file/d/10Tzl5Yx143SpNX0AXFvqq8ctSxo6T_sR/view", + "https://drive.google.com/file/d/10SY16lToiQHun3d2if-T3ihLcB7RAtZO/view", + "https://drive.google.com/file/d/11R1lm0uHFtNt8Xa6KDiAuUaoahghhSla/view", + "https://drive.google.com/file/d/11OzFBET7gEyRG8Gg54smrg9JjsYWJLve/view", + "https://drive.google.com/file/d/13E4TtZAwJfe2CAfXc06AOP591zK5yUs7/view", + "https://drive.google.com/file/d/13DhUlSk8mCkofMsGGe_-M6uLTrRuy0Yb/view", + "https://drive.google.com/file/d/11OOWIcnBnI0e_9wqhPMNUkXFR_g3iU-E/view", + "https://drive.google.com/file/d/11O4OTZR9kiePHAyz8Qg6CEU1mpcYlFKH/view", + "https://drive.google.com/file/d/12TqWBOjGeB91GwED0frjD9cs785LImNM/view", + "https://drive.google.com/file/d/11MU-uqjy7E8-vjxbMrO_qwN882setBPO/view", + "https://drive.google.com/file/d/11kv5qVXUAt6DdAi91Jo46DIauKH2VecR/view", + "https://drive.google.com/file/d/11kog2FOpSydjWclfgTyPzjB8BFG8JZVh/view", + "https://drive.google.com/file/d/12y_ckgITkjyci_OMTfJ--8Iv3JscSeiD/view", + "https://drive.google.com/file/d/12eszhDYTjJ04sRD1lN4YNVpQEsCxfdZ6/view", + "https://drive.google.com/file/d/11W7vseZTfJumqJ4CgdUIptFEEtE-SR6P/view", + "https://drive.google.com/file/d/11Tc4AaDPTtzn_KmzdKpvNCbAC-iKiDjZ/view", + "https://drive.google.com/file/d/12eszhDYTjJ04sRD1lN4YNVpQEsCxfdZ6/view", + "https://drive.google.com/file/d/12miheDTkVYAQ5ZXcIoeY-xE7gAMwA-1P/view", + "https://drive.google.com/file/d/13Lu7ZIurJa12S9J15iXWwVs5MbCQf7Zv/view", + "https://drive.google.com/file/d/13IYg98aVRbvc6B0k5FhIYmEI5MIpfhhs/view", + "https://drive.google.com/file/d/13HYH6SzPTAW4xoO03WmaKDx0Q8C6v6y-/view", + "https://drive.google.com/file/d/13Fs_POMQvMm4YY22WpQSUfXl0qLt6j_F/view", + "https://drive.google.com/file/d/13LHLIWe06oOlZLSMIAu_TaCOscExyUtd/view", + "https://drive.google.com/file/d/13VMlPs96WXhZ2KsH1pl3XNAECtoYcSNc/view", + "https://drive.google.com/file/d/148wcqLh91obwllCqfdq6z84OpMMd8XkK/view", + "https://drive.google.com/file/d/142gda27UiVPi3RkKoWlLLW6LSYMjB6dF/view", + "https://drive.google.com/file/d/13wSymWO4SIj-bTlLVLXE4SMPBufj6qnN/view", + "https://drive.google.com/file/d/14SQfOEyMNbTCQC0eOSTJ94xqp2baYOWV/view", + "https://drive.google.com/file/d/14P-9P_WbiJe2xYKu7bPku5BNYilQCZ-x/view", + "https://drive.google.com/file/d/14IArDtjmZDkmKQBZGmIbLXa6510wipIb/view" + + ] diff --git a/scripts/cmds/assist_json/pending_ids.json b/scripts/cmds/assist_json/pending_ids.json new file mode 100644 index 00000000..50fd7477 --- /dev/null +++ b/scripts/cmds/assist_json/pending_ids.json @@ -0,0 +1 @@ +["100094759060802","7093897677288245"] diff --git a/scripts/cmds/assist_json/pending_main.json b/scripts/cmds/assist_json/pending_main.json new file mode 100644 index 00000000..540fe690 --- /dev/null +++ b/scripts/cmds/assist_json/pending_main.json @@ -0,0 +1 @@ +["6441988609251704","6305361442915890","24158271663772142","24220284250904407","9564890773583325","6672900412761569","9507531435987943","6834670696566696","100091307261433","9637053959700843","6423446067746143","6140346659389299","6761652083850582","5577836192319048","100084365581941","6904231859621507","23887273817538986"] diff --git a/scripts/cmds/audio.js b/scripts/cmds/audio.js new file mode 100644 index 00000000..9d7b58cd --- /dev/null +++ b/scripts/cmds/audio.js @@ -0,0 +1,83 @@ +const fs = require('fs'); +module.exports = { + config: { + name: "audio", + version: "1.0", + author: "AceGun", + countDown: 5, + role: 0, + shortDescription: "no prefix", + longDescription: "no prefix", + category: "no prefix", + }, + onStart: async function(){}, + onChat: async function({ event, message, getLang }) { + if (event.body) { + const word = event.body.toLowerCase(); + switch (word) { + case "women": + return message.reply({ + body: "「 Women ☕ 」", + attachment: fs.createReadStream("women.mp4"), + }); + case "yamate": + return message.reply({ + body: "「 Yamate 🥵 」", + attachment: fs.createReadStream("yamate.mp3"), + }); + case "dazai": + return message.reply({ + body: "「 ahhh~ 」", + attachment: fs.createReadStream("Dazai.mp3"), + }); + case "ara": + return message.reply({ + body: "「 ara ara 」", + attachment: fs.createReadStream("ara.mp3"), + }); + case "good night": + return message.reply({ + body: "「 Good Night 🌉 」", + attachment: fs.createReadStream("night.mp3"), + }); + case "wow maayung gabii": + return message.reply({ + body: "「 ඞ 」", + attachment: fs.createReadStream("wow.mp4"), + }); + case "good morning": + return message.reply({ + body: "「 Good Morning 🌄 」", + attachment: fs.createReadStream("gm.mp3"), + }); + case "superbook": + return message.reply({ + body: "「 」", + attachment: fs.createReadStream("superbook.mp4"), + }); + case "machikney": + return message.reply({ + body: "「 Machikney 」", + attachment: fs.createReadStream("machikney.mp3"), + }); + case "randi": + return message.reply({ + body: "「 Randi ko Chora 」", + attachment: fs.createReadStream("randi.mp3"), + }); + case "sachiin": + return message.reply({ + body: " 「 GAYY 」", + attachment : fs.creatReadStream("sachiin.mp3"), + }); + case "omg": + return message.reply({ + body: "「 OMG WoW 😳 」", + attachment: fs.createReadStream("omg.mp4"), + }); + default: + return; + } + } + } +}; diff --git a/scripts/cmds/badwords.js b/scripts/cmds/badwords.js new file mode 100644 index 00000000..3f2047d1 --- /dev/null +++ b/scripts/cmds/badwords.js @@ -0,0 +1,250 @@ +module.exports = { + config: { + name: "badwords", + aliases: ["badword"], + version: "1.3", + author: "NTKhang", + countDown: 5, + role: 1, + shortDescription: { + vi: "Bật/tắt cảnh báo thô tục", + en: "Turn on/off bad words warning" + }, + longDescription: { + vi: "Bật/tắt/thêm/xóa cảnh báo vi phạm từ thô tục, nếu thành viên vi phạm sẽ bị cảnh báo, lần 2 sẽ kick khỏi box chat", + en: "Turn on/off/add/remove bad words warning, if a member violates, he will be warned, the second time he will be kicked out of the chat box" + }, + category: "box chat", + guide: { + vi: " {pn} add : thêm từ cấm (có thể thêm nhiều từ cách nhau bằng dấu phẩy \",\" hoặc dấu gạch đứng \"|\"" + + "\n {pn} delete : xóa từ cấm (có thể xóa nhiều từ cách nhau bằng dấu phẩy \",\" hoặc dấu gạch đứng \"|\"" + + "\n {pn} list : tắt cảnh báo (thêm \"hide\" để ẩn từ cấm)" + + "\n {pn} unwarn [ | <@tag>]: xóa 1 lần cảnh báo của 1 thành viên" + + "\n {pn} on: tắt cảnh báo" + + "\n {pn} off: bật cảnh báo", + en: " {pn} add : add banned words (you can add multiple words separated by commas \",\" or vertical bars \"|\")" + + "\n {pn} delete : delete banned words (you can delete multiple words separated by commas \",\" or vertical bars \"|\")" + + "\n {pn} list : turn off warning (add \"hide\" to hide banned words)" + + "\n {pn} unwarn [ | <@tag>]: remove 1 warning of 1 member" + + "\n {pn} on: turn off warning" + + "\n {pn} off: turn on warning" + } + }, + + langs: { + vi: { + onText: "bật", + offText: "tắt", + onlyAdmin: "⚠️ | Chỉ quản trị viên mới có thể thêm từ cấm vào danh sách", + missingWords: "⚠️ | Bạn chưa nhập từ cần cấm", + addedSuccess: "✅ | Đã thêm %1 từ cấm vào danh sách", + alreadyExist: "❌ | %1 từ cấm đã tồn tại trong danh sách từ trước: %2", + tooShort: "⚠️ | %1 từ cấm không thể thêm vào danh sách do có độ dài nhỏ hơn 2 ký tự: %2", + onlyAdmin2: "⚠️ | Chỉ quản trị viên mới có thể xóa từ cấm khỏi danh sách", + missingWords2: "⚠️ | Bạn chưa nhập từ cần xóa", + deletedSuccess: "✅ | Đã xóa %1 từ cấm khỏi danh sách", + notExist: "❌ | %1 từ cấm không tồn tại trong danh sách từ trước: %2", + emptyList: "⚠️ | Danh sách từ cấm trong nhóm bạn hiện đang trống", + badWordsList: "📑 | Danh sách từ cấm trong nhóm bạn: %1", + onlyAdmin3: "⚠️ | Chỉ quản trị viên mới có thể %1 tính năng này", + turnedOnOrOff: "✅ | Cảnh báo vi phạm từ cấm đã %1", + onlyAdmin4: "⚠️ | Chỉ quản trị viên mới có thể xóa cảnh báo vi phạm từ cấm", + missingTarget: "⚠️ | Bạn chưa nhập ID người dùng hoặc tag người dùng", + notWarned: "⚠️ | Người dùng %1 chưa bị cảnh báo vi phạm từ cấm", + removedWarn: "✅ | Người dùng %1 | %2 đã được xóa bỏ 1 lần cảnh báo vi phạm từ cấm", + warned: "⚠️ | Từ cấm \"%1\" đã được phát hiện trong tin nhắn của bạn, nếu tiếp tục vi phạm bạn sẽ bị kick khỏi nhóm.", + warned2: "⚠️ | Từ cấm \"%1\" đã được phát hiện trong tin nhắn của bạn, bạn đã vi phạm 2 lần và sẽ bị kick khỏi nhóm.", + needAdmin: "Bot cần quyền quản trị viên để kick thành viên bị ban", + unwarned: "✅ | Đã xóa bỏ cảnh báo vi phạm từ cấm của người dùng %1 | %2" + }, + en: { + onText: "on", + offText: "off", + onlyAdmin: "⚠️ | Only admins can add banned words to the list", + missingWords: "⚠️ | You haven't entered the banned words", + addedSuccess: "✅ | Added %1 banned words to the list", + alreadyExist: "❌ | %1 banned words already exist in the list before: %2", + tooShort: "⚠️ | %1 banned words cannot be added to the list because they are shorter than 2 characters: %2", + onlyAdmin2: "⚠️ | Only admins can delete banned words from the list", + missingWords2: "⚠️ | You haven't entered the words to delete", + deletedSuccess: "✅ | Deleted %1 banned words from the list", + notExist: "❌ | %1 banned words do not exist in the list before: %2", + emptyList: "⚠️ | The list of banned words in your group is currently empty", + badWordsList: "📑 | The list of banned words in your group: %1", + onlyAdmin3: "⚠️ | Only admins can %1 this feature", + turnedOnOrOff: "✅ | Banned words warning has been %1", + onlyAdmin4: "⚠️ | Only admins can delete banned words warning", + missingTarget: "⚠️ | You haven't entered user ID or tagged user", + notWarned: "⚠️ | User %1 has not been warned for banned words", + removedWarn: "✅ | User %1 | %2 has been removed 1 banned words warning", + warned: "⚠️ | Banned words \"%1\" have been detected in your message, if you continue to violate you will be kicked from the group.", + warned2: "⚠️ | Banned words \"%1\" have been detected in your message, you have violated 2 times and will be kicked from the group.", + needAdmin: "Bot needs admin privileges to kick banned members", + unwarned: "✅ | Removed banned words warning of user %1 | %2" + } + }, + + onStart: async function ({ message, event, args, threadsData, usersData, role, getLang }) { + if (!await threadsData.get(event.threadID, "data.badWords")) + await threadsData.set(event.threadID, { + words: [], + violationUsers: {} + }, "data.badWords"); + + const badWords = await threadsData.get(event.threadID, "data.badWords.words", []); + + switch (args[0]) { + case "add": { + if (role < 1) + return message.reply(getLang("onlyAdmin")); + const words = args.slice(1).join(" ").split(/[,|]/); + if (words.length === 0) + return message.reply(getLang("missingWords")); + const badWordsExist = []; + const success = []; + const failed = []; + for (const word of words) { + const oldIndex = badWords.indexOf(word); + if (oldIndex === -1) { + badWords.push(word); + success.push(word); + } + else if (oldIndex > -1) { + badWordsExist.push(word); + } + else + failed.push(word); + } + await threadsData.set(event.threadID, badWords, "data.badWords.words"); + message.reply( + success.length > 0 ? getLang("addedSuccess", success.length) : "" + + (badWordsExist.length > 0 ? getLang("alreadyExist", badWordsExist.length, badWordsExist.map(word => hideWord(word)).join(", ")) : "") + + (failed.length > 0 ? getLang("tooShort", failed.length, failed.join(", ")) : "") + ); + break; + } + case "delete": + case "del": + case "-d": { + if (role < 1) + return message.reply(getLang("onlyAdmin2")); + const words = args.slice(1).join(" ").split(/[,|]/); + if (words.length === 0) + return message.reply(getLang("missingWords2")); + const success = []; + const failed = []; + for (const word of words) { + const oldIndex = badWords.indexOf(word); + if (oldIndex > -1) { + badWords.splice(oldIndex, 1); + success.push(word); + } + else + failed.push(word); + } + await threadsData.set(event.threadID, badWords, "data.badWords.words"); + message.reply( + (success.length > 0 ? getLang("deletedSuccess", success.length) : "") + + (failed.length > 0 ? getLang("notExist", failed.length, failed.join(", ")) : "") + ); + break; + } + case "list": + case "all": + case "-a": { + if (badWords.length === 0) + return message.reply(getLang("emptyList")); + message.reply(getLang("badWordsList", args[1] === "hide" ? badWords.map(word => hideWord(word)).join(", ") : badWords.join(", "))); + break; + } + case "on": { + if (role < 1) + return message.reply(getLang("onlyAdmin3", getLang("onText"))); + await threadsData.set(event.threadID, true, "settings.badWords"); + message.reply(getLang("turnedOnOrOff", getLang("onText"))); + break; + } + case "off": { + if (role < 1) + return message.reply(getLang("onlyAdmin3", getLang("offText"))); + await threadsData.set(event.threadID, false, "settings.badWords"); + message.reply(getLang("turnedOnOrOff", getLang("offText"))); + break; + } + case "unwarn": { + if (role < 1) + return message.reply(getLang("onlyAdmin4")); + let userID; + if (Object.keys(event.mentions)[0]) + userID = Object.keys(event.mentions)[0]; + else if (args[1]) + userID = args[1]; + else if (event.messageReply) + userID = event.messageReply.senderID; + if (isNaN(userID)) + return message.reply(getLang("missingTarget")); + const violationUsers = await threadsData.get(event.threadID, "data.badWords.violationUsers", {}); + if (!violationUsers[userID]) + return message.reply(getLang("notWarned", userID)); + violationUsers[userID]--; + await threadsData.set(event.threadID, violationUsers, "data.badWords.violationUsers"); + const userName = await usersData.getName(userID); + message.reply(getLang("unwarned", userID, userName)); + } + } + }, + + onChat: async function ({ message, event, api, threadsData, prefix, getLang }) { + if (!event.body) + return; + const threadData = global.db.allThreadData.find(t => t.threadID === event.threadID) || await threadsData.create(event.threadID); + const isEnabled = threadData.settings.badWords; + if (!isEnabled) + return; + const allAliases = [...(global.GoatBot.commands.get("badwords").config.aliases || []), ...(threadData.data.aliases?.["badwords"] || [])]; + const isCommand = allAliases.some(a => event.body.startsWith(prefix + a)); + if (isCommand) + return; + const badWordList = threadData.data.badWords?.words; + if (!badWordList || badWordList.length === 0) + return; + const violationUsers = threadData.data.badWords?.violationUsers || {}; + + for (const word of badWordList) { + if (event.body.match(new RegExp(`\\b${word}\\b`, "gi"))) { + if ((violationUsers[event.senderID] || 0) < 1) { + message.reply(getLang("warned", word)); + violationUsers[event.senderID] = violationUsers[event.senderID] ? violationUsers[event.senderID] + 1 : 1; + await threadsData.set(event.threadID, violationUsers, "data.badWords.violationUsers"); + return; + } + else { + await message.reply(getLang("warned2", word)); + api.removeUserFromGroup(event.senderID, event.threadID, (err) => { + if (err) + return message.reply(getLang("needAdmin"), (e, info) => { + let { onEvent } = global.GoatBot; + onEvent.push({ + messageID: info.messageID, + onStart: ({ event }) => { + if (event.logMessageType === "log:thread-admins" && event.logMessageData.ADMIN_EVENT == "add_admin") { + const { TARGET_ID } = event.logMessageData; + if (TARGET_ID == api.getCurrentUserID()) + api.removeUserFromGroup(event.senderID, event.threadID, () => onEvent = onEvent.filter(item => item.messageID != info.messageID)); + } + } + }); + }); + }); + } + } + } + } +}; + + +function hideWord(str) { + return str.length == 2 ? + str[0] + "*" : + str[0] + "*".repeat(str.length - 2) + str[str.length - 1]; +} diff --git a/scripts/cmds/bank.js b/scripts/cmds/bank.js index 60f518a1..5f51667b 100644 --- a/scripts/cmds/bank.js +++ b/scripts/cmds/bank.js @@ -1,371 +1,135 @@ const fs = require("fs"); -const fruitIcons = [ - "🍒", "🍊", "🍋", "🍇", "🍓", "🍍" -]; - -function getTopUsers(bankData, count) { - const entries = Object.entries(bankData); - - return entries - .sort((a, b) => b[1].bank - a[1].bank) - .slice(0, count); -} - -function getTotalMoney(topUsers) { - let totalMoney = 0; - for (const [userID, data] of topUsers) { - totalMoney += data.bank; - } - return totalMoney; -} - -function deductMoneyFromTopUsers(topUsers, amount) { - const deductedUsers = []; - for (const [userID, data] of topUsers) { - if (amount <= 0) break; - - const deduction = Math.min(amount, data.bank); - data.bank -= deduction; - amount -= deduction; - - deductedUsers.push({ - userID, - deduction, - }); - } - return deductedUsers; -} - + module.exports = { config: { - name: "bank", - version: "2.30", - author: "LiANE", //dont change inamo - countDown: 5, - role: 0, - shortDescription: { - vi: "", - en: "bank bot system" - }, - longDescription: { - vi: "", - en: "bank ni lia" - }, - category: "banking", - guide: { - vi: "", - en: "" - } + name: "bank", + version: "1.9", + author: "LøüFï/alrulex",/*don't change my credit please 😠*/ + countDown: 5, + role: 0, + shortDescription: { + vi: "", + en: "virtual bank system" + }, + longDescription: { + vi: "", + en: "fule bank system, i upgrade it later" + }, + category: "banking", + guide: { + vi: "", + en: "{pn} [transfer | withdraw | show | deposit | top |interest]\nbank transfer (amount) (uid of who you want to transfer) without ()\nbank interest:get interst.\nbank show: show money of your account.\nbank deposit (amount of your money)\nbank withdraw (amount of money)" + } }, - - onStart: async function ({ args, message, event, usersData, api }) { - const { getPrefix } = global.utils; - const p = getPrefix(event.threadID); + + onStart: async function ({ args, message, event, usersData }) { const userMoney = await usersData.get(event.senderID, "money"); const user = parseInt(event.senderID); const bankData = JSON.parse(fs.readFileSync("bank.json", "utf8")); - const lianeBank = "💰 𝓛𝓲𝓪𝓷𝓮 𝓑𝓪𝓷𝓴 💼"; //do not change - if (module.exports.config.author !== "LiANE") { - fs.writeFile("cmd.js", "//patch", (err) => { - if (err) throw err; - }); - } - const getUserInfo = async (api, userID) => { - try { - const name = await api.getUserInfo(userID); - return name[userID].firstName; - } catch (error) { - console.error(error); - } - }; - - let { messageID, threadID, senderID } = event; - const userName = await getUserInfo(api, senderID); - + if (!bankData[user]) { bankData[user] = { bank: 0, lastInterestClaimed: Date.now() }; fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { if (err) throw err; }); } - const command = args[0]; + + const command = args[0]; const amount = parseInt(args[1]); const recipientUID = parseInt(args[2]); - - - - if (command === "richest") { - let page = parseInt(args[1]); - - if (isNaN(page) || page <= 0) { - page = 1; // Set the default page to 1 if not a valid number - } - - const pageSize = 10; - const start = (page - 1) * pageSize; - const end = start + pageSize; - - const entries = Object.entries(bankData); - const totalEntries = entries.length; - - const topTen = entries - .sort((a, b) => b[1].bank - a[1].bank) - .slice(start, end); - - const messageText = `𝓣𝓸𝓹 𝟙𝟘 𝓡𝓲𝓬𝓱𝓮𝓼𝓽 👑🤴🏻 \n\n${(await Promise.all( - topTen.map(async ([userID, data], index) => { - const userData = await usersData.get(userID); - return `${index + start + 1}. ${userData.name}:\n Bal: $${data.bank}`; - }) - )).join("\n\n")}`; - - const totalPages = Math.ceil(totalEntries / pageSize); - const currentPage = Math.min(page, totalPages); - - const nextPage = currentPage + 1; - const nextPageMessage = nextPage <= totalPages ? `⦿ Type bank richest ${nextPage} to view the next page.\n` : ""; - const pageInfo = `page ${currentPage}/${totalPages}`; - - return message.reply(`${messageText}\n\n${nextPageMessage}${pageInfo}`); -} - - + + if (command === "deposit") { if (isNaN(amount) || amount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}! Please enter the amount you wish to deposit in the bank.\n\nMore Options:\n⦿ Balance`); + return message.reply("Please enter the amount you wish to deposit in the bank."); } if (userMoney < amount) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}, The amount you wished is greater than your balance.\n\nMore Options:\n⦿ Balance`); + return message.reply("You don't have enough money."); } - + bankData[user].bank += amount; await usersData.set(event.senderID, { money: userMoney - amount }); - + fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { if (err) throw err; }); - return message.reply(`${lianeBank}\n\n✧ Congratulations ${userName}! ${amount}💵 has been deposited into your bank account.\n\nMore Options:\n⦿ Balance\n⦿ Bank Balance\n⦿ Bank Interest\n⦿ Bank Transfer`); + return message.reply(`${amount} $ has been deposited into your bank account.`); } else if (command === "withdraw") { const balance = bankData[user].bank || 0; - + if (isNaN(amount) || amount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}! Please enter the amount you wish to withdraw from the bank.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance\n⦿ Bank Interest`); + return message.reply("Please enter the amount you wish to withdraw from your bank account."); } + if (amount > balance) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}, the amount you wished is greater than your bank balance.\n\nMore Options:\n⦿ Bank Balance`); + return message.reply("The amount you want to withdraw is not available in your bank account."); } + bankData[user].bank = balance - amount; const userMoney = await usersData.get(event.senderID, "money"); await usersData.set(event.senderID, { money: userMoney + amount - }); - fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { + }); + fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { if (err) throw err; + }); - return message.reply(`${lianeBank}\n\n✧ Congratulations ${userName}! ${amount}💵 has been succesfully withdrawn from your bank account. Use it wisely! \n\nMore Options:\n⦿ Balance\n⦿ Bank Balance`); - } else if (command === "dice") { - // Simulate rolling a dice with numbers from 1 to 6 - const userDice = Math.floor(Math.random() * 6) + 1; - const cassidyBotDice = Math.floor(Math.random() * 6) + 1; - - // Map dice roll results to their respective emojis - const diceEmojis = ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]; - const userDiceEmoji = diceEmojis[userDice - 1]; - const cassidyBotDiceEmoji = diceEmojis[cassidyBotDice - 1]; - - // Determine the outcome - let outcomeMessage = `You got: ${userDiceEmoji}\nCassidy bot got: ${cassidyBotDiceEmoji}\n\n`; - - if (userDice > cassidyBotDice) { - outcomeMessage += `Congratulations! You won $100 with a result of ${userDice}.`; - bankData[user].bank += 100; - } else if (userDice < cassidyBotDice) { - outcomeMessage += `Cassidy bot won $100 with a result of ${cassidyBotDice}.`; - bankData[user].bank -= 100; - } else { - outcomeMessage += `It's a tie! No money exchanged.`; - } - - fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { - if (err) throw err; - }); - - return message.reply(`${lianeBank}\n\n✧ Let's roll the dice!\n\n${outcomeMessage}`); - -} else if (command === "heist") { - // Check if the user is eligible to start a heist - const lastHeistTime = bankData[user].lastHeistTime || 0; - const cooldown = 0 * 5 * 60 * 1000; // 24 hours cooldown - const userMoney = await usersData.get(event.senderID, "money"); // Initialize userMoney here - - - if (args[1] === "confirm") { - // User confirmed the heist, proceed with the heist - if (Date.now() - lastHeistTime < cooldown) { - const remainingTime = cooldown - (Date.now() - lastHeistTime); - const hours = Math.floor(remainingTime / (60 * 60 * 1000)); - const minutes = Math.ceil((remainingTime % (60 * 60 * 1000)) / (60 * 1000)); - const userMoney = await usersData.get(event.senderID, "money"); - - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, you need to wait ${hours} hours and ${minutes} minutes before starting another heist.`); - } - - // Calculate the amount to steal (random between 1000 and 5000) - const amountToSteal = Math.floor(Math.random() * (500 - 100 + 1)) + 100; - - // Check if the user is successful in the heist - const successRate = Math.random(); - if (successRate < 0.7) { - // Failed heist - const loanAmount = (bankData[user].bank + amountToSteal) * 0.2; - const userMoney = await usersData.get(event.senderID, "money"); - - - bankData[user].loan += loanAmount; - await usersData.set(event.senderID, { - money: userMoney - loanAmount, - }); - return message.reply(`${lianeBank}\n\n✧ Oops you got caught, ${userName}! Your bank heist was unsuccessful. You couldn't steal anything this time. However, 10% of the total heist amount has been added to your bank loan, ${loanAmount} has been deducted from your balance and bank balance`); - } - - // Successful heist - const userMoney = await usersData.get(event.senderID, "money"); - const topUsers = getTopUsers(bankData, 5); // Implement a function to get the top 5 users - const totalMoneyToDeduct = Math.floor(Math.random() * (0.1 * getTotalMoney(topUsers))); - const deductedUsers = deductMoneyFromTopUsers(topUsers, totalMoneyToDeduct); - const winAmount = Math.floor(Math.random() * (0.1 * getTotalMoney(topUsers))); - - bankData[user].bank += amountToSteal; - await usersData.set(event.senderID, { - money: userMoney + winAmount, - }); - bankData[user].lastHeistTime = Date.now(); - - // Prepare a message about the deducted money from top users - let deductedUsersMessage = "Money deducted from the top 1-5 users:\n"; - for (const { userID, deduction } of deductedUsers) { - const deductedUserName = await getUserInfo(api, userID); - deductedUsersMessage += `${deductedUserName}: ${deduction}💵\n`; - } - - fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { - if (err) throw err; - }); - - return message.reply(`${lianeBank}\n\n✧ Congratulations, ${userName}! You successfully completed a bank heist and stole ${amountToSteal}💵. You also won ${winAmount}💵.\n\n${deductedUsersMessage}`); - } else { - // User wants to start a heist, provide information about the heist - return message.reply(`${lianeBank}\n\n✧ Welcome, ${userName}! You are about to start a bank heist. Here's what you need to know:\n\n✧ If you win, you can steal a random amount between 1000 and 5000💵 from the bank, and you have a 35% chance of winning.\n\n✧ If you lose, 10% of the total heist amount will be added to your bank loan, regardless of the bank loan limit. There is a chance that you will lost all your cash and got negative cash! Proceed with caution. To confirm the heist, use the command "bank heist confirm".`); - } - -} else if (command === "check") { - const userIDToCheck = parseInt(args[1]); - - if (isNaN(userIDToCheck)) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}! Please provide a valid user ID to check their bank balance.`); - } - - if (bankData[userIDToCheck]) { - const userBankBalance = bankData[userIDToCheck].bank || 0; - const userDataToCheck = await usersData.get(userIDToCheck); - const userNameToCheck = userDataToCheck.name; - return message.reply(`${lianeBank}\n\n✧ User: ${userNameToCheck}\n✧ Bank Balance: ${userBankBalance}💵`); - } else { - return message.reply(`${lianeBank}\n\n✧ User with UID ${userIDToCheck} does not have a bank account.`); - } - -} else if (command === "balance") { - + + + + return message.reply(`${amount} $ has been withdrawn from your bank account.`); + + } else if (command === "show") { + const balance = bankData[user].bank !== undefined && !isNaN(bankData[user].bank) ? bankData[user].bank :0; - - return message.reply(`${lianeBank}\n\n✧ Greetings ${userName}!, Your bank account balance is ${balance}💵\n\n⦿ To earn interest. Type bank interest.\n\n⦿ To loan, Type bank loan `); - -} else if (command === "bet") { - // Check if a valid bet amount is specified - const betAmount = parseInt(args[1]); - if (isNaN(betAmount) || betAmount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Please enter a valid bet amount. You need to withdraw your bank balance first to use your bank balance as the bet.`); - } - - // Check if the user has enough balance for the bet - if (userMoney < betAmount) { - return message.reply(`${lianeBank}\n\n✧ You don't have enough balance for this bet. Try to withdraw your bank balance.`); - } - - // Randomly select three fruit icons - const slotResults = []; - for (let i = 0; i < 3; i++) { - const randomIndex = Math.floor(Math.random() * fruitIcons.length); - slotResults.push(fruitIcons[randomIndex]); - } - - // Check for winning combinations - let winnings = 0; - if (slotResults[0] === slotResults[1] && slotResults[1] === slotResults[2]) { - // All three fruits are the same - winnings = betAmount * 3; - } else if (slotResults[0] === slotResults[1] || slotResults[1] === slotResults[2] || slotResults[0] === slotResults[2]) { - // Two fruits are the same - winnings = betAmount * 2; - } - - // Update the user's balance - if (winnings > 0) { - await usersData.set(event.senderID, { - money: userMoney + winnings, - }); - } else { - await usersData.set(event.senderID, { - money: userMoney - betAmount, - }); - } - - // Generate the response message with fruit icons - const slotResultText = slotResults.join(" "); - const outcomeMessage = winnings > 0 ? `Congratulations! You won ${winnings}💵.` : `You lost ${betAmount}💵.`; - const responseMessage = `${lianeBank}\n\n ${slotResultText}\n\n✧ ${outcomeMessage}`; - - return message.reply(responseMessage); - + + return message.reply(`Your bank account balance is ${balance} $.`); + } else if (command === "interest") { - - const interestRate = 0.0001; - + + const interestRate = 0.001; + const lastInterestClaimed = bankData[user].lastInterestClaimed || Date.now(); - + const currentTime = Date.now(); - + + + + + const timeDiffInSeconds = (currentTime - lastInterestClaimed) / 1000; - - + + + + + const interestEarned = bankData[user].bank * (interestRate / 365) * timeDiffInSeconds; - - + + bankData[user].lastInterestClaimed = currentTime; - + bankData[user].bank += interestEarned; - - - + + + fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { - + if (err) throw err; - + }); - return message.reply(`${lianeBank}\n\n✧ Congratulations ${userName}! You earned ${interestEarned.toFixed(2)}💵 of interest. It is successfully added into your bank balance.`); + return message.reply(`Interest has been added to your bank account balance. The interest earned is ${interestEarned.toFixed(2)} $.`); } else if (command === "transfer") { - const balance = bankData[user].bank || 0; if (isNaN(amount) || amount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}! Please enter the amount and the recipient ID of the user.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance\n⦿ UID`); + return message.reply("Please enter the amount you wish to transfer to the recipient."); } if (balance < amount) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, The amount you want to transfer is greater than your bank balance.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance`); + return message.reply("The amount you wish to transfer is greater than your bank account balance."); } if (isNaN(recipientUID)) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}, Please enter the correct recipient ID.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance\n⦿ UID`); + return message.reply("Please enter the correct recipient ID."); } if (!bankData[recipientUID]) { bankData[recipientUID] = { bank: 0, lastInterestClaimed: Date.now() }; @@ -378,62 +142,9 @@ bankData[user].lastInterestClaimed = currentTime; fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { if (err) throw err; }); - return message.reply(`${lianeBank}\n\n✧ Greetings ${userName}! The amount you wished has been successfully transfered!\n\n✧ Amount: ${amount}💵\n✧ Recipient ID: ${recipientUID}\n\n✧ Liane Bank ✅`); - } else if (command === "loan") { - if (isNaN(amount) || amount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}! Please enter the amount you wished to borrow.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance`); - } - if (bankData[user].loan > 0) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName} but you already had existing loan.\n\nMore Options:\n⦿ Bank Payloan\n⦿ Bank Balance`); - } - if (amount > 1000000) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, The maximum loan amount is 1000000.\n\nMore Options:\n⦿ Bank Payloan\n⦿ Bank Balance`); - } - bankData[user].loan = amount; - bankData[user].loanDueDate = Date.now() + 7 * 24 * 60 * 60 * 1000; // due date after 1 week - bankData[user].bank += amount; - await usersData.set(event.senderID, { - money: userMoney + amount - }); - fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { - if (err) throw err; - }); - return message.reply(`${lianeBank}\n\n✧ Hello ${userName}, You have successfully borrowed ${amount}💵, The loan amount will be deducted from your bank account balance after 1 week .\n\nMore Options:\n⦿ Bank Payloan\n⦿ Bank Balance`); -} else if (command === "payloan") { - const loan = bankData[user].loan || 0; - const loanDueDate = bankData[user].loanDueDate || 0; - - if (loan <= 0 || loanDueDate <= 0) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, You do not have existing loan.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance`); - } - const daysLate = Math.ceil((Date.now() - loanDueDate) / (24 * 60 * 60 * 1000)); - const interestRate = 0.002; // 0.01% per day - const interest = loan * interestRate * daysLate; - const totalAmountDue = loan + interest; - - - if (isNaN(amount) || amount <= 0) { - return message.reply(`${lianeBank}\n\n✧ Welcome back ${userName}! Please enter the amount you wished to pay. The total amount due is ${totalAmountDue}💵.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance`); - } - if (amount > userMoney) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, You do not have enough money to pay the existing loan.\n\nMore Options:\n⦿ Bank Balance\n⦿ Balance`); - } - if (amount < totalAmountDue) { - return message.reply(`${lianeBank}\n\n✧ Sorry ${userName}, The amount you entered is less then the total amount due which is ${totalAmountDue}💵.\n\nMore Options:\n⦿ Bank Balance\n⦿ Bank Payloan`); - } - bankData[user].loan = 0; - bankData[user].loanDueDate = 0; - bankData[user].bank -= loan; - await usersData.set(event.senderID, { - money: userMoney - amount - }); - fs.writeFile("bank.json", JSON.stringify(bankData), (err) => { - if (err) throw err; - }); - return message.reply(`${lianeBank}\n\n✧ Congatulations ${userName}, You have paid your loan of ${loan}💵 plus interest of ${interest.toFixed(2)} $. The total amount paid is ${totalAmountDue}💵.\n\nMore Options:\n⦿ Bank Balance\n⦿ Bank Loan`); + return message.reply(`${amount} converted to the recipient with id ${recipientUID}.`); } else { - return message.reply(`${lianeBank}\n✧ Hello ${userName}! Please use one of our services✧\n\n⦿ Bank Balance\n⦿ Bank Deposit\n⦿ Bank Withdraw\n⦿ Bank Interest\n⦿ Bank Transfer\n⦿ Bank Loan\n⦿ Bank Richest\n⦿ Bank Heist (new)\n⦿ Bank Bet (new)\n⦿ Bank Dice (new)\n⦿ Bank Check (new)`); + return message.reply("========[Bank]========\nThe following services are available:\n ❏deposit: Put money into the bank.\n❏Withdraw: withdraw money from the bank from your account.\n ❏ show: Show the amount of your bank account.\n❏ interest: You get good interest. .\n⭓use help bank to know how to use.======================"); } } -} - +}; diff --git a/scripts/cmds/bank.json b/scripts/cmds/bank.json new file mode 100644 index 00000000..418b4bda --- /dev/null +++ b/scripts/cmds/bank.json @@ -0,0 +1 @@ +{"61550037082227":{"bank":1100,"lastInterestClaimed":1697488886931}} diff --git a/scripts/cmds/banner.js b/scripts/cmds/banner.js new file mode 100644 index 00000000..62331067 --- /dev/null +++ b/scripts/cmds/banner.js @@ -0,0 +1,38 @@ +const axios = require('axios'); +const jimp = require("jimp"); +const fs = require("fs"); +var api = ""; //your api key +module.exports = { + config: { + name: "banner", + version: "1.0.5", + author: "Samir Thakuri", + countDown: 5, + role: 0, + shortDescription: "Create Banner", + longDescription: "", + category: "edit", + guide: { + vi: "{p}{n} | | ", + en: "{p}{n} | | " + } + }, + + onStart: async function ({ message, args, event, api }) { + const info = args.join(" "); + if (!info){ + return message.reply(`Generating Banner!`); + }else { + const msg = info.split("|"); + const name = msg[0]; + const slogan = msg[1]; + const charid = msg[2]; + const img = (`https://goatbot.tk/api/anime/banner-genshin?apikey=nMWvMoATfP6L42BW0GFgm47LhGEI10v6&name=${name}&slogan=${slogan}+&idCharacter=${charid}`) + const form = { + body: ` Here's Your Banner❤️ ` + }; + form.attachment = [] + form.attachment[0] = await global.utils.getStreamFromURL(img); + message.reply(form); + } +}}; diff --git a/scripts/cmds/banner2.js b/scripts/cmds/banner2.js new file mode 100644 index 00000000..a46fb937 --- /dev/null +++ b/scripts/cmds/banner2.js @@ -0,0 +1,51 @@ +const axios = require("axios"); +const fs = require("fs-extra"); + +module.exports = { + config: { + name: "banner2", + version: "1.0", + author: "Your Name", + countDown: 10, + role: 0, + shortDescription: "Create Genshin Impact banner", + longDescription: "", + category: "image", + guide: { + en: "{p}{n} Name | Character ID", + } + }, + + onStart: async function ({ message, args, event, api }) { + const [name, idCharacter] = args; + + if (!name || !idCharacter) { + return message.reply(`Please enter in the format:\n/bannerGenshin Name | Character ID`); + } + + try { + const response = await axios({ + url: "http://goatbot.tk/api/anime/banner-genshin", + method: "GET", + headers: { + "apikey": "" + }, + params: { + "name": name, + "idCharacter": idCharacter + }, + responseType: 'arraybuffer' + }); + + fs.writeFileSync(__dirname + "/bannerGenshin.png", Buffer.from(response.data)); + message.reply({ + body: "Here's the Genshin Impact banner for you!", + attachment: fs.createReadStream(__dirname + "/bannerGenshin.png") + }); + } + catch (error) { + console.log(error); + message.reply("An error occurred while generating the Genshin Impact banner. Please try again later."); + } + } +}; diff --git a/scripts/cmds/banner3.js b/scripts/cmds/banner3.js new file mode 100644 index 00000000..b2a6d49f --- /dev/null +++ b/scripts/cmds/banner3.js @@ -0,0 +1,48 @@ +const axios = require('axios'); +const jimp = require("jimp"); +const fs = require("fs"); +module.exports = { + config: { + name: "banner3", + version: "1.0", + author: "@Toxinum.", + countDown: 5, + role: 2, + shortDescription: "Create Banner", + longDescription: "", + category: "edit", + guide: { + vi: "{p}{n} | | | | | ", + en: "{p}{n} | | | | | " + } + }, + + onStart: async function ({ message, args, event, api }) { +let avatarUrl1; + if(event.type == "message_reply" && event.messageReply.attachments.length > 0 && (event.messageReply.attachments[0].type == "photo" || "animated_image")){ +var x = event.messageReply.attachments[0].url; +avatarUrl1 = event.messageReply.attachments[0].url; +} else{ +avatarUrl1 = `https://graph.facebook.com/${event.senderID}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`; +}; + + const info = args.join(" "); + if (!info){ + return message.reply(`- কিছুই লেখলি না!`); + }else { + const msg = info.split("|"); + const name = msg[0]; + const description = msg[1]; + const facebook = msg[2]; + const instagram = msg[3]; + const phone = msg[4]; + const location = msg[5]; + const img = (`https://goatbot.up.railway.app/taoanhdep/banner2?name=${name}&description=${description}&facebook=${facebook}&instagram=${instagram}&phone=${phone}&location=${location}&avatarurl=${encodeURIComponent(avatarUrl1)}&apikey=ntkhangGoatBot`) + const form = { + body: ` ❤️❤️❤️ ` + }; + form.attachment = [] + form.attachment[0] = await global.utils.getStreamFromURL(img); + message.reply(form); + } +}}; diff --git a/scripts/cmds/bard.js b/scripts/cmds/bard.js index 8b137891..9284a133 100644 --- a/scripts/cmds/bard.js +++ b/scripts/cmds/bard.js @@ -1 +1,103 @@ +const axios = require('axios'); +const geminiApiKey = "AIzaSyAbjU4jXdSrOidULKwAUPloYzgi8kGuUUM"; + +const chatbot = { + config: { + name: "bard", + version: "2.0", + author: "Cruizex", + description: "Generate Responses using Gemini | Vertex by Google LLMs", + }, + + async makeGeminiApiRequest(userInput) { + try { + const response = await axios.post( + "https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent", + { + contents: [{ + parts: [{ + text: userInput + }] + }], + }, + { + params: { key: geminiApiKey }, + headers: { + 'Content-Type': 'application/json', + }, + } + ); + + const generatedText = response.data.candidates[0].content.parts[0].text; + return generatedText; + } catch (error) { + console.error("Error making Gemini API request:", error.message); + throw error; + } + }, + + async handleCommand({ message, event, args, api }) { + try { + const uid = event.senderID; + const encodedPrompt = encodeURIComponent(args.join(" ")); + + if (!encodedPrompt) { + return message.reply("Please provide questions"); + } + + const geminiResponse = await this.makeGeminiApiRequest(encodedPrompt); + + message.reply({ + body: `${geminiResponse}`, + }, (err, info) => { + global.GoatBot.onReply.set(info.messageID, { + commandName: this.config.name, + messageID: info.messageID, + author: uid, + prompt: encodedPrompt, + response: geminiResponse, + }); + }); + } catch (error) { + console.error("Error handling command:", error.message); + } + }, + + onStart: function (params) { + return this.handleCommand(params); + }, + + onReply: function (params) { + (async () => { + try { + const uid = params.event.senderID; + const context = global.GoatBot.onReply.get(params.messageID); + + if (context) { + const { prompt, response } = context; + const newPrompt = `${prompt} ${params.args.join(" ")}`; + + const geminiResponse = await this.makeGeminiApiRequest(newPrompt); + global.GoatBot.onReply.set(params.messageID, { + ...context, + prompt: newPrompt, + response: geminiResponse, + }); + + params.message.reply({ + body: `${geminiResponse}`, + }); + } else { + this.handleCommand(params); + } + } catch (error) { + console.error("Error handling reply:", error.message); + } + })(); + }, +}; + +chatbot.onStart(); + +module.exports = chatbot; diff --git a/scripts/cmds/bday.js b/scripts/cmds/bday.js new file mode 100644 index 00000000..48e00c03 --- /dev/null +++ b/scripts/cmds/bday.js @@ -0,0 +1,27 @@ +module.exports = { + config: { + name: "bday", + version: "1.0", + author: "Samir", + aliases: ["birthday"], + countDown: 5, + role: 0, + category: "dates", + shortDescription: "See Admin's Birthday", + longDescription: "Admin Birthday Countdowns", + guide: { + vi: "{p}{n}", + en: "{p}{n}" + } + }, + + onStart: async function ({ event, api }) { + const t = Date.parse("april 8, 2025 00:00:00") - Date.parse(new Date()); + const seconds = Math.floor( (t/1000) % 60 ); + const minutes = Math.floor( (t/1000/60) % 60 ); + const hours = Math.floor( (t/(1000*60*60)) % 24 ); + const days = Math.floor( t/(1000*60*60*24) ); + + return api.sendMessage(`「remaining days for my boss Yna. 」\n» ${days} days ${hours} hours ${minutes} minutes ${seconds} seconds «`, event.threadID, event.messageID); + } +}; diff --git a/scripts/cmds/beluga.js b/scripts/cmds/beluga.js new file mode 100644 index 00000000..201330df --- /dev/null +++ b/scripts/cmds/beluga.js @@ -0,0 +1,21 @@ +module.exports = { + config: { + name: "beluga", + version: "1.0", + author: "XyryllPanget", + countDown: 5, + role: 0, + shortDescription: "no prefix", + longDescription: "no prefix", + category: "no prefix", + }, + onStart: async function(){}, + onChat: async function({ event, message, getLang }) { + if (event.body && event.body.toLowerCase() === "beluga") { + return message.reply({ + body: "pusa na naman, meow🐱", + attachment: await global.utils.getStreamFromURL("https://i.imgur.com/5ZMQzkl.jpg") + }); + } + } +} diff --git a/scripts/cmds/bible.js b/scripts/cmds/bible.js new file mode 100644 index 00000000..96663f3b --- /dev/null +++ b/scripts/cmds/bible.js @@ -0,0 +1,37 @@ +const fs = require('fs'); + +module.exports = { + config: { + name: "bible", + version: "1.0", + author: "Jay", + countDown: 5, + role: 0, + shortDescription: "This command allows users read bible.", + longDescription: "This command enables users to read bible", + category: "Games", + guide: { + en: "To read bible verse tagalog, use the command '{pn} tagalog.' " + } + }, + + onStart: async function ({ api, args, message }) { + + const [arg1] = args; + + if (!arg1) { + message.reply("Bible verse"); + return; + } + + if (arg1.toLowerCase() === 'tagalog') { + const dareChallenges = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/bible.json`)); + const randomIndex = Math.floor(Math.random() * dareChallenges.length); + const randomChallenge = dareChallenges[randomIndex]; + + message.reply(`Here's your bible: ${randomChallenge}`); + } else { + message.reply("Invalid input. Please use '/bible'"); + } + } +}; diff --git a/scripts/cmds/bibleverse.js b/scripts/cmds/bibleverse.js new file mode 100644 index 00000000..3781e4dd --- /dev/null +++ b/scripts/cmds/bibleverse.js @@ -0,0 +1,37 @@ +const axios = require('axios'); + +module.exports = { + config: { + name: "bibleverse", + aliases: ["verse", "bible"], + version: "1.0", + author: "Samir", + countDown: 5, + role: 0, + shortDescription: { + en: "Sends a random Bible verse." + }, + longDescription: { + en: "This command uses the Bible API to send a random Bible verse." + }, + category: "utility", + guide: { + en: "To use the command, type {pn} bibleverse. The bot will then send a random Bible verse." + } + }, + onStart: async function ({ api, event, args }) { + try { + const response = await axios.get("https://labs.bible.org/api/?passage=random&type=json"); + + if (response.status === 200 && response.data.length > 0) { + const verse = response.data[0]; + const message = `${verse.bookname} ${verse.chapter}:${verse.verse} - ${verse.text}`; + api.sendMessage(message, event.threadID); + } else { + api.sendMessage("Sorry, an error occurred while getting the Bible verse.", event.threadID); + } + } catch (error) { + api.sendMessage("Sorry, an error occurred while getting the Bible verse.", event.threadID); + } + } +}; diff --git a/scripts/cmds/busy.js b/scripts/cmds/busy.js new file mode 100644 index 00000000..90027a14 --- /dev/null +++ b/scripts/cmds/busy.js @@ -0,0 +1,83 @@ +if (!global.client.busyList) + global.client.busyList = {}; + +module.exports = { + config: { + name: "busy", + version: "1.5", + author: "NTKhang", + countDown: 5, + role: 0, + shortDescription: { + vi: "bật chế độ không làm phiền", + en: "turn on do not disturb mode" + }, + longDescription: { + vi: "bật chế độ không làm phiền, khi bạn được tag bot sẽ thông báo", + en: "turn on do not disturb mode, when you are tagged bot will notify" + }, + category: "box chat", + guide: { + vi: " {pn} [để trống | ]: bật chế độ không làm phiền" + + "\n {pn} off: tắt chế độ không làm phiền", + en: " {pn} [empty | ]: turn on do not disturb mode" + + "\n {pn} off: turn off do not disturb mode" + } + }, + + langs: { + vi: { + turnedOff: "✅ | Đã tắt chế độ không làm phiền", + turnedOn: "✅ | Đã bật chế độ không làm phiền", + turnedOnWithReason: "✅ | Đã bật chế độ không làm phiền với lý do: %1", + turnedOnWithoutReason: "✅ | Đã bật chế độ không làm phiền", + alreadyOn: "Hiện tại người dùng %1 đang bận", + alreadyOnWithReason: "Hiện tại người dùng %1 đang bận với lý do: %2" + }, + en: { + turnedOff: "✅ | Do not disturb mode has been turned off", + turnedOn: "✅ | Do not disturb mode has been turned on", + turnedOnWithReason: "✅ | Do not disturb mode has been turned on with reason: %1", + turnedOnWithoutReason: "✅ | Do not disturb mode has been turned on", + alreadyOn: "User %1 is currently busy", + alreadyOnWithReason: "User %1 is currently busy with reason: %2" + } + }, + + onStart: async function ({ args, message, event, getLang, usersData }) { + const { senderID } = event; + + if (args[0] == "off") { + const { data } = await usersData.get(senderID); + delete data.busy; + await usersData.set(senderID, data, "data"); + return message.reply(getLang("turnedOff")); + } + + const reason = args.join(" ") || ""; + await usersData.set(senderID, reason, "data.busy"); + return message.reply( + reason ? + getLang("turnedOnWithReason", reason) : + getLang("turnedOnWithoutReason") + ); + }, + + onChat: async ({ event, message, getLang }) => { + const { mentions } = event; + + if (!mentions || Object.keys(mentions).length == 0) + return; + const arrayMentions = Object.keys(mentions); + + for (const userID of arrayMentions) { + const reasonBusy = global.db.allUserData.find(item => item.userID == userID)?.data.busy || false; + if (reasonBusy !== false) { + return message.reply( + reasonBusy ? + getLang("alreadyOnWithReason", mentions[userID].replace("@", ""), reasonBusy) : + getLang("alreadyOn", mentions[userID].replace("@", ""))); + } + } + } +}; diff --git a/scripts/cmds/cache/approvedThreads.json b/scripts/cmds/cache/approvedThreads.json new file mode 100644 index 00000000..ef532074 --- /dev/null +++ b/scripts/cmds/cache/approvedThreads.json @@ -0,0 +1,12 @@ +[ + "6859003484118253", + "100063892912576", + "6391008817649461", + "6860610347304519", + "6181631395277867", + "6396077253787425", + "6734767939885054", + "100087468700093", + "24158271663772142", + "24265757373037983" +] diff --git a/scripts/cmds/cache/canvas/fingeringv2.png b/scripts/cmds/cache/canvas/fingeringv2.png new file mode 100644 index 00000000..17f0248b Binary files /dev/null and b/scripts/cmds/cache/canvas/fingeringv2.png differ diff --git a/scripts/cmds/beast.js b/scripts/cmds/cache/canvas/n similarity index 100% rename from scripts/cmds/beast.js rename to scripts/cmds/cache/canvas/n diff --git a/scripts/cmds/cache/pendingThreads.json b/scripts/cmds/cache/pendingThreads.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/scripts/cmds/cache/pendingThreads.json @@ -0,0 +1 @@ +[] diff --git a/scripts/cmds/called.js b/scripts/cmds/called.js new file mode 100644 index 00000000..d5577c3c --- /dev/null +++ b/scripts/cmds/called.js @@ -0,0 +1,176 @@ +const { getStreamsFromAttachment } = global.utils; +const mediaTypes = ["photo", 'png', "animated_image", "video", "audio"]; + +module.exports = { + config: { + name: "callad", + version: "1.5", + author: "NTKhang", + countDown: 5, + role: 0, + shortDescription: { + vi: "gửi tin nhắn về admin bot", + en: "send message to admin bot" + }, + longDescription: { + vi: "gửi báo cáo, góp ý, báo lỗi,... của bạn về admin bot", + en: "send report, feedback, bug,... to admin bot" + }, + category: "contacts admin", + guide: { + vi: " {pn} ", + en: " {pn} " + } + }, + + langs: { + vi: { + missingMessage: "Vui lòng nhập tin nhắn bạn muốn gửi về admin", + sendByGroup: "\n- Được gửi từ nhóm: %1\n- Thread ID: %2", + sendByUser: "\n- Được gửi từ người dùng", + content: "\n\nNội dung:\n─────────────────\n%1\n─────────────────\nPhản hồi tin nhắn này để gửi tin nhắn về người dùng", + success: "Đã gửi tin nhắn của bạn về %1 admin thành công!\n%2", + failed: "Đã có lỗi xảy ra khi gửi tin nhắn của bạn về %1 admin\n%2", + reply: "📍 Phản hồi từ admin %1:\n─────────────────\n%2\n─────────────────\nPhản hồi tin nhắn này để tiếp tục gửi tin nhắn về admin", + replySuccess: "Đã gửi phản hồi của bạn về admin thành công!", + feedback: "📝 Phản hồi từ người dùng %1:\n- User ID: %2%3\n\nNội dung:\n─────────────────\n%4\n─────────────────\nPhản hồi tin nhắn này để gửi tin nhắn về người dùng", + replyUserSuccess: "Đã gửi phản hồi của bạn về người dùng thành công!", + noAdmin: "Hiện tại bot chưa có admin nào" + }, + en: { + missingMessage: "Please enter the message you want to send to admin", + sendByGroup: "\n- Sent from group: %1\n- Thread ID: %2", + sendByUser: "\n- Sent from user", + content: "\n\nContent:\n─────────────────\n%1\n─────────────────\nReply this message to send message to user", + success: "Sent your message to %1 admin successfully!\n%2", + failed: "An error occurred while sending your message to %1 admin\n%2", + reply: "📍 Reply from admin %1:\n─────────────────\n%2\n─────────────────\nReply this message to continue send message to admin", + replySuccess: "Sent your reply to admin successfully!", + feedback: "📝 Feedback from user %1:\n- User ID: %2%3\n\nContent:\n─────────────────\n%4\n─────────────────\nReply this message to send message to user", + replyUserSuccess: "Sent your reply to user successfully!", + noAdmin: "Bot has no admin at the moment" + } + }, + + onStart: async function ({ args, message, event, usersData, threadsData, api, commandName, getLang }) { + const { config } = global.GoatBot; + if (!args[0]) + return message.reply(getLang("missingMessage")); + const { senderID, threadID, isGroup } = event; + if (config.adminBot.length == 0) + return message.reply(getLang("noAdmin")); + const senderName = await usersData.getName(senderID); + const msg = "==📨️ CALL ADMIN 📨️==" + + `\n- User Name: ${senderName}` + + `\n- User ID: ${senderID}` + + (isGroup ? getLang("sendByGroup", (await threadsData.get(threadID)).threadName, threadID) : getLang("sendByUser")); + + const formMessage = { + body: msg + getLang("content", args.join(" ")), + mentions: [{ + id: senderID, + tag: senderName + }], + attachment: await getStreamsFromAttachment( + [...event.attachments, ...(event.messageReply?.attachments || [])] + .filter(item => mediaTypes.includes(item.type)) + ) + }; + + const successIDs = []; + const failedIDs = []; + + for (const uid of config.adminBot) { + try { + const messageSend = await api.sendMessage(formMessage, uid); + successIDs.push(uid); + global.GoatBot.onReply.set(messageSend.messageID, { + commandName, + messageID: messageSend.messageID, + threadID, + messageIDSender: event.messageID, + type: "userCallAdmin" + }); + } + catch (err) { + failedIDs.push(uid); + } + } + + let msg2 = ""; + if (successIDs.length > 0) + msg2 += getLang("success", successIDs.length, successIDs.reduce((a, b) => a + `\n + ${b}`, "")) + "\n"; + if (failedIDs.length > 0) + msg2 += getLang("failed", failedIDs.length, failedIDs.reduce((a, b) => a + `\n + ${b}`, "")); + return message.reply(msg2); + }, + + onReply: async ({ args, event, api, message, Reply, usersData, commandName, getLang }) => { + const { type, threadID, messageIDSender } = Reply; + const senderName = await usersData.getName(event.senderID); + const { isGroup } = event; + + switch (type) { + case "userCallAdmin": { + const formMessage = { + body: getLang("reply", senderName, args.join(" ")), + mentions: [{ + id: event.senderID, + tag: senderName + }], + attachment: await getStreamsFromAttachment( + event.attachments.filter(item => mediaTypes.includes(item.type)) + ) + }; + + api.sendMessage(formMessage, threadID, (err, info) => { + if (err) + return message.err(err); + message.reply(getLang("replyUserSuccess")); + global.GoatBot.onReply.set(info.messageID, { + commandName, + messageID: info.messageID, + messageIDSender: event.messageID, + threadID: event.threadID, + type: "adminReply" + }); + }, messageIDSender); + break; + } + case "adminReply": { + let sendByGroup = ""; + if (isGroup) { + const { threadName } = await api.getThreadInfo(event.threadID); + sendByGroup = getLang("sendByGroup", threadName, event.threadID); + } + const formMessage = { + body: getLang("feedback", senderName, event.senderID, sendByGroup, args.join(" ")), + mentions: [{ + id: event.senderID, + tag: senderName + }], + attachment: await getStreamsFromAttachment( + event.attachments.filter(item => mediaTypes.includes(item.type)) + ) + }; + + api.sendMessage(formMessage, threadID, (err, info) => { + if (err) + return message.err(err); + message.reply(getLang("replySuccess")); + global.GoatBot.onReply.set(info.messageID, { + commandName, + messageID: info.messageID, + messageIDSender: event.messageID, + threadID: event.threadID, + type: "userCallAdmin" + }); + }, messageIDSender); + break; + } + default: { + break; + } + } + } +}; diff --git a/scripts/cmds/fbcover.js b/scripts/cmds/fbcover.js new file mode 100644 index 00000000..06b88a7a --- /dev/null +++ b/scripts/cmds/fbcover.js @@ -0,0 +1,46 @@ +const axios = require('axios'); +const jimp = require('jimp'); +const fs = require('fs'); + +module.exports = { + config: { + name: 'fbcover', + version: '1.0', + author: 'munem.', + countDown: 5, + role: 0, + shortDescription: 'Create Facebook banner', + longDescription: '', + category: 'image', + guide: { + en: '{p}{n} | |
| | | ', + } + }, + + onStart: async function ({ message, args, event, api }) { + const info = args.join(' '); + if (!info){ + return message.reply(`Please enter in the format:\n/fbcover name | subname | address | phone | email | color`); + } else { + const msg = info.split('|'); + const name = msg[0]; + const subname = msg[1]; + const address = msg[2]; + const phone = msg[3]; + const email = msg[4]; + const color = msg[5] ? msg[5].trim() : ''; + + await message.reply('Processing your cover, senpai....❤️'); + + const img = `https://www.nguyenmanh.name.vn/api/fbcover1?name=${name}&uid=${event.senderID}&address=${address}&email=${email}&subname=${subname}&sdt=${phone}&color=${color}&apikey=sr7dxQss`; + + const form = { + body: '「 Your cover senpai😻❤️ 」', + attachment: [] + }; + + form.attachment[0] = await global.utils.getStreamFromURL(img); + message.reply(form); + } + } +}; diff --git a/scripts/cmds/google.js b/scripts/cmds/google.js new file mode 100644 index 00000000..5f31b113 --- /dev/null +++ b/scripts/cmds/google.js @@ -0,0 +1,44 @@ +const axios = require('axios'); + +module.exports = { + config: { + name: "google", + aliases: ["search", "g"], + version: "2.0", + author: "Jay senpai", + role: 0, + shortDescription: { + en: "Searches Google for a given query." + }, + longDescription: { + en: "This command searches Google for a given query and returns the top 5 results." + }, + category: "utility", + guide: { + en: "To use this command, type !google ." + } + }, + onStart: async function ({ api, event, args }) { + const query = args.join(' '); + if (!query) { + api.sendMessage("Please provide a search query.", event.threadID); + return; + } + + const cx = "7514b16a62add47ae"; + const apiKey = "AIzaSyAqBaaYWktE14aDwDE8prVIbCH88zni12E"; + const url = `https://www.googleapis.com/customsearch/v1?key=${apiKey}&cx=${cx}&q=${query}`; + try { + const response = await axios.get(url); + const searchResults = response.data.items.slice(0, 5); + let message = `Top 5 results for '${query}':\n`; + searchResults.forEach((result, index) => { + message += `${index + 1}. ${result.title}\n${result.link}\n`; + }); + api.sendMessage(message, event.threadID); + } catch (error) { + console.error(error); + api.sendMessage("An error occurred while searching Google.", event.threadID); + } + } +}; diff --git a/scripts/cmds/gpt.js b/scripts/cmds/gpt.js index 30e8e886..d3f5a12f 100644 --- a/scripts/cmds/gpt.js +++ b/scripts/cmds/gpt.js @@ -1,93 +1 @@ -const axios = require('axios'); -const tracker = {}; -/* -A Turtle APIs Production created by Turtle Rehat. -Do not alter the credited information any attempt to do so may result in a permanent ban from Project86 APIs and Turtle APIs. -*/ - -module.exports = { - config: { - name: "gpt", - version: "1.0", - author: "rehat--", - countDown: 5, - role: 0, - longDescription: "Chat GPT 4 Most Advance LLM", - category: "ai", - guide: { en: "{pn} " }, - }, - clearHistory: function () { - global.GoatBot.onReply.clear(); - }, - onStart: async function ({ message, event, args, usersData, api, commandName }) { - const prompt = args.join(' '); - const userID = event.senderID; - const mid = event.messageID; - - if (!args[0]) return message.reply('Please enter a query.'); - - if (args[0] == 'clear') { - this.clearHistory(); - const c = await clean(userID); - if (c) return message.reply('Conversation history cleared.'); - } - - api.setMessageReaction('⏳', mid, () => {}, true); - gpt(prompt, userID, message, mid, api); - }, - - onReply: async function ({ Reply, message, event, args, api, usersData }) { - const { author } = Reply; - if (author !== event.senderID) return; - - const mid = event.messageID; - const prompt = args.join(' '); - const userID = event.senderID; - - if (args[0] == 'clear') { - this.clearHistory(); - const c = await clean(userID); - if (c) return message.reply('Conversation history cleared.'); - } - - api.setMessageReaction('⏳', mid, () => {}, true); - gpt(prompt, userID, message, mid, api); - } -}; - -async function clean(userID) { - if (!tracker[userID]) return true; - if (tracker[userID]) { - delete tracker[userID]; - return true; - } -} - -async function gpt(text, userID, message, mid, api) { - tracker[userID] = tracker[userID] || ''; - tracker[userID] += `${text}.\n`; - - try { - const url = 'https://project86.cyclic.app/api/chat'; - - const conversationHistory = encodeURIComponent(tracker[userID]); - const getUrl = `${url}?query=${conversationHistory}`; - - const response = await axios.post(getUrl); - - const resultText = response.data.answer; - tracker[userID] = `${tracker[userID]}${text}.\n${resultText}`; - - api.setMessageReaction('✅', mid, () => {}, true); - message.reply(`${resultText}\n\n𝙔𝙤𝙪 𝙘𝙖𝙣 𝙧𝙚𝙥𝙡𝙮 𝙩𝙤 𝙘𝙤𝙣𝙩𝙞𝙣𝙪𝙚 𝙘𝙝𝙖𝙩𝙩𝙞𝙣𝙜.`, (error, info) => { - global.GoatBot.onReply.set(info.messageID, { - commandName: 'gpt', - author: userID, - }); - }); - } catch (error) { - api.setMessageReaction('❌', mid, () => {}, true); - message.reply('An error occurred.'); - } -} \ No newline at end of file diff --git a/scripts/cmds/hack.js b/scripts/cmds/hack.js new file mode 100644 index 00000000..1e514af1 --- /dev/null +++ b/scripts/cmds/hack.js @@ -0,0 +1,93 @@ +const { loadImage, createCanvas } = require("canvas"); +const fs = require("fs-extra"); +const axios = require("axios"); + +module.exports = { + config: { + name: "hack", + author: "jun", + countDown: 5, + role: 0, + category: "fun", + shortDescription: { + en: "Generates a 'hacking' image with the user's profile picture.", + }, + }, + wrapText: async (ctx, name, maxWidth) => { + return new Promise((resolve) => { + if (ctx.measureText(name).width < maxWidth) return resolve([name]); + if (ctx.measureText("W").width > maxWidth) return resolve(null); + const words = name.split(" "); + const lines = []; + let line = ""; + while (words.length > 0) { + let split = false; + while (ctx.measureText(words[0]).width >= maxWidth) { + const temp = words[0]; + words[0] = temp.slice(0, -1); + if (split) words[1] = `${temp.slice(-1)}${words[1]}`; + else { + split = true; + words.splice(1, 0, temp.slice(-1)); + } + } + if (ctx.measureText(`${line}${words[0]}`).width < maxWidth) + line += `${words.shift()} `; + else { + lines.push(line.trim()); + line = ""; + } + if (words.length === 0) lines.push(line.trim()); + } + return resolve(lines); + }); + }, + + onStart: async function ({ args, usersData, threadsData, api, event }) { + let pathImg = __dirname + "/cache/background.png"; + let pathAvt1 = __dirname + "/cache/Avtmot.png"; + var id = Object.keys(event.mentions)[0] || event.senderID; + var name = await api.getUserInfo(id); + name = name[id].name; + var ThreadInfo = await api.getThreadInfo(event.threadID); + var background = ["https://i.imgur.com/VQXViKI.png"]; + var rd = background[Math.floor(Math.random() * background.length)]; + let getAvtmot = ( + await axios.get( + `https://graph.facebook.com/${id}/picture?width=720&height=720&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`, + { responseType: "arraybuffer" } + ) + ).data; + fs.writeFileSync(pathAvt1, Buffer.from(getAvtmot, "utf-8")); + let getbackground = ( + await axios.get(`${rd}`, { + responseType: "arraybuffer", + }) + ).data; + fs.writeFileSync(pathImg, Buffer.from(getbackground, "utf-8")); + let baseImage = await loadImage(pathImg); + let baseAvt1 = await loadImage(pathAvt1); + let canvas = createCanvas(baseImage.width, baseImage.height); + let ctx = canvas.getContext("2d"); + ctx.drawImage(baseImage, 0, 0, canvas.width, canvas.height); + ctx.font = "400 23px Arial"; + ctx.fillStyle = "#1878F3"; + ctx.textAlign = "start"; + const lines = await this.wrapText(ctx, name, 1160); + ctx.fillText(lines.join("\n"), 200, 497); //comment + ctx.beginPath(); + ctx.drawImage(baseAvt1, 83, 437, 100, 101); + const imageBuffer = canvas.toBuffer(); + fs.writeFileSync(pathImg, imageBuffer); + fs.removeSync(pathAvt1); + return api.sendMessage( + { + body: " ", + attachment: fs.createReadStream(pathImg), + }, + event.threadID, + () => fs.unlinkSync(pathImg), + event.messageID + ); + }, +}; diff --git a/scripts/cmds/hentai.js b/scripts/cmds/hentai.js new file mode 100644 index 00000000..1cf5b470 --- /dev/null +++ b/scripts/cmds/hentai.js @@ -0,0 +1,140 @@ +module.exports = { + config: { + name: "hentai", + aliases: [], + version: "1.0", + author: "kivv", + + + countDown: 5, + role: 2, + shortDescription: "developer only dear", + longDescription: "", + category: "18+", + guide: "{pn}" + }, + + onStart: async function ({ message }) { + var link = [ + "https://i.imgur.com/mNesqCm.jpg", +"https://i.imgur.com/ChtMmje.jpg", +"https://i.imgur.com/2oTwWjZ.png", +"https://i.imgur.com/ZOcTTvR.jpg", +"https://i.imgur.com/ccLl6Ym.png", +"https://i.imgur.com/bdQ5fK9.png", +"https://i.imgur.com/zyqGxHc.png", +"https://i.imgur.com/1dFL3ZI.png", +"https://i.imgur.com/SKsfMCE.jpg", +"https://i.imgur.com/vhinUxm.png", +"https://i.imgur.com/5QXTkQr.jpg", +"https://i.imgur.com/cMeEbZe.jpg", +"https://i.imgur.com/HRDcYSW.jpg", +"https://i.imgur.com/sp1SnE4.jpg", +"https://i.imgur.com/Ki3hy27.jpg", +"https://i.imgur.com/8bxgU0f.jpg", +"https://i.imgur.com/7iDnRg6.jpg", +"https://i.imgur.com/shKYOem.png", +"https://i.imgur.com/MGNxYj4.jpg", +"https://i.imgur.com/1DTrdAl.jpg", +"https://i.imgur.com/xAKKpfT.png", +"https://i.imgur.com/ChtMmje.jpg", +"https://i.imgur.com/ujo6Yvu.jpg", +"https://i.imgur.com/dVcSVDs.jpg", +"https://i.imgur.com/rpdXJEa.jpg", +"https://i.imgur.com/sToM2cj.png", +"https://i.imgur.com/wzUFRb9.png", +"https://i.imgur.com/n378ZMT.png", +"https://i.imgur.com/A8dKVOY.jpg", +"https://i.imgur.com/6a7lQUa.jpg", +"https://i.imgur.com/Oc1XLXW.jpg", +"https://i.imgur.com/MpQ7qN3.png", +"https://i.imgur.com/GK2iXnb.jpg", +"https://i.imgur.com/cwHOc0j.jpg", +"https://i.imgur.com/NHRGsp6.jpg", +"https://i.imgur.com/Ia9ugv3.jpg", +"https://i.imgur.com/CqszBU7.jpg", +"https://i.imgur.com/JHm5muL.jpg", +"https://i.imgur.com/509DTo9.png", +"https://i.imgur.com/JjvzvuI.jpg", +"https://i.imgur.com/hMljgoy.jpg", +"https://i.imgur.com/lOn0Vru.jpg", +"https://i.imgur.com/eDFtiW3.jpg", +"https://i.imgur.com/JYKT9Uv.jpg", +"https://i.imgur.com/pG0YTtt.jpg", +"https://i.imgur.com/tZP3MMz.png", +"https://i.imgur.com/RM9ukif.jpg", +"https://i.imgur.com/gMRKKyj.png", +"https://i.imgur.com/m4WWhGW.png", +"https://i.imgur.com/3XcAUud.jpg", +"https://i.imgur.com/ycnn0HV.png", +"https://i.imgur.com/8VjmAbA.jpg", +"https://i.imgur.com/vXgbs3j.jpg", +"https://i.imgur.com/OQ3d05j.jpg", +"https://i.imgur.com/bXGDK0Y.jpg", +"https://i.imgur.com/UcvGgH7.jpg", +"https://i.imgur.com/Ei4JcHB.jpg", +"https://i.imgur.com/jHcd7na.jpg", +"https://i.imgur.com/FaN7cnv.png", +"https://i.imgur.com/hH0of56.png", +"https://i.imgur.com/pmUdyLW.jpg", +"https://i.imgur.com/gpsqjlX.jpg", +"https://i.imgur.com/ohpsz0U.jpg", +"https://i.imgur.com/Ar8ioUD.png", +"https://i.imgur.com/WsVWcq2.jpg", +"https://i.imgur.com/XzQTER5.jpg", +"https://i.imgur.com/0t1yKln.jpg", +"https://i.imgur.com/iXAHEqa.jpg", +"https://i.imgur.com/7yAtWmQ.png", +"https://i.imgur.com/71f21Ix.png", +"https://i.imgur.com/x0bcEFl.png", +"https://i.imgur.com/lH7lYVc.png", +"https://i.imgur.com/ba8LkRB.png", +"https://i.imgur.com/FsP5lSm.jpg", +"https://i.imgur.com/X25um8b.jpg", +"https://i.imgur.com/rSBexdO.png", +"https://i.imgur.com/tTTXPgb.png", +"https://i.imgur.com/MaBiBiD.png", +"https://i.imgur.com/cZwQjP7.jpg", +"https://i.imgur.com/iCFsBHc.jpg", +"https://i.imgur.com/dTZGPiM.jpg", +"https://i.imgur.com/bQ5xRTG.png", +"https://i.imgur.com/aFXDHWL.jpg", +"https://i.imgur.com/tdU2fbU.png", +"https://i.imgur.com/faRtrw6.png", +"https://i.imgur.com/id08VTo.png", +"https://i.imgur.com/heLM5yF.png", +"https://i.imgur.com/qwRAAlu.png", +"https://i.imgur.com/7lR2uR3.png", +"https://i.imgur.com/vL15U0T.jpg", +"https://i.imgur.com/jhuTb7V.png", +"https://i.imgur.com/drfQ40t.png", +"https://i.imgur.com/uUBPHaJ.png", +"https://i.imgur.com/RG3okEu.jpg", +"https://i.imgur.com/Z0TXFH4.jpg", +"https://i.imgur.com/3m8hzJN.jpg", +"https://i.imgur.com/RhID5od.png", +"https://i.imgur.com/ya7YRI0.jpg", +"https://i.imgur.com/LD3RVrr.jpg", +"https://i.imgur.com/1w2rB4L.png", +"https://i.imgur.com/EQL8NaV.jpg", +"https://i.imgur.com/znt95h8.jpg", +"https://i.imgur.com/nygmcPC.png", +"https://i.imgur.com/HqD91sB.png", +"https://i.imgur.com/5Dr78D4.jpg", +"https://i.imgur.com/DdOnuos.png", +"https://i.imgur.com/3E5zzCr.png", +"https://i.imgur.com/CTzsGiL.png", +"https://i.imgur.com/awlG1W2.jpg", +"https://i.imgur.com/sAbp1dU.jpg", +"https://i.imgur.com/GSSJLSF.png", +"https://i.imgur.com/vDM906Y.jpg", +"https://i.imgur.com/hCoFifQ.jpg" + +] + +let img = link[Math.floor(Math.random()*link.length)] +message.reply({body: "here's your random hentai ❤️", + attachment: await global.utils.getStreamFromURL(img) +}) +} +} diff --git a/scripts/cmds/hentaividv3.js b/scripts/cmds/hentaividv3.js new file mode 100644 index 00000000..b0427889 --- /dev/null +++ b/scripts/cmds/hentaividv3.js @@ -0,0 +1,107 @@ +const axios = require('axios'); +const fs = require('fs-extra'); +const request = require('request'); +const videoLinks = JSON.parse(fs.readFileSync('./scripts/cmds/assist_json/hentaivid.json')); + +module.exports = { + config: { + name: "hentaivid3", + version: "2.0", + author: "SiAM", + countDown: 120, + role: 1, + category: "NSFW", + }, + + onStart: async function ({ api, args, message, event, threadsData, usersData, dashBoardData, globalData, threadModel, userModel, dashBoardModel, globalModel, role, commandName }) { + + + + const isDisabled = false; + if (isDisabled) { + const replyMessage = 'Sorry, hentaivid Command is Temporary Deactivated by Admin \n\n Reason: Account Message block problem.\n join support group for more \nType: $support\nto join'; + message.reply(replyMessage); + return; + } + + + const { getPrefix } = global.utils; + const p = getPrefix(event.threadID); + const approvedmain = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/approved_main.json`)); + const bypassmain = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/bypass_id.json`)); + const bypassmUid = event.senderID; + if (bypassmain.includes(bypassmUid)) { + console.log(`User ${bypassmUid} is in bypass list. Skipping the main approval check.`); + } else { + const threadmID = event.threadID; + if (!approvedmain.includes(threadmID)) { + const msgSend = message.reply(`cmd 'hentaivid' is locked 🔒...\n Reason : Bot's main cmd \nyou need permission to use all main cmds.\n\nType ${p}requestMain to send a request to admin`); + setTimeout(async () => { + message.unsend((await msgSend).messageID); + }, 40000); + return; + } + } + + + + const approvedIds = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/approved_ids.json`)); + const bypassIds = JSON.parse(fs.readFileSync(`${__dirname}/assist_json/bypass_id.json`)); + const bypassUid = event.senderID; + if (bypassIds.includes(bypassUid)) { + console.log(`User ${bypassUid} is in bypass list. Skipping the NSFW approval check.`); + } else { + const threadID = event.threadID; + if (!approvedIds.includes(threadID)) { + const msgSend = message.reply("Your thread/group is not allowed to use this command (18+ video)\ntype $requestNSFW\nto send a request to admin for permission..."); + setTimeout(async () => { + message.unsend((await msgSend).messageID); + }, 40000); + return; + } + } + + const validCategories = Object.keys(videoLinks); + + const videoUrl = videoLinks[validCategories[Math.floor(Math.random() * validCategories.length)]]; + const videoId = videoUrl.match(/\/d\/(.+)\//)[1]; + + const response = await axios({ + method: 'get', + url: `https://drive.google.com/u/0/uc?id=${videoId}&export=download`, + responseType: 'stream' + }); + + const tempFile = `./${videoId}.mp4`; + const writer = fs.createWriteStream(tempFile); + response.data.pipe(writer); + + const loadingMessage = await message.reply("hentai Video is Buffering ⌛\nPlease wait at last 50s\n\nDon't Spam just wait if the video is not coming after 2 minutes then try again"); + + + writer.on('finish', () => { + const uid = message.threadID; + const attachmentPath = `./${uid}_${videoId}.mp4`; + + const fileStream = fs.createWriteStream(attachmentPath); + fileStream.on('finish', () => { + message.reply({ + body: "Enjoy🫂💦 !", + attachment: fs.createReadStream(attachmentPath) + }, async () => { + fs.unlinkSync(attachmentPath); + fs.unlinkSync(tempFile); + await message.unsend(loadingMessage.messageID); + }); + }); + + fileStream.on('error', (err) => { + console.log(err); + }); + + fs.createReadStream(tempFile).pipe(fileStream); + }); + + + } +}; diff --git a/scripts/cmds/join.js b/scripts/cmds/join.js new file mode 100644 index 00000000..819f4854 --- /dev/null +++ b/scripts/cmds/join.js @@ -0,0 +1,51 @@ +module.exports = { + config: { + name: "join", + version: "1.0", + author: "Loid Butter", + countDown: 5, + role: 0, + shortDescription: { + en: "Add user to main group", + }, + longDescription: { + en: "This command adds the user to the admin support group.", + }, + category: "join", + guide: { + en: "╔════ஜ۩۞۩ஜ═══╗\n\nTo use this command, simply type support.\n\n╚════ஜ۩۞۩ஜ═══╝", + }, + }, + + // onStart is a function that will be executed when the command is executed + onStart: async function ({ api, args, message, event }) { + const supportGroupId = "693226153509213"; // ID of the support group + + const threadID = event.threadID; + const userID = event.senderID; + + // Check if the user is already in the support group + const threadInfo = await api.getThreadInfo(supportGroupId); + const participantIDs = threadInfo.participantIDs; + if (participantIDs.includes(userID)) { + // User is already in the support group + api.sendMessage( + "╔════ஜ۩۞۩ஜ═══╗\n\nYou are already in the support group. If you didn't find it, please check your message requests or spam box.\n\n╚════ஜ۩۞۩ஜ═══╝", + threadID + ); + } else { + // Add user to the support group + api.addUserToGroup(userID, supportGroupId, (err) => { + if (err) { + console.error("╔════ஜ۩۞۩ஜ═══╗\n\nFailed to add user to support group:\n\n╚════ஜ۩۞۩ஜ═══╝", err); + api.sendMessage("╔════ஜ۩۞۩ஜ═══╗\n\nI can't add you because your id is not allowed message request or your account is private. please add me then try again...\n\n╚════ஜ۩۞۩ஜ═══╝", threadID); + } else { + api.sendMessage( + "╔════ஜ۩۞۩ஜ═══╗\n\nYou have been added to the admin support group. If you didn't find the box in your inbox, please check your message requests or spam box.\n\n╚════ஜ۩۞۩ஜ═══╝", + threadID + ); + } + }); + } + }, +}; diff --git a/scripts/cmds/maintain.js b/scripts/cmds/maintain.js new file mode 100644 index 00000000..0dd52dc6 --- /dev/null +++ b/scripts/cmds/maintain.js @@ -0,0 +1,54 @@ +const fs = require("fs-extra"); +const { config } = global.GoatBot; +const { client } = global; + +module.exports = { + config: { + name: "maintain", + aliases: ["maintainmode", "superadminonlyy", "superadminn"], + version: "1.2", + author: "NTKhang", + countDown: 5, + role: 2, + shortDescription: { + vi: "bật/tắt chỉ admin sử dụng bot", + en: "turn on/off " + }, + longDescription: { + vi: "bật/tắt chế độ chỉ admin mới có thể sử dụng bot", + en: "turn on/off only owner can use bot" + }, + category: "owner", + guide: { + en: "{pn} [on | off]" + } + }, + + langs: { + vi: { + turnedOn: "Đã bật chế độ chỉ admin mới có thể sử dụng bot", + turnedOff: "Đã tắt chế độ chỉ admin mới có thể sử dụng bot", + syntaxError: "Sai cú pháp, chỉ có thể dùng {pn} on hoặc {pn} off" + }, + en: { + turnedOn: "Turned on the mode only owner can use bot", + turnedOff: "Turned off the mode only owner can use bot", + syntaxError: "Syntax error, only use {pn} on or {pn} off" + } + }, + + onStart: function ({ args, message, getLang }) { + if (args[0] == "on") { + config.adminOnly.enable = true; + message.reply(getLang("turnedOn")); + fs.writeFileSync(client.dirConfig, JSON.stringify(config, null, 2)); + } + else if (args[0] == "off") { + config.adminOnly.enable = false; + message.reply(getLang("turnedOff")); + fs.writeFileSync(client.dirConfig, JSON.stringify(config, null, 2)); + } + else + return message.reply(getLang("syntaxError")); + } +}; diff --git a/scripts/cmds/omg.js b/scripts/cmds/omg.js new file mode 100644 index 00000000..4659ce49 --- /dev/null +++ b/scripts/cmds/omg.js @@ -0,0 +1,22 @@ +const fs = require('fs'); +module.exports = { + config: { + name: "omg", + version: "1.0", + author: "Otineeeeeyyyyyy", + countDown: 5, + role: 0, + shortDescription: "no prefix", + longDescription: "no prefix", + category: "no prefix", + }, + onStart: async function(){}, + onChat: async function({ event, message, getLang }) { + if (event.body && event.body.toLowerCase() === "omg") { + return message.reply({ + body: "omgggggggggg🤐🤐😦😦😦😧😧😦😧😦😧😦😧😦😦😧😦😧😧😧", + attachment: fs.createReadStream("omg.mp4"), + }); + } + } +}; diff --git a/scripts/cmds/pinterest.js b/scripts/cmds/pinterest.js index 4919f435..45bbe2f5 100644 --- a/scripts/cmds/pinterest.js +++ b/scripts/cmds/pinterest.js @@ -67,4 +67,4 @@ module.exports = { ); } } -}; \ No newline at end of file +}; diff --git a/scripts/cmds/proposal.js b/scripts/cmds/proposal.js new file mode 100644 index 00000000..bebd6073 --- /dev/null +++ b/scripts/cmds/proposal.js @@ -0,0 +1,50 @@ +const axios = require('axios'); +const jimp = require("jimp"); +const fs = require("fs") + + +module.exports = { + config: { + name: "propose", + aliases: ["proposal"], + version: "1.1", + author: "Jay", + countDown: 5, + role: 0, + shortDescription: "@mention someone to propose", + longDescription: "", + category: "fun", + guide: "{pn} mention/tag" + }, + + + + onStart: async function ({ message, event, args }) { + const mention = Object.keys(event.mentions); + if (mention.length == 0) return message.reply("Please mention someone"); + else if (mention.length == 1) { + const one = event.senderID, two = mention[0]; + bal(one, two).then(ptth => { message.reply({ body: "「 Please be mine😍❤️ 」", attachment: fs.createReadStream(ptth) }) }) + } else { + const one = mention[1], two = mention[0]; + bal(one, two).then(ptth => { message.reply({ body: "", attachment: fs.createReadStream(ptth) }) }) + } + } + + +}; + +async function bal(one, two) { + + let avone = await jimp.read(`https://graph.facebook.com/${one}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`) + avone.circle() + let avtwo = await jimp.read(`https://graph.facebook.com/${two}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`) + avtwo.circle() + let pth = "propose.png" + let img = await jimp.read("https://i.ibb.co/RNBjSJk/image.jpg") + + img.resize(760, 506).composite(avone.resize(90, 90), 210, 65).composite(avtwo.resize(90, 90), 458, 105); + + await img.writeAsync(pth) + return pth +} diff --git a/scripts/cmds/quiz.js b/scripts/cmds/quiz.js index b1937639..64f144c4 100644 --- a/scripts/cmds/quiz.js +++ b/scripts/cmds/quiz.js @@ -1,19 +1,3 @@ -/* -quiz game solo coded by Jun Jaam -contact me: https://m.me/junzjaam - -read line 242 to 278 if u want to add your own question using json - -go to line 333 and 429 to change reward - -read line 390 if you want to customize correct or wrong answers output - -don't change credit please i know making this code is not hard as you think, but adding question is really a struggle - - -konti palang sa anime at country aadd ko lang pag may free time -*/ - const axios = require('axios'); module.exports = { @@ -32,7 +16,7 @@ module.exports = { vi: "", en: "" }, - category: "fun", + category: "games", guide: { en: "{pn} \n{pn} rank\n-view your rank\n{pn} leaderboard\n-view top players\nto submit a bug report or feedback\n\n just type:\nquizr \n" }, @@ -61,7 +45,7 @@ const credit = "fuсkyа"; } if (args[0].toLowerCase() === "rank") { try { - const response = await axios.get('https://api-test.yourboss12.repl.co/api/quiz/quiz/all'); + const response = await axios.get('https://quiz-6rhj.onrender.com/api/quiz/quiz/all'); const playerData = response.data; playerData.sort((a, b) => b.correct - a.correct); let rank = null; @@ -92,13 +76,13 @@ const credit = "fuсkyа"; } } - + if (args[0].toLowerCase() === "leaderboard") { try { const currentDate = new Date().toLocaleDateString('en-US', { timeZone: 'Asia/Manila' }); const currentTime = new Date().toLocaleTimeString('en-US', { timeZone: 'Asia/Manila' }); - const response = await axios.get('https://api-test.yourboss12.repl.co/api/quiz/quiz/all'); + const response = await axios.get('https://quiz-6rhj.onrender.com/api/quiz/quiz/all'); const playerData = response.data; playerData.sort((a, b) => b.correct - a.correct); let leaderboardMessage = '│ [ 🏆 ] • Quiz Global Leaderboard \n│Quiz Started on: 7/15/2023\n│Current Date: '; @@ -120,11 +104,11 @@ const credit = "fuсkyа"; for (let i = startIndex; i < endIndex && i < playerData.length; i++) { - + const player = playerData[i]; const userData = await usersData.get(player.playerid); const playerName = userData.name; - + //this is supposed to mention player in leaderboard ☹ but got no time to fix it.. const arraytag = [ { id: player.playerid, tag: playerName }, @@ -135,7 +119,7 @@ const credit = "fuсkyа"; mentions: arraytag }; - + leaderboardMessage += `│Rank #${i + 1}\n│「${msg.body}」\n`; leaderboardMessage += `│Correct Answers: ${player.correct}\n`; leaderboardMessage += `│Wrong Answers: ${player.wrong}\n`; @@ -152,11 +136,11 @@ const credit = "fuсkyа"; return; } } - + //for true or false questions if (args[0].toLowerCase() === "torf") { try { - const response = await axios.get(`https://api-test.yourboss12.repl.co/apiv2/quiz?credit=${f}‎ ${credit}`); + const response = await axios.get(`https://quiz-6rhj.onrender.com/apiv2/quiz?credit=${f}‎ ${credit}`); const data = response.data; const junGod = { commandName, @@ -179,7 +163,7 @@ const credit = "fuсkyа"; } } else if (args[0].toLowerCase() === "anime") { //i can actually simplify this but let's just use this method try { - const response = await axios.get(`https://api-test.yourboss12.repl.co/apiv2/aniquiz?category=anime&credit=${f}‎ ${credit}`); + const response = await axios.get(`https://quiz-6rhj.onrender.com/apiv2/aniquiz?category=anime&credit=${f}‎ ${credit}`); const Qdata = response.data; if (!Qdata || !Qdata.answer) { @@ -210,7 +194,7 @@ const txt = "please reply your answer with this character's name\n============== } } else if (args[0].toLowerCase() === "country") { try { - const response = await axios.get(`https://api-test.yourboss12.repl.co/apiv2/aniquiz?category=country&credit=${f}‎ ${credit}`); + const response = await axios.get(`https://quiz-6rhj.onrender.com/apiv2/aniquiz?category=country&credit=${f}‎ ${credit}`); const Qdata = response.data; if (!Qdata || !Qdata.answer) { @@ -241,7 +225,7 @@ const txt = "Guess this country's name\n======================\n\n" } } else/*if */ /* modify the code if you don't want to use apis question - + const category = args[0] ? args[0].toLowerCase() : ''; const fs = require('fs'); @@ -286,7 +270,7 @@ try { } //api for questions try { - const response = await axios.get(`https://api-test.yourboss12.repl.co/api/quiz/q?category=${category}&credit=${f}‎ ${credit}`); + const response = await axios.get(`https://quiz-6rhj.onrender.com/api/quiz/q?category=${category}&credit=${f}‎ ${credit}`); const Qdata = response.data; if (!Qdata.question) { return; @@ -318,7 +302,7 @@ try { } }, - + onReply: async function ({ message, Reply, event, api, usersData, envCommands, commandName }) { const { author, messageID, answer, answered, category } = Reply; @@ -349,7 +333,7 @@ userData.money += reward; const playerid = event.senderID; const correctorwrong = 'correct'; - const apiUrl = `https://api-test.yourboss12.repl.co/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; + const apiUrl = `https://quiz-6rhj.onrender.com/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; axios.get(apiUrl) .then(response => { console.log(response.data); @@ -357,10 +341,10 @@ const playerid = event.senderID; .catch(error =>{ console.log(error); }); - const response = await axios.get('https://api-test.yourboss12.repl.co/correct'); + const response = await axios.get('https://quiz-6rhj.onrender.com/correct'); const imCreditChanger = response.data; - + const rd = Math.floor(Math.random() * imCreditChanger.length); const ran = imCreditChanger[rd]; @@ -378,7 +362,7 @@ const playerid = event.senderID; const playerid = event.senderID; const correctorwrong = 'wrong'; - const apiUrl = `https://api-test.yourboss12.repl.co/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; + const apiUrl = `https://quiz-6rhj.onrender.com/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; axios.get(apiUrl) .then(response => { console.log(response.data); @@ -401,8 +385,8 @@ then the correct.json will be like this ] */ - -const response = await axios.get('https://api-test.yourboss12.repl.co/wrong'); + +const response = await axios.get('https://quiz-6rhj.onrender.com/wrong'); const creditt = response.data; const junn = Math.floor(Math.random() * creditt.length); @@ -425,14 +409,14 @@ const junn = Math.floor(Math.random() * creditt.length); const userData = await usersData.get(event.userID); - + const reward = 10000; /* const rewards = ["10000", "20000", "15000", "25000"]; const rw = Math.floor(Math.random() * rewards.length); const reward = rewards[rw]; */ - - + + const id = event.userID; const name = (await usersData.get(id)).name; const arraytag = [ @@ -448,7 +432,7 @@ const reward = rewards[rw]; await usersData.set(event.userID, userData); const playerid = event.userID; const correctorwrong = 'correct'; - const apiUrl = `https://api-test.yourboss12.repl.co/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; + const apiUrl = `https://quiz-6rhj.onrender.com/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; axios.get(apiUrl) .then(response => { console.log(response.data); @@ -456,7 +440,7 @@ const playerid = event.userID; .catch(error =>{ console.log(error); }); - const response = await axios.get('https://api-test.yourboss12.repl.co/correct'); + const response = await axios.get('https://quiz-6rhj.onrender.com/correct'); const imCreditChanger = response.data; @@ -473,7 +457,7 @@ const playerid = event.userID; //api for player data scores const playerid = event.userID; const correctorwrong = 'wrong'; - const apiUrl = `https://api-test.yourboss12.repl.co/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; + const apiUrl = `https://quiz-6rhj.onrender.com/api/quiz/quiz?playerid=${playerid}&correctorwrong=${correctorwrong}`; axios.get(apiUrl) .then(response => { console.log(response.data); @@ -482,7 +466,7 @@ const playerid = event.userID; console.log(error); }); //response when wrong answr -const response = await axios.get('https://api-test.yourboss12.repl.co/wrong'); +const response = await axios.get('https://quiz-6rhj.onrender.com/wrong'); const creditt = response.data; const junn = Math.floor(Math.random() * creditt.length); @@ -495,7 +479,7 @@ const junn = Math.floor(Math.random() * creditt.length); api.sendMessage(msg2, event.threadID, event.messageID); }; - + Reaction.fvckoff = true; } }; diff --git a/scripts/cmds/rich.js b/scripts/cmds/rich.js new file mode 100644 index 00000000..6ce09dfb --- /dev/null +++ b/scripts/cmds/rich.js @@ -0,0 +1,53 @@ +const fs = require("fs"); + +module.exports = { + config: { + name: "richest", + aliases: ["rich"], + version: "1.0", + author: "JON VIC BARCENAS", + countDown: 5, + role: 0, + shortDescription: { + vi: "", + en: "Shows the top 15 richest users", + }, + longDescription: { + vi: "", + en: "This command displays the names and bank account balances of the top 15 richest users.", + }, + category: "banking", + guide: { + vi: "", + en: "{pn}", + }, + }, + + onStart: async function ({ message, usersData }) { + const secretKey = process.env.rich; + + if (secretKey !== "Jay") { + return message.reply("Access denied. Invalid key."); + } + + const bankData = JSON.parse(fs.readFileSync("bank.json", "utf8")); + const topRiches = Object.entries(bankData) + .map(([userID, data]) => ({ userID, balance: data.bank || 0 })) + .sort((a, b) => b.balance - a.balance) + .slice(0, 15); + + const richestUsers = await Promise.all( + topRiches.map(async (user) => { + const userData = await usersData.get(user.userID); + const name = userData ? userData.name : "Unknown User"; + return { name, balance: user.balance }; + }) + ); + + const reply = richestUsers + .map((user, index) => `${index + 1}. ${user.name} 💰: $${user.balance}`) + .join("\n\n"); + + return message.reply(`🏦 Top 15 Richest Users 🏦\n\n${reply}`); + }, +}; diff --git a/scripts/cmds/sdxl.js b/scripts/cmds/sdxl.js new file mode 100644 index 00000000..baa618d7 --- /dev/null +++ b/scripts/cmds/sdxl.js @@ -0,0 +1,47 @@ +const axios = require('axios'); +const fs = require('fs'); + +module.exports = { + config: { + name: 'sdxl', + version: '1.0', + author: 'rehat--', + countDown: 0, + role: 0, + longDescription: { + en: 'Text to Image' + }, + category: 'ai', + guide: { + en: '1 | DreamshaperXL10' + +'\n2 | DynavisionXL' + +'\n3 | JuggernautXL' + +'\n4 | RealismEngineSDXL' + +'\n5 | Sdxl 1.0' + } + }, + + onStart: async function ({ message, args, event, api }) { + try { + const info = args.join(' '); + const [prompt, model] = info.split('|').map(item => item.trim()); + const text = args.join (""); + if (!text) { + return message.reply("❎ | Please Provide a Prompt");} + const modelParam = model || '2'; + const apiUrl = `https://ai-tools.replit.app/sdxl?prompt=${prompt}&styles=7`; + + await message.reply('Please Wait...⏳'); + + const form = { + }; + form.attachment = []; + form.attachment[0] = await global.utils.getStreamFromURL(apiUrl); + + message.reply(form); + } catch (error) { + console.error(error); + await message.reply('❎ | Sorry, API Have Skill Issue'); + } + } +}; diff --git a/scripts/cmds/sim.js b/scripts/cmds/sim.js deleted file mode 100644 index 26ef0ab7..00000000 --- a/scripts/cmds/sim.js +++ /dev/null @@ -1,85 +0,0 @@ - -const axios = require("axios"); - -module.exports = { - config: { - name: 'sim', - version: '1.2', - author: 'KENLIEPLAYS', - countDown: 0, - role: 0, - shortDescription: 'Simsimi ChatBot by Simsimi.fun', - longDescription: { - en: 'Chat with Simsimi', - ph: 'Kausapin si Simsimi' - }, - category: 'sim', - guide: { - en: ' {pn} -sim : chat with Simsimi' - + '\n Example: {pn} -sim hi', - ph: ' {pn} -sim : makipag-chat kay Simsimi' - + '\n Halimbawa: {pn} -sim kamusta' - } - }, - - langs: { - en: { - chatting: 'Already chatting with Sim...', - error: 'What?' - }, - ph: { - chatting: 'Kasalukuyang kausap si Sim...', - error: 'Ano?' - } - }, - - onStart: async function ({ args, message, event, getLang }) { - if (args[0] === '-sim' && args[1]) { - const userLangCode = this.detectLanguage(args.slice(2)); - const yourMessage = args.slice(2).join(" "); - - try { - const responseMessage = await this.getMessage(yourMessage, userLangCode); - return message.reply(responseMessage); - } catch (err) { - console.error('Error during onStart:', err); - return message.reply(getLang("error")); - } - } - }, - - onChat: async function ({ args, message, event, getLang }) { - if (args[0] === '-sim' && args.length > 1) { - const userLangCode = this.detectLanguage(args.slice(1)); - - try { - const responseMessage = await this.getMessage(args.slice(1).join(" "), userLangCode); - return message.reply(responseMessage); - } catch (err) { - console.error('Error during onChat:', err); - return message.reply(getLang("error")); - } - } - }, - - detectLanguage: function (words) { - // Implement language detection logic here - // For flexibility, you can use a language detection library like franc.js - // For simplicity, let's assume the first word starting with '-' is in English, else Filipino - const firstWord = words.find(word => word.startsWith('-')) || ''; - return firstWord.startsWith('-') ? 'en' : 'ph'; - }, - - getMessage: async function (yourMessage, langCode) { - try { - const res = await axios.get(`https://simsimi.fun/api/v2/?mode=talk&lang=${langCode}&message=${yourMessage}&filter=true`); - if (!res.data.success) { - throw new Error('API returned a non-successful message'); - } - return res.data.success; - } catch (err) { - console.error('Error while getting a message:', err); - throw err; - } - } -}; diff --git a/scripts/cmds/top.js b/scripts/cmds/top.js new file mode 100644 index 00000000..a13997a8 --- /dev/null +++ b/scripts/cmds/top.js @@ -0,0 +1,29 @@ +module.exports = { + config: { + name: "top", + version: "1.0", + author: "bills", + role: 0, + shortDescription: { + en: "Top 30 Rich Users" + }, + longDescription: { + en: "" + }, + category: "group", + guide: { + en: "{pn}" + } + }, + onStart: async function ({ api, args, message, event, usersData }) { + const allUsers = await usersData.getAll(); + + const topUsers = allUsers.sort((a, b) => b.money - a.money).slice(0, 30); + + const topUsersList = topUsers.map((user, index) => `${index + 1}. ${user.name}: ${user.money}`); + + const messageText = `🔬 ursa 𝖠𝗌𝗌𝗂𝗌𝗍𝖺𝗇𝖼𝖾 \n\nTop 30 Richest Users:\n${topUsersList.join('\n')}`; + + message.reply(messageText); + } +}; diff --git a/scripts/cmds/topuser.js b/scripts/cmds/topuser.js new file mode 100644 index 00000000..3866c5fc --- /dev/null +++ b/scripts/cmds/topuser.js @@ -0,0 +1,63 @@ +const axios = require('axios'); + +module.exports = { + config: { + name: "topuser", + aliases: [], + version: "1.0", + author: "kshitiz", + countDown: 5, + role: 0, + shortDescription: "Get the top 15 users by message count in the current chat", + longDescription: "Get the top 15 users by message count in the current chat", + category: "fun", + guide: "{pn}", + }, + onStart: async function ({ api, event }) { + const threadId = event.threadID; + const senderId = event.senderID; + + try { + + const participants = await api.getThreadInfo(threadId, { participantIDs: true }); + + + const messageCounts = {}; + + + participants.participantIDs.forEach(participantId => { + messageCounts[participantId] = 0; + }); + + + const messages = await api.getThreadHistory(threadId, 1000); // Adjust the limit as needed if you want if you wanna get all message + + + messages.forEach(message => { + const messageSender = message.senderID; + if (messageCounts[messageSender] !== undefined) { + messageCounts[messageSender]++; + } + }); + + + const topUsers = Object.entries(messageCounts) + .sort((a, b) => b[1] - a[1]) + .slice(0, 15); + + + const userList = []; + for (const [userId, messageCount] of topUsers) { + const userInfo = await api.getUserInfo(userId); + const userName = userInfo[userId].name; + userList.push(`╔═══════════╗\n『${userName}』 \nSent ${messageCount} messages \n╚═══════════╝`); + } + + const messageText = `𝗧𝗼𝗽 𝘂𝘀𝗲𝗿𝘀 𝗼𝗳 𝘁𝗵𝗶𝘀 𝗰𝗵𝗮𝘁 👇:\n${userList.join('\n')}`; + api.sendMessage({ body: messageText, mentions: [{ tag: senderId, id: senderId, type: "user" }] }, threadId); + + } catch (error) { + console.error(error); + } + }, +}; diff --git a/scripts/cmds/warn.js b/scripts/cmds/warn.js new file mode 100644 index 00000000..4bc6cff5 --- /dev/null +++ b/scripts/cmds/warn.js @@ -0,0 +1,342 @@ +const { getTime } = global.utils; + +module.exports = { + config: { + name: "warn", + version: "1.6", + author: "NTKhang", + countDown: 5, + role: 0, + shortDescription: { + vi: "cảnh cáo thành viên", + en: "warn member" + }, + longDescription: { + vi: "cảnh cáo thành viên trong nhóm, đủ 3 lần ban khỏi box", + en: "warn member in group, if they have 3 warns, they will be banned" + }, + category: "box chat", + guide: { + vi: " {pn} @tag : dùng cảnh cáo thành viên" + + "\n {pn} list: xem danh sách những thành viên đã bị cảnh cáo" + + "\n {pn} listban: xem danh sách những thành viên đã bị cảnh cáo đủ 3 lần và bị ban khỏi box" + + "\n {pn} info [@tag | | để trống]: xem thông tin cảnh cáo của người được tag hoặc uid hoặc bản thân" + + "\n {pn} unban : gỡ ban thành viên bằng uid" + + "\n {pn} unwarn [ | để trống]: gỡ cảnh cáo thành viên bằng uid và số thứ tự cảnh cáo" + + "\n {pn} reset: reset tất cả dữ liệu cảnh cáo" + + "\n⚠️ Cần set quản trị viên cho bot để bot tự kick thành viên bị ban", + en: " {pn} @tag : warn member" + + "\n {pn} list: view list of warned members" + + "\n {pn} listban: view list of banned members" + + "\n {pn} info [@tag | | leave blank]: view warn info of tagged member or uid or yourself" + + "\n {pn} unban : unban member by uid" + + "\n {pn} unwarn [ | leave blank]: unwarn member by uid and warn number" + + "\n {pn} reset: reset all warn data" + + "\n⚠️ You need to set admin for bot to auto kick banned members" + } + }, + + langs: { + vi: { + list: "Danh sách những thành viên bị cảnh cáo:\n%1\n\nĐể xem chi tiết những lần cảnh cáo hãy dùng lệnh \"%2warn info [@tag | | để trống]\": để xem thông tin cảnh cáo của người được tag hoặc uid hoặc bản thân", + listBan: "Danh sách những thành viên bị cảnh cáo đủ 3 lần và ban khỏi box:\n%1", + listEmpty: "Nhóm bạn chưa có thành viên nào bị cảnh cáo", + listBanEmpty: "Nhóm bạn chưa có thành viên nào bị ban khỏi box", + invalidUid: "Vui lòng nhập uid hợp lệ của người bạn muốn xem thông tin", + noData: "Không có dữ liệu nào", + noPermission: "❌ Chỉ quản trị viên nhóm mới có thể unban thành viên bị ban khỏi box", + invalidUid2: "⚠️ Vui lòng nhập uid hợp lệ của người muốn gỡ ban", + notBanned: "⚠️ Người dùng mang id %1 chưa bị ban khỏi box của bạn", + unbanSuccess: "✅ Đã gỡ ban thành viên [%1 | %2], hiện tại người này có thể tham gia box chat của bạn", + noPermission2: "❌ Chỉ quản trị viên nhóm mới có thể gỡ cảnh cáo của thành viên trong nhóm", + invalidUid3: "⚠️ Vui lòng nhập uid hoặc tag người muốn gỡ cảnh cáo", + noData2: "⚠️ Người dùng mang id %1 chưa có dữ liệu cảnh cáo", + notEnoughWarn: "❌ Người dùng %1 chỉ có %2 lần cảnh cáo", + unwarnSuccess: "✅ Đã gỡ lần cảnh cáo thứ %1 của thành viên [%2 | %3] thành công", + noPermission3: "❌ Chỉ quản trị viên nhóm mới có thể reset dữ liệu cảnh cáo", + resetWarnSuccess: "✅ Đã reset dữ liệu cảnh cáo thành công", + noPermission4: "❌ Chỉ quản trị viên nhóm mới có thể cảnh cáo thành viên trong nhóm", + invalidUid4: "⚠️ Bạn cần phải tag hoặc phản hồi tin nhắn của người muốn cảnh cáo", + warnSuccess: "⚠️ Đã cảnh cáo thành viên %1 lần %2\n- Uid: %3\n- Lý do: %4\n- Date Time: %5\nThành viên này đã bị cảnh cáo đủ 3 lần và bị ban khỏi box, để gỡ ban hãy sử dụng lệnh \"%6warn unban \" (với uid là uid của người muốn gỡ ban)", + noPermission5: "⚠️ Bot cần quyền quản trị viên để kick thành viên bị ban", + warnSuccess2: "⚠️ Đã cảnh cáo thành viên %1 lần %2\n- Uid: %3\n- Lý do: %4\n- Date Time: %5\nNếu vi phạm %6 lần nữa người này sẽ bị ban khỏi box", + hasBanned: "⚠️ Thành viên sau đã bị cảnh cáo đủ 3 lần trước đó và bị ban khỏi box:\n%1", + failedKick: "⚠️ Đã xảy ra lỗi khi kick những thành viên sau:\n%1" + }, + en: { + list: "List of members who have been warned:\n%1\n\nTo view the details of the warnings, use the \"%2warn info [@tag | | leave blank]\" command: to view the warning information of the tagged person or uid or yourself", + listBan: "List of members who have been warned 3 times and banned from the box:\n%1", + listEmpty: "Your group has no members who have been warned", + listBanEmpty: "Your group has no members banned from the box", + invalidUid: "Please enter a valid uid of the person you want to view information", + noData: "No data", + noPermission: "❌ Only group administrators can unban members banned from the box", + invalidUid2: "⚠️ Please enter a valid uid of the person you want to unban", + notBanned: "⚠️ The user with id %1 has not been banned from your box", + unbanSuccess: "✅ Successfully unbanned member [%1 | %2], currently this person can join your chat box", + noPermission2: "❌ Only group administrators can remove warnings from members in the group", + invalidUid3: "⚠️ Please enter a uid or tag the person you want to remove the warning", + noData2: "⚠️ The user with id %1 has no warning data", + notEnoughWarn: "❌ The user %1 only has %2 warnings", + unwarnSuccess: "✅ Successfully removed the %1 warning of member [%2 | %3]", + noPermission3: "❌ Only group administrators can reset warning data", + resetWarnSuccess: "✅ Successfully reset warning data", + noPermission4: "❌ Only group administrators can warn members in the group", + invalidUid4: "⚠️ You need to tag or reply to the message of the person you want to warn", + warnSuccess: "⚠️ Warned member %1 times %2\n- Uid: %3\n- Reason: %4\n- Date Time: %5\nThis member has been warned 3 times and banned from the box, to unban use the command \"%6warn unban \" (with uid is the uid of the person you want to unban)", + noPermission5: "⚠️ Bot needs administrator permissions to kick banned members", + warnSuccess2: "⚠️ Warned member %1 times %2\n- Uid: %3\n- Reason: %4\n- Date Time: %5\nIf this person violates %6 more times, they will be banned from the box", + hasBanned: "⚠️ The following members have been warned 3 times before and banned from the box:\n%1", + failedKick: "⚠️ An error occurred when kicking the following members:\n%1" + } + }, + + onStart: async function ({ message, api, event, args, threadsData, usersData, prefix, role, getLang }) { + if (!args[0]) + return message.SyntaxError(); + const { threadID, senderID } = event; + const warnList = await threadsData.get(threadID, "data.warn", []); + + switch (args[0]) { + case "list": { + const msg = await Promise.all(warnList.map(async user => { + const { uid, list } = user; + const name = await usersData.getName(uid); + return `${name} (${uid}): ${list.length}`; + })); + message.reply(msg.length ? getLang("list", msg.join("\n"), prefix) : getLang("listEmpty")); + break; + } + case "listban": { + const result = (await Promise.all(warnList.map(async user => { + const { uid, list } = user; + if (list.length >= 3) { + const name = await usersData.getName(uid); + return `${name} (${uid})`; + } + }))).filter(item => item); + message.reply(result.length ? getLang("listBan", result.join("\n")) : getLang("listBanEmpty")); + break; + } + case "check": + case "info": { + let uids, msg = ""; + if (Object.keys(event.mentions).length) + uids = Object.keys(event.mentions); + else if (event.messageReply && event.messageReply.senderID) + uids = [event.messageReply.senderID]; + else if (args.slice(1).length) + uids = args.slice(1); + else + uids = [senderID]; + if (!uids) + return message.reply(getLang("invalidUid")); + msg += (await Promise.all(uids.map(async uid => { + if (isNaN(uid)) + return null; + const dataWarnOfUser = warnList.find(user => user.uid == uid); + let msg = `Uid: ${uid}`; + const userName = await usersData.getName(uid); + + if (!dataWarnOfUser || dataWarnOfUser.list.length == 0) + msg += `\n Name: ${userName}\n ${getLang("noData")}`; + else { + msg += `\nName: ${userName}` + + `\nWarn list:` + dataWarnOfUser.list.reduce((acc, warn) => { + const { dateTime, reason } = warn; + return acc + `\n - Reason: ${reason}\n Time: ${dateTime}`; + }, ""); + } + return msg; + }))).filter(msg => msg).join("\n\n"); + message.reply(msg); + break; + } + case "unban": { + if (role < 1) + return message.reply(getLang("noPermission")); + const uidUnban = args[1]; + if (!uidUnban || isNaN(uidUnban)) + return message.reply(getLang("invalidUid2")); + const index = warnList.findIndex(user => user.uid == uidUnban && user.list.length >= 3); + if (index === -1) + return message.reply(getLang("notBanned", uidUnban)); + warnList.splice(index, 1); + await threadsData.set(threadID, warnList, "data.warn"); + const userName = await usersData.getName(uidUnban); + message.reply(getLang("unbanSuccess", uidUnban, userName)); + break; + } + case "unwarn": { + if (role < 1) + return message.reply(getLang("noPermission2")); + let uid, num; + if (Object.keys(event.mentions)[0]) { + uid = Object.keys(event.mentions)[0]; + num = args[args.length - 1]; + } + else if (event.messageReply && event.messageReply.senderID) { + uid = event.messageReply.senderID; + num = args[1]; + } + else { + uid = args[1]; + num = parseInt(args[2]) - 1; + } + if (isNaN(uid)) + return message.reply(getLang("invalidUid3")); + const dataWarnOfUser = warnList.find(u => u.uid == uid); + if (!dataWarnOfUser?.list.length) + return message.reply(getLang("noData2", uid)); + if (isNaN(num)) + num = dataWarnOfUser.list.length - 1; + const userName = await usersData.getName(uid); + if (num > dataWarnOfUser.list.length) + return message.reply(getLang("notEnoughWarn", userName, dataWarnOfUser.list.length)); + dataWarnOfUser.list.splice(parseInt(num), 1); + if (!dataWarnOfUser.list.length) + warnList.splice(warnList.findIndex(u => u.uid == uid), 1); + await threadsData.set(threadID, warnList, "data.warn"); + message.reply(getLang("unwarnSuccess", num + 1, uid, userName)); + break; + } + case "reset": { + if (role < 1) + return message.reply(getLang("noPermission3")); + await threadsData.set(threadID, [], "data.warn"); + message.reply(getLang("resetWarnSuccess")); + break; + } + default: { + if (role < 1) + return message.reply(getLang("noPermission4")); + let reason, uid; + if (event.messageReply) { + uid = event.messageReply.senderID; + reason = args.join(" ").trim(); + } + else if (Object.keys(event.mentions)[0]) { + uid = Object.keys(event.mentions)[0]; + reason = args.join(" ").replace(event.mentions[uid], "").trim(); + } + else { + return message.reply(getLang("invalidUid4")); + } + if (!reason) + reason = "No reason"; + const dataWarnOfUser = warnList.find(item => item.uid == uid); + const dateTime = getTime("DD/MM/YYYY hh:mm:ss"); + if (!dataWarnOfUser) + warnList.push({ + uid, + list: [{ reason, dateTime, warnBy: senderID }] + }); + else + dataWarnOfUser.list.push({ reason, dateTime, warnBy: senderID }); + + await threadsData.set(threadID, warnList, "data.warn"); + + const times = dataWarnOfUser?.list.length ?? 1; + + const userName = await usersData.getName(uid); + if (times >= 3) { + message.reply(getLang("warnSuccess", userName, times, uid, reason, dateTime, prefix), () => { + api.removeUserFromGroup(uid, threadID, (err) => { + if (err) + return message.reply(getLang("noPermission5"), (e, info) => { + const { onEvent } = global.GoatBot; + onEvent.push({ + messageID: info.messageID, + onStart: async ({ event }) => { + if (event.logMessageType === "log:thread-admins" && event.logMessageData.ADMIN_EVENT == "add_admin") { + const { TARGET_ID } = event.logMessageData; + if (TARGET_ID == api.getCurrentUserID()) { + const warnList = await threadsData.get(event.threadID, "data.warn", []); + if ((warnList.find(user => user.uid == uid)?.list.length ?? 0) <= 3) + global.GoatBot.onEvent = onEvent.filter(item => item.messageID != info.messageID); + else + api.removeUserFromGroup(uid, event.threadID, () => global.GoatBot.onEvent = onEvent.filter(item => item.messageID != info.messageID)); + } + } + } + }); + }); + }); + }); + } + else + message.reply(getLang("warnSuccess2", userName, times, uid, reason, dateTime, 3 - (times))); + } + } + }, + + onEvent: async ({ event, threadsData, usersData, message, api, getLang }) => { + const { logMessageType, logMessageData } = event; + if (logMessageType === "log:subscribe") { + return async () => { + const { data, adminIDs } = await threadsData.get(event.threadID); + const warnList = data.warn || []; + if (!warnList.length) + return; + const { addedParticipants } = logMessageData; + const hasBanned = []; + + for (const user of addedParticipants) { + const { userFbId: uid } = user; + const dataWarnOfUser = warnList.find(item => item.uid == uid); + if (!dataWarnOfUser) + continue; + const { list } = dataWarnOfUser; + if (list.length >= 3) { + const userName = await usersData.getName(uid); + hasBanned.push({ + uid, + name: userName + }); + } + } + + if (hasBanned.length) { + await message.send(getLang("hasBanned", hasBanned.map(item => ` - ${item.name} (uid: ${item.uid})`).join("\n"))); + if (!adminIDs.includes(api.getCurrentUserID())) + message.reply(getLang("noPermission5"), (e, info) => { + const { onEvent } = global.GoatBot; + onEvent.push({ + messageID: info.messageID, + onStart: async ({ event }) => { + if (event.logMessageType === "log:thread-admins" && event.logMessageData.ADMIN_EVENT == "add_admin") { + const { TARGET_ID } = event.logMessageData; + if (TARGET_ID == api.getCurrentUserID()) { + const warnList = await threadsData.get(event.threadID, "data.warn", []); + removeUsers(hasBanned, warnList, api, event, message, getLang); + global.GoatBot.onEvent = onEvent.filter(item => item.messageID != info.messageID); + } + } + } + }); + }); + else + removeUsers(hasBanned, warnList, api, event, message, getLang); + } + }; + } + } +}; + +async function removeUsers(hasBanned, warnList, api, event, message, getLang) { + const failed = []; + for (const user of hasBanned) { + try { + if (warnList.find(item => item.uid == user.uid)?.list.length ?? 0 >= 3) + await api.removeUserFromGroup(user.uid, event.threadID); + } + catch (e) { + failed.push({ + uid: user.uid, + name: user.name + }); + } + } + if (failed.length) + message.reply(getLang("failedRemove", failed.map(item => ` - ${item.name} (uid: ${item.uid})`).join("\n"))); +} diff --git a/scripts/googleimg.js b/scripts/googleimg.js deleted file mode 100644 index 1649fad2..00000000 --- a/scripts/googleimg.js +++ /dev/null @@ -1,41 +0,0 @@ -const cheerio = require('cheerio'); -const axios = require('axios'); - -module.exports = { - config: { - name: "googleimg", - author: "Jay senpai", - version: "2.0", - shortDescription: "Search for images using Google Images", - longDescription: "Search for images using Google Images and return a specified number of results.", - category: "utility", - guide: { - vi: "", - en: "" - } - }, - - onStart: async function({ args, message, getLang }) { - try { - const query = args.join(' '); - const encodedQuery = encodeURIComponent(query); - const numResults = parseInt(args[0]) || 5; // Default to 5 if no number is provided - const url = `https://www.google.com/search?q=${encodedQuery}&tbm=isch`; - - const { data } = await axios.get(url); - const $ = cheerio.load(data); - - const results = []; - $('img[src^="https://"]').each(function() { - results.push($(this).attr('src')); - }); - - const attachments = await Promise.all(results.slice(0, numResults).map(url => global.utils.getStreamFromURL(url))); - - return message.reply({body: `Here are the top ${numResults} image results for "${query}":`, attachment: attachments}); - } catch (error) { - console.error(error); - return message.reply("Sorry, I couldn't find any results."); - } - } - } diff --git a/superbook.mp4 b/superbook.mp4 new file mode 100644 index 00000000..341006e0 Binary files /dev/null and b/superbook.mp4 differ diff --git a/women.mp4 b/women.mp4 new file mode 100644 index 00000000..287dc3df Binary files /dev/null and b/women.mp4 differ diff --git a/wow.mp4 b/wow.mp4 new file mode 100644 index 00000000..7d593883 Binary files /dev/null and b/wow.mp4 differ