-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlove.js
More file actions
70 lines (65 loc) · 3.67 KB
/
Copy pathlove.js
File metadata and controls
70 lines (65 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module.exports.config = {
name: "love",
version: "1.0.1",
hasPermssion: 0,
credits: "MewMew", //del getinfo by Jukie
description: "Tìm Kiếm Nửa Kia Của Bạn fix by Jukie",
commandCategory: "Giải trí",
usages: "[boy/girl]",
cooldowns: 1
}
module.exports.run = async ({ api, event,args, Users }) => {
const axios = global.nodemodule["axios"];
const fs = global.nodemodule["fs-extra"];
if (!args[0]) {
var ThreadInfo = await api.getThreadInfo(event.threadID);
var all = ThreadInfo.userInfo
let data = [];
for (let u of all) {
if (u.gender == "MALE") {
if ( u != event.senderID) data.push(u.id)
}
if (u.gender == "FEMALE") {
if ( u != event.senderID) data.push(u.id)
}
}
console.log(data)
if (data.length == 0) return api.sendMessage("Rất tiếc! Không tìm thấy nửa đời của bạn :(", event.threadID, event.messageID);
let e = data[Math.floor(Math.random() * data.length)]
let a = (Math.random() * 50)+50;
var n = (await Users.getData(e)).name
const url = api.getCurrentUserID(e);
let getAvatar = (await axios.get(`https://graph.facebook.com/${e}/picture?height=720&width=720&access_token=170440784240186|bc82258eaaf93ee5b9f577a8d401bfc9`, { responseType: "arraybuffer" } )).data;
fs.writeFileSync( __dirname + "/cache/avt.png", Buffer.from(getAvatar, "utf-8") );
api.sendMessage({ body: `⚡️Tìm Kiếm Nửa Kia Của Bạn\n⚡️Tên: ${n}\n⚡️Mối Quan Hệ: Độc Thân (có thể)\n⚡️Độ Phù Hợp: ${a.toFixed(2)}%\n⚡️ID: ${e}\n⚡️Profile: fb.me/${url}`,
attachment: fs.createReadStream(__dirname + `/cache/avt.png`)
}, event.threadID, () => fs.unlinkSync(__dirname + `/cache/avt.png`), event.messageID);
}
else {
var ThreadInfo = await api.getThreadInfo(event.threadID);
var all = ThreadInfo.userInfo
let data = [];
if(args[0] == "boy"){
for (let u of all) {
if (u.gender == "MALE") {
if (u != event.senderID) data.push(u.id)
}
}}
else if(args[0] == "girl"){
for (let u of all) {
if (u.gender == "FEMALE") {
if (u != event.senderID) data.push(u.id)
}
}}
console.log(data)
if (data.length == 0) return api.sendMessage("⚡️Rất tiếc! Không tìm thấy nửa đời của bạn :(", event.threadID, event.messageID);
let e = data[Math.floor(Math.random() * data.length)]
let a = (Math.random() * 50)+50;
var n = (await Users.getData(e)).name
const url = api.getCurrentUserID(e);
let getAvatar = (await axios.get(`https://graph.facebook.com/${e}/picture?height=720&width=720&access_token=170440784240186|bc82258eaaf93ee5b9f577a8d401bfc9`, { responseType: "arraybuffer" } )).data;
fs.writeFileSync( __dirname + "/cache/avt.png", Buffer.from(getAvatar, "utf-8") );
api.sendMessage({ body: `⚡️Tìm Kiếm Nửa Kia Của Bạn\n⚡️Tên: ${n}\n⚡️Mối Quan Hệ: Độc Thân (có thể)\n⚡️Độ Phù Hợp: ${a.toFixed(2)}%\n⚡️ID: ${e}\n⚡️Profile: fb.me/${url}`,
attachment: fs.createReadStream(__dirname + `/cache/avt.png`)
}, event.threadID, () => fs.unlinkSync(__dirname + `/cache/avt.png`), event.messageID);}
};