alicezetion 1.7.6 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cache/replit/__replit_disk_meta.json +1 -1
- package/.cache/replit/nix/env.json +1 -1
- package/.travis.yml +6 -0
- package/index.js +118 -654
- package/package.json +25 -37
- package/replit.nix +4 -3
- package/src/addExternalModule.js +5 -13
- package/src/addUserToGroup.js +12 -36
- package/src/changeAdminStatus.js +37 -85
- package/src/changeArchivedStatus.js +9 -15
- package/src/changeBio.js +8 -13
- package/src/changeBlockedStatus.js +8 -14
- package/src/changeGroupImage.js +13 -28
- package/src/changeNickname.js +11 -22
- package/src/changeThreadColor.js +10 -16
- package/src/changeThreadEmoji.js +9 -18
- package/src/chat.js +280 -401
- package/src/createNewGroup.js +10 -18
- package/src/createPoll.js +11 -17
- package/src/deleteMessage.js +10 -17
- package/src/deleteThread.js +10 -17
- package/src/forwardAttachment.js +9 -15
- package/src/forwardMessage.js +0 -0
- package/src/getCurrentUserID.js +1 -1
- package/src/getEmojiUrl.js +2 -3
- package/src/getFriendsList.js +10 -18
- package/src/getThreadHistory.js +59 -156
- package/src/getThreadHistoryDeprecated.js +15 -26
- package/src/getThreadInfo.js +42 -68
- package/src/getThreadInfoDeprecated.js +13 -25
- package/src/getThreadList.js +53 -112
- package/src/getThreadListDeprecated.js +12 -30
- package/src/getThreadPictures.js +13 -25
- package/src/getUserID.js +7 -9
- package/src/getUserInfo.js +10 -12
- package/src/handleFriendRequest.js +35 -36
- package/src/handleMessageRequest.js +10 -18
- package/src/httpGet.js +13 -20
- package/src/httpPost.js +13 -19
- package/src/{sendTypingIndicator.js → leiamnash.js} +19 -44
- package/src/listen.js +553 -0
- package/src/listenMqtt-Test.js +687 -0
- package/src/listenMqtt.js +621 -1224
- package/src/logout.js +13 -18
- package/src/markAsDelivered.js +10 -17
- package/src/markAsRead.js +24 -36
- package/src/markAsSeen.js +12 -22
- package/src/muteThread.js +9 -15
- package/src/react.js +9 -20
- package/src/removeUserFromGroup.js +11 -38
- package/src/resolvePhotoUrl.js +6 -9
- package/src/searchForThread.js +8 -14
- package/src/seen.js +10 -17
- package/src/setPostReaction.js +22 -63
- package/src/setTitle.js +12 -22
- package/src/threadColors.js +19 -17
- package/src/unfriend.js +9 -15
- package/src/{unsend.js → unsendMessage.js} +8 -9
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +27 -120
- package/Extra/Database/index.js +0 -399
- package/Extra/Database/methods.js +0 -286
- package/Extra/ExtraAddons.js +0 -213
- package/Extra/ExtraGetThread.js +0 -1
- package/Extra/ExtraUptimeRobot.js +0 -59
- package/Extra/PM2/ecosystem.config.js +0 -23
- package/Extra/Src/Last-Run.js +0 -48
- package/Language/index.json +0 -151
- package/StateCrypt.js +0 -22
- package/broadcast.js +0 -42
- package/logger.js +0 -21
- package/src/changeAvt.js +0 -91
- package/src/getAccessToken.js +0 -32
- package/src/getMessage.js +0 -84
- package/src/getUserInfoV2.js +0 -35
- package/src/httpPostFormData.js +0 -46
package/Language/index.json
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"Language": "vi",
|
4
|
-
"Folder": {
|
5
|
-
"Index": {
|
6
|
-
"ErrAppState": "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
|
-
"CheckPointLevelI": "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
|
-
"UID": "Đăng Nhập Tại ID: %1",
|
9
|
-
"Area": "Vùng Của Tài Khoản Là: %1",
|
10
|
-
"NoAreaData": "Không Thể Lấy Vùng Của Tài Khoản !",
|
11
|
-
"OnLogin": "Đang Đăng Nhập ...",
|
12
|
-
"InvaildAccount": "Sai Mật Khẩu Hoặc Tài Khoản !",
|
13
|
-
"TwoAuth": "Bạn Đang Bật 2 Bảo Mật !",
|
14
|
-
"InvaildTwoAuthCode": "Sai Mã Hai Bảo Mật !",
|
15
|
-
"ApprovalsErr": "Lỗi Khi Đăng Nhập Với Hai Bảo Mật !",
|
16
|
-
"VerifiedCheck": "Xác Nhận Từ Trình Duyệt, Đang Đăng Nhập...",
|
17
|
-
"ForceLoginNotEnable": "Không Thể Đăng Nhập, Hãy Thử Bật 'forceLogin' !",
|
18
|
-
"SubmitErrSuccess": "Đã Gửi Báo Cáo Lỗi Tới Server !",
|
19
|
-
"ErrorWhileSendErr": "Đã Xảy Ra Lỗi Khi Cố Gửi Lỗi Đến Server !",
|
20
|
-
"OnProcess": "Khởi Động Tiến Trình Đăng Nhập !",
|
21
|
-
"BackupNoti": "Đang Thay AppState Từ Backup, Nếu Điều Này Tiếp Tục Diễn Ra, Hãy Liên Hệ Với Fb.com/Lazic.Kanzu",
|
22
|
-
"ErrGetPassWord": "Lỗi Khi Lấy Mật Khẩu Mã Hoá AppState !",
|
23
|
-
"ErrGenerateKey": "Lỗi Khi Tạo Mật Khẩu Cho AppState !",
|
24
|
-
"UnsupportedDevice": "Hệ Điều Hành Của Bạn Hiện Không Được Hỗ Trợ !",
|
25
|
-
"NotReadyToDecrypt": "Chưa Sẵn Sàng Để Giải Hóa Appstate !",
|
26
|
-
"DecryptSuccess": "Giải Hóa Appstate Thành Công !",
|
27
|
-
"ErrBackup": "Lỗi Khi Sao Lưu AppState, Hãy Thay AppState !",
|
28
|
-
"DecryptFailed": "Giải Hóa Không Thành Công, Hãy Thử Thay AppState !",
|
29
|
-
"InvaildAppState": "Không Nhận Dạng Được AppState, Xin Vui Lòng Thay AppState !",
|
30
|
-
"YourAppStatePass": "Mật Khẩu AppState Của Bạn Là: %1",
|
31
|
-
"BackupFailed": "Sao Lưu AppState Không Thành Công !",
|
32
|
-
"ScreenShotConsoleAndSendToAdmin": "Chụp Lại Màn Hình Dòng Này Và Gửi Vô Facebook: Fb.com/Lazic.Kanzu",
|
33
|
-
"DoneLogin": "Hoàn Thành Quá Trình Đăng Nhập !",
|
34
|
-
"AutoCheckUpdate": "Đang Kiểm Tra Bản Cập Nhật !",
|
35
|
-
"NewVersionFound": "Phiên Bản Mới Đã Được Cập Nhật: %1 => %2",
|
36
|
-
"AutoUpdate": "Tiến Hành Tự Động Cập Nhật Lên Phiên Bản Mới Nhất !",
|
37
|
-
"UpdateSuccess": "Nâng Cấp Phiên Bản Thành Công !",
|
38
|
-
"RestartAfterUpdate": "Đang Khởi Động Lại Để Phiên Bản Mới Có Hiệu Lực !",
|
39
|
-
"UpdateFailed": "Lỗi Khi Nâng Cấp Lên Phiên Bản Mới Nhất !",
|
40
|
-
"UseSupportToolAfterUpdateFailed": "Nâng Cấp Thức Bại, Tiến Hành Sử Dụng Công Cụ Hỗ Trợ !",
|
41
|
-
"InstallSupportTool": "Đang Tải Dụng Cụ Hộ Trợ Cho Fca !",
|
42
|
-
"NotiAfterUseToolFail": "Hãy Tự Fix Bằng Cách Nhập:",
|
43
|
-
"LocalVersion": "Bạn Hiện Đang Sử Dụng Phiên Bản: %1 !",
|
44
|
-
"EncryptSuccess": "Mã Hoá AppState Thành Công !",
|
45
|
-
"ProcessDone": "Kết Thúc Với: %1 !",
|
46
|
-
"InvaildMainColor": "%1 Không Phải Là Một Màu Hex !",
|
47
|
-
"IsNotABoolean": "%1 Không Phải Là Một Boolean, Cần Là true Hoặc false !",
|
48
|
-
"InvaildOption": "%1 Không Phải Là Một Lựa Chọn !",
|
49
|
-
"EncryptStateOff": "Tính Năng EncryptState Đã Bị Tắt !",
|
50
|
-
"WishMessage": [
|
51
|
-
"Chúc Bạn Một Ngày Tốt Lành Nhé !",
|
52
|
-
"Hãy Báo Cáo Với Admin Khi Có Lỗi Fca Nhé !",
|
53
|
-
"Cảm Ơn Đã Sử Dụng Fca Của Horizon !",
|
54
|
-
"Donate Tại: Momo: 0396301843, MBank: 0396301843"
|
55
|
-
]
|
56
|
-
},
|
57
|
-
"ExtraGetThread": {
|
58
|
-
"CreateDatabaseSuccess": "Khởi Tạo Thành Công Database Cho Nhóm: %1",
|
59
|
-
"CreateDatabaseFailure": "Khởi Tạo Thất Bại Database Của Nhóm: %1",
|
60
|
-
"alreadyUpdate": "%1 Đã Sẵn Sàng Để Update Database",
|
61
|
-
"updateDataSuccess": "Cập Nhật Dữ Liệu Cho Nhóm %1 Thành Công !",
|
62
|
-
"updateDataFailure": "Cập Nhật Dữ Liệu Cho Nhóm %1 Thất Bại !"
|
63
|
-
},
|
64
|
-
"ExtraUpTime": {
|
65
|
-
"Uptime": "Kết Nối Đến Server Uptime Thành Công !",
|
66
|
-
"PM2": "Đang Vào Chế Độ Uptime !",
|
67
|
-
"InPm2Mode": "Bạn Đang Ở Chế Độ Uptime PM2",
|
68
|
-
"NotSupport": "Không Hỗ Trợ Uptime Server!",
|
69
|
-
"Maintenance": "Server Uptime Đang Bảo Trì, Hãy Thử Lại Sau !"
|
70
|
-
},
|
71
|
-
"Src": {
|
72
|
-
"AutoRestart": "Tự Động Khởi Động Lại Sau: %1 Phút Nữa !",
|
73
|
-
"OnRestart": "Đang Restart..."
|
74
|
-
}
|
75
|
-
}
|
76
|
-
},
|
77
|
-
{
|
78
|
-
"Language": "en",
|
79
|
-
"Folder": {
|
80
|
-
"Index": {
|
81
|
-
"ErrAppState": "Appstate - Your Cookie Is Wrong, Please Replace It, Or Go To Incognito Browser Then Sign In And Try Again !",
|
82
|
-
"CheckPointLevelI": "CheckPoint Detected - Can't Login, Try Logout Then Login And Retrieve Appstate - Cookie !",
|
83
|
-
"UID": "Login as ID: %1",
|
84
|
-
"Area": "Area Of Account Is: %1",
|
85
|
-
"NoAreaData": "Can't Get Area Of Account !",
|
86
|
-
"OnLogin": "Currently logged ...",
|
87
|
-
"InvaildAccount": "Wrong Password Or Account !",
|
88
|
-
"TwoAuth": "You Currently On 2 Factor Security !",
|
89
|
-
"InvaildTwoAuthCode": "Wrong Code Two Factor Security !",
|
90
|
-
"ApprovalsErr": "Error When Login With Two Factor Security !",
|
91
|
-
"VerifiedCheck": "Confirm From Browser, Logging In...",
|
92
|
-
"ForceLoginNotEnable": "Can't Login, Try Enable 'forceLogin' !",
|
93
|
-
"SubmitErrSuccess": "Error Report Sent To Server !",
|
94
|
-
"ErrorWhileSendErr": "An error occurred while trying to send an error to the server !",
|
95
|
-
"OnProcess": "Start the Login Process !",
|
96
|
-
"BackupNoti": "Changing AppState From Backup, If This Continues, Contact Fb.com/Lazic.Kanzu",
|
97
|
-
"ErrGetPassWord": "Error Retrieving AppState Encryption Password !",
|
98
|
-
"ErrGenerateKey": "Error Creating Password For AppState !",
|
99
|
-
"UnsupportedDevice": "Your Operating System Is Currently Not Supported !",
|
100
|
-
"NotReadyToDecrypt": "Not Ready To Solve Appstate !",
|
101
|
-
"DecryptSuccess": "Successfully Appstate Solved !",
|
102
|
-
"ErrBackup": "Error When Backing Up AppState, Please Replace AppState !",
|
103
|
-
"DecryptFailed": "Solution Failed, Try Replacing AppState !",
|
104
|
-
"InvaildAppState": "AppState Not Recognized, Please Replace AppState !",
|
105
|
-
"YourAppStatePass": "Your AppState Password Is: %1",
|
106
|
-
"BackupFailed": "AppState Backup Failed !",
|
107
|
-
"ScreenShotConsoleAndSendToAdmin": "Take a Screenshot of This Line And Send It To Facebook: Fb.com/Lazic.Kanzu",
|
108
|
-
"DoneLogin": "Complete the Login Process !",
|
109
|
-
"AutoCheckUpdate": "Checking for Updates !",
|
110
|
-
"NewVersionFound": "New Version, Ready to Update: %1 => %2",
|
111
|
-
"AutoUpdate": "Perform Automatic Update to the Latest Version !",
|
112
|
-
"UpdateSuccess": "Upgrade Version Successfully !",
|
113
|
-
"RestartAfterUpdate": "Rebooting For New Version To Take Effect !",
|
114
|
-
"UpdateFailed": "Error When Upgrading To Latest Version !",
|
115
|
-
"UseSupportToolAfterUpdateFailed": "Upgrade Failed, Proceed to Using Support Tools !",
|
116
|
-
"InstallSupportTool": "Loading Support Tools For FCA !",
|
117
|
-
"NotiAfterUseToolFail": "Please Fix It Yourself By Entering:",
|
118
|
-
"LocalVersion": "You Are Currently Using Version: %1 !",
|
119
|
-
"EncryptSuccess": "Encrypt Appstate Success !",
|
120
|
-
"ProcessDone": "Process Done: %1 !",
|
121
|
-
"InvaildMainColor": "%1 Is Not A Hex Color Code !",
|
122
|
-
"IsNotABoolean": "%1 Is Not A Boolean, Need To Be true Or false !",
|
123
|
-
"EncryptStateOff": "Encryption Has Been Turned Off !",
|
124
|
-
"InvaildOption": "Invail Option: %1",
|
125
|
-
"WishMessage": [
|
126
|
-
"Have a Nice Day !",
|
127
|
-
"Please Report To Admin When There Is Error in FCA !",
|
128
|
-
"Thank You For Using Horizon's FCA !"
|
129
|
-
]
|
130
|
-
},
|
131
|
-
"ExtraGetThread": {
|
132
|
-
"CreateDatabaseSuccess": "Successfully Initiate Database for Group: %1",
|
133
|
-
"CreateDatabaseFailure": "Initialization of Group Database Failure: %1",
|
134
|
-
"alreadyUpdate": "%1 Ready to Update Database",
|
135
|
-
"updateDataSuccess": "Data Update for Group %1 Success!",
|
136
|
-
"updateDataFailure": "Data Update for Group %1 Failed!"
|
137
|
-
},
|
138
|
-
"ExtraUpTime": {
|
139
|
-
"Uptime": "Connecting To Server Uptime Succeeds!",
|
140
|
-
"PM2": "Trying to PM2 Mode!",
|
141
|
-
"InPm2Mode": "You Are In Uptime PM2 Mode !",
|
142
|
-
"NotSupport": "Your Operating System does not currently support Uptime Server !",
|
143
|
-
"Maintenance": "Server Uptime In Maintenance, Try Again Later!"
|
144
|
-
},
|
145
|
-
"Src": {
|
146
|
-
"AutoRestart": "Automatically Restart After: %1 Minutes !",
|
147
|
-
"OnRestart": "Restarting..."
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}
|
151
|
-
]
|
package/StateCrypt.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
const crypto = require('crypto');
|
3
|
-
const aes = require("aes-js");
|
4
|
-
|
5
|
-
function encryptState(data, key) {
|
6
|
-
let hashEngine = crypto.createHash("sha256");
|
7
|
-
let hashKey = hashEngine.update(key).digest();
|
8
|
-
let bytes = aes.utils.utf8.toBytes(data);
|
9
|
-
let aesCtr = new aes.ModeOfOperation.ctr(hashKey);
|
10
|
-
let encryptedData = aesCtr.encrypt(bytes);
|
11
|
-
return aes.utils.hex.fromBytes(encryptedData);
|
12
|
-
}
|
13
|
-
|
14
|
-
function decryptState(data, key) {
|
15
|
-
let hashEngine = crypto.createHash("sha256");
|
16
|
-
let hashKey = hashEngine.update(key).digest();
|
17
|
-
let encryptedBytes = aes.utils.hex.toBytes(data);
|
18
|
-
let aesCtr = new aes.ModeOfOperation.ctr(hashKey);
|
19
|
-
let decryptedData = aesCtr.decrypt(encryptedBytes);
|
20
|
-
return aes.utils.utf8.fromBytes(decryptedData);
|
21
|
-
}
|
22
|
-
module.exports = { encryptState,decryptState };
|
package/broadcast.js
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
module.exports = function({ api }) {
|
2
|
-
return function() {
|
3
|
-
switch (require("./alice/alicezetion.json").BroadCast) {
|
4
|
-
case true:
|
5
|
-
{
|
6
|
-
BroadCast();
|
7
|
-
return setInterval(() => {
|
8
|
-
try {
|
9
|
-
var test = api.getCurrentUserID();
|
10
|
-
if (test) return;
|
11
|
-
else process.exit(1);
|
12
|
-
} catch (e) {
|
13
|
-
console.log(e);
|
14
|
-
}
|
15
|
-
return BroadCast();
|
16
|
-
}, 1800 * 1000);
|
17
|
-
}
|
18
|
-
case false:
|
19
|
-
{
|
20
|
-
break;
|
21
|
-
}
|
22
|
-
default:
|
23
|
-
{
|
24
|
-
break;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
function BroadCast() {
|
31
|
-
try {
|
32
|
-
var logger = require('./logger');
|
33
|
-
var Fetch = require('got');
|
34
|
-
Fetch.get("https://raw.githubusercontent.com/amogusdevlol/FCASUS-DATA/main/FcaSusBC.json").then(async(res) => {
|
35
|
-
var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Sanaol";
|
36
|
-
logger(random, "[ FCA-SUS ]");
|
37
|
-
});
|
38
|
-
} catch (e) {
|
39
|
-
console.log(e);
|
40
|
-
return;
|
41
|
-
}
|
42
|
-
}
|
package/logger.js
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
|
3
|
-
const chalk = require('chalk');
|
4
|
-
var log = require("npmlog");
|
5
|
-
var isHexcolor = require('is-hexcolor');
|
6
|
-
var getText = require('gettext.js')();
|
7
|
-
const languageFile = require('./Language/index.json');
|
8
|
-
|
9
|
-
module.exports = (str, end) => {
|
10
|
-
/*if (isHexcolor(require("./alice/alicezetion.json").MainColor || "#00CCCC") != true) {
|
11
|
-
var Language = languageFile.find(i => i.Language == require("./alice/alicezetion.json").Language).Folder.Index;
|
12
|
-
//log.warn("FastConfig-MainColor", getText.gettext(Language.InvaildMainColor,require("./alice/alicezetion.json").MainColor));
|
13
|
-
process.exit(0);
|
14
|
-
} */
|
15
|
-
//console.log(chalk.hex( "00CCCC").bold(`${end || '[ ALICIZATION ]'} > `) + str);
|
16
|
-
};
|
17
|
-
|
18
|
-
module.exports.onLogger = (str,end) => console.log(chalk.hex('#00CCCC').bold(`${end || '[ FCA-SUS ]'} > `) + str);
|
19
|
-
|
20
|
-
module.exports.Error = () => console.log(chalk.bold.red('There was an error, Please Contact: Facebook.com/Lazic.Kanzu'));
|
21
|
-
|
package/src/changeAvt.js
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
/**
|
6
|
-
* It posts an image to a Facebook profile
|
7
|
-
* @param Api - The API object
|
8
|
-
* @param BotID - The ID of the bot you want to post the image to.
|
9
|
-
* @param form - The form data that you want to send.
|
10
|
-
* @returns The JSON.parse(Data.split("for (;;);")[1]); is returning the following:
|
11
|
-
* {"__ar":1,"payload":null,"jsmods":{"require":[["ImageUploader","uploadPhoto",[{"__m":"__elem_0"},{"__m":"__elem_1"},{"__m":"__elem_2"},{"__m":"__
|
12
|
-
*/
|
13
|
-
async function postImage(Api, BotID, form) {
|
14
|
-
var Data = await Api.httpPostFormData(
|
15
|
-
`https://www.facebook.com/profile/picture/upload/?profile_id=${BotID}&photo_source=57&av=${BotID}`,
|
16
|
-
form
|
17
|
-
);
|
18
|
-
return JSON.parse(Data.split("for (;;);")[1]);
|
19
|
-
}
|
20
|
-
|
21
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
22
|
-
/* Changing the profile picture of the bot. */
|
23
|
-
return function changeAvt(link, caption, callback) {
|
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, data) {
|
33
|
-
if (err) return rejectFunc(err);
|
34
|
-
resolveFunc(data);
|
35
|
-
};
|
36
|
-
}
|
37
|
-
try {
|
38
|
-
var Fetch = require("axios");
|
39
|
-
Fetch.get(link, { responseType: "stream" }).then(data => {
|
40
|
-
postImage(api, ctx.userID, { file: data.data }).then(data => {
|
41
|
-
if (data.error)
|
42
|
-
throw new Error({
|
43
|
-
error: data.error,
|
44
|
-
des: data.error.errorDescription
|
45
|
-
});
|
46
|
-
var form = {
|
47
|
-
av: ctx.userID,
|
48
|
-
fb_api_req_friendly_name: "ProfileCometProfilePictureSetMutation",
|
49
|
-
fb_api_caller_class: "RelayModern",
|
50
|
-
doc_id: "5066134240065849",
|
51
|
-
variables: JSON.stringify({
|
52
|
-
input: {
|
53
|
-
caption: caption || "",
|
54
|
-
existing_photo_id: data.payload.fbid,
|
55
|
-
expiration_time: null,
|
56
|
-
profile_id: ctx.userID,
|
57
|
-
profile_pic_method: "EXISTING",
|
58
|
-
profile_pic_source: "TIMELINE",
|
59
|
-
scaled_crop_rect: {
|
60
|
-
height: 1,
|
61
|
-
width: 1,
|
62
|
-
x: 0,
|
63
|
-
y: 0
|
64
|
-
},
|
65
|
-
skip_cropping: true,
|
66
|
-
actor_id: ctx.userID,
|
67
|
-
client_mutation_id: Math.round(Math.random() * 19).toString()
|
68
|
-
},
|
69
|
-
isPage: false,
|
70
|
-
isProfile: true,
|
71
|
-
scale: 3
|
72
|
-
})
|
73
|
-
};
|
74
|
-
defaultFuncs
|
75
|
-
.post("https://www.facebook.com/api/graphql/", ctx.jar, form)
|
76
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
77
|
-
.then(function (resData) {
|
78
|
-
if (resData.error) throw resData;
|
79
|
-
else return callback(null, true);
|
80
|
-
})
|
81
|
-
.catch(function (err) {
|
82
|
-
return callback(err);
|
83
|
-
});
|
84
|
-
});
|
85
|
-
});
|
86
|
-
} catch (e) {
|
87
|
-
throw e;
|
88
|
-
}
|
89
|
-
return returnPromise;
|
90
|
-
};
|
91
|
-
};
|
package/src/getAccessToken.js
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
var utils = require("../utils");
|
5
|
-
var log = require("npmlog");
|
6
|
-
|
7
|
-
|
8
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
9
|
-
return function getAccessToken(callback) {
|
10
|
-
var resolveFunc = function () { };
|
11
|
-
var rejectFunc = function () { };
|
12
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
13
|
-
resolveFunc = resolve;
|
14
|
-
rejectFunc = reject;
|
15
|
-
});
|
16
|
-
|
17
|
-
if (!callback) {
|
18
|
-
callback = function (err, userInfo) {
|
19
|
-
if (err) return rejectFunc(err);
|
20
|
-
resolveFunc(userInfo);
|
21
|
-
};
|
22
|
-
}
|
23
|
-
try {
|
24
|
-
var { getAccessToken } = require('../Extra/ExtraAddons');
|
25
|
-
getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
|
26
|
-
}
|
27
|
-
catch (e) {
|
28
|
-
callback(null, e);
|
29
|
-
}
|
30
|
-
return returnPromise;
|
31
|
-
};
|
32
|
-
};
|
package/src/getMessage.js
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
var utils = require("../utils");
|
5
|
-
var log = require("npmlog");
|
6
|
-
|
7
|
-
module.exports = function(defaultFuncs, api, ctx) {
|
8
|
-
return function getMessage(threadID, messageID, callback) {
|
9
|
-
if (!callback) {
|
10
|
-
return callback({ error: "getMessage: need callback" });
|
11
|
-
}
|
12
|
-
|
13
|
-
if (!threadID || !messageID) {
|
14
|
-
return callback({ error: "getMessage: need threadID and messageID" });
|
15
|
-
}
|
16
|
-
|
17
|
-
const form = {
|
18
|
-
av: ctx.globalOptions.pageID,
|
19
|
-
queries: JSON.stringify({
|
20
|
-
o0: {
|
21
|
-
//This doc_id is valid as of ? (prob January 18, 2020)
|
22
|
-
doc_id: "1768656253222505",
|
23
|
-
query_params: {
|
24
|
-
thread_and_message_id: {
|
25
|
-
thread_id: threadID,
|
26
|
-
message_id: messageID
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
})
|
31
|
-
};
|
32
|
-
|
33
|
-
defaultFuncs
|
34
|
-
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
35
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
36
|
-
.then(resData => {
|
37
|
-
if (resData[resData.length - 1].error_results > 0) {
|
38
|
-
throw resData[0].o0.errors;
|
39
|
-
}
|
40
|
-
|
41
|
-
if (resData[resData.length - 1].successful_results === 0) {
|
42
|
-
throw {
|
43
|
-
error: "getMessage: there was no successful_results",
|
44
|
-
res: resData
|
45
|
-
};
|
46
|
-
}
|
47
|
-
|
48
|
-
var fetchData = resData[0].o0.data.message;
|
49
|
-
if (fetchData) {
|
50
|
-
(!ctx.globalOptions.selfListen &&
|
51
|
-
fetchData.message_sender.id.toString() === ctx.userID) ||
|
52
|
-
!ctx.loggedIn
|
53
|
-
? undefined
|
54
|
-
: (function() {
|
55
|
-
callback(null, {
|
56
|
-
threadID: threadID,
|
57
|
-
messageID: fetchData.message_id,
|
58
|
-
senderID: fetchData.message_sender.id,
|
59
|
-
attachments: fetchData.blob_attachments.map(att => {
|
60
|
-
var x;
|
61
|
-
try {
|
62
|
-
x = utils._formatAttachment(att);
|
63
|
-
} catch (ex) {
|
64
|
-
x = att;
|
65
|
-
x.error = ex;
|
66
|
-
x.type = "unknown";
|
67
|
-
}
|
68
|
-
return x;
|
69
|
-
}),
|
70
|
-
body: fetchData.message.text,
|
71
|
-
mentions: fetchData.message.ranges,
|
72
|
-
timestamp: fetchData.timestamp_precise,
|
73
|
-
messageReply: fetchData.replied_to_message,
|
74
|
-
raw: fetchData
|
75
|
-
});
|
76
|
-
})();
|
77
|
-
}
|
78
|
-
})
|
79
|
-
.catch(err => {
|
80
|
-
log.error("getMessage", err);
|
81
|
-
callback(err);
|
82
|
-
});
|
83
|
-
};
|
84
|
-
};
|
package/src/getUserInfoV2.js
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
var utils = require("../utils");
|
5
|
-
var log = require("npmlog");
|
6
|
-
|
7
|
-
|
8
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
9
|
-
return function getUserInfoV2(id, callback) {
|
10
|
-
var resolveFunc = function () { };
|
11
|
-
var rejectFunc = function () { };
|
12
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
13
|
-
resolveFunc = resolve;
|
14
|
-
rejectFunc = reject;
|
15
|
-
});
|
16
|
-
|
17
|
-
if (!callback) {
|
18
|
-
callback = function (err, userInfo) {
|
19
|
-
if (err) return rejectFunc(err);
|
20
|
-
resolveFunc(userInfo);
|
21
|
-
};
|
22
|
-
}
|
23
|
-
try {
|
24
|
-
var { getInfo } = require('../Extra/ExtraAddons');
|
25
|
-
getInfo(id)
|
26
|
-
.then(data => {
|
27
|
-
return callback(null, data);
|
28
|
-
});
|
29
|
-
}
|
30
|
-
catch (e) {
|
31
|
-
return callback(null, e);
|
32
|
-
}
|
33
|
-
return returnPromise;
|
34
|
-
};
|
35
|
-
};
|
package/src/httpPostFormData.js
DELETED
@@ -1,46 +0,0 @@
|
|
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 httpPostFormData(url, form, callback) {
|
8
|
-
var resolveFunc = function() {};
|
9
|
-
var rejectFunc = function() {};
|
10
|
-
|
11
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
12
|
-
resolveFunc = resolve;
|
13
|
-
rejectFunc = reject;
|
14
|
-
});
|
15
|
-
|
16
|
-
if (
|
17
|
-
!callback &&
|
18
|
-
(utils.getType(form) == "Function" ||
|
19
|
-
utils.getType(form) == "AsyncFunction")
|
20
|
-
) {
|
21
|
-
callback = form;
|
22
|
-
form = {};
|
23
|
-
}
|
24
|
-
|
25
|
-
form = form || {};
|
26
|
-
|
27
|
-
callback =
|
28
|
-
callback ||
|
29
|
-
function(err, data) {
|
30
|
-
if (err) return rejectFunc(err);
|
31
|
-
resolveFunc(data);
|
32
|
-
};
|
33
|
-
|
34
|
-
defaultFuncs
|
35
|
-
.postFormData(url, ctx.jar, form)
|
36
|
-
.then(function(resData) {
|
37
|
-
callback(null, resData.body.toString());
|
38
|
-
})
|
39
|
-
.catch(function(err) {
|
40
|
-
log.error("httpPostFormData", err);
|
41
|
-
return callback(err);
|
42
|
-
});
|
43
|
-
|
44
|
-
return returnPromise;
|
45
|
-
};
|
46
|
-
};
|