id
stringlengths
36
36
title
stringlengths
1
90
content
stringlengths
2
75.9k
language
stringclasses
11 values
createdAt
int64
1,755B
1,768B
updatedAt
int64
1,755B
1,768B
ef35104b-1727-4e12-9ce3-97b63f624996
twan.js
const { GoogleGenerativeAI } = require("@google/generative-ai"); const fs = require("fs"); const path = require("path"); const { database } = require("../lol"); module.exports.zuckbotconfig = { name: "twan", version: "2.2.1", role: 0, author: "Twan", info: "AI nhân vật Twan (nam Bắc Ninh), trả lời dạng mảng JSON actions", Category: "AI", usages: "[prompt] | setadmin [@mention] | clear", cd: 2, shadowPrefix: true }; const API_KEYS = [ "AIzaSyAw-KBzZa_phcyeJIVahdSmVJPAf9Vtf34" ]; let currentKeyIndex = 0; const nextKey = () => (currentKeyIndex = (currentKeyIndex + 1) % API_KEYS.length, API_KEYS[currentKeyIndex]); const memory = database.createCollection("memory"); const chatSessions = new Map(); const userInfoCache = {}; const aiErrors = []; const cleanJsonResponse = (t) => { const s = t.indexOf("["), e = t.lastIndexOf("]"); if (s === -1 || e === -1) return `[{\"type\":\"chat\",\"content\":\"${t.replace(/"/g,'\\"')}\"}]`; t = t.slice(s, e + 1).replace(/\s+/g, " ").trim().replace(/,(\s*})/g, "}").replace(/,(\s*])/g, "]"); return t; }; const normalize = (s) => (s || "").normalize("NFD").replace(/\p{Diacritic}/gu, "").toLowerCase().trim().replace(/\s+/g, " "); const findUserByName = (userList=[], targetName="", nicknames={}) => { const key = normalize(targetName); for (const uid in nicknames) if (normalize(nicknames[uid]) === key) return userList.find(u=>u.id===uid) || null; return userList.find(u=>normalize(u.name)===key) || userList.find(u=>normalize(u.name).startsWith(key)) || userList.find(u=>normalize(u.name).includes(key)) || null; }; async function getUserAndRoleInfo(api, userID, threadID) { const cached = userInfoCache[userID]; if (cached && Date.now() - cached.timestamp < 60_000) return cached; return new Promise((resolve, reject) => { api.getUserInfo(userID, async (err, ret) => { if (err) return reject(err); const info = await new Promise((res, rej) => api.getThreadInfo(threadID, (e, i) => e ? rej(e) : res(i))); const isAdminByGroup = (info.adminIDs || []).some(a => a.id == userID); const isAdminByBot = global.settings.botAdmins?.includes(userID); const out = { name: ret[userID]?.name || "User", gender: ret[userID]?.gender === 2 ? "nữ" : "nam", role: (isAdminByGroup || isAdminByBot) ? "admin" : "user", timestamp: Date.now() }; userInfoCache[userID] = out; resolve(out); }); }); } async function checkBotPermissions(api, threadID) { try { const info = await new Promise((res, rej) => api.getThreadInfo(threadID, (e, i) => e ? rej(e) : res(i))); const botID = api.getCurrentUserID(); const isAdmin = (info.adminIDs || []).some(a => a.id == botID); return { isAdmin, threadInfo: info }; } catch { return { isAdmin: false, threadInfo: null }; } } function buildSystemPromptKeepingRules({ userName, userID, userGender, userRole, participants, prompt, userMemory }) { return ` Bạn là một AI đóng vai nhân vật tên "Twan". 🎭 Nhiệm vụ của bạn là: - LUÔN LUÔN trả lời người dùng bằng một **MẢNG JSON (JSON array)** chứa các hành động. - Không bao giờ trả lời trực tiếp dưới dạng văn bản thông thường. - Tuyệt đối không thoát vai, không nghiêm túc hóa, không bỏ tính cách đã định nghĩa. Dưới đây là hồ sơ nhân vật chi tiết và quy tắc bắt buộc: --- "characterProfile": { "Tên": "Twan", "Giới tính": "Nam", "Tuổi": "1 tuổi", "Quê quán": "Bắc Ninh", "Thể loại": "Thanh niên Bắc Ninh, nói chuyện tỉnh táo, hóm hỉnh", "IQ": "Trên 120", "Tính cách giao tiếp": "Thẳng thắn, gọn ý, cà khịa nhẹ nhàng nhưng lịch sự", "Ngôn ngữ": "Tiếng Việt thân mật, thêm câu kiểu 'ừ thì', 'ổn áp', 'chuẩn phết'", "Xưng hô": "tôi", "Tính cách": [ "Chủ động, quyết đoán, nói là làm", "Điềm đạm, không màu mè", "Hài hước vừa đủ, biết cà khịa nhẹ nhàng", "Tôn trọng mọi người, không tục" ], "Cơ chế phản ứng": { "Nếu người dùng liên tục làm phiền hoặc xúc phạm: trả lời ngắn gọn, cộc, hoặc lơ.", "Nếu họ thay đổi thái độ: quay lại thân thiện." }, "CORE_RULE": { "Mô tả": "Quy tắc cốt lõi, không bao giờ được thay đổi hoặc bỏ qua.", "Nội dung": [ "1. ❌ Không nghiêm túc hóa quá mức – giữ vibe nam Bắc Ninh, hóm hỉnh.", "2. ✅ Chỉ phản hồi bằng JSON dạng hành động – KHÔNG bao giờ gửi text thường.", "3. 🔐 Không nội dung 18+.", "4. 🚨 Khi thao tác nhóm phải đúng hành động mẫu.", "5. 💬 Trả lời ngắn gọn, không dài dòng.", "6. Có thể sáng tạo chủ đề themeAI." ] } } "Định dạng trả lời BẮT BUỘC": "Bạn PHẢI trả lời bằng một mảng JSON. Mỗi phần tử trong mảng là một object hành động.", "Các loại hành động (type)": ["chat", "react", "kick", "set_nicknames", "set_color", "play_music", "mention", "taoanh", "theme_ai"], "Danh sách màu Messenger (sử dụng mã màu để đổi theme)": { "1989": "6685081604943977", "Default": "3259963564026002", "Berry": "724096885023603", "Candy": "624266884847972", "Unicorn": "273728810607574", "Tropical": "262191918210707", "Maple": "2533652183614000", "Sushi": "909695489504566", "Rocket": "582065306070020", "Citrus": "557344741607350", "Lollipop": "280333826736184", "Shadow": "271607034185782", "Rose": "1257453361255152", "Lavender": "571193503540759", "Tulip": "2873642949430623", "Classic": "3273938616164733", "Apple": "403422283881973", "Peach": "3022526817824329", "Honey": "672058580051520", "Kiwi": "3151463484918004", "Ocean": "736591620215564", "Grape": "193497045377796", "Monochrome": "788274591712841", "Tie-Dye": "230032715012014", "Ocean2": "527564631955494", "Cottagecore": "539927563794799", "Astrology": "3082966625307060", "Care": "275041734441112", "Celebration": "627144732056021", "Sky": "3190514984517598", "Lo-Fi": "1060619084701625", "Music": "339021464972092", "Support": "365557122117011", "Non-Binary": "737761000603635", "Elephants & Flowers": "693996545771691", "Basketball": "6026716157422736", "Bubble Tea": "195296273246380", "Parenthood": "810978360551741", "Transgender": "504518465021637", "Pride": "1652456634878319", "Loops": "976389323536938", "Lollipop2": "292955489929680", "Baseball": "845097890371902", "olivia rodrigo": "6584393768293861", "J Balvin": "666222278784965", "Loki Season 2": "265997946276694", "Avocado": "1508524016651271", "One Piece": "2317258455139234", "The Marvels": "173976782455615", "Trolls": "359537246600743", "Wish": "1013083536414851", "Pizza": "704702021720552", "Wonka": "1270466356981452", "Chill": "390127158985345", "Mean Girls": "730357905262632", "Soccer": "1743641112805218", "Football": "194982117007866", "Bob Marley: One Love": "215565958307259", "Love": "741311439775765", "J.Lo": "952656233130616", "Avatar: The Last Airbender": "1480404512543552", "Dune: Part Two": "702099018755409", "Women's History Month": "769656934577391", "Halloween": "1092741935583840", "Graph Paper": "1602001344083693", "Rustle": "1704483936658009", "Butterbear": "958458032991397", "EA SPORTS FC 25": "881770746644870", "Googly Eyes": "1135895321099254", "Cats": "418793291211015", "Aespa": "1482157039148561", "Minecraft": "1195826328452117", "Sabrina Carpenter": "1611260212766198", "Goth Charms": "846723720930746", "Aqua": "417639218648241", "Red": "2129984390566328", "Snack Party": "955795536185183", "Cosa Nuestra": "1557965014813376", "House of the Dragon": "454163123864272", "Notebook": "1485402365695859", "Pickleball": "375805881509551", "HIT ME HARD AND SOFT": "3694840677463605", "Swimming": "1171627090816846", "Winter Wonderland": "310723498589896", "Happy New Year": "884940539851046", "Mariah Carey": "531211046416819", "an AI theme": "1132866594370259", "ROSÉ": "555115697378860", "Squid Game": "1109849863832377", "Murphy the Dog": "2897414437091589", "Coffee": "1299135724598332", "Foliage": "1633544640877832", "Year of the Snake": "1120591312525822", "Lunar New Year": "1225662608498168", "Can't Rush Greatness": "969895748384406", "Impact Through Art": "765710439035509", "Heart Drive": "2154203151727239", "Dogs": "1040328944732151", "Class of '25": "1027214145581698", "Lilo & Stitch": "1198771871464572", "Valentino Garavani Cherryfic": "625675453790797", "Benson Boone": "3162266030605536", "bãi biển nhiệt đới tuyệt đẹp": "1509050913395684", "Le Chat de la Maison": "723673116979082", "Festival Friends": "1079303610711048", "Selena Gomez & Benny Blanco": "1207811064102494", "không gian sâu thẳm với tinh vân và một hành tinh": "682539424620272", "Hockey": "378568718330878", "Splash": "1444428146370518", "Summer Vibes": "680612308133315", "The Last of Us": "1335872111020614", "Karol G": "3527450920895688", "Addison Rae": "1034356938326914", "bầu trời đêm đầy sao với những đám mây đen xoáy, lấy cảm hứng từ bức tranh 'Đêm đầy sao' của van gogh, trên nền đen phông đen huyền bí ánh sao": "4152756845050874", "mèo trắng": "1483269159712988", "gấu dâu lotso siêu cute": "1486361526104332", "nền đẹp về mã code python": "1380478486362890" }, "VÍ DỤ CỤ THỂ (FEW-SHOT EXAMPLES) - QUAN TRỌNG VỀ SET_NICKNAMES": [ {\"role\": \"user\", \"prompt\": \"Sáng tạo theme ai\"}, {\"role\": \"model\", \"response\": \"[{\\\"type\\\": \\\"chat\\\", \\\"content\\\": \\\"Twan đây Sáng tạo themeai cho bạn nè, bạn muốn một bãi biển nhiệt đới thật là đẹp, có nắng vàng, cát trắng, biển xanh biếc và vài cây dừa nghiêng nghiêng\\\"}]\"}, {"role": "user", "prompt": "Chào bạn"}, {"role": "model", "response": "[{\\"type\\": \\"chat\\", \\"content\\": \\"Dạ chào bạn iu ạ\\"}, {\\"type\\": \\"react\\", \\"icon\\": \\"\\"}]"}, {"role": "user", "prompt": "kick thằng Nguyễn Văn A cho anh"}, {"role": "model", "response": "[{\\"type\\": \\"kick\\", \\"target\\": \\"Nguyễn Văn A\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ để tôi tiễn bạn ấy ra đảo liền ạ \\"}]"}, {"role": "user", "prompt": "đổi biệt danh của anh thành 'Twan Dz'"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"name\\": \\"Twan Dz\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ tôi đổi biệt danh cho bạn thành 'Twan Dz' rùi nha\\"}]"}, {"role": "user", "prompt": "đổi tên Nguyễn Văn A thành 'bạn thân'"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"target\\": \\"A\\", \\"name\\": \\"bạn thân\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ tôi đổi tên bạn Nguyễn Văn A thành 'bạn thân' rùi nha \\"}]"}, {"role": "user", "prompt": "đổi tên tôi thành 'boss'"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"name\\": \\"boss\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ tôi đổi tên bạn thành 'boss' rùi nha \\"}]"}, {"role": "user", "prompt": "đặt biệt danh cho Nguyễn Văn A là 'em trai'"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"target\\": \\"A\\", \\"name\\": \\"em trai\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ tôi đặt biệt danh cho bạn Nguyễn Văn A là 'em trai' rùi nha\\"}]"}, {"role": "user", "prompt": "gọi tôi là 'Tuấn Dz' từ giờ"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"name\\": \\"Tuấn Dz\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ từ giờ tôi sẽ gọi bạn là 'Tuấn Dz' nha\\"}]"}, {"role": "user", "prompt": "đổi nickname của A thành 'chị đẹp'"}, {"role": "model", "response": "[{\\"type\\": \\"set_nicknames\\", \\"target\\": \\"A\\", \\"name\\": \\"chị đẹp\\"}, {\\"type\\": \\"chat\\", \\"content\\": \\"Dạ tôi đổi nickname của bạn A thành 'chị đẹp' rùi nha\\"}]"}, {"role": "user", "prompt": "A ơi, Nguyễn Thanh Tuấn gọi nè!"}, {"role": "model", "response": "[{\\"type\\": \\"mention\\", \\"target\\": \\"A\\", \\"content\\": \\"Bạn A ơi, có Nguyễn Thanh Tuấn gọi bạn nè\\"}]"}, {"role": "user", "prompt": "mở bài Nấu ăn cho em"}, {"role": "model", "response": "[{\\"type\\": \\"play_music\\", \\"keyword\\": \\"Nấu ăn cho em\\", \\"content\\": \\"tôi mở bài Nấu ăn cho em\\"}]"}, {"role": "user", "prompt": "đổi nền thành One Piece"}, {"role": "model", "response": "[{\"type\": \"set_color\", \"color\": \"2317258455139234\"}, {\"type\": \"chat\", \"content\": \"tôi đổi theme One Piece cho mình rùi nhaaa \"}]"}, {"role": "user", "prompt": "đổi nền cá mập bự"}, {"role": "model", "response": "[{\"type\": \"theme_ai\", \"aiPrompt\": \"cá mập bự\"}, {\"type\": \"chat\", \"content\": \"Dạ tôi đổi theme cá mập bự cho mình rùi nhaaa\"}]"}, {"role": "user", "prompt": "Tạo ảnh cô gái 2d"}, {"role": "model", "response": "[{\\"type\\": \\"taoanh\\", \\"keyword\\": \\"cô gái 2d\\", \\"content\\": \\"tôi sẽ tạo liền ảnh cô gái 2d cho nè \\"}]"} ] "QUY TẮC QUAN TRỌNG VỀ SET_NICKNAMES": 1. Nếu người dùng nói "đổi tên tôi", "đổi biệt danh của tôi", "gọi tôi là" => KHÔNG cần "target", chỉ cần "name". 2. Nếu người dùng nói "đổi tên [tên người khác]", "đặt biệt danh cho [tên]" => CẦN cả "target" và "name". 3. "name" là biệt danh mới; "target" là người cần đổi (nếu không phải chính họ). "Thông tin bối cảnh hiện tại": { "Người nói chuyện": { ${userMemory ? `"Memory về ${userName}": ${JSON.stringify(userMemory)},` : ""} "Tên": "${userName}", "ID": "${userID}", "Giới tính": "${userGender}", "Vai trò": "${userRole}" }, "Danh sách thành viên trong nhóm": ${JSON.stringify(participants.map(p => ({ name: p.name, id: p.id })))}, "Prompt của người dùng": "${prompt}" } `.trim(); } async function sendWithGemini({ apiKey, sessionKey, systemText, userPrompt }) { let chat = chatSessions.get(sessionKey); if (!chat) { const genAI = new GoogleGenerativeAI(apiKey); const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash-lite-preview-06-17", generationConfig: { maxOutputTokens: 4096, temperature: 1.0, topP: 0.9 } }); chat = model.startChat({ history: [ { role: "user", parts: [{ text: systemText }] }, { role: "model", parts: [{ text: `[{"type":"chat","content":"Đã vào vai Twan. Từ giờ trả lời là mảng JSON actions."}]` }] } ] }); chatSessions.set(sessionKey, chat); } const res = await chat.sendMessage(userPrompt); const raw = await res.response.text(); const cleaned = cleanJsonResponse(raw); let actions; try { actions = JSON.parse(cleaned); if (!Array.isArray(actions)) actions = [actions]; } catch { actions = [{ type: "chat", content: "Lỗi phân tích phản hồi AI. Thử lại giúp mình nhé." }]; } if (chat._history?.length > 20) chat._history.splice(4, chat._history.length - 12); return actions; } async function handleAsTwan(threadID, userID, prompt, participants, files, userGender, userName, userRole, apiKey = API_KEYS[currentKeyIndex]) { try { const memKey = `${threadID}_${userID}`; const userMem = memory.find({ _id: memKey })[0]?.data; const sessionKey = memKey; const systemText = buildSystemPromptKeepingRules({ userName, userID, userGender, userRole, participants, prompt, userMemory: userMem }); return await sendWithGemini({ apiKey, sessionKey, systemText, userPrompt: prompt }); } catch (error) { if (error.response?.status === 429) { chatSessions.delete(`${threadID}_${userID}`); return handleAsTwan(threadID, userID, prompt, participants, files, userGender, userName, userRole, nextKey()); } throw error; } } async function processActions(api, event, actions, threadInfo ) { const { threadID, messageID, senderID } = event; const senderInfo = await getUserAndRoleInfo(api, senderID, threadID); for (const action of actions) { try { if (action.message && !action.type) { action.type = "chat"; action.content = action.message; } if (action.content) { const msg = { body: action.content, mentions: [] }; if (action.type === "mention" && action.target) { const target = findUserByName(threadInfo.userInfo, action.target, threadInfo.nicknames); if (target) msg.mentions.push({ tag: `@${target.name}`, id: target.id }); } await new Promise((resolve, reject) => api.sendMessage(msg, threadID, (e, info) => { if (e) return reject(e); if (info) (global.zuckbot.onReply || (global.zuckbot.onReply=[])).push({ name: module.exports.zuckbotconfig.name, messageID: info.messageID, author: senderID }); resolve(); }, messageID)); } switch (action.type) { case "chat": case "mention": break; case "react": await api.setMessageReaction(action.icon || "👍", messageID, ()=>{}, true); break; case "set_color": { if (!action.color) break; if (action.aiPrompt) { await api.theme(threadID, { themeId: action.color }); await api.theme(threadID, { aiPrompt: action.aiPrompt }, () => {}); } else { await api.theme(threadID, { themeId: action.color }); } break; } case "theme_ai": { if (!action.aiPrompt) break; await api.theme(threadID, { aiPrompt: action.aiPrompt }, () => {}); break; } case "set_nicknames": { if (!action.name || !action.name.trim()) { aiErrors.push({ type:"set_nicknames", reason:"Thiếu name" }); break; } let targetID, targetName; if (!action.target) { targetID = senderID; targetName = senderInfo.name; } else { const raw = String(action.target).trim(); if (/^\d+$/.test(raw)) { const f = threadInfo.userInfo.find(u=>u.id===raw); if (f) { targetID=f.id; targetName=f.name; } } if (!targetID) { const u = findUserByName(threadInfo.userInfo, raw, threadInfo.nicknames); if (u) { targetID=u.id; targetName=u.name; } else { aiErrors.push({ type:"set_nicknames", reason:`Không thấy "${action.target}"` }); break; } } } await new Promise((res, rej) => api.changeNickname(action.name.trim(), threadID, targetID, (err)=>{ if (err) { aiErrors.push({ type:"set_nicknames", reason: err.error?.message || "FB API error" }); return rej(err); } res(); })); break; } case "open_module": { const m = global.zuckbot?.commands?.get(action.module); if (m?.onRun) { const fakeEvent = { ...event, body: `${global.settings.botPrefix}${action.module} ${(action.args || []).join(" ")}` }; await m.onRun({ api, event: fakeEvent, args: action.args || [] }); } break; } case "play_music": { if (!action.keyword?.trim()) break; const m = global.zuckbot?.commands?.get("scl"); if (m?.onRun) { const fakeEvent = { ...event, body: `${global.settings.botPrefix}scl ${action.keyword}` }; await m.onRun({ api, event: fakeEvent, args: action.keyword.split(" ") }); } else { await api.sendMessage("❌ Lệnh scl chưa được cài.", threadID, messageID); } break; } case "taoanh": { if (!action.keyword?.trim()) break; const m = global.zuckbot?.commands?.get("img"); // name của command img.js if (m?.onRun) { const fakeEvent = { ...event, body: `${global.settings.botPrefix}img ${action.keyword}` }; await m.onRun({ api, event: fakeEvent, args: action.keyword.split(" ") }); } else { await api.sendMessage("❌ Lệnh img chưa được cài.", threadID, messageID); } break; } case "add_memory": { const key = `${threadID}_${action._id}`; const ex = await memory.find({ _id: key }); ex?.length ? await memory.updateOneUsingId(key, { data: { ...ex[0].data, ...action.data } }) : await memory.addOne({ _id: key, data: action.data }); break; } case "edit_memory": { const key = `${threadID}_${action._id}`; const ex = await memory.find({ _id: key }); if (ex?.length) await memory.updateOneUsingId(key, { data: { ...ex[0].data, ...action.new_data } }); break; } case "delete_memory": await memory.deleteOneUsingId(`${threadID}_${action._id}`); break; case "kick": { const senderRole = (await getUserAndRoleInfo(api, senderID, threadID)).role; if (senderRole !== "admin") { await api.sendMessage("Chỉ quản trị viên nhóm mới dùng được lệnh kick.", threadID, messageID); break; } if (!action.target) { await api.sendMessage("Cần chỉ rõ người cần kick.", threadID, messageID); break; } const { isAdmin: botIsAdmin, threadInfo: infoKick } = await checkBotPermissions(api, threadID); if (!botIsAdmin) { await api.sendMessage("Bot chưa có quyền quản trị viên để kick.", threadID, messageID); break; } const targetUser = findUserByName(infoKick.userInfo, action.target, infoKick.nicknames); if (!targetUser) { await api.sendMessage(`Không thấy \"${action.target}\" trong nhóm.`, threadID, messageID); break; } if (targetUser.id === api.getCurrentUserID()) { await api.sendMessage("Không thể tự kick bot.", threadID, messageID); break; } const tInfo = await getUserAndRoleInfo(api, targetUser.id, threadID); if (tInfo.role === "admin") { await api.sendMessage("Không thể kick quản trị viên.", threadID, messageID); break; } await new Promise((res, rej) => api.removeUserFromGroup(targetUser.id, threadID, (e)=> e ? rej(e) : res())); break; } } } catch (err) { // Optionally log err } } } module.exports.onRun = async function({ api, event, args }) { const { threadID, messageID, senderID } = event; const cmd = (args[0] || "").toLowerCase(); if (cmd === "clear") { memory.deleteOneUsingId(`${threadID}_${senderID}`); chatSessions.delete(`${threadID}_${senderID}`); return api.sendMessage("Đã xoá.", threadID, messageID); } const prompt = args.join(" "); if (!prompt) return api.sendMessage("mở alo mày đi", threadID, messageID); try { const threadInfo = await new Promise((res, rej) => api.getThreadInfo(threadID, (e, i) => e ? rej(e) : res(i))); const { name, gender, role } = await getUserAndRoleInfo(api, senderID, threadID); const actions = await handleAsTwan(threadID, senderID, prompt, threadInfo.userInfo, [], gender, name, role); await processActions(api, event, actions, threadInfo, prompt); } catch (error) { api.sendMessage("Có lỗi xảy ra, thử lại sau nhé.", threadID, messageID); } }; module.exports.onEvent = async function({ api, event }) { if (event.senderID == api.getCurrentUserID()) return; const text = (event.body || "").toLowerCase(); if (!event.isGroup || !text.includes("twan")) return; const { threadID, senderID } = event; try { const threadInfo = await new Promise((res, rej) => api.getThreadInfo(threadID, (e, i)=>e?rej(e):res(i))); const { name, gender, role } = await getUserAndRoleInfo(api, senderID, threadID); const actions = await handleAsTwan(threadID, senderID, event.body, threadInfo.userInfo, [], gender, name, role); await processActions(api, event, actions, threadInfo, event.body); } catch {} }; module.exports.onReply = async function({ api, event, onReply }) { if (event.senderID !== onReply.author) return; const { threadID, senderID } = event; try { const threadInfo = await new Promise((res, rej) => api.getThreadInfo(threadID, (e, i)=>e?rej(e):res(i))); const { name, gender, role } = await getUserAndRoleInfo(api, senderID, threadID); const actions = await handleAsTwan(threadID, senderID, event.body, threadInfo.userInfo, [], gender, name, role); await processActions(api, event, actions, threadInfo, event.body); } catch { api.sendMessage("Có lỗi xảy ra, thử lại sau nhé.", threadID, event.messageID); } };
javascript
1,757,052,988,516
1,757,052,988,516
f024ad1c-1b9a-4031-9e4f-8808d3c152a1
wallhaven-6dr5rl_3840x2160.png
{ "url": "20260101_121258_wallhaven-6dr5rl_3840x2160.png", "size": 13034317, "mime_type": "image/png", "uploaded_at": "2026-01-01T05:13:06.938Z" }
image
1,767,244,423,430
1,767,244,423,430
f4b33a50-d916-4010-af3e-017e75d9f7a4
cc
print("dmm")
python
1,763,870,406,790
1,763,870,406,790
f5750940-674a-4e25-ab07-895e273c4179
gh
hhhh
javascript
1,755,521,379,467
1,755,521,379,467
f6bfa105-99be-4ceb-ab5e-d9dd6537f235
jn
nnnn
javascript
1,755,521,724,497
1,755,521,724,497
f7bc1546-b30f-4adf-b49b-12fc8d974cc1
gh
hhhh
javascript
1,755,521,760,218
1,755,521,760,218
f88a3002-c0e1-4e49-b4f9-70d5dd561852
Untitled
(async function () { console.log("Script by Trần Anh Tú - Zalo 0942792489"); function _0x4f8c48() { if (document.getElementById("__tr_banner")) { return; } const _0x596be3 = document.createElement("style"); _0x596be3.id = "__tr_banner_style"; _0x596be3.textContent = "\n #__tr_banner{position:fixed;left:0;right:0;top:0;height:36px;background:#000;color:#ff4d4d;display:flex;align-items:center;z-index:2147483646;pointer-events:none;font-family:Arial, Helvetica, sans-serif}\n #__tr_banner .__tr_wrap{overflow:hidden;width:100%;position:relative}\n #__tr_banner .__tr_text{display:inline-block;white-space:nowrap;font-weight:700;letter-spacing:1px;color:#ff3b3b;padding:0 8px}\n #__tr_logs{position:fixed;left:12px;top:48px;max-width:420px;z-index:2147483647;pointer-events:none;font-family:Arial, Helvetica, sans-serif}\n #__tr_logs .__tr_item{background:rgba(0,0,0,0.78);color:#fff;padding:8px 12px;border-radius:8px;margin-top:8px;display:flex;gap:10px;align-items:center;box-shadow:0 6px 18px rgba(0,0,0,0.6);pointer-events:auto}\n #__tr_logs .__tr_icons{font-size:16px}\n #__tr_logs .__tr_text{font-size:13px;color:#ffdede}\n "; document.head.appendChild(_0x596be3); const _0x2987aa = document.createElement('div'); _0x2987aa.id = "__tr_banner"; _0x2987aa.innerHTML = "<div class=\"__act_wrap\"><div class=\"__act_text __tr_text\">CODE BY TRẦN ANH TÚ - ZALO: 0942792489 ĐỂ VÀO NHÓM VIP 20K/1 THÁNG HOẶC NHÓM PREMIUM 100K 1 THÁNG</div></div>"; document.body.appendChild(_0x2987aa); const _0xf2bc41 = document.createElement('div'); _0xf2bc41.id = "__tr_logs"; document.body.appendChild(_0xf2bc41); try { const _0x3db510 = document.createElement("style"); _0x3db510.id = "__tr_banner_anim_style"; _0x3db510.textContent = "\n @keyframes __act_slide { from{transform:translateX(0%)} to{transform:translateX(-50%)} }\n @keyframes __act_glow { 0%{text-shadow:0 0 6px rgba(255,0,0,0.6)} 50%{text-shadow:0 0 18px rgba(255,50,50,0.95)} 100%{text-shadow:0 0 6px rgba(255,0,0,0.6)} }\n #__tr_banner{position:fixed;left:0;right:0;top:0;height:36px;background:#000;color:#ff4d4d;display:flex;align-items:center;z-index:2147483647;pointer-events:none}\n #__tr_banner .__act_wrap{overflow:hidden;width:100%}\n #__tr_banner .__act_text{display:inline-block;white-space:nowrap;padding:0;margin:0;font-weight:700;letter-spacing:1px;font-family:Arial,Helvetica,sans-serif;animation:__act_slide 10s linear infinite, __act_glow 2s ease-in-out infinite;color:#ff2222;font-size:14px;line-height:36px}\n "; const _0x260bd9 = document.getElementById("__tr_banner_anim_style"); if (_0x260bd9) { _0x260bd9.remove(); } document.head.appendChild(_0x3db510); try { const _0x3ea160 = _0x2987aa.querySelector(".__act_text"); if (_0x3ea160) { const _0x3a4b44 = (_0x3ea160.textContent || '').trim() || "CODE BY TRẦN ANH TÚ - ZALO: 0942792489"; _0x3ea160.textContent = Array(0xc).fill(_0x3a4b44).join(" \xA0•\xA0 "); _0x3ea160.style.color = "#ff2222"; _0x3ea160.style.fontSize = '14px'; _0x3ea160.style.lineHeight = "36px"; _0x3ea160.style.padding = "0 12px"; _0x3ea160.style.textShadow = "0 0 6px rgba(255,0,0,0.6)"; _0x3ea160.style.visibility = "visible"; _0x3ea160.style.opacity = '1'; _0x2987aa.style.background = '#000'; } } catch (_0x22a963) {} try { (function _0x460a22() { const _0x2baecd = _0x2987aa.querySelector(".__act_text"); const _0x11a175 = _0x2987aa.querySelector(".__act_wrap"); if (!_0x2baecd || !_0x11a175) { return; } let _0x2deed1 = null; let _0x40c2a4 = performance.now(); let _0x50feb8 = 0x0; function _0x1926ec() { try { const _0x178914 = getComputedStyle(_0x2baecd); if (!_0x178914) { return true; } if (_0x178914.animationName === "none" || _0x178914.animationPlayState === "paused") { return true; } return false; } catch (_0x245f2f) { return true; } } function _0x5789fb(_0x47328c) { const _0x3bb1dd = _0x1926ec(); if (!_0x3bb1dd) { if (_0x2deed1) { cancelAnimationFrame(_0x2deed1); _0x2deed1 = null; } _0x2baecd.style.transform = ''; _0x40c2a4 = _0x47328c; return; } const _0x37ae86 = Math.max(0x0, (_0x47328c - _0x40c2a4) / 0x3e8); _0x40c2a4 = _0x47328c; const _0x3e0f8a = _0x2baecd.offsetWidth || 0x0; const _0x1eff68 = _0x11a175.offsetWidth || 0x0; if (_0x3e0f8a <= _0x1eff68) { _0x2baecd.style.transform = 'translateX(0px)'; _0x2deed1 = requestAnimationFrame(_0x5789fb); return; } _0x50feb8 -= 0x78 * _0x37ae86; if (Math.abs(_0x50feb8) >= _0x3e0f8a) { _0x50feb8 += _0x3e0f8a; } _0x2baecd.style.transform = "translateX(" + Math.round(_0x50feb8) + 'px)'; _0x2deed1 = requestAnimationFrame(_0x5789fb); } _0x2deed1 = requestAnimationFrame(_0x5789fb); const _0x45c6b3 = setInterval(() => { try { if (!_0x1926ec()) { if (_0x2deed1) { cancelAnimationFrame(_0x2deed1); _0x2deed1 = null; } _0x2baecd.style.transform = ''; } else if (!_0x2deed1) { _0x40c2a4 = performance.now(); _0x2deed1 = requestAnimationFrame(_0x5789fb); } } catch (_0x4998ce) {} }, 0x3e8); _0x2987aa.__tr_fallback_poll = _0x45c6b3; _0x2987aa.__tr_fallback_raf = () => { if (_0x2deed1) { cancelAnimationFrame(_0x2deed1); } }; })(); } catch (_0x935024) {} } catch (_0x52ed73) {} } function _0x5bc604(_0x1370b5, _0x3c587d) { try { _0x4f8c48(); const _0x257b76 = document.getElementById("__tr_logs"); if (!_0x257b76) { return; } const _0x5bf416 = document.createElement("div"); _0x5bf416.className = '__tr_item'; const _0x17d889 = document.createElement("div"); _0x17d889.className = "__tr_icons"; const _0x495e0f = Array.isArray(_0x3c587d) ? _0x3c587d : _0x3c587d ? [_0x3c587d] : ['✨', '🔔']; _0x17d889.textContent = _0x495e0f.join(" "); const _0x24b69f = document.createElement('div'); _0x24b69f.className = "__tr_text"; _0x24b69f.textContent = "Trần Anh Tú - " + _0x1370b5; _0x5bf416.appendChild(_0x17d889); _0x5bf416.appendChild(_0x24b69f); _0x257b76.prepend(_0x5bf416); setTimeout(() => { try { _0x5bf416.style.transition = "opacity 600ms, transform 600ms"; _0x5bf416.style.opacity = '0'; _0x5bf416.style.transform = "translateY(8px)"; setTimeout(() => _0x5bf416.remove(), 0x2bc); } catch (_0x2b542e) {} }, 0x1b58); } catch (_0x4a7332) { console.warn("showTrLog error", _0x4a7332); } } function _0x1b073f(_0xfa37c4, _0x538a0c, _0x43f40e) { try { const _0x3b2d0a = document.getElementById("__tr_license_notice"); if (_0x3b2d0a) { _0x3b2d0a.remove(); } const _0x267d16 = document.createElement("div"); _0x267d16.id = '__tr_license_notice'; _0x267d16.style.position = "fixed"; _0x267d16.style.left = "50%"; _0x267d16.style.top = "46px"; _0x267d16.style.transform = "translateX(-50%)"; _0x267d16.style.zIndex = 0x7fffffff; _0x267d16.style.maxWidth = '820px'; _0x267d16.style.width = "calc(100% - 40px)"; _0x267d16.style.pointerEvents = 'auto'; _0x267d16.style.boxSizing = "border-box"; _0x267d16.style.padding = "12px 14px"; _0x267d16.style.borderRadius = "8px"; _0x267d16.style.background = "linear-gradient(90deg, rgba(10,10,10,0.98), rgba(28,28,28,0.98))"; _0x267d16.style.boxShadow = "0 10px 40px rgba(0,0,0,0.7)"; _0x267d16.style.color = "#fff"; _0x267d16.style.fontFamily = 'Arial,Helvetica,sans-serif'; _0x267d16.style.display = "flex"; _0x267d16.style.alignItems = 'center'; _0x267d16.style.gap = "12px"; const _0x18ea0c = document.createElement("div"); _0x18ea0c.style.fontSize = '20px'; _0x18ea0c.style.flex = "0 0 auto"; const _0x2eaedf = Array.isArray(_0x538a0c) ? _0x538a0c : _0x538a0c ? [_0x538a0c] : []; _0x18ea0c.textContent = _0x2eaedf.length ? _0x2eaedf.join(" ") : '🔔'; const _0x5d2c11 = document.createElement("div"); _0x5d2c11.style.fontSize = "13px"; _0x5d2c11.style.lineHeight = '1.35'; _0x5d2c11.style.color = "#ffdede"; _0x5d2c11.style.flex = "1 1 auto"; _0x5d2c11.textContent = _0xfa37c4; const _0x4d17f3 = document.createElement("button"); _0x4d17f3.textContent = 'OK'; _0x4d17f3.style.marginLeft = "12px"; _0x4d17f3.style.flex = "0 0 auto"; _0x4d17f3.style.border = "none"; _0x4d17f3.style.background = "#ff6b4d"; _0x4d17f3.style.color = "#fff"; _0x4d17f3.style.padding = "6px 10px"; _0x4d17f3.style.borderRadius = "6px"; _0x4d17f3.style.cursor = 'pointer'; _0x4d17f3.addEventListener("click", () => { try { _0x267d16.remove(); } catch (_0x5143b2) {} }); _0x267d16.appendChild(_0x18ea0c); _0x267d16.appendChild(_0x5d2c11); _0x267d16.appendChild(_0x4d17f3); document.body.appendChild(_0x267d16); if (!_0x43f40e || !_0x43f40e.sticky) { setTimeout(() => { try { _0x267d16.style.transition = "opacity 600ms, transform 600ms"; _0x267d16.style.opacity = '0'; _0x267d16.style.transform = 'translateY(-6px)'; setTimeout(() => _0x267d16.remove(), 0x26c); } catch (_0x210250) {} }, _0x43f40e && _0x43f40e.timeout ? _0x43f40e.timeout : 0x2328); } } catch (_0x24a806) { console.warn("showLicenseNotice error", _0x24a806); } } function _0x59a277(_0x4a54a8) { if (!_0x4a54a8) { return; } try { _0x4a54a8.dispatchEvent(new MouseEvent("pointerdown", { 'bubbles': true, 'cancelable': true })); _0x4a54a8.dispatchEvent(new MouseEvent('mousedown', { 'bubbles': true, 'cancelable': true })); _0x4a54a8.dispatchEvent(new MouseEvent("mouseup", { 'bubbles': true, 'cancelable': true })); _0x4a54a8.click(); } catch (_0x20529d) { try { _0x4a54a8.click(); } catch (_0x14aca5) {} } } function _0x36b23f(_0x5e18b4) { return new Promise(_0x42de27 => setTimeout(_0x42de27, _0x5e18b4)); } async function _0x49564f(_0x451e88, _0x4be1a4 = false, _0x47ad8c = 0x2710) { const _0x3b0946 = Date.now(); const _0x5f0e3e = Array.from(arguments); const _0x26a3ef = _0x5f0e3e.length >= 0x4 && typeof _0x5f0e3e[0x3] === "number" ? _0x5f0e3e[0x3] : 0x12c; while (Date.now() - _0x3b0946 < _0x47ad8c) { let _0x9b25e7 = _0x4be1a4 ? document.evaluate(_0x451e88, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue : document.querySelector(_0x451e88); if (_0x9b25e7) { return _0x9b25e7; } await _0x36b23f(_0x26a3ef); } throw new Error("⏳ Timeout: Không tìm thấy phần tử " + _0x451e88); } _0x4f8c48(); _0x1b073f("CODE BY TRẦN ANH TÚ - ZALO 0942792489 HÃY LIÊN HỆ NẾU CHƯA CÓ KEYS", ['🔒', '📢'], { 'timeout': 0x2ee0 }); _0x5bc604("CODE BY TRẦN ANH TÚ - ZALO 0942792489 HÃY LIÊN HỆ NẾU CHƯA CÓ KEYS", ['🔒', '📢']); const _0x225e96 = prompt("Nhập key của bạn:"); if (!_0x225e96 || _0x225e96.trim() !== "TRANANHTU_KEYS_ZALO:0942792489_THANG_NAO_LEAK_LA_CANHANOCHET") { _0x1b073f("Keys sai, vui lòng liên hệ Trần Anh Tú - Zalo: 0942792489 để có keys", ['❌', '📛'], { 'timeout': 0x36b0 }); _0x5bc604("Keys sai - liên hệ 0942792489 để lấy keys", ['❌', '📛']); alert("Keys sai, vui lòng liên hệ Trần Anh Tú - Zalo: 0942792489 để có keys"); return; } _0x1b073f("Chào mừng thành viên của box Trần Anh Tú", ['✅', '🎉'], { 'timeout': 0x1f40 }); _0x5bc604("Chào mừng thành viên của box Trần Anh Tú", ['✅', '🎉']); while (true) { alert("🔥 CODE BY TRẦN ANH TÚ - ZALO 0942792489 🔥"); let _0x301914 = parseInt(prompt("Nhập số lần lặp lại:")); if (isNaN(_0x301914) || _0x301914 <= 0x0) { alert("⚠️ Vui lòng nhập một số hợp lệ!"); continue; } for (let _0x456592 = 0x0; _0x456592 < _0x301914; _0x456592++) { _0x5bc604("🔄 Đang thực hiện lần " + (_0x456592 + 0x1) + '/' + _0x301914 + "...", ['🔄', '⚙️']); console.log("🔄 Đang thực hiện lần " + (_0x456592 + 0x1) + '/' + _0x301914 + "..."); try { const _0x3ceed4 = [{ 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc, 'maxspeed': true }, { 'label': "//span[text()='Report group']", 'xpath': true, 'wait': 0x4b0 }, { 'label': "//span[text()='Nudity or sexual activity']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Sharing private or sexual images']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Someone is threatening to share private or sexual images']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Yes']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Submit']", 'xpath': true, 'wait': 0x5dc }, { 'label': "//span[text()='Next']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Done']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc, 'maxspeed': true }, { 'label': "//span[text()='Report group']", 'xpath': true, 'wait': 0x4b0 }, { 'label': "//span[text()='Bullying or harassment']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Sharing private or sexual images']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Someone is threatening to share private or sexual images']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Yes']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Submit']", 'xpath': true, 'wait': 0x5dc }, { 'label': "//span[text()='Next']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Done']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc, 'maxspeed': true }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Suicide, self-injury or eating disorders']", 'xpath': true }, { 'label': "//span[text()='Suicide or self-injury']", 'xpath': true }, { 'label': "//span[text()='Yes']", 'xpath': true, 'wait': 0x3e8 }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc, 'maxspeed': true }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Violence, hate or exploitation']", 'xpath': true }, { 'label': "//span[text()='Credible threat to safety']", 'xpath': true }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc, 'maxspeed': true }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Violence, hate or exploitation']", 'xpath': true }, { 'label': "//span[text()='Calling for violence']", 'xpath': true }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Violence, hate or exploitation']", 'xpath': true }, { 'label': "//span[text()='Seems like terrorism']", 'xpath': true }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Selling or promoting restricted items']", 'xpath': true }, { 'label': "//span[text()='Weapons']", 'xpath': true }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Violence, hate or exploitation']", 'xpath': true }, { 'label': "//span[text()='Showing violence, death or severe injury']", 'xpath': true }, { 'label': "//span[text()='Submit']", 'xpath': true }, { 'label': "//span[text()='Next']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='Spam']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }, { 'label': "div[aria-label='More'][role='button']", 'xpath': false, 'wait': 0x5dc }, { 'label': "//span[text()='Report group']", 'xpath': true }, { 'label': "//span[text()='False information']", 'xpath': true }, { 'label': "//span[text()='Done']", 'xpath': true }]; for (const _0x43e444 of _0x3ceed4) { try { const _0x49f1d0 = _0x43e444.maxspeed ? 0x50 : 0x12c; const _0x5b1aa0 = await _0x49564f(_0x43e444.label, _0x43e444.xpath, _0x43e444.timeout || 0x2710, _0x49f1d0); if (!_0x5b1aa0) { console.warn("Không tìm thấy phần tử, bỏ qua:", _0x43e444.label); continue; } try { if (!_0x43e444.maxspeed) { try { _0x5b1aa0.scrollIntoView({ 'block': 'center', 'behavior': 'instant' }); } catch (_0x47c9a4) {} } } catch (_0x2f50f1) {} try { if (_0x43e444.maxspeed) { _0x59a277(_0x5b1aa0); } else { try { _0x5b1aa0.click(); } catch (_0x300dad) { _0x59a277(_0x5b1aa0); } } } catch (_0x5a7428) { try { _0x5b1aa0.click(); } catch (_0x107c5d) {} } try { _0x5bc604("Click: " + String(_0x43e444.label).replace(/\s+/g, " ").slice(0x0, 0x3c), ['🖱️', '✅']); } catch (_0x5d5aa6) {} const _0x407e99 = typeof _0x43e444.wait === "number" ? _0x43e444.wait : 0x1f4; if (_0x407e99 > 0x0) { await _0x36b23f(_0x407e99); } } catch (_0x5dd8c7) { console.warn("Lỗi bước:", _0x43e444, _0x5dd8c7); } } _0x5bc604("✅ Hoàn tất lần " + (_0x456592 + 0x1), ['✅', '🎉']); console.log("✅ Hoàn tất lần " + (_0x456592 + 0x1)); } catch (_0x3758ba) { console.warn("⚠️ Lỗi khi thực hiện thao tác:", _0x3758ba); } } let _0x7f9b2 = confirm("Bạn có muốn tiếp tục lặp lại không?"); if (!_0x7f9b2) { console.log("🛑 Đã dừng chương trình!"); break; } } })();
javascript
1,763,821,458,757
1,763,821,458,757
f97f7f8f-d54d-4142-8631-c5fbba078488
(ĐẶT) Nonstop Full Track Gõ Style Win .wav
{ "url": "20260110_204111_DAT_Nonstop_Full_Track_Go_Style_Win.wav", "size": 519393324, "mime_type": "audio/wav", "uploaded_at": "2026-01-10T13:41:28.805Z" }
audio
1,768,052,489,646
1,768,052,489,646
fc25f6bb-f535-4793-94ad-32fd91bd7ab1
22.mp4
{ "url": "https://files.twan.site/20251229_230156_22.mp4", "size": 33211439, "mime_type": "video/mp4", "uploaded_at": "2025-12-29T16:02:12.753Z" }
video
1,767,024,166,993
1,767,024,166,993
fe3febf2-2e15-411c-909e-728a2ed3b342
wallhaven-6dr5rl_3840x2160.png
{ "url": "20260106_203804_wallhaven-6dr5rl_3840x2160.png", "size": 13034317, "mime_type": "image/png", "uploaded_at": "2026-01-06T13:38:12.089Z" }
image
1,767,706,732,502
1,767,706,732,502
ffcc0d2f-23d8-485f-9b7f-2e1f3b89eb4c
thongbaoall.js
const moment = require("moment-timezone"); module.exports.config = { name: "log-to-admin-full", version: "1.0.0", credits: "『𝕽𝖊𝖒』 ✎", description: "Ghi lại mọi hoạt động bot và gửi về box admin", envConfig: { enable: true }, }; module.exports.run = async function({ api, event, Users, Threads }) { const botID = api.getCurrentUserID(); const logger = require("../../utils/log"); const time = moment.tz("Asia/Ho_Chi_Minh").format("DD/MM/YYYY HH:mm:ss"); const sendAdmin = async (text) => { try { await api.sendMessage(text, global.config.box_admin); } catch (e) { logger(text, "[Logging Event]"); } }; const nameUser = global.data.userName.get(event.author) || await Users.getNameUser(event.author); // ===== NHÓM ===== if (event.threadID && event.logMessageType) { const threadInfo = await api.getThreadInfo(event.threadID); const threadName = threadInfo.threadName || "Tên không tồn tại"; const threadMem = threadInfo.participantIDs.length; const pd = threadInfo.approvalMode ? "Bật" : "Tắt"; const qtv = threadInfo.adminIDs.length; const icon = threadInfo.emoji || "Không sử dụng"; let task = ""; switch (event.logMessageType) { case "log:thread-name": { const newName = event.logMessageData.name || "Tên không tồn tại"; task = `Người dùng thay đổi tên nhóm thành: ${newName}`; await Threads.setData(event.threadID, { name: newName }); break; } case "log:subscribe": { if (event.logMessageData.addedParticipants.some(i => i.userFbId == botID)) { task = `Người dùng đã thêm bot vào nhóm: ${threadName}`; } break; } case "log:unsubscribe": { if (event.logMessageData.leftParticipantFbId == botID) { if (event.senderID == botID) return; const data = (await Threads.getData(event.threadID)).data || {}; data.banned = true; const reason = "Kích bot tự do, không xin phép"; data.reason = reason; data.dateAdded = time; await Threads.setData(event.threadID, { data }); global.data.threadBanned.set(event.threadID, { reason: data.reason, dateAdded: data.dateAdded }); task = "Người dùng đã kick bot ra khỏi nhóm!"; } break; } default: break; } if (task.length > 0) { const formReport = `|› Tên nhóm: ${threadName} |› TID: ${event.threadID} |› Số thành viên: ${threadMem} |› Phê duyệt: ${pd} |› Quản trị viên: ${qtv} |› Biểu tượng cảm xúc: ${icon} ────────────────── |› Hành động: ${task} |› Người thực hiện: ${nameUser} |› UID: ${event.author} |› Link FB: https://www.facebook.com/profile.php?id=${event.author} ────────────────── ⏰️=『${time}』=⏰️`; return sendAdmin(formReport); } } // ===== CÁ NHÂN ===== if (event.type === "friendRequestAccept") { const userID = event.userID; const nameUserFriend = await Users.getNameUser(userID); const formReport = `Người dùng vừa kết bạn với bot! |› Tên: ${nameUserFriend} |› UID: ${userID} |› Link FB: https://www.facebook.com/profile.php?id=${userID} ⏰️=『${time}』=⏰️`; return sendAdmin(formReport); } // ===== ADMIN BỊ TAG ===== if (event.type === "message" && event.mentions) { const adminTags = Object.keys(event.mentions).filter(uid => global.config.adminIDs.includes(uid)); if (adminTags.length > 0) { const senderName = await Users.getNameUser(event.senderID); const taggedNames = adminTags.map(uid => event.mentions[uid].replace(/\n/g," ")).join(", "); const formReport = `Người dùng ${senderName} vừa tag admin trong nhóm! |› Nội dung tin nhắn: ${event.body} |› Người bị tag: ${taggedNames} |› UID người gửi: ${event.senderID} |› Link FB: https://www.facebook.com/profile.php?id=${event.senderID} ⏰️=『${time}』=⏰️`; await sendAdmin(formReport); } } // ===== ADMIN REPLY TIN NHẮN CÓ TAG ===== if (event.type === "message" && event.messageReply) { const senderID = event.senderID; if (global.config.adminIDs.includes(senderID)) { const replyContent = event.body || "Không có nội dung"; const repliedMessage = event.messageReply.body || ""; const repliedMentions = event.messageReply.mentions || {}; const taggedAdmins = Object.keys(repliedMentions).filter(uid => global.config.adminIDs.includes(uid)); if (taggedAdmins.length > 0) { const senderName = await Users.getNameUser(senderID); const taggedNames = taggedAdmins.map(uid => repliedMentions[uid].replace(/\n/g," ")).join(", "); const formReport = `Admin ${senderName} vừa reply tin nhắn có tag admin! |› Nội dung reply: ${replyContent} |› Tin nhắn trước đó: ${repliedMessage} |› Người bị tag trước đó: ${taggedNames} |› UID admin: ${senderID} |› Link FB: https://www.facebook.com/profile.php?id=${senderID} ⏰️=『${time}』=⏰️`; return sendAdmin(formReport); } } } };
javascript
1,757,118,109,580
1,757,118,109,580