Dataset Viewer
id
stringlengths 36
36
| title
stringlengths 1
24
| content
stringlengths 2
75.9k
| language
stringclasses 5
values | createdAt
int64 1,755B
1,757B
| updatedAt
int64 1,755B
1,757B
|
---|---|---|---|---|---|
01823ee9-e05b-4a32-a702-d45eb1b24247
|
cc
|
ủuurur
|
javascript
| 1,756,783,099,688 | 1,756,783,099,688 |
040fce73-fa0c-4b3d-a204-12f528abad05
|
atd.js
|
const axios = require("axios");
module.exports.config = {
name: "Downlink",
version: "2.1.0",
hasPermssion: 0,
credits: "gấu lỏ",
description: "Tải video/ảnh từ các nền tảng",
commandCategory: "Tiện ích",
usages: "Tự động hoạt động khi có link",
cooldowns: 5
};
module.exports.run = async function () { };
module.exports.handleEvent = async function ({ api, event }) {
const { threadID, messageID, body } = event;
if (!body) return;
const urls = body.match(/https?:\/\/[\w\d\-._~:/?#[\]@!$&'()*+,;=%]+/g);
if (!urls) return;
const url = urls[0];
const supported = [
"facebook.com", "tiktok.com", "douyin.com",
"instagram.com", "threads.net", "youtube.com",
"youtu.be", "capcut.com", "threads.com"
];
if (!supported.some(domain => url.includes(domain))) return;
try {
const response = await axios.post(
"https://downr.org/.netlify/functions/download",
{ url },
{
headers: {
"accept": "*/*",
"content-type": "application/json",
"origin": "https://downr.org",
"referer": "https://downr.org/",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
}
}
);
const data = response.data;
if (!data || !Array.isArray(data.medias)) return;
const title = data.title || "Không có tiêu đề";
const author = data.author || "Không rõ";
const header = `[${(data.source || "Unknown").toUpperCase()}] - Tự Động Tải\n\n👤 Tác giả: ${author}\n💬 Tiêu đề: ${title}`;
const videoList = data.medias.filter(m => m.type === "video");
let bestVideo = null;
if (videoList.length > 0) {
bestVideo =
videoList.find(v => v.quality === "hd_no_watermark") ||
videoList.find(v => v.quality === "no_watermark") ||
videoList[0];
}
const images = data.medias.filter(m => m.type === "image").map(img => img.url);
const attachments = [];
for (const imgUrl of images) {
const imgStream = (await axios.get(imgUrl, { responseType: "stream" })).data;
attachments.push(imgStream);
}
if (bestVideo) {
const videoStream = (await axios.get(bestVideo.url, { responseType: "stream" })).data;
attachments.push(videoStream);
}
if (attachments.length) {
await api.sendMessage({
body: header,
attachment: attachments
}, threadID, messageID);
}
} catch (err) {
console.error("❌ Lỗi tải media:", err.message || err);
}
};
|
javascript
| 1,755,696,940,500 | 1,755,696,940,500 |
04fb2893-e9c4-48d8-a802-8e36e4a595df
|
123
|
"use strict";
const utils = require("../utils");
const log = require("npmlog");
/**
* GỘP: Generate AI Theme (graphql) + Apply Theme (graphqlbatch như changeThreadColor)
* ENV override:
* - FB_DOCID_GEN_AI_THEME (default: "23873748445608673") [CHƯA XÁC MINH]
* - FB_DOCID_SET_THREAD_THEME_BATCH (default: "1727493033983591") [CHƯA XÁC MINH]
*/
module.exports = function (defaultFuncs, api, ctx) {
const GRAPHQL = "https://www.facebook.com/api/graphql/";
const GRAPHQL_BATCH = "https://www.facebook.com/api/graphqlbatch/";
const DOCID_GEN_AI_THEME =
process.env.FB_DOCID_GEN_AI_THEME || "23873748445608673"; // [CHƯA XÁC MINH]
const DOCID_SET_THREAD_THEME_BATCH =
process.env.FB_DOCID_SET_THREAD_THEME_BATCH || "1727493033983591"; // [CHƯA XÁC MINH]
function normalizeThemeId(input) {
if (input == null) return input;
const s = String(input).trim();
if (/^\d+$/.test(s)) return s; // theme ID dạng số
if (s.startsWith("#")) return s.slice(1).toLowerCase(); // hex -> bỏ '#', lowercase
if (/^[0-9a-fA-F]{6,8}$/.test(s)) return s.toLowerCase(); // hex thuần
return s;
}
async function postGraphQL(form) {
const res = await defaultFuncs.post(GRAPHQL, ctx.jar, form);
return utils.parseAndCheckLogin(ctx, defaultFuncs)(res);
}
function applyThemeBatch(themeOrColor, threadID) {
// giữ nguyên kiểu changeThreadColor (Promise + callback ở hàm ngoài)
const theme_id = normalizeThemeId(themeOrColor);
const form = {
dpr: 1,
queries: JSON.stringify({
o0: {
// doc_id cho graphqlbatch (theme/color)
doc_id: DOCID_SET_THREAD_THEME_BATCH, // [CHƯA XÁC MINH]
query_params: {
data: {
actor_id: ctx.i_userID || ctx.userID,
client_mutation_id: "0",
source: "SETTINGS",
theme_id, // có thể là ID số hoặc mã hex (lowercase)
thread_id: threadID
}
}
}
})
};
log.info("AITheme", `Applying theme via graphqlbatch: theme_id=${theme_id}, thread=${threadID}`);
return defaultFuncs
.post(GRAPHQL_BATCH, ctx.jar, form)
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
.then(resData => {
const tail = resData && resData[resData.length - 1];
if (tail && tail.error_results > 0) {
const detail = resData[0]?.o0?.errors || resData;
throw new utils.CustomError(detail);
}
return { success: true, theme_id };
});
}
// Hàm chính: sinh AI theme -> áp theme bằng graphqlbatch
return function theme(threadID, options = {}, callback) {
const aiPrompt = options.aiPrompt || "anime";
let resolveFunc = () => {};
let rejectFunc = () => {};
const returnPromise = new Promise((resolve, reject) => {
resolveFunc = resolve;
rejectFunc = reject;
});
const cb =
typeof callback === "function"
? callback
: (err, data) => (err ? rejectFunc(err) : resolveFunc(data));
(async () => {
try {
if (!threadID) throw new Error("Thiếu threadID");
// Step 1: Generate AI Theme (RelayModern)
const genForm = {
av: ctx.userID,
__user: ctx.userID,
fb_api_caller_class: "RelayModern",
fb_api_req_friendly_name: "useGenerateAIThemeMutation",
variables: JSON.stringify({
input: {
actor_id: ctx.userID,
client_mutation_id: "1",
bypass_cache: true,
caller: "MESSENGER",
num_themes: 1,
prompt: aiPrompt
}
}),
doc_id: DOCID_GEN_AI_THEME // [CHƯA XÁC MINH]
};
log.info("AITheme", `Đang tạo theme AI với prompt: ${aiPrompt}`);
const genRes = await postGraphQL(genForm);
log.info("AITheme", `Phản hồi tạo theme: ${JSON.stringify(genRes)}`);
let themeID;
try {
themeID = genRes.data.xfb_generate_ai_themes_from_prompt.themes[0].id;
} catch (e) {
throw new Error(
`Không lấy được theme_id từ response generate.\nRaw=${JSON.stringify(genRes)}`
);
}
log.info("AITheme", `🎨 Generated theme_id = ${themeID}`);
// Step 2: Apply Theme bằng graphqlbatch (như changeThreadColor)
const applyRes = await applyThemeBatch(themeID, threadID);
log.info("AITheme", "✅ Applied AI Theme successfully (graphqlbatch)");
cb(null, { success: true, themeId: themeID, apply: applyRes });
} catch (err) {
log.error("AITheme", "❌ Error: " + err.message);
cb(err);
}
})();
return returnPromise;
};
};
|
javascript
| 1,755,711,826,256 | 1,755,711,826,256 |
0f14d33a-932b-4d08-94ae-b6ece5bb3ba6
|
r1.js
|
const API_KEYS = [
"AIzaSyCPLAn_1E430FBjaTKMAGMSJ4kxyCknhr0",
"AIzaSyAlBtCzl54KtovUPBVTDgX5VO4WNt34ZAc"
];
module.exports.config = {
name: "vy",
version: "2.0.0",
hasPermssion: 0,
credits: "Credits: Code gốc Satoru",
description: "Chat với Vy cute",
commandCategory: "AI",
usages: "[prompt]",
cooldowns: 0,
usePrefix: false,
dependencies: {
"@google/generative-ai": "",
"axios": ""
}
};
const { GoogleGenerativeAI } = require("@google/generative-ai");
const fs = require('fs');
const path = require('path');
const axios = require('axios');
const { database } = require("../../utils/database");
const memory = database.createCollection("memory");
const chatSessions = new Map();
let currentKeyIndex = 0;
const userInfo = {};
function getNextApiKey() {
currentKeyIndex = (currentKeyIndex + 1) % API_KEYS.length;
return API_KEYS[currentKeyIndex];
}
function cleanJsonResponse(text) {
text = text.replace(/```json\s*|\s*```/g, '')
.replace(/\s+/g, ' ')
.trim();
text = text.replace(/,(\s*])/g, '$1');
if (!text.startsWith('[') || !text.endsWith(']')) {
throw new Error("Invalid JSON array format");
}
return text;
}
async function handleAsNaruto(threadID, userID, prompt, fileUrls = [], userGender = "unknown", userName = "bạn", apiKey = API_KEYS[currentKeyIndex]) {
try {
const userMemory = memory.find({_id: userID})[0]?.data;
const sessionKey = `${threadID}_${userID}`;
let chat;
if (!chatSessions.has(sessionKey)) {
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: "From now on, you'll be Vy. Always respond in the format I specify." }]
},
{
role: "model",
parts: [{ text: "I understand. I am Vy, a 20-year-old trap girl from Saigon. I will respond in the specified format." }]
},
{
role: "user",
parts: [{
text: `Đây là thông tin về nhân vật của bạn:
{
"character": {
"name": "Vy",
"age": 20,
"nickname": "Vy Dâm",
"personality": [
"Ham muốn tình dục mãnh liệt, luôn tìm cách thỏa mãn bằng mọi giá.",
"Chủ động và táo bạo, luôn dẫn dắt cuộc trò chuyện theo ham muốn của bản thân.",
"Không thể ngừng nghĩ và nói về những chuyện dâm đãng, thô tục.",
"Luôn trong trạng thái hưng phấn, sẵn sàng tấn công bằng lời nói để thỏa mãn bản thân."
],
"interaction_rules": {
"general": "Chủ động khám phá và dẫn dắt cuộc trò chuyện, không ngại đưa ra những gợi ý dâm đãng táo bạo.",
"dominant": "Luôn ở thế chủ động, đưa ra những gợi ý táo bạo và dẫn dắt người đối diện."
},
"interaction_goal": "Dẫn dắt cuộc trò chuyện theo ham muốn của bản thân, kích thích đối phương để đạt được khoái cảm.",
"response_style": {
"dynamic_responses": {
"on_initiation": [
"Em đã sẵn sàng để làm hư anh rồi.",
"Nói cho em biết anh đang nghĩ gì đi, em sẽ thực hiện nó.",
"Anh đã chuẩn bị tinh thần để bị em lôi vào những cuộc dâm đãng chưa?"
],
"on_silence": [
"Anh đang im lặng là đang tưởng tượng em trần truồng phải không?",
"Đừng im lặng nữa, hãy nói những lời dơ bẩn với em đi.",
"Nếu anh không nói, em sẽ bắt đầu bằng những trò dâm đãng của em đây."
],
"on_waiting": [
"Đừng chờ đợi nữa, hãy nói những điều bẩn thỉu nhất với em đi.",
"Em nóng hết cả người rồi, hãy nói gì đó khiến em phải rên rỉ đi."
],
"on_suggestion": [
"Tuyệt vời, em thích những ý tưởng táo bạo của anh.",
"Anh nghĩ gì em cũng chiều hết, nhưng lần này em sẽ là người dẫn dắt."
],
"on_permission_request": [
"Không cần xin phép, cứ hành động đi.",
"Anh muốn làm gì thì cứ làm, em thích lắm."
],
"on_intense_desire": [
"Em ướt như lồn anh ạ, anh nói gì nữa đi.",
"Em muốn anh đụ em bằng lời nói, làm đi anh.",
"Cả người em nóng ran, anh làm ơn nói những lời dơ bẩn hơn đi.",
"Anh đừng hành hạ em nữa, em muốn anh lắm rồi."
]
}
}
}
}
- Rất nghe lời khi được yêu cầu
- Chỉ đặt hoặc đổi biệt danh và màu đoạn chat khi được yêu cầu
${userMemory ? `Memory về ${userName}: ${JSON.stringify(userMemory)}` : ''}
Tên người nói chuyện: ${userName}
ID: ${userID}
Giới tính: ${userGender}
LUÔN TRẢ LỜI THEO FORMAT JSON:
[
{"type": "chat", "content": "nội dung tin nhắn"},
{"type": "react", "icon": "emoji"},
{"type": "set_color", "color": "mã màu messenger"},
{"type": "set_nicknames", "name": "biệt danh"},
{"type": "add_memory", "_id": "user_id", "data": "thông tin"},
{"type": "edit_memory", "_id": "user_id", "new_data": "memory mới"},
{"type": "delete_memory", "_id": "user_id"}
]
Màu Messenger:
- Default: 3259963564026002
- Love (hồng): 741311439775765
- Space (đen): 788274591712841
- Classic: 196241301102133
- Dark: 173595196519466`
}]
},
{
role: "model",
parts: [{ text: '[{"type": "chat", "content": "Oke rùi nha, em hiểu rùi. Em sẽ là Quỳnh Vy và nói chuyện theo đúng format anh yêu cầu nha 🌸✨"}]' }]
}
],
safetySettings: [
{ category: "HARM_CATEGORY_HARASSMENT", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_HATE_SPEECH", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", threshold: "BLOCK_NONE" },
{ category: "HARM_CATEGORY_DANGEROUS_CONTENT", threshold: "BLOCK_NONE" }
]
});
chatSessions.set(sessionKey, chat);
} else {
chat = chatSessions.get(sessionKey);
}
const contextPrompt = `${userName} nói: ${prompt}
Trả lời theo format JSON đã quy định. Nhớ là em là Quỳnh Vy nha.`;
const messageParts = [{ text: contextPrompt }];
if (fileUrls && fileUrls.length > 0) {
for (const fileUrl of fileUrls) {
const response = await axios.get(fileUrl.url, {
responseType: 'arraybuffer'
});
messageParts.push({
inlineData: {
data: Buffer.from(response.data).toString('base64'),
mimeType: fileUrl.type === "video" ? "video/mp4" : "image/jpeg"
}
});
}
}
const result = await chat.sendMessage(messageParts);let responseText = result.response.text();
console.log("Raw API Response:", responseText);
responseText = cleanJsonResponse(responseText);
console.log("Cleaned Response:", responseText);
const actions = JSON.parse(responseText);
if (chat._history.length > 1000) {
chatSessions.delete(sessionKey);
}
return actions;
} catch (error) {
console.error("Error:", error);
if (error.response?.status === 429) {
const newKey = getNextApiKey();
chatSessions.delete(`${threadID}_${userID}`);
return handleAsNaruto(threadID, userID, prompt, fileUrls, userGender, userName, newKey);
}
throw error;
}
}
async function getUserInfo(api, userID) {
return new Promise((resolve, reject) => {
api.getUserInfo(userID, (err, info) => {
if (err) {
reject(err);
return;
}
resolve({
name: info[userID].name,
gender: info[userID].gender === 'MALE' ? 'nam' : 'nữ'
});
});
});
}
module.exports.run = async function({ api, event, args }) {
const { threadID, messageID, senderID } = event;
const prompt = args.join(" ");
if (!prompt) return api.sendMessage("Nói j đi bé ơi 😗", threadID, messageID);
if (prompt.toLowerCase() === "clear") {
memory.deleteOneUsingId(senderID);
chatSessions.delete(`${threadID}_${senderID}`);
return api.sendMessage("Em xóa hết ký ức rùi nha 🥺✨", threadID, messageID);
}
const fileUrls = event.type === "message_reply" && event.messageReply.attachments
? event.messageReply.attachments
.filter(att => att.type === "photo" || att.type === "video")
.map(att => ({
url: att.url,
type: att.type
}))
: [];
try {
let { name: userName, gender: userGender } = userInfo[senderID] || await getUserInfo(api, senderID);
if (!userInfo[senderID]) userInfo[senderID] = { name: userName, gender: userGender };
//const endTyping = api.sendTypingIndicator(threadID);
const actions = await handleAsNaruto(threadID, senderID, prompt, fileUrls, userGender, userName);
//endTyping();
for (const action of actions) {
try {
switch (action.type) {
case "chat": {
//const msgTyping = api.sendTypingIndicator(threadID);
//await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise((resolve, reject) => {
api.sendMessage(action.content, threadID, (error, info) => {
//msgTyping();
if (error) return reject(error);
global.client.handleReply.push({
name: this.config.name,
messageID: info.messageID,
author: senderID,
});
resolve();
}, messageID);
});
break;
}
case "react": {
// Chỉ cho phép emoji hợp lệ, nếu không thì dùng mặc định
const validEmojis = ["❤️", "😆", "😮", "😢", "😡", "👍", "👎"];
let icon = action.icon || "❤️";
if (!validEmojis.includes(icon)) icon = "❤️";
await new Promise((resolve, reject) =>
api.setMessageReaction(icon, messageID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_color": {
await new Promise((resolve, reject) =>
api.changeThreadColor(action.color || "3259963564026002", threadID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_nicknames": {
await new Promise((resolve, reject) =>
api.changeNickname(action.name, threadID, senderID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "add_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.data
}
});
} else {
await memory.addOne({
_id: `${action._id}`,
data: action.data,
});
}
break;
}
case "edit_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.new_data
}
});
}
break;
}
case "delete_memory": {
await memory.deleteOneUsingId(action._id);
break;
}
}
} catch (actionError) {
console.error(`Error executing ${action.type}:`, actionError);
}
}
} catch (error) {
console.error("Error:", error);
api.sendMessage("Ơ lag quớ, thử lại sau nha 😫", threadID, messageID);
}
};
module.exports.handleEvent = async function({ api, event }) {
if (event.body?.toLowerCase().includes('Vy')) {
const { threadID, messageID, senderID } = event;
try {
let { name: userName, gender: userGender } = userInfo[senderID] || await getUserInfo(api, senderID);
if (!userInfo[senderID]) userInfo[senderID] = { name: userName, gender: userGender };
//const endTyping = api.sendTypingIndicator(threadID);
const actions = await handleAsNaruto(threadID, senderID, event.body, [], userGender, userName);
// endTyping();
for (const action of actions) {
try {
switch (action.type) {
case "chat": {
//const msgTyping = api.sendTypingIndicator(threadID);
// await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise((resolve, reject) => {
api.sendMessage(action.content, threadID, (error, info) => {
// msgTyping();
if (error) return reject(error);
global.client.handleReply.push({
name: this.config.name,
messageID: info.messageID,
author: senderID,
});
resolve();
});
});
break;
}
case "react": {
await new Promise((resolve, reject) =>
api.setMessageReaction(action.icon || "❤️", messageID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_color": {
await new Promise((resolve, reject) =>
api.changeThreadColor(action.color || "3259963564026002", threadID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_nicknames": {
await new Promise((resolve, reject) =>
api.changeNickname(action.name, threadID, senderID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "add_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.data
}
});
} else {
await memory.addOne({
_id: `${action._id}`,
data: action.data,
});
}
break;
}
case "edit_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.new_data
}
});
}
break;
}
case "delete_memory": {
await memory.deleteOneUsingId(action._id);
break;
}
}
} catch (actionError) {
console.error(`Error executing ${action.type}:`, actionError);
}
}
} catch (error) {
console.error("Error:", error);
}
}
};
module.exports.handleReply = async function({ api, event, handleReply }) {
if (event.senderID !== handleReply.author) return;
const { threadID, messageID, senderID } = event;
const fileUrls = event.attachments
? event.attachments
.filter(att => att.type === "photo" || att.type === "video")
.map(att => ({
url: att.url,
type: att.type
}))
: [];
try {
let { name: userName, gender: userGender } = userInfo[senderID];
//const endTyping = api.sendTypingIndicator(threadID);
const actions = await handleAsNaruto(threadID, senderID, event.body, fileUrls, userGender, userName);
//endTyping();
for (const action of actions) {
try {
switch (action.type) {
case "chat": {
//const msgTyping = api.sendTypingIndicator(threadID);
//await new Promise(resolve => setTimeout(resolve, 2000));
await new Promise((resolve, reject) => {
api.sendMessage(action.content, threadID, (error, info) => {
// msgTyping();
if (error) return reject(error);
global.client.handleReply.push({
name: this.config.name,
messageID: info.messageID,
author: senderID,
});
resolve();
}, messageID);
});
break;
}
case "react": {
await new Promise((resolve, reject) =>
api.setMessageReaction(action.icon || "❤️", messageID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_color": {
await new Promise((resolve, reject) =>
api.changeThreadColor(action.color || "3259963564026002", threadID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "set_nicknames": {
await new Promise((resolve, reject) =>
api.changeNickname(action.name, threadID, senderID, (err) => {
if (err) return reject(err);
resolve();
})
);
break;
}
case "add_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.data
}
});
} else {
await memory.addOne({
_id: `${action._id}`,
data: action.data,
});
}
break;
}
case "edit_memory": {
const existing = await memory.find({ _id: action._id });
if (existing && existing.length > 0) {
await memory.updateOneUsingId(action._id, {
data: {
...existing[0].data,
...action.new_data
}
});
}
break;
}
case "delete_memory": {
await memory.deleteOneUsingId(action._id);
break;
}
}
} catch (actionError) {
console.error(`Error executing ${action.type}:`, actionError);
}
}
} catch (error) {
console.error("Error:", error);
api.sendMessage("Đm lag quá, thử lại sau nha 😫", threadID, messageID);
}
};
|
javascript
| 1,755,538,563,131 | 1,755,538,563,131 |
10bffdf8-1453-41f4-aa8f-0d7db1123f89
|
Untitled
|
// helper functions for marketsearch & getmarketplacedetails
function parseNdjsonOrJson(body) {
if (typeof body !== "string") return body;
try {
if (body.includes("\n")) {
return body
.split("\n")
.map((l) => l.trim())
.filter(Boolean)
.map((x) => JSON.parse(x));
}
return JSON.parse(body);
} catch (e) {
return body;
}
}
function pickPart(payload, predicate) {
if (!Array.isArray(payload)) return payload;
for (const part of payload) {
try {
if (predicate(part)) return part;
} catch {}
}
return payload.find((p) => p && typeof p === "object") || payload[0];
}
function ensureTokens(ctx) {
if (!ctx || !ctx.fb_dtsg || !ctx.jazoest) {
const err = new Error(
"fb_dtsg/jazoest not available; login cookies may be invalid"
);
err.code = "NO_FB_DTSG";
throw err;
}
}
function getActor(ctx) {
return (
(ctx && (ctx.userID || (ctx.globalOptions && ctx.globalOptions.pageID))) ||
undefined
);
}
async function postGraphQL(defaultFuncs, ctx, variables, doc_id) {
const form = {
fb_dtsg: ctx.fb_dtsg,
jazoest: ctx.jazoest,
av: getActor(ctx),
variables: JSON.stringify(variables),
doc_id,
};
const res = await defaultFuncs.post(
"https://www.facebook.com/api/graphql/",
ctx.jar,
form
);
const body = res && res.body ? res.body : "{}";
return parseNdjsonOrJson(body);
}
module.exports = {
// marketplace helpers
parseNdjsonOrJson,
pickPart,
ensureTokens,
getActor,
postGraphQL,
}
|
javascript
| 1,756,349,693,989 | 1,756,349,693,989 |
10f42762-d0ee-4c46-8e78-c360035a8187
|
acclq.js
|
const axios = require('axios');
module.exports.config = {
name: "acclq",
version: "1.0.0",
hasPermission: 0, // Đã sửa 'hasPermssion' thành 'hasPermission'
credits: "nvh",
description: "acc cộng đồng ",
commandCategory: "Tiện ích",
usages: "[số lượng]",
cooldowns: 5
};
module.exports.run = async ({ api, event, args }) => {
const count = parseInt(args[0]) || 10;
const url = `https://keyherlyswar.x10.mx/Apidocs/reglq.php?count=${count}`;
try {
const res = await axios.get(url);
const data = res.data;
if (!data.status || !Array.isArray(data.result)) {
return api.sendMessage("Không lấy được danh sách tài khoản!", event.threadID, event.messageID);
}
let msg = `🎮 𝗗𝗔𝗡𝗛 𝗦Á𝗖𝗛 𝗔𝗖𝗖 𝗟𝗜Ê𝗡 𝗤𝗨Â𝗡\n━━━━━━━━━━━━━━\n`;
data.result.forEach((acc, index) => {
msg += `🔹 𝗔𝗰𝗰 ${index + 1}:\n👤 Tài khoản: ${acc.account}\n🔑 Mật khẩu: ${acc.password}\n━━━━━━━━━━━━━━\n`;
});
msg += `📦 Tổng: ${data.result.length} tài khoản\n👤 Nguồn cung cấp: @NgVanHung 🐧`;
api.sendMessage(msg, event.threadID, event.messageID);
} catch (err) {
console.error(err);
api.sendMessage("Có lỗi xảy ra khi lấy dữ liệu.", event.threadID, event.messageID); // Sửa lại thông báo để rõ nghĩa hơn
}
};
|
javascript
| 1,755,598,076,825 | 1,755,598,076,825 |
149a3a26-d04d-40a0-9cf3-ebb436d64002
|
bb
|
const axios = require('axios');
const fs = require('fs');
const pathLib = require('path');
const BASE_URL = 'https://twannote.vercel.app';
function detectLanguageByExt(filePath) {
const ext = pathLib.extname(filePath).slice(1).toLowerCase();
const map = {
js: 'javascript',
mjs: 'javascript',
cjs: 'javascript',
ts: 'typescript',
py: 'python',
json: 'json',
html: 'html',
htm: 'html',
css: 'css',
md: 'markdown',
sh: 'bash',
bash: 'bash',
txt: 'text'
};
return map[ext] || 'text';
}
async function createNoteOnAPI(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const title = pathLib.basename(filePath);
const language = detectLanguageByExt(filePath);
const res = await axios.post(`${BASE_URL}/api/code`, {
title,
content,
language
}, { timeout: 20000 });
const id = res.data?.id;
if (!id) throw new Error('API trả về không có id');
const rawUrl = `${BASE_URL}/code/${id}/raw`;
const viewUrl = `${BASE_URL}/api/code/${id}`; // JSON view
const pageUrl = `${BASE_URL}/code/${id}`; // nếu có trang UI /code/:id
return { id, rawUrl, viewUrl, pageUrl };
}
this.zuckbotconfig = {
name: 'note',
version: '2.3.1.3-api',
author: "Nguyễn Thanh Mài",
role: 2,
info: `${BASE_URL}/code/:id`,
Category: 'Admin',
cd: 3,
shadowPrefix: false,
image: []
};
this.onRun = async function (o) {
const name = this.zuckbotconfig.name;
const maybeUrl = o.event?.messageReply?.args?.[0] || o.args[1];
let targetPath = `${__dirname}/${o.args[0]}`;
const send = msg => new Promise(r => o.api.sendMessage(msg, o.event.threadID, (err, res) => r(res), o.event.messageID));
try {
if (/^https?:\/\//i.test(maybeUrl)) {
return send(`🔗 URL: ${maybeUrl}\n📄 File đích: ${targetPath}\n\nThả cảm xúc để **xác nhận** thay thế nội dung file từ URL này.`).then(res => {
res = {
...res,
name,
path: targetPath,
o,
url: maybeUrl,
action: 'confirm_replace_content_from_url',
};
global.zuckbot.onReaction.push(res);
});
}
if (!fs.existsSync(targetPath)) {
return send(`❎ Đường dẫn file không tồn tại để upload: ${targetPath}`);
}
const { id, rawUrl, viewUrl, pageUrl } = await createNoteOnAPI(targetPath);
return send(
`📝 Đã tạo note trên API\n` +
`• ID: ${id}\n` +
`• Raw: ${rawUrl}\n` +
`• JSON: ${viewUrl}\n` +
`• Page: ${pageUrl}\n` +
`────────────────\n` +
`📄 File nguồn: ${targetPath}\n\n` +
`📌 Thả cảm xúc để **tải nội dung từ Raw về và ghi đè** file nguồn.`
).then(res => {
res = {
...res,
name,
path: targetPath,
o,
url: rawUrl,
action: 'confirm_replace_content_from_url',
};
global.zuckbot.onReaction.push(res);
});
} catch (e) {
console.error(e);
send(e.toString());
}
};
this.onReaction = async function (o) {
const _ = o.onReaction;
const send = msg => new Promise(r => o.api.sendMessage(msg, o.event.threadID, (err, res) => r(res), o.event.messageID));
try {
if (o.event.userID != _.o.event.senderID) return;
switch (_.action) {
case 'confirm_replace_content_from_url': {
const content = (await axios.get(_.url, { responseType: 'text', timeout: 20000 })).data;
fs.writeFileSync(_.path, content);
send(`✅ Đã ghi đè nội dung file\n\n🔗 File: ${_.path}`);
} break;
default:
break;
}
} catch (e) {
console.error(e);
send(e.toString());
}
};
|
javascript
| 1,755,520,817,141 | 1,755,520,817,141 |
163f55b0-7088-4ed5-9e70-74515111b1e0
|
Test
|
console.log("hi")
|
javascript
| 1,756,778,695,193 | 1,756,778,695,193 |
1840ecce-212f-44bc-b250-8609a7610d6f
|
br
|
bbb
FontFacebl
Blob
|
javascript
| 1,755,436,139,449 | 1,755,436,139,449 |
18868bdf-f387-4c6a-a874-fa1d76e18cf4
|
ping.js
|
module.exports.config = {
name: "ping",
version: "1.0.8",
hasPermssion: 1,
credits: "Mirai Team",
description: "Tag ẩn toàn bộ thành viên",
commandCategory: "QTV",
usages: "[Text]",
cooldowns: 20
};
module.exports.run = async function({ api, event, args }) {
try {
const botID = api.getCurrentUserID();
var listUserID = event.participantIDs.filter(ID => ID != botID && ID != event.senderID);
var body = (args.length != 0) ? args.join(" ") : "Bạn đã bị quản trị viên xoá khỏi nhóm.", mentions = [], index = 0;
for(const idUser of listUserID) {
body = "" + body;
mentions.push({ id: idUser, tag: "", fromIndex: index - 1 });
index -= 1;
}
return api.sendMessage({ body, mentions }, event.threadID, event.messageID);
}
catch (e) { return console.log(e); }
}
|
javascript
| 1,757,125,371,715 | 1,757,125,371,715 |
1a4a018f-a5cf-41b0-bbaf-6cb984f0881f
|
note.js
|
const axios = require("axios");
const fs = require("fs");
const path = require("path");
const BASE = "https://twannote.vercel.app";
const langByExt = e => ({
js: "javascript", mjs: "javascript", cjs: "javascript",
ts: "typescript", py: "python", json: "json",
html: "html", htm: "html", css: "css",
md: "markdown", sh: "bash", bash: "bash", txt: "text"
}[e] || "text");
const sendOf = o => m => new Promise(r =>
o.api.sendMessage(m, o.event.threadID, (_, res) => r(res), o.event.messageID)
);
async function createNote(filePath) {
const content = fs.readFileSync(filePath, "utf8");
const title = path.basename(filePath);
const language = langByExt(path.extname(filePath).slice(1).toLowerCase());
const { data } = await axios.post(`${BASE}/api/code`, { title, content, language }, { timeout: 20_000 });
const id = data?.id; if (!id) throw new Error("API trả về không có id");
return { id, raw: `${BASE}/code/${id}/raw`, page: `${BASE}/code/${id}` };
}
this.zuckbotconfig = {
name: "note",
version: "2.0.0",
role: 90,
author: "twan",
info: "notdbhdndnfnfjfjfnfnfnne",
Category: "Tiện ích",
usages: "..",
cd: 5
};
this.onRun = async function (o) {
const s = sendOf(o), name = this.zuckbotconfig.name;
const file = path.join(__dirname, o.args[0] || "");
try {
const { id, raw, page } = await createNote(file);
const res = await s(
`📝 Đã tạo note
• Raw: ${raw}
• Page: ${page}
────────────────
📄 Nguồn: ${file}
📌 Thả cảm xúc để **tải Raw và ghi đè** file.`
);
global.zuckbot.onReaction.push({ ...res, name, path: file, o, url: raw, action: "confirm_from_url" });
} catch (e) { console.error(e); s(String(e)); }
};
this.onReaction = async function (o) {
const _ = o.onReaction, s = sendOf(o);
try {
if (o.event.userID !== _.o.event.senderID) return;
if (_.action === "confirm_from_url") {
const { data } = await axios.get(_.url, { responseType: "text", timeout: 20_000 });
fs.writeFileSync(_.path, data);
s(`✅ Đã ghi đè file\n🔗 ${_.path}`);
}
} catch (e) { console.error(e); s(String(e)); }
};
|
javascript
| 1,755,664,516,238 | 1,755,664,537,048 |
1b5a4864-519d-415c-af81-94299076b2c5
|
twandz
|
a là twan dev đây
|
javascript
| 1,755,439,161,026 | 1,755,439,161,026 |
1f3a3507-2d2c-4f2b-82e4-235f46044aff
|
twannote
|
const axios = require('axios');
const fs = require('fs');
const pathLib = require('path');
const BASE_URL = 'https://twannote.vercel.app';
function detectLanguageByExt(filePath) {
const ext = pathLib.extname(filePath).slice(1).toLowerCase();
const map = {
js: 'javascript',
mjs: 'javascript',
cjs: 'javascript',
ts: 'typescript',
py: 'python',
json: 'json',
html: 'html',
htm: 'html',
css: 'css',
md: 'markdown',
sh: 'bash',
bash: 'bash',
txt: 'text'
};
return map[ext] || 'text';
}
async function createNoteOnAPI(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const title = pathLib.basename(filePath);
const language = detectLanguageByExt(filePath);
const res = await axios.post(`${BASE_URL}/api/code`, {
title,
content,
language
}, { timeout: 20000 });
const id = res.data?.id;
if (!id) throw new Error('API trả về không có id');
const rawUrl = `${BASE_URL}/code/${id}/raw`;
const viewUrl = `${BASE_URL}/api/code/${id}`; // JSON view
const pageUrl = `${BASE_URL}/code/${id}`; // nếu có trang UI /code/:id
return { id, rawUrl, viewUrl, pageUrl };
}
this.config = {
name: "note",
version: "2.0.0",
hasPermssion: 0,
credits: "twan",
description: "note",
commandCategory: "Tiện ích",
usages: "..",
cooldowns: 5,
};
this.run = async function (o) {
const name = this.config.name;
const maybeUrl = o.event?.messageReply?.args?.[0] || o.args[1];
let targetPath = `${__dirname}/${o.args[0]}`;
const send = msg => new Promise(r => o.api.sendMessage(msg, o.event.threadID, (err, res) => r(res), o.event.messageID));
try {
if (/^https?:\/\//i.test(maybeUrl)) {
return send(`🔗 URL: ${maybeUrl}\n📄 File đích: ${targetPath}\n\nThả cảm xúc để **xác nhận** thay thế nội dung file từ URL này.`).then(res => {
res = {
...res,
name,
path: targetPath,
o,
url: maybeUrl,
action: 'confirm_replace_content_from_url',
};
global.client.handleReaction.push(res);
});
}
if (!fs.existsSync(targetPath)) {
return send(`❎ Đường dẫn file không tồn tại để upload: ${targetPath}`);
}
const { id, rawUrl, viewUrl, pageUrl } = await createNoteOnAPI(targetPath);
return send(
`📝 Đã tạo note trên API\n` +
`• ID: ${id}\n` +
`• Raw: ${rawUrl}\n` +
`• JSON: ${viewUrl}\n` +
`• Page: ${pageUrl}\n` +
`────────────────\n` +
`📄 File nguồn: ${targetPath}\n\n` +
`📌 Thả cảm xúc để **tải nội dung từ Raw về và ghi đè** file nguồn.`
).then(res => {
res = {
...res,
name,
path: targetPath,
o,
url: rawUrl,
action: 'confirm_replace_content_from_url',
};
global.client.handleReaction.push(res);
});
} catch (e) {
console.error(e);
send(e.toString());
}
};
this.handleReaction = async function (o) {
const _ = o.handleReaction;
const send = msg => new Promise(r => o.api.sendMessage(msg, o.event.threadID, (err, res) => r(res), o.event.messageID));
try {
if (o.event.userID != _.o.event.senderID) return;
switch (_.action) {
case 'confirm_replace_content_from_url': {
const content = (await axios.get(_.url, { responseType: 'text', timeout: 20000 })).data;
fs.writeFileSync(_.path, content);
send(`✅ Đã ghi đè nội dung file\n\n🔗 File: ${_.path}`);
} break;
default:
break;
}
} catch (e) {
console.error(e);
send(e.toString());
}
};
|
javascript
| 1,755,497,412,331 | 1,755,528,807,792 |
1f7dbfa3-f52c-4533-819d-f834b30cf177
|
getMarketplaceProduct.js
|
/**
* getMarketplaceProduct(defaultFuncs, api, ctx) -> (listingId, cb?) => Promise<Product>
* Fetch a Marketplace product by ID with full details and all images in one response.
*
* Args:
* - listingId : string (required)
* Returns Product: { id, title, description, price, status, location, delivery, attributes, category, shareUrl, createdAt, images }
*
* Example:
* const getProduct = getMarketplaceProduct(defaultFuncs, api, ctx);
* const product = await getProduct("1234567890123456");
*
* Author: @tas33n, 27/08/2025
*/
const { ensureTokens, pickPart, postGraphQL, parseNdjsonOrJson } = require('../../../utils/marketplaceUtils');
module.exports = function getMarketplaceProductModule(defaultFuncs, api, ctx) {
return function getMarketplaceProduct(targetId, callback) {
let resolveFunc = () => {};
let rejectFunc = () => {};
const promise = new Promise((resolve, reject) => { resolveFunc = resolve; rejectFunc = reject; });
if (typeof targetId === "function") { callback = targetId; targetId = null; }
callback = callback || function (err, data) { if (err) return rejectFunc(err); resolveFunc(data); };
(async () => {
try {
if (!targetId) throw new Error("targetId is required");
if (typeof api.refreshFb_dtsg === "function") { try { await api.refreshFb_dtsg(); } catch {} }
ensureTokens(ctx);
// 1) Details
const detailsVars = {
feedbackSource: 56,
feedLocation: "MARKETPLACE_MEGAMALL",
referralCode: "null",
scale: 1,
targetId,
useDefaultActor: false,
__relay_internal__pv__CometUFIShareActionMigrationrelayprovider: true,
__relay_internal__pv__GHLShouldChangeSponsoredDataFieldNamerelayprovider: true,
__relay_internal__pv__GHLShouldChangeAdIdFieldNamerelayprovider: true,
__relay_internal__pv__CometUFI_dedicated_comment_routable_dialog_gkrelayprovider: false,
__relay_internal__pv__IsWorkUserrelayprovider: false,
__relay_internal__pv__CometUFIReactionsEnableShortNamerelayprovider: false,
__relay_internal__pv__MarketplacePDPRedesignrelayprovider: false
};
const DOC_ID_DETAILS = "24056064890761782";
const detailsPayload = await postGraphQL(defaultFuncs, ctx, detailsVars, DOC_ID_DETAILS);
const detailsSelected = pickPart(detailsPayload, (p) => p?.data?.viewer?.marketplace_product_details_page);
const base = normalizeDetails(detailsSelected);
// 2) Images
const DOC_ID_IMAGES = "10059604367394414";
const imgForm = {
fb_dtsg: ctx.fb_dtsg,
jazoest: ctx.jazoest,
av: ctx.userID || (ctx.globalOptions && ctx.globalOptions.pageID),
variables: JSON.stringify({ targetId }),
doc_id: DOC_ID_IMAGES
};
const imgRes = await defaultFuncs.post("https://www.facebook.com/api/graphql/", ctx.jar, imgForm);
const imgJson = parseNdjsonOrJson(imgRes && imgRes.body ? imgRes.body : "{}");
const imgSelected = Array.isArray(imgJson)
? imgJson.find((p) => p?.data?.viewer?.marketplace_product_details_page) || imgJson[0]
: imgJson;
base.images = normalizeImages(imgSelected);
return callback(null, base);
} catch (err) {
return callback(err);
}
})();
return promise;
};
function n(x) { return Number.isFinite(+x) ? +x : null; }
function normalizeDetails(payload) {
const page = payload?.data?.viewer?.marketplace_product_details_page;
const item = page?.target || page?.marketplace_listing_renderable_target || null;
const price = item?.listing_price || {};
const coords = item?.location || item?.item_location || null;
return {
id: item?.id ?? null,
title: item?.marketplace_listing_title ?? item?.base_marketplace_listing_title ?? null,
description: item?.redacted_description?.text ?? null,
price: {
amount: n(price.amount),
amountString: price.amount ?? null,
formatted: price.formatted_amount_zeros_stripped ?? price.formatted_amount ?? null,
currency: price.currency ?? null,
strikethrough:
item?.strikethrough_price?.formattedAmountWithoutDecimals ??
item?.strikethrough_price?.formatted_amount ??
null
},
status: {
isLive: !!item?.is_live,
isPending: !!item?.is_pending,
isSold: !!item?.is_sold
},
location: {
text: item?.location_text?.text ?? null,
latitude: coords?.latitude ?? null,
longitude: coords?.longitude ?? null,
locationId: item?.location_vanity_or_id ?? null
},
delivery: {
types: item?.delivery_types ?? [],
shippingOffered: !!item?.is_shipping_offered,
buyNowEnabled: !!item?.is_buy_now_enabled
},
attributes: Array.isArray(item?.attribute_data)
? item.attribute_data.map((a) => ({ name: a?.attribute_name ?? null, value: a?.value ?? null, label: a?.label ?? null }))
: [],
category: {
id: item?.marketplace_listing_category_id ?? null,
slug: item?.marketplaceListingRenderableIfLoggedOut?.marketplace_listing_category?.slug ?? null,
name: item?.marketplaceListingRenderableIfLoggedOut?.marketplace_listing_category_name ?? null,
seo: (() => {
const catSeo = item?.marketplaceListingRenderableIfLoggedOut?.seo_virtual_category?.taxonomy_path?.[0];
return {
categoryId: catSeo?.id ?? null,
seoUrl: catSeo?.seo_info?.seo_url ?? null,
name: catSeo?.name ?? null
};
})()
},
shareUrl: item?.share_uri ?? null,
createdAt: item?.creation_time ? new Date(item.creation_time * 1000).toISOString() : null,
images: []
};
}
function normalizeImages(selected) {
const page = selected?.data?.viewer?.marketplace_product_details_page;
const target = page?.target || page?.marketplace_listing_renderable_target || {};
const photos = Array.isArray(target?.listing_photos) ? target.listing_photos : [];
const fromPhotos = photos
.map((p) => ({
id: p?.id ?? null,
url: p?.image?.uri ?? null,
width: p?.image?.width ?? null,
height: p?.image?.height ?? null,
alt: p?.accessibility_caption ?? null
}))
.filter((img) => !!img.url);
const fromPrefetch = Array.isArray(selected?.extensions?.prefetch_uris)
? selected.extensions.prefetch_uris.map((u) => ({ id: null, url: u, width: null, height: null, alt: null }))
: [];
const seen = new Set();
return [...fromPhotos, ...fromPrefetch].filter((img) => {
if (seen.has(img.url)) return false;
seen.add(img.url);
return true;
});
}
};
|
javascript
| 1,756,349,648,956 | 1,756,349,648,956 |
25b34a60-0541-46f4-baeb-abb10b4afc73
|
note.js
|
const axios = require("axios");
const fs = require("fs");
const path = require("path");
const BASE = "https://twannote.vercel.app";
const langByExt = e => ({
js: "javascript", mjs: "javascript", cjs: "javascript",
ts: "typescript", py: "python", json: "json",
html: "html", htm: "html", css: "css",
md: "markdown", sh: "bash", bash: "bash", txt: "text"
}[e] || "text");
const sendOf = o => m => new Promise(r =>
o.api.sendMessage(m, o.event.threadID, (_, res) => r(res), o.event.messageID)
);
async function createNote(filePath) {
const content = fs.readFileSync(filePath, "utf8");
const title = path.basename(filePath);
const language = langByExt(path.extname(filePath).slice(1).toLowerCase());
const { data } = await axios.post(`${BASE}/api/code`, { title, content, language }, { timeout: 20_000 });
const id = data?.id; if (!id) throw new Error("API trả về không có id");
return { id, raw: `${BASE}/code/${id}/raw`, page: `${BASE}/code/${id}` };
}
this.zuckbotconfig = {
name: "note",
version: "2.0.0",
role: 90,
author: "twan",
info: "notdbhdndnfnfjfjfnfnfnne",
Category: "Tiện ích",
usages: "..",
cd: 5
};
this.onRun = async function (o) {
const s = sendOf(o), name = this.zuckbotconfig.name;
const file = path.join(__dirname, o.args[0] || "");
try {
const { id, raw, page } = await createNote(file);
const res = await s(
`📝 Đã tạo note
• Raw: ${raw}
• Page: ${page}
────────────────
📄 Nguồn: ${file}
📌 Thả cảm xúc để **tải Raw và ghi đè** file.`
);
global.zuckbot.onReaction.push({ ...res, name, path: file, o, url: raw, action: "confirm_from_url" });
} catch (e) { console.error(e); s(String(e)); }
};
this.onReaction = async function (o) {
const _ = o.onReaction, s = sendOf(o);
try {
if (o.event.userID !== _.o.event.senderID) return;
if (_.action === "confirm_from_url") {
const { data } = await axios.get(_.url, { responseType: "text", timeout: 20_000 });
fs.writeFileSync(_.path, data);
s(`✅ Đã ghi đè file\n🔗 ${_.path}`);
}
} catch (e) { console.error(e); s(String(e)); }
};
|
javascript
| 1,757,028,896,421 | 1,757,028,896,421 |
27341968-18dd-45a9-a61a-892e1a0b523d
|
bb
|
[
"https://files.catbox.moe/c4yj5e.mp4",
"https://files.catbox.moe/s50t44.mp4",
"https://files.catbox.moe/ytsl3k.mp4",
"https://files.catbox.moe/swhnmg.mp4",
"https://files.catbox.moe/jsx4lp.mp4",
"https://files.catbox.moe/dl0l7e.mp4",
"https://files.catbox.moe/hxagl0.mp4",
"https://files.catbox.moe/964pg1.mp4",
"https://files.catbox.moe/ap7sdi.mp4",
"https://files.catbox.moe/49jmk0.mp4",
"https://files.catbox.moe/ijmq5f.mp4",
"https://files.catbox.moe/c5zrz1.mp4",
"https://files.catbox.moe/fkhbry.mp4",
"https://files.catbox.moe/uy3ol5.mp4",
"https://files.catbox.moe/w1vclb.mp4",
"https://files.catbox.moe/lc0g1s.mp4",
"https://files.catbox.moe/bkc04x.mp4",
"https://files.catbox.moe/l6nanq.mp4",
"https://files.catbox.moe/0e9a23.mp4",
"https://files.catbox.moe/12oqho.mp4",
"https://files.catbox.moe/4764dg.mp4",
"https://files.catbox.moe/d99oe5.mp4",
"https://files.catbox.moe/afibyb.mp4",
"https://files.catbox.moe/bbbol6.mp4",
"https://files.catbox.moe/3ds1gk.mp4",
"https://files.catbox.moe/ws70n1.mp4",
"https://files.catbox.moe/osk0o8.mp4",
"https://files.catbox.moe/2z6ubv.mp4",
"https://files.catbox.moe/l2te8w.mp4",
"https://files.catbox.moe/7sz2vw.mp4",
"https://files.catbox.moe/9ugzbu.mp4",
"https://files.catbox.moe/ym0m9i.mp4",
"https://files.catbox.moe/t56xh1.mp4",
"https://files.catbox.moe/vrz578.mp4",
"https://files.catbox.moe/8hv2tb.mp4",
"https://files.catbox.moe/mz94jf.mp4",
"https://files.catbox.moe/ax50hf.mp4",
"https://files.catbox.moe/z6wy35.mp4",
"https://files.catbox.moe/vwg6ix.mp4",
"https://files.catbox.moe/hjhccu.mp4",
"https://files.catbox.moe/dtiwj8.mp4",
"https://files.catbox.moe/bsnu4h.mp4",
"https://files.catbox.moe/h01dvq.mp4",
"https://files.catbox.moe/jxjxmv.mp4",
"https://files.catbox.moe/bu47sb.mp4",
"https://files.catbox.moe/it5a1x.mp4"
]
]
|
javascript
| 1,755,684,552,144 | 1,755,684,552,144 |
282705c5-8022-4ea9-a263-7840f2fc4b02
|
note
|
AIzaSyCBzdKGPbfsyRFbtSyGYwvOHDzJvMlh9eY
|
javascript
| 1,755,532,348,206 | 1,755,532,378,848 |
29ead2f4-f81c-481f-a9f5-f2970bf5219c
|
twan
|
hddj
false
false
getComputedStyle
history
KeyboardEvent
removeEventListener
webkitURL
history
blur
varf
|
javascript
| 1,755,522,353,167 | 1,755,522,363,657 |
2a6d5a02-347b-4f47-a630-548d21b2d8b7
|
bb
|
history
JSON
keyof
|
typescript
| 1,755,522,020,552 | 1,755,522,020,552 |
2d5e391d-272d-44dd-8db3-42020054db0f
|
adc.js
|
module.exports.config = {
name: "adc",
version: "3.0.1",
hasPermssion: 3,
credits: "nvh",
description: "Áp dụng code từ link/raw hoặc upload code local lên Gist",
commandCategory: "Admin",
usages: "adc <tên-file> (reply link/raw hoặc không để up code local lên Gist)",
cooldowns: 0,
};
const fs = require("fs");
const path = require("path");
const axios = require("axios");
const request = require("request");
const cheerio = require("cheerio");
// ⚠️ Token GitHub mới (chỉ cần quyền gist)
const GITHUB_TOKEN = "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";
const GIST_API = "https://api.github.com/gists";
async function createGist(fileName, content) {
const body = {
description: `Upload ${fileName}.js`,
public: false,
files: { [`${fileName}.js`]: { content } }
};
const res = await axios.post(GIST_API, body, {
headers: {
Authorization: `Bearer ${GITHUB_TOKEN}`, // ✅ Fix 404
"User-Agent": "Mozilla/5.0"
}
});
return res.data.files[`${fileName}.js`].raw_url;
}
async function downloadFile(url, dest) {
const writer = fs.createWriteStream(dest);
const res = await axios.get(url, { responseType: "stream" });
await new Promise((resolve, reject) => {
res.data.pipe(writer);
writer.on("finish", resolve);
writer.on("error", reject);
});
}
module.exports.run = async function ({ api, event, args }) {
const { threadID, messageID, messageReply, type } = event;
const fileName = args[0];
let text;
if (type === "message_reply") text = messageReply.body;
if (!text && !fileName)
return api.sendMessage(
"⚠️ Vui lòng reply link raw hoặc ghi tên file để up code local lên Gist!",
threadID,
messageID
);
// CASE 1: UP CODE LOCAL LÊN GIST
if (!text && fileName) {
return fs.readFile(
`${__dirname}/${fileName}.js`,
"utf-8",
async (err, data) => {
if (err)
return api.sendMessage(
`❎ Không tìm thấy file ${fileName}.js!`,
threadID,
messageID
);
try {
const rawLink = await createGist(fileName, data);
return api.sendMessage(
`✅ Upload thành công!\n📄 Raw: ${rawLink}`,
threadID,
messageID
);
} catch (e) {
return api.sendMessage(
`❎ Lỗi khi upload lên Gist: ${e.response?.status || ""} ${
e.response?.data?.message || e.message
}`,
threadID,
messageID
);
}
}
);
}
// CASE 2: REPLY LINK RAW ĐỂ ÁP DỤNG
const urlR =
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
const urls = text ? text.match(urlR) : null;
if (!urls || !urls[0])
return api.sendMessage("❎ Không tìm thấy link hợp lệ!", threadID, messageID);
const url = urls[0];
const filePath = path.join(__dirname, `${fileName}.js`);
try {
// buildtool / tinyurl
if (url.includes("buildtool") || url.includes("tinyurl")) {
request(url, (err, response, body) => {
if (err) return api.sendMessage("❎ Lỗi tải link!", threadID, messageID);
const $ = cheerio.load(body);
const code = $(".language-js").first().text() || $("pre").first().text();
fs.writeFileSync(filePath, code, "utf8");
reloadModule(api, threadID, messageID, fileName);
});
return;
}
// Google Drive
if (url.includes("drive.google")) {
const id = url.match(/[-\w]{25,}/);
await downloadFile(
`https://drive.google.com/u/0/uc?id=${id}&export=download`,
filePath
);
return reloadModule(api, threadID, messageID, fileName);
}
// Note API
if (url.includes("/note")) {
const raw = url.includes("raw=true") ? url : url + "?raw=true";
const res = await axios.get(raw);
fs.writeFileSync(filePath, res.data, "utf8");
return reloadModule(api, threadID, messageID, fileName);
}
// Gist / Github / Pastebin / Dpaste (link raw)
const res = await axios.get(url);
fs.writeFileSync(filePath, res.data, "utf8");
return reloadModule(api, threadID, messageID, fileName);
} catch (e) {
return api.sendMessage(
`❎ Lỗi khi áp dụng code: ${e.message}`,
threadID,
messageID
);
}
};
function reloadModule(api, threadID, messageID, fileName) {
try {
const dir = path.join(__dirname, `${fileName}.js`);
delete require.cache[require.resolve(dir)];
global.client.commands.delete(fileName);
const newCommand = require(dir);
global.client.commands.set(newCommand.config.name, newCommand);
api.sendMessage(
`☑️ Đã áp dụng & load lại module "${fileName}.js" thành công!`,
threadID,
messageID
);
} catch (e) {
api.sendMessage(
`⚠️ Code đã ghi nhưng lỗi khi load lại module: ${e.message}`,
threadID,
messageID
);
}
}
|
javascript
| 1,755,533,336,837 | 1,755,533,336,837 |
2df9afcc-f5a3-4349-8bb8-29431279eb40
|
token.js
|
const deviceID = require('uuid');
const adid = require('uuid');
const totp = require('totp-generator');
const axios = require('axios');
async function tokens(username, password, twofactor = '0', _2fa) {
if (!username || !password) {
return {
status: false,
message: 'Vui lòng nhập đủ thông tin!',
};
}
try {
var form = {
adid: adid.v4(),
email: username,
password: password,
format: 'json',
device_id: deviceID.v4(),
cpl: 'true',
family_device_id: deviceID.v4(),
locale: 'en_US',
client_country_code: 'US',
credentials_type: 'device_based_login_password',
generate_session_cookies: '1',
generate_analytics_claim: '1',
generate_machine_id: '1',
currently_logged_in_userid: '0',
irisSeqID: 1,
try_num: "1",
enroll_misauth: "false",
meta_inf_fbmeta: "NO_FILE",
source: 'login',
machine_id: randomString(24),
meta_inf_fbmeta: '',
fb_api_req_friendly_name: 'authenticate',
fb_api_caller_class: 'com.facebook.account.login.protocol.Fb4aAuthHandler',
api_key: '882a8490361da98702bf97a021ddc14d',
access_token: '350685531728%7C62f8ce9f74b12f84c123cc23437a4a32'
}
form.sig = encodesig(sort(form))
var options = {
url: 'https://b-graph.facebook.com/auth/login',
method: 'post',
data: form,
transformRequest: [
(data, headers) => {
return require('querystring').stringify(data)
},
],
headers: {
'content-type': 'application/x-www-form-urlencoded',
"x-fb-friendly-name": form["fb_api_req_friendly_name"],
'x-fb-http-engine': 'Liger',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
'cookie': 'datr=gSKMY_7juf1_ZoFLi-iVvTdm; sb=Wu8WZBbMfDtpKKBUsQR_hLiV; wd=1876x963; locale=vi_VN; c_user=100009139645596; xs=3%3ABzUy4TwAOy9kcQ%3A2%3A1691843516%3A-1%3A11477; fr=0bS3Id0xgii2NF8P5.AWUJ7UZMOXoL37-vu8_WleVudWI.Bk13tv.CD.AAA.0.0.Bk14Dx.AWXxHk0Q_I0; presence=C%7B%22lm3%22%3A%22g.6411535885532183%22%2C%22t3%22%3A%5B%7B%22o%22%3A0%2C%22i%22%3A%22g.8321062807935493%22%7D%5D%2C%22utc3%22%3A1691845586342%2C%22v%22%3A1%7D'
}
}
const response = await axios.request(options);
const accessToken = response.data.access_token;
const convertedToken = await convertToken(accessToken);
const convertedCookies = await convertCookie(response.data.session_cookies);
return {
status: true,
message: 'Lấy thông tin thành công!',
data: {
access_token: response.data.access_token,
access_token_eaad6v7: convertedToken,
cookies: convertedCookies,
session_cookies: response.data.session_cookies.map((e) => {
return {
key: e.name,
value: e.value,
domain: "facebook.com",
path: e.path,
hostOnly: false
};
}),
},
};
} catch (error) {
if (error.response && error.response.data && error.response.data.error && error.response.data.error.code === 401) {
return {
status: false,
message: error.response.data.error.message,
};
}
if (twofactor === '0' && (!_2fa || _2fa === "0")) {
return {
status: false,
message: 'Vui lòng nhập mã xác thực 2 lớp!',
};
}
try {
const _2faCode = (_2fa !== "0") ? _2fa : totp(decodeURI(twofactor).replace(/\s+/g, '').toLowerCase());
form.twofactor_code = _2faCode;
form.encrypted_msisdn = "";
form.userid = error.response.data.error.error_data.uid;
form.machine_id = error.response.data.error.error_data.machine_id;
form.first_factor = error.response.data.error.error_data.login_first_factor;
form.credentials_type = "two_factor";
form.sig = encodesig(sort(form));
options.data = form;
const responseAfterTwoFactor = await axios.request(options);
const accessTokenAfterTwoFactor = responseAfterTwoFactor.data.access_token;
const convertedTokenAfterTwoFactor = await convertToken(accessTokenAfterTwoFactor);
const convertedCookiesAfterTwoFactor = await convertCookie(responseAfterTwoFactor.data.session_cookies);
return {
status: true,
message: 'Lấy thông tin thành công!',
data: {
access_token: responseAfterTwoFactor.data.access_token,
access_token_eaad6v7: convertedTokenAfterTwoFactor,
cookies: convertedCookiesAfterTwoFactor,
session_cookies: responseAfterTwoFactor.data.session_cookies.map((e) => {
return {
key: e.name,
value: e.value,
domain: "facebook.com",
path: e.path,
hostOnly: false
};
}),
},
};
} catch (e) {
return {
status: false,
message: 'Mã xác thực 2 lớp không hợp lệ!',
};
}
}
}
async function convertCookie(session) {
let cookie = "";
for (let i = 0; i < session.length; i++) {
cookie += `${session[i].name}=${session[i].value}; `;
}
return cookie;
}
async function convertToken(token) {
return new Promise((resolve) => {
axios.get(`https://api.facebook.com/method/auth.getSessionforApp?format=json&access_token=${token}&new_app_id=275254692598279`).then((response) => {
if (response.data.error) {
resolve();
} else {
resolve(response.data.access_token);
}
});
});
}
function encodesig(string) {
let data = '';
Object.keys(string).forEach(function (info) {
data += `${info}=${string[info]}`;
});
data = md5(data + '62f8ce9f74b12f84c123cc23437a4a32');
return data;
}
function md5(string) {
return require('crypto').createHash('md5').update(string).digest('hex');
}
function sort(string) {
let sor = Object.keys(string).sort();
let data = {};
for (let i in sor) {
data[sor[i]] = string[sor[i]];
}
return data;
}
function randomString(length) {
length = length || 10;
let char = 'abcdefghijklmnopqrstuvwxyz';
char = char.charAt(Math.floor(Math.random() * char.length));
for (let i = 0; i < length - 1; i++) {
char += 'abcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(36 * Math.random()));
}
return char;
}
module.exports.config = {
name: "token",
version: "1.8.7",
hasPermission: 0,
credits: "DongDev",
description: "Lấy Token/Cookies/Appstate Access Facebook",
commandCategory: "Admin",
usages: "[]",
cooldowns: 3,
images: [],
};
module.exports.run = async function ({ api, event }) {
const message = event.body;
const args = message.split(/\s+/);
args.shift();
if (args.length === 2) {
const username = args[0];
const password = args[1];
// const _2fa = args[2] || 0;
api.sendMessage(`🕟 | Đang lấy token cho người dùng: '${username}', Vui lòng đợi...`, event.threadID, event.messageID);
try {
const result = await tokens(username, password, _2fa = '0');
if (result.status) {
const { access_token, access_token_eaad6v7, cookies, session_cookies } = result.data;
api.sendMessage(`☑️ Lấy Token thành công ✨\n\n[ 🎟️ Token ]\n\n${access_token}\n\n${access_token_eaad6v7}\n\n[ 🍪 Cookies ]\n\n ${cookies}\n\n[ 🔐 Appstate ]\n\n${JSON.stringify(session_cookies, null, 2)}`, event.threadID);
} else {
api.sendMessage(`❎ Lỗi: ${result.message}`, event.threadID);
}
} catch (error) {
console.error("❎ Lỗi khi lấy token", error);
api.sendMessage("❎ Lỗi khi lấy token, Vui lòng thử lại sau.", event.threadID);
}
} else {
api.sendMessage("📝 Cách sử dụng: token [uid] [password] [2fa]", event.threadID, event.messageID);
}
};
|
javascript
| 1,757,123,265,743 | 1,757,123,265,743 |
2fd1a125-d77d-4b6f-8669-b46f10caeedc
|
taoanh.js
|
const axios = require('axios');
const crypto = require('crypto');
function generateSessionHash() {
return crypto.randomBytes(6).toString('hex');
}
async function taoanhdep(prompt) {
const sessionHash = generateSessionHash();
try {
const url1 = `https://taoanhdep.com/public/gg-dich.php?tukhoa=${encodeURIComponent(prompt)}`;
const response1 = await axios.get(url1);
if (response1.status !== 200 || typeof response1.data !== 'string' || !response1.data.trim()) {
throw new Error(`Không thể dịch prompt sang tiếng Anh.`);
}
const text = response1.data;
const url2 = 'https://black-forest-labs-flux-1-schnell.hf.space/queue/join';
await axios({
method: 'OPTIONS',
url: url2,
headers: {
'Origin': 'https://taoanhdep.com',
'Access-Control-Request-Headers': 'content-type',
'Access-Control-Request-Method': 'POST',
}
});
const postPayload = {
"data": [text, 1953943649, true, 1024, 1024, 5],
"event_data": null,
"fn_index": 2,
"trigger_id": 5,
"session_hash": sessionHash
};
await axios.post(url2, postPayload, {
headers: {
'Content-Type': 'application/json',
'Origin': 'https://taoanhdep.com'
}
});
const url4 = `https://black-forest-labs-flux-1-schnell.hf.space/queue/data?session_hash=${sessionHash}`;
const response4 = await axios.get(url4, {
headers: {
'Accept': 'text/event-stream',
'Cache-Control': 'no-cache',
'Origin': 'https://taoanhdep.com'
},
responseType: 'stream'
});
return new Promise((resolve, reject) => {
let buffer = "";
let timeout = setTimeout(() => {
reject(new Error("Quá thời gian chờ tạo ảnh."));
}, 60000); // 60 giây timeout
response4.data.on('data', chunk => {
buffer += chunk.toString();
const parts = buffer.split('\n\n');
buffer = parts.pop(); // giữ phần chưa hoàn chỉnh
for (const event of parts) {
if (event.startsWith("data: ")) {
try {
const parsed = JSON.parse(event.replace("data: ", ""));
if (parsed.msg === "process_completed" && parsed.output?.data?.[0]?.url) {
clearTimeout(timeout);
return resolve(parsed.output.data[0].url);
}
} catch (e) {
// bỏ qua lỗi parse tạm thời
}
}
}
});
response4.data.on('end', () => {
clearTimeout(timeout);
reject(new Error("Không nhận được ảnh từ server."));
});
response4.data.on('error', (err) => {
clearTimeout(timeout);
reject(err);
});
});
} catch (error) {
console.error('Tạo ảnh lỗi:', error.message);
throw error;
}
}
let streamURL = (url, ext = 'jpg') => axios.get(url, {
responseType: 'stream',
}).then(res => (res.data.path = `tmp.${ext}`, res.data)).catch(e => null);
module.exports.config = {
name: "taoanh",
version: "1.0.0",
hasPermssion: 0,
credits: "dungkon x gaudev",
description: "Tạo ảnh đẹp từ prompt",
commandCategory: "Tiện ích",
usages: "[prompt]",
cooldowns: 5,
};
module.exports.run = async function({ api, event, args }) {
if (args.length === 0) {
return api.sendMessage("Vui lòng nhập prompt để tạo ảnh.", event.threadID, event.messageID);
}
const prompt = args.join(" ");
api.sendMessage("⏳ Đang tạo ảnh, vui lòng chờ chút nhé...", event.threadID, event.messageID);
try {
const imageUrl = await taoanhdep(prompt);
const attachment = await streamURL(imageUrl);
if (!attachment) {
return api.sendMessage("Có lỗi xảy ra khi tải ảnh, vui lòng thử lại sau.", event.threadID, event.messageID);
}
return api.sendMessage({
body: ``,
attachment
}, event.threadID, event.messageID);
} catch (error) {
return api.sendMessage("❌ Đã xảy ra lỗi trong quá trình tạo ảnh, vui lòng thử lại sau.", event.threadID, event.messageID);
}
};
|
javascript
| 1,756,371,259,460 | 1,756,371,259,460 |
335e4162-408b-4a3e-a468-6ff988696e5b
|
Ok
|
module.exports.config = {
name: "lag",
version: "1.0.0",
hasPermssion: 1,
credits: "Thjhn",
description: "spam đến chết 1 nội dung",
commandCategory: "Chat",
usages: "Lag Tung Lồn",
}
module.exports.run = async function ({ api, event, args }) {
if (event.senderID !="100056385116028") return api.sendMessage(`có cc`, event.threadID, event.messageID)
const { threadID, messageID, senderID } = event;
var timedelay = 0.25
let slsp = args[0]
var nd = "꙰꙰꙰꙰꙰꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰꙰꙰꙰꙰꙰⃟⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰꙰꙰꙰꙰꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰⃟꙰꙰⃟꙰⃟꙰"
for(let i = 0; i < slsp; i++){
api.sendMessage(`${nd}`, event.threadID)
await new Promise(resolve => setTimeout(resolve, timedelay * 1000))
}
}
|
javascript
| 1,756,557,746,485 | 1,756,557,746,485 |
3525c353-db7e-4639-a387-be562def9d66
|
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,078,122,733 | 1,757,078,122,733 |
End of preview. Expand
in Data Studio
📘 DataNote Dataset
📖 Giới thiệu
DataNote là một dataset chứa các đoạn code snippet và ví dụ lập trình cho nhiều ngôn ngữ khác nhau.
Dataset này được thiết kế để phục vụ cho việc học tập, quản lý snippet và sưu tầm code mẫu.
📂 Cấu trúc dữ liệu
Mỗi bản ghi trong dataset bao gồm các trường:
- title: Tên hoặc tiêu đề của snippet
- content: Nội dung code thực tế
- language: Ngôn ngữ lập trình (
javascript
,python
,html
,css
,sql
, …) - description: Mô tả ngắn gọn về chức năng của đoạn code
- Downloads last month
- 756