fca-duong 0.0.1-security → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fca-duong might be problematic. Click here for more details.
- package/.cache/replit/nix/env.json +1 -0
- package/.replit +2 -0
- package/.upm/store.json +1 -0
- package/DOCS.md +1738 -0
- package/README.md +77 -3
- package/StateCrypt.js +22 -0
- package/broadcast.js +18 -0
- package/index.js +687 -0
- package/languages/languages.json +122 -0
- package/lib/getInfoNew.js +34 -0
- package/lib/getToken.js +44 -0
- package/logger.js +15 -0
- package/package.json +71 -3
- package/replit.nix +9 -0
- package/src/ReportV1.js +55 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +78 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +86 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeName.js +3 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +33 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +79 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadHistoryDeprecated.js +71 -0
- package/src/getThreadInfo.js +206 -0
- package/src/getThreadInfoDeprecated.js +56 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +66 -0
- package/src/getUserInfoV2.js +35 -0
- package/src/getUserInfoV3.js +64 -0
- package/src/getUserInfoV4.js +56 -0
- package/src/getUserInfoV5.js +62 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +629 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +337 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/utils.js +1246 -0
@@ -0,0 +1,122 @@
|
|
1
|
+
{
|
2
|
+
"vi": {
|
3
|
+
"index": {
|
4
|
+
"uptime": "Đã Hoàn Thành Kết Nối Đến Server Uptime Cho Url: ",
|
5
|
+
"erroUptime": "Server Uptime Gặp sự Cố, Không Thể Bật Uptime Cho Bạn!",
|
6
|
+
"errorLogin": "Appstate - Cookie Của Bạn Đã Bị Lỗi, Hãy Thay Cái Mới, Hoặc Vô Trình Duyệt Ẩn Danh Rồi Đăng Nhập Và Thử Lại !",
|
7
|
+
"checkpoint": "Phát Hiện CheckPoint - Không Đăng Nhập Được, Hãy Thử Logout Rồi Login Và Lấy Lại Appstate - Cookie !",
|
8
|
+
"loginSu": "Đăng Nhập Thành Công Tại UID: ",
|
9
|
+
"region": "Vùng Của Tài Khoản Là: ",
|
10
|
+
"login": "Đang Đăng Nhập...",
|
11
|
+
"loginError": "Sai Mật Khẩu Hoặc Tài Khoản !",
|
12
|
+
"errorFa": "Bạn Đang Sử Dụng 2 Bảo Mật !",
|
13
|
+
"okweb": "Xác Nhận Từ Trình Duyệt, Tiến Hành Các Quá Trình Đăng Nhập...",
|
14
|
+
"errorEnv": "Tạo Tệp ENV Thất Bại !",
|
15
|
+
"env": "Tạo Thành Công Tệp ENV !",
|
16
|
+
"errorPassRandom": "Đã Có Lỗi Khi Đang Try Tạo Mật Khẩu Ngẫu Nhiên",
|
17
|
+
"appstateDec": "Chưa Sẵn Sàng Để Giải Mã Appstate !",
|
18
|
+
"appstate": "Giải Mã Appstate Thành Công !",
|
19
|
+
"appstateError": "Appstate Đã Bị Lỗi ! Vui Lòng Thay Mới",
|
20
|
+
"oklogin": "Hoàn Thành Quá Trình Đăng Nhập !",
|
21
|
+
"newVersion": "Phiên Bản Mới Đã Được Publish: ",
|
22
|
+
"autoUpdate": "Tiến Hành Tự Động Cập Nhật Lên Phiên Bản Mới Nhất !",
|
23
|
+
"okUpdate": "Nâng Cấp Phiên Bản Thành Công!",
|
24
|
+
"restart": "Đang Khởi Động Lại...",
|
25
|
+
"errorUpdate": "Đã Xảy Ra Lỗi",
|
26
|
+
"checkVersion": "Bạn Hiện Đang Sử Dụng Phiên Bản: ",
|
27
|
+
"chucAdmin": "Chúc Các Admin Một Ngày Tốt Lành",
|
28
|
+
"errorUid": "Không Thể Lấy UID Hãy Thử Lại !",
|
29
|
+
"encAppstate": "Mã Hoá AppState Thành Công !"
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"en": {
|
33
|
+
"index": {
|
34
|
+
"uptime": "Completed Connection To Server Uptime For Url: ",
|
35
|
+
"erroUptime": "Uptime Server Has Problems, Can't Turn On Uptime For You!",
|
36
|
+
"errorLogin": "Appstate - Your Cookie Is Wrong, Please Replace It, Or Go To Incognito Browser Then Login And Try Again!",
|
37
|
+
"checkpoint": "Detected CheckPoint - Can't Login, Try Logout Then Login And Get Appstate - Cookie !",
|
38
|
+
"loginSu": "Successfully Login At UID: ",
|
39
|
+
"region": "Account's Region Is:",
|
40
|
+
"login": "Logging in...",
|
41
|
+
"loginError": "Wrong Password Or Account !",
|
42
|
+
"errorFa": "You're Using 2 Security !",
|
43
|
+
"okweb": "Confirm From Browser, Proceed to Login Process...",
|
44
|
+
"errorEnv": "Create ENV File Failed!",
|
45
|
+
"env": "Successfully Created ENV File!",
|
46
|
+
"errorPassRandom": "An error occurred while trying to generate a Random Password",
|
47
|
+
"appstateDec": "Not Ready To Decode Appstate !",
|
48
|
+
"appstate": "Decrypting Appstate Successfully!",
|
49
|
+
"appstateError": "Appstate Error ! Please Replace",
|
50
|
+
"oklogin": "Complete Login Process!",
|
51
|
+
"newVersion": "New Version Published: ",
|
52
|
+
"autoUpdate": "Proceed to Automatically Update to the Latest Version!",
|
53
|
+
"okUpdate": "Version Upgrade Successful!",
|
54
|
+
"restart": "Rebooting...",
|
55
|
+
"errorUpdate": "An error has occurred",
|
56
|
+
"checkVersion": "You Are Currently Using Version: ",
|
57
|
+
"chucAdmin": "Have a nice day Admin",
|
58
|
+
"errorUid": "Unable to Get UID Try Again !",
|
59
|
+
"encAppstate": "AppState Encryption Successful !"
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"th": {
|
63
|
+
"index": {
|
64
|
+
"uptime": "เสร็จสิ้นการเชื่อมต่อกับ Server Uptime สำหรับ URL: ",
|
65
|
+
"erroUptime": "เซิร์ฟเวอร์เวลาทำงานมีปัญหา ไม่สามารถเปิดเวลาทำงานให้คุณ!",
|
66
|
+
"errorLogin": "Appstate - คุกกี้ของคุณไม่ถูกต้อง โปรดแทนที่ด้วยอันใหม่ หรือไปที่เบราว์เซอร์ที่ไม่ระบุตัวตน จากนั้นลงชื่อเข้าใช้แล้วลองอีกครั้ง!",
|
67
|
+
"checkpoint": "ตรวจพบจุดตรวจสอบ - ไม่สามารถเข้าสู่ระบบ ลองออกจากระบบ จากนั้นเข้าสู่ระบบและรับ Appstate - Cookie !",
|
68
|
+
"loginSu": "เข้าสู่ระบบสำเร็จที่ UID: ",
|
69
|
+
"region": "ภูมิภาคของบัญชีคือ:",
|
70
|
+
"login": "กำลังเข้าสู่ระบบ...",
|
71
|
+
"loginError": "รหัสผ่านหรือบัญชีไม่ถูกต้อง!",
|
72
|
+
"errorFa": "คุณกำลังใช้ 2 Security !",
|
73
|
+
"okweb": "ยืนยันจากเบราว์เซอร์ ดำเนินการเข้าสู่ระบบ...",
|
74
|
+
"errorEnv": "สร้างไฟล์ ENV ล้มเหลว!",
|
75
|
+
"env": "สร้างไฟล์ ENV สำเร็จ!",
|
76
|
+
"errorPassRandom": "เกิดข้อผิดพลาดขณะพยายามสร้างรหัสผ่านแบบสุ่ม",
|
77
|
+
"appstateDec": "ไม่พร้อมที่จะถอดรหัส Appstate !",
|
78
|
+
"appstate": "ถอดรหัส Appstate สำเร็จ!",
|
79
|
+
"appstateError": "ข้อผิดพลาดของ Appstate โปรดแทนที่",
|
80
|
+
"oklogin": "เสร็จสิ้นขั้นตอนการเข้าสู่ระบบ!",
|
81
|
+
"newVersion": "เผยแพร่เวอร์ชันใหม่: ",
|
82
|
+
"autoUpdate": "ดำเนินการอัปเดตอัตโนมัติเป็นเวอร์ชันล่าสุด!",
|
83
|
+
"okUpdate": "อัปเกรดเวอร์ชันสำเร็จ!",
|
84
|
+
"restart": "กำลังรีบูต...",
|
85
|
+
"errorUpdate": "เกิดข้อผิดพลาด",
|
86
|
+
"checkVersion": "คุณกำลังใช้เวอร์ชัน: ",
|
87
|
+
"chucAdmin": "ขอให้มีวันที่ดีผู้ดูแลระบบ",
|
88
|
+
"errorUid": "ไม่สามารถรับ UID ลองอีกครั้ง !",
|
89
|
+
"encAppstate": "การเข้ารหัส AppState สำเร็จ !"
|
90
|
+
}
|
91
|
+
},
|
92
|
+
"jp": {
|
93
|
+
"index": {
|
94
|
+
"uptime": "URL のサーバー稼働時間への接続が完了しました: ",
|
95
|
+
"erroUptime": "稼働時間サーバーに問題があり、稼働時間をオンにできません!",
|
96
|
+
"errorLogin": "Appstate - あなたの Cookie が間違っています。新しい Cookie に置き換えるか、シークレット ブラウザに移動してからサインインしてから、もう一度お試しください!",
|
97
|
+
"checkpoint": "検出された CheckPoint - ログインできません。ログアウトしてからログインして Appstate を取得してください - Cookie !",
|
98
|
+
"loginSu": "UID でログインに成功しました: ",
|
99
|
+
"region": "アカウントの地域:",
|
100
|
+
"login": "ログインしています...",
|
101
|
+
"loginError": "パスワードまたはアカウントが間違っています!",
|
102
|
+
"errorFa": "2 つのセキュリティを使用しています!",
|
103
|
+
"okweb": "ブラウザから確認し、ログインプロセスに進みます...",
|
104
|
+
"errorEnv": "ENV ファイルの作成に失敗しました!",
|
105
|
+
"env": "ENV ファイルの作成に成功しました!",
|
106
|
+
"errorPassRandom": "ランダム パスワードの生成中にエラーが発生しました",
|
107
|
+
"appstateDec": "Appstate をデコードする準備ができていません!",
|
108
|
+
"appstate": "Appstate の復号に成功しました!",
|
109
|
+
"appstateError": "Appstate エラーです! 置き換えてください",
|
110
|
+
"oklogin": "ログインプロセスを完了してください!",
|
111
|
+
"newVersion": "公開された新しいバージョン: ",
|
112
|
+
"autoUpdate": "最新バージョンへの自動更新に進みます!",
|
113
|
+
"okUpdate": "バージョンアップ成功!",
|
114
|
+
"restart": "再起動しています...",
|
115
|
+
"errorUpdate": "エラーが発生しました",
|
116
|
+
"checkVersion": "現在使用しているバージョン: ",
|
117
|
+
"chucAdmin": "良い一日を管理者に",
|
118
|
+
"errorUid": "UID を取得できません。再試行してください!",
|
119
|
+
"encAppstate": "AppState の暗号化に成功しました!"
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
var utils = require('./../utils');
|
2
|
+
var logger = require('./../logger')
|
3
|
+
var OTP = require('totp-generator');
|
4
|
+
|
5
|
+
module.exports.getInfo = async function (id, jar, ctx, defaultFuncs) {
|
6
|
+
var AccessToken = await require("./getToken").getAccessToken(jar, ctx, defaultFuncs);
|
7
|
+
var { body:Data } = await utils.get(`https://graph.facebook.com/${id}?fields=name,first_name,email,about,birthday,gender,website,hometown,link,location,quotes,relationship_status,significant_other,username,subscribers.limite(0)&access_token=${AccessToken}`, jar, null, ctx.globalOptions);
|
8
|
+
var Format = {
|
9
|
+
id: JSON.parse(Data).id || "Không Có Dữ Liệu",
|
10
|
+
name: JSON.parse(Data).name || "Không Có Dữ Liệu",
|
11
|
+
first_name: JSON.parse(Data).first_name || "Không Có Dữ Liệu",
|
12
|
+
username: JSON.parse(Data).username || "Không Có Dữ Liệu",
|
13
|
+
link: JSON.parse(Data).link || "Không Có Dữ Liệu",
|
14
|
+
verified: JSON.parse(Data).verified || "Không Có Dữ Liệu",
|
15
|
+
about: JSON.parse(Data).about || "Không Có Dữ Liệu",
|
16
|
+
avatar: `https://graph.facebook.com/${id}/picture?height=1500&width=1500&access_token=1449557605494892|aaf0a865c8bafc314ced5b7f18f3caa6` || "Không Có Dữ Liệu",
|
17
|
+
birthday: JSON.parse(Data).birthday || "Không Có Dữ Liệu",
|
18
|
+
follow: JSON.parse(Data).subscribers.summary.total_count || "Không Có Dữ Liệu",
|
19
|
+
gender: JSON.parse(Data).gender || "Không Có Dữ Liệu",
|
20
|
+
hometown: JSON.parse(Data).hometown || "Không Có Dữ Liệu",
|
21
|
+
email: JSON.parse(Data).email || "Không Có Dữ Liệu",
|
22
|
+
interested_in: JSON.parse(Data).interested_in || "Không Có Dữ Liệu",
|
23
|
+
location: JSON.parse(Data).location || "Không Có Dữ Liệu",
|
24
|
+
locale: JSON.parse(Data).locale || "Không Có Dữ Liệu",
|
25
|
+
relationship_status: JSON.parse(Data).relationship_status || "Không Có Dữ Liệu",
|
26
|
+
love: JSON.parse(Data).significant_other || "Không Có Dữ Liệu",
|
27
|
+
website: JSON.parse(Data).website || "Không Có Dữ Liệu",
|
28
|
+
quotes: JSON.parse(Data).quotes || "Không Có Dữ Liệu",
|
29
|
+
timezone: JSON.parse(Data).timezone || "Không Có Dữ Liệu",
|
30
|
+
updated_time: JSON.parse(Data).updated_time || "Không Có Dữ Liệu"
|
31
|
+
};
|
32
|
+
return Format;
|
33
|
+
}
|
34
|
+
//HORIZON
|
package/lib/getToken.js
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
var utils = require('../utils');
|
2
|
+
var log = require('../logger');
|
3
|
+
var OTP = require('totp-generator');
|
4
|
+
//var FastConfig = require("./../../FastConfig");
|
5
|
+
//var { AuthString } = FastConfig
|
6
|
+
|
7
|
+
module.exports.getAccessToken = async function (jar, ctx, defaultFuncs) {
|
8
|
+
if (global.data.AccessToken) {
|
9
|
+
return global.data.AccessToken;
|
10
|
+
}
|
11
|
+
else {
|
12
|
+
var netURLS = "https://business.facebook.com/security/twofactor/reauth/enter/";
|
13
|
+
return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions).then(async function(data) {
|
14
|
+
try {
|
15
|
+
if (/"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1]) {
|
16
|
+
global.data.AccessToken = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
|
17
|
+
return global.data.AccessToken;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
catch (_) {
|
21
|
+
var OPTCODE = AuthString.includes(" ") ? AuthString.replace(RegExp(" ", 'g'), "") : AuthString;
|
22
|
+
var Form = {
|
23
|
+
approvals_code: OTP(String(OPTCODE)),
|
24
|
+
save_device: true,
|
25
|
+
lsd: utils.getFrom(data.body, "[\"LSD\",[],{\"token\":\"", "\"}")
|
26
|
+
}
|
27
|
+
return defaultFuncs.post(netURLS, jar, Form, ctx.globalOptions, {
|
28
|
+
referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
|
29
|
+
}).then(async function(data) {
|
30
|
+
if (String(data.body).includes(false)) throw { Error: "Invaild OTP | FastConfig.json: AuthString" }
|
31
|
+
return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions,{
|
32
|
+
referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
|
33
|
+
})
|
34
|
+
.then(async function(data) {
|
35
|
+
var Access_Token = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
|
36
|
+
global.data.AccessToken = Access_Token;
|
37
|
+
return Access_Token;
|
38
|
+
});
|
39
|
+
});
|
40
|
+
}
|
41
|
+
})
|
42
|
+
}
|
43
|
+
}
|
44
|
+
//HORIZON
|
package/logger.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
const chalk = require('chalk');
|
2
|
+
module.exports = (str, end) => {
|
3
|
+
console.log(chalk.hex(global.fca.ObjFcaConfig.mainColor || "#00FFFF").bold(`${global.fca.ObjFcaConfig.mainName || '[ FCA-DUONG ]'} > `) + str);
|
4
|
+
};
|
5
|
+
module.exports.onLogger = (str,end,ctscolor) => {
|
6
|
+
var checkbutdak = ctscolor.replace("#",'');
|
7
|
+
if (ctscolor.indexOf('#') != 1) {
|
8
|
+
|
9
|
+
console.log(chalk.hex(global.fca.ObjFcaConfig.mainColor || "#00FFFF").bold(`${global.fca.ObjFcaConfig.mainName || '[ FCA-DUOMG ]'} > `) + str);
|
10
|
+
}
|
11
|
+
else if (!isNaN(checkbutdak)) {
|
12
|
+
console.log(chalk.hex(ctscolor).bold(`${global.fca.ObjFcaConfig.mainName || '[ FCA-DUONG ]'} > `) + str);
|
13
|
+
}
|
14
|
+
else console.log(chalk.hex(global.fca.ObjFcaConfig.mainColor || "#00FFFF").bold(`${global.fca.ObjFcaConfig.mainName || '[ FCA-DUONG ]'} > `) + str);
|
15
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,74 @@
|
|
1
1
|
{
|
2
2
|
"name": "fca-duong",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "7.2.0",
|
4
|
+
"description": "Repo này là một nhánh rẽ từ Repo chính và thường sẽ có các tính năng mới được tích hợp nhanh hơn Repo chính (và cũng có thể bao gồm một số lỗi nhất định)",
|
5
|
+
"scripts": {
|
6
|
+
"test": "mocha",
|
7
|
+
"lint": "./node_modules/.bin/eslint **.js",
|
8
|
+
"prettier": "prettier utils.js src/* --write"
|
9
|
+
},
|
10
|
+
"repository": {
|
11
|
+
"type": "git",
|
12
|
+
"url": "git://github.com/ThanhDuong465052998/fca-duonggg"
|
13
|
+
},
|
14
|
+
"keywords": [
|
15
|
+
"Fca",
|
16
|
+
"fca-duong",
|
17
|
+
"fca bot",
|
18
|
+
"fca",
|
19
|
+
"Fca-duong"
|
20
|
+
],
|
21
|
+
"bugs": {
|
22
|
+
"url": "https://github.com/ThanhDuong465052998/fca-duonggg"
|
23
|
+
},
|
24
|
+
"author": "Avery, David, Maude, Benjamin, Kanzu",
|
25
|
+
"license": "MIT",
|
26
|
+
"dependencies": {
|
27
|
+
"aes-js": "^3.1.2",
|
28
|
+
"axios": "^1.2.1",
|
29
|
+
"bluebird": "^2.11.0",
|
30
|
+
"cheerio": "^1.0.0-rc.10",
|
31
|
+
"dotenv": "^16.0.3",
|
32
|
+
"fs-extra": "^11.1.0",
|
33
|
+
"https-proxy-agent": "^4.0.0",
|
34
|
+
"mqtt": "^4.2.8",
|
35
|
+
"npmlog": "^1.2.0",
|
36
|
+
"request": "^2.53.0",
|
37
|
+
"semver": "",
|
38
|
+
"websocket-stream": "^5.5.0"
|
39
|
+
},
|
40
|
+
"engines": {
|
41
|
+
"node": ">=10.x"
|
42
|
+
},
|
43
|
+
"devDependencies": {
|
44
|
+
"eslint": "^7.5.0",
|
45
|
+
"mocha": "^7.0.1",
|
46
|
+
"prettier": "^1.11.1"
|
47
|
+
},
|
48
|
+
"eslintConfig": {
|
49
|
+
"env": {
|
50
|
+
"es6": true,
|
51
|
+
"node": true
|
52
|
+
},
|
53
|
+
"extends": "eslint:recommended",
|
54
|
+
"parserOptions": {
|
55
|
+
"sourceType": "module"
|
56
|
+
},
|
57
|
+
"rules": {
|
58
|
+
"linebreak-style": [
|
59
|
+
"error",
|
60
|
+
"unix"
|
61
|
+
],
|
62
|
+
"semi": [
|
63
|
+
"error",
|
64
|
+
"always"
|
65
|
+
],
|
66
|
+
"no-unused-vars": [
|
67
|
+
1,
|
68
|
+
{
|
69
|
+
"argsIgnorePattern": "^_"
|
70
|
+
}
|
71
|
+
]
|
72
|
+
}
|
73
|
+
}
|
6
74
|
}
|
package/replit.nix
ADDED
package/src/ReportV1.js
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function ReportV1(args,callback) {
|
8
|
+
if (!args.Link && !args.RealName && !args.Content && !args.Gmail) throw new Error("Link,RealName,Content,Gmail are required");
|
9
|
+
if (!args.Link) throw new Error("Điền args.Link vào, api.Premium.ReportV1(Link,RealName,Content,Gmail,Time,callback)");
|
10
|
+
if (!args.RealName) throw new Error("Điền RealName vào, api.Premium.ReportV1(Link,RealName,Content,Time,Gmail,callback)");
|
11
|
+
if (!args.Gmail) throw new Error("Điền Gmail vào, api.Premium.ReportV1(Link,RealName,Content,Gmail,Time,callback)");
|
12
|
+
var resolveFunc = function () { };
|
13
|
+
var rejectFunc = function () { };
|
14
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
15
|
+
resolveFunc = resolve;
|
16
|
+
rejectFunc = reject;
|
17
|
+
});
|
18
|
+
|
19
|
+
if (!callback) {
|
20
|
+
callback = function (err, data) {
|
21
|
+
if (err) return rejectFunc(err);
|
22
|
+
resolveFunc(data);
|
23
|
+
};
|
24
|
+
}
|
25
|
+
let RealForm;
|
26
|
+
utils.get('https://www.facebook.com/help/contact/209046679279097?locale2=en_US', ctx.jar, null, ctx.globalOptions)
|
27
|
+
.then(function(data) {
|
28
|
+
RealForm = {
|
29
|
+
crt_url: args.Link,
|
30
|
+
crt_name: args.RealName,
|
31
|
+
cf_age: "9 years",
|
32
|
+
Field255260417881843: args.Content ? utils.getType(args.Content)=="String"? args.Content : "This timeline is impersonating me and my friends. It harass people on Facebook. I think this is a time line of baby, parents are not allowed. Please let Facebook account deactivated for Facebook is increasingly safer. Thank you!" : "This timeline is impersonating me and my friends. It harass people on Facebook. I think this is a time line of baby, parents are not allowed. Please let Facebook account deactivated for Facebook is increasingly safer. Thank you!",
|
33
|
+
Field166040066844792: args.Gmail,
|
34
|
+
source: '',
|
35
|
+
support_form_id: 209046679279097,
|
36
|
+
support_form_hidden_fields: JSON.stringify({}),
|
37
|
+
support_form_fact_false_fields: [],
|
38
|
+
lsd: utils.getFrom(data.body, "[\"LSD\",[],{\"token\":\"", "\"}")
|
39
|
+
};
|
40
|
+
}).then(function() {
|
41
|
+
defaultFuncs.postFormData('https://www.facebook.com/ajax/help/contact/submit/page', ctx.jar, RealForm, {})
|
42
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
43
|
+
.then(async function(dt) {
|
44
|
+
if (dt.__ar == 1) {
|
45
|
+
callback(null, "Thành Công");
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
callback(null, "Thất Bại");
|
49
|
+
}
|
50
|
+
});
|
51
|
+
})
|
52
|
+
return returnPromise;
|
53
|
+
}
|
54
|
+
};
|
55
|
+
//HORIZON
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
|
5
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
6
|
+
return function addExternalModule(moduleObj) {
|
7
|
+
if (utils.getType(moduleObj) == "Object") {
|
8
|
+
for (let apiName in moduleObj) {
|
9
|
+
if (utils.getType(moduleObj[apiName]) == "Function") api[apiName] = moduleObj[apiName](defaultFuncs, api, ctx);
|
10
|
+
else throw new Error(`Item "${apiName}" in moduleObj must be a function, not ${utils.getType(moduleObj[apiName])}!`);
|
11
|
+
|
12
|
+
}
|
13
|
+
}
|
14
|
+
else throw new Error(`moduleObj must be an object, not ${utils.getType(moduleObj)}!`);
|
15
|
+
};
|
16
|
+
};
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function addUserToGroup(userID, threadID, callback) {
|
8
|
+
var resolveFunc = function () { };
|
9
|
+
var rejectFunc = function () { };
|
10
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
11
|
+
resolveFunc = resolve;
|
12
|
+
rejectFunc = reject;
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!callback && (utils.getType(threadID) === "Function" || utils.getType(threadID) === "AsyncFunction")) throw { error: "please pass a threadID as a second argument." };
|
16
|
+
|
17
|
+
if (!callback) {
|
18
|
+
callback = function (err) {
|
19
|
+
if (err) return rejectFunc(err);
|
20
|
+
resolveFunc();
|
21
|
+
};
|
22
|
+
}
|
23
|
+
|
24
|
+
if (utils.getType(threadID) !== "Number" && utils.getType(threadID) !== "String") throw { error: "ThreadID should be of type Number or String and not " + utils.getType(threadID) + "." };
|
25
|
+
|
26
|
+
if (utils.getType(userID) !== "Array") userID = [userID];
|
27
|
+
|
28
|
+
var messageAndOTID = utils.generateOfflineThreadingID();
|
29
|
+
var form = {
|
30
|
+
client: "mercury",
|
31
|
+
action_type: "ma-type:log-message",
|
32
|
+
author: "fbid:" + ctx.userID,
|
33
|
+
thread_id: "",
|
34
|
+
timestamp: Date.now(),
|
35
|
+
timestamp_absolute: "Today",
|
36
|
+
timestamp_relative: utils.generateTimestampRelative(),
|
37
|
+
timestamp_time_passed: "0",
|
38
|
+
is_unread: false,
|
39
|
+
is_cleared: false,
|
40
|
+
is_forward: false,
|
41
|
+
is_filtered_content: false,
|
42
|
+
is_filtered_content_bh: false,
|
43
|
+
is_filtered_content_account: false,
|
44
|
+
is_spoof_warning: false,
|
45
|
+
source: "source:chat:web",
|
46
|
+
"source_tags[0]": "source:chat",
|
47
|
+
log_message_type: "log:subscribe",
|
48
|
+
status: "0",
|
49
|
+
offline_threading_id: messageAndOTID,
|
50
|
+
message_id: messageAndOTID,
|
51
|
+
threading_id: utils.generateThreadingID(ctx.clientID),
|
52
|
+
manual_retry_cnt: "0",
|
53
|
+
thread_fbid: threadID
|
54
|
+
};
|
55
|
+
|
56
|
+
for (var i = 0; i < userID.length; i++) {
|
57
|
+
if (utils.getType(userID[i]) !== "Number" && utils.getType(userID[i]) !== "String") throw { error: "Elements of userID should be of type Number or String and not " + utils.getType(userID[i]) + "." };
|
58
|
+
form["log_message_data[added_participants][" + i + "]"] = "fbid:" + userID[i];
|
59
|
+
}
|
60
|
+
|
61
|
+
defaultFuncs
|
62
|
+
.post("https://www.facebook.com/messaging/send/", ctx.jar, form)
|
63
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
64
|
+
.then(function (resData) {
|
65
|
+
if (!resData) throw { error: "Add to group failed." };
|
66
|
+
if (resData.error) throw resData;
|
67
|
+
|
68
|
+
|
69
|
+
return callback();
|
70
|
+
})
|
71
|
+
.catch(function (err) {
|
72
|
+
log.error("addUserToGroup", err);
|
73
|
+
return callback(err);
|
74
|
+
});
|
75
|
+
|
76
|
+
return returnPromise;
|
77
|
+
};
|
78
|
+
};
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
const utils = require("../utils");
|
4
|
+
const log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
7
|
+
return function changeAdminStatus(threadID, adminIDs, adminStatus, callback) {
|
8
|
+
if (utils.getType(threadID) !== "String") {
|
9
|
+
throw {error: "changeAdminStatus: threadID must be a string"};
|
10
|
+
}
|
11
|
+
|
12
|
+
if (utils.getType(adminIDs) === "String") {
|
13
|
+
adminIDs = [adminIDs];
|
14
|
+
}
|
15
|
+
|
16
|
+
if (utils.getType(adminIDs) !== "Array") {
|
17
|
+
throw {error: "changeAdminStatus: adminIDs must be an array or string"};
|
18
|
+
}
|
19
|
+
|
20
|
+
if (utils.getType(adminStatus) !== "Boolean") {
|
21
|
+
throw {error: "changeAdminStatus: adminStatus must be a string"};
|
22
|
+
}
|
23
|
+
|
24
|
+
var resolveFunc = function(){};
|
25
|
+
var rejectFunc = function(){};
|
26
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
27
|
+
resolveFunc = resolve;
|
28
|
+
rejectFunc = reject;
|
29
|
+
});
|
30
|
+
|
31
|
+
if (!callback) {
|
32
|
+
callback = function (err) {
|
33
|
+
if (err) {
|
34
|
+
return rejectFunc(err);
|
35
|
+
}
|
36
|
+
resolveFunc();
|
37
|
+
};
|
38
|
+
}
|
39
|
+
|
40
|
+
if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
|
41
|
+
throw {error: "changeAdminStatus: callback is not a function"};
|
42
|
+
}
|
43
|
+
|
44
|
+
let form = {
|
45
|
+
"thread_fbid": threadID,
|
46
|
+
};
|
47
|
+
|
48
|
+
let i = 0;
|
49
|
+
for (let u of adminIDs) {
|
50
|
+
form[`admin_ids[${i++}]`] = u;
|
51
|
+
}
|
52
|
+
form["add"] = adminStatus;
|
53
|
+
|
54
|
+
defaultFuncs
|
55
|
+
.post("https://www.facebook.com/messaging/save_admins/?dpr=1", ctx.jar, form)
|
56
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
57
|
+
.then(function(resData) {
|
58
|
+
if (resData.error) {
|
59
|
+
switch (resData.error) {
|
60
|
+
case 1976004:
|
61
|
+
throw { error: "Cannot alter admin status: you are not an admin.", rawResponse: resData };
|
62
|
+
case 1357031:
|
63
|
+
throw { error: "Cannot alter admin status: this thread is not a group chat.", rawResponse: resData };
|
64
|
+
default:
|
65
|
+
throw { error: "Cannot alter admin status: unknown error.", rawResponse: resData };
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
callback();
|
70
|
+
})
|
71
|
+
.catch(function(err) {
|
72
|
+
log.error("changeAdminStatus", err);
|
73
|
+
return callback(err);
|
74
|
+
});
|
75
|
+
|
76
|
+
return returnPromise;
|
77
|
+
};
|
78
|
+
};
|
79
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var utils = require("../utils");
|
4
|
+
var log = require("npmlog");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function changeArchivedStatus(threadOrThreads, archive, callback) {
|
8
|
+
var resolveFunc = function () { };
|
9
|
+
var rejectFunc = function () { };
|
10
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
11
|
+
resolveFunc = resolve;
|
12
|
+
rejectFunc = reject;
|
13
|
+
});
|
14
|
+
|
15
|
+
if (!callback) {
|
16
|
+
callback = function (err) {
|
17
|
+
if (err) return rejectFunc(err);
|
18
|
+
resolveFunc();
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
var form = {};
|
23
|
+
|
24
|
+
if (utils.getType(threadOrThreads) === "Array") for (var i = 0; i < threadOrThreads.length; i++) form["ids[" + threadOrThreads[i] + "]"] = archive;
|
25
|
+
else form["ids[" + threadOrThreads + "]"] = archive;
|
26
|
+
|
27
|
+
defaultFuncs
|
28
|
+
.post("https://www.facebook.com/ajax/mercury/change_archived_status.php", ctx.jar, form)
|
29
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
30
|
+
.then(function (resData) {
|
31
|
+
if (resData.error) throw resData;
|
32
|
+
return callback();
|
33
|
+
})
|
34
|
+
.catch(function (err) {
|
35
|
+
log.error("changeArchivedStatus", err);
|
36
|
+
return callback(err);
|
37
|
+
});
|
38
|
+
|
39
|
+
return returnPromise;
|
40
|
+
};
|
41
|
+
};
|