fca-anup-candy 0.0.1-security → 10.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fca-anup-candy might be problematic. Click here for more details.
- package/Extra/Database/index.js +469 -0
- package/Extra/ExtraAddons.js +80 -0
- package/Extra/ExtraFindUID.js +62 -0
- package/Extra/ExtraGetThread.js +118 -0
- package/Extra/ExtraScreenShot.js +430 -0
- package/Extra/ExtraUptimeRobot.js +38 -0
- package/Extra/Html/Classic/script.js +119 -0
- package/Extra/Html/Classic/style.css +8 -0
- package/Extra/Security/Index.js +146 -0
- package/Extra/Security/Step_1.js +6 -0
- package/Extra/Security/Step_2.js +22 -0
- package/Extra/Security/Step_3.js +22 -0
- package/Extra/Src/Change_Environment.js +24 -0
- package/Extra/Src/Check_Update.js +67 -0
- package/Extra/Src/Instant_Update.js +64 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Premium.js +81 -0
- package/Extra/Src/Release_Memory.js +41 -0
- package/Extra/Src/uuid.js +137 -0
- package/Func/AcceptAgreement.js +32 -0
- package/Func/ClearCache.js +64 -0
- package/Func/ReportV1.js +54 -0
- package/Index.js +350 -0
- package/Language/index.json +205 -0
- package/Main.js +1099 -0
- package/README.md +133 -3
- package/SECURITY.md +17 -0
- package/broadcast.js +40 -0
- package/logger.js +66 -0
- package/package.json +89 -3
- package/src/Dev_Horizon_Data.js +125 -0
- package/src/Premium.js +30 -0
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +79 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -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 +28 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadInfo.js +412 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadMain.js +220 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +113 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +32 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -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 +697 -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 +334 -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/test/Aliya_Database/A_README.md +1 -0
- package/test/Aliya_Database/Database.db +0 -0
- package/test/Database_Test.js +4 -0
- package/test/Db2.js +530 -0
- 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/env/.env +0 -0
- package/test/example-config.json +18 -0
- package/test/example-db.db +0 -0
- package/test/memoryleak.js +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/test/testv2.js +18 -0
- package/utils.js +1628 -0
package/README.md
CHANGED
@@ -1,5 +1,135 @@
|
|
1
|
-
|
1
|
+
[![Socket Badge](https://socket.dev/api/badge/npm/package/fca-anup-candy)](https://socket.dev/npm/package/fca-anup-candy)
|
2
2
|
|
3
|
-
|
3
|
+
## Important !
|
4
4
|
|
5
|
-
|
5
|
+
This package require NodeJS 14.17.0 to work properly.
|
6
|
+
|
7
|
+
## Notification !
|
8
|
+
|
9
|
+
|
10
|
+
Original Project(Deprecated): https://github.com/Schmavery/facebook-chat-api
|
11
|
+
|
12
|
+
## Support For :
|
13
|
+
|
14
|
+
+ Support English, VietNamese !,
|
15
|
+
+ All bot if using listenMqtt first.
|
16
|
+
|
17
|
+
# Api Cho ChatBot Messenger
|
18
|
+
|
19
|
+
Facebook Đã Có Và Cho Người Dùng Tạo Api Cho Chatbots 😪 Tại Đey => [Đây Nè](https://developers.facebook.com/docs/messenger-platform).
|
20
|
+
|
21
|
+
### Api Này Có Thể Khiến Cho Bạn Payy Acc Như Cách Acc Bạn Chưa Từng Có, Hãy Chú Ý Nhé =))
|
22
|
+
|
23
|
+
Lưu Ý ! Nếu Bạn Muốn Sài Api Này Hãy Xem Document Tại [Đây Nè](https://github.com/Schmavery/facebook-chat-api).
|
24
|
+
|
25
|
+
## Tải Về
|
26
|
+
|
27
|
+
Nếu Bạn Muốn Sử Dụng, Hãy Tải Nó Bằng Cách:
|
28
|
+
```bash
|
29
|
+
npm i fca-anup-candy
|
30
|
+
```
|
31
|
+
or
|
32
|
+
```bash
|
33
|
+
npm install fca-anup-candy
|
34
|
+
```
|
35
|
+
|
36
|
+
Nó Sẽ Tải Vô node_modules (Lib Của Bạn) - Lưu Ý Replit Sẽ Không Hiện Đâu Mà Tìm 😪
|
37
|
+
|
38
|
+
### Tải Bản Mới Nhất Hoặc Update
|
39
|
+
|
40
|
+
Nếu Bạn Muốn Sử Dụng Phiên Bản Mới Nhất Hay Cập Nhật Thì Hãy Vô Terminal Hoặc Command Promt Nhập :
|
41
|
+
```bash
|
42
|
+
npm install fca-anup-candy@latest
|
43
|
+
```
|
44
|
+
Hoặc
|
45
|
+
```bash
|
46
|
+
npm i fca-anup-candy@latest
|
47
|
+
```
|
48
|
+
|
49
|
+
## Nếu Bạn Muốn Test Api
|
50
|
+
|
51
|
+
Lợi Ích Cho Việc Này Thì Bạn Sẽ Không Tốn Thời Gian Pay Acc Và Có Acc 😪
|
52
|
+
Hãy Sử Dụng Với Tài Khoản Thử Nghiệm => [Facebook Whitehat Accounts](https://www.facebook.com/whitehat/accounts/).
|
53
|
+
|
54
|
+
## Cách Sử Dụng
|
55
|
+
|
56
|
+
```javascript
|
57
|
+
const login = require("fca-anup-candy"); // lấy từ lib ra
|
58
|
+
|
59
|
+
// đăng nhập
|
60
|
+
login({email: "Gmail Account", password: "Mật Khẩu Facebook Của Bạn"}, (err, api) => {
|
61
|
+
|
62
|
+
if(err) return console.error(err); // trường hợp lỗi
|
63
|
+
|
64
|
+
// tạo bot tự động nhái theo bạn:
|
65
|
+
api.listenMqtt((err, message) => {
|
66
|
+
api.sendMessage(message.body, message.threadID);
|
67
|
+
});
|
68
|
+
|
69
|
+
});
|
70
|
+
```
|
71
|
+
|
72
|
+
Kết Quả Là Nó Sẽ Nhái Bạn Như Hình Dưới:
|
73
|
+
<img width="517" alt="screen shot 2016-11-04 at 14 36 00" src="https://cloud.githubusercontent.com/assets/4534692/20023545/f8c24130-a29d-11e6-9ef7-47568bdbc1f2.png">
|
74
|
+
|
75
|
+
Nếu Bạn Muốn Sử Dụng Nâng Cao Thì Hãy Sử Dụng Các Loại Bot Được Liệt Kê Ở Trên !
|
76
|
+
|
77
|
+
## Danh Sách
|
78
|
+
|
79
|
+
Bạn Có Thể Đọc Full Api Tại => [here](DOCS.md).
|
80
|
+
|
81
|
+
## Cài Đặt Cho Mirai:
|
82
|
+
|
83
|
+
Bạn Cần Vô File Mirai.js,Sau Đó Tìm Đến Dòng
|
84
|
+
```js
|
85
|
+
var login = require('fca-anup-candy');
|
86
|
+
/* Có thể là :
|
87
|
+
var login = require('@maihuybao/fca-Unofficial');
|
88
|
+
var login = require('fca-xuyen-get');
|
89
|
+
var login = require('fca-unofficial-force');
|
90
|
+
...
|
91
|
+
*/
|
92
|
+
```
|
93
|
+
|
94
|
+
Và Thay Nó Bằng:
|
95
|
+
|
96
|
+
```js
|
97
|
+
var login = require('fca-anup-candy')
|
98
|
+
```
|
99
|
+
|
100
|
+
Sau Đó Thì Chạy Bình Thường Thôi !
|
101
|
+
|
102
|
+
## Tự Nghiên Cứu
|
103
|
+
|
104
|
+
Nếu Bạn Muốn Tự Nghiên Cứu Hoặc Tạo Bot Cho Riêng Bạn Thì Bạn Hãy Vô Cái Này Đọc Chức Năng Của Nó Và Cách Sử Dụng => [Link](https://github.com/Schmavery/facebook-chat-api#Unofficial%20Facebook%20Chat%20API)
|
105
|
+
|
106
|
+
------------------------------------
|
107
|
+
|
108
|
+
### Lưu Lại Thông Tin Đăng Nhập.
|
109
|
+
|
110
|
+
Để Lưu Lại Thì Bạn Cần 1 Apstate Kiểu (Cookie, etc,..) Để Lưu Lại Hoặc Là Sử Dụng Mã Login Như Trên Để Đăng Nhập !
|
111
|
+
|
112
|
+
Và Chế Độ Này Đã Có Sẵn Trong 1 Số Bot Việt Nam Nên Bạn Cứ Yên Tâm Nhé !
|
113
|
+
|
114
|
+
__Hướng Dẫn Với Appstate__
|
115
|
+
|
116
|
+
```js
|
117
|
+
const fs = require("fs");
|
118
|
+
const login = require("fca-anup-candy");
|
119
|
+
|
120
|
+
var credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"}; // thông tin tk
|
121
|
+
|
122
|
+
login(credentials, (err, api) => {
|
123
|
+
if(err) return console.error(err);
|
124
|
+
// đăng nhập
|
125
|
+
fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState(), null,'\t')); //tạo appstate
|
126
|
+
});
|
127
|
+
```
|
128
|
+
|
129
|
+
Hoặc Dễ Dàng Hơn ( Chuyên Nghiệp ) Bạn Có Thể Dùng => [c3c-fbstate](https://github.com/c3cbot/c3c-fbstate) Để Lấy Fbstate And Rename Lại Thành Apstate Cũng Được ! (appstate.json)
|
130
|
+
|
131
|
+
------------------------------------
|
132
|
+
|
133
|
+
## FAQS
|
134
|
+
|
135
|
+
FAQS => [Link](https://github.com/Schmavery/facebook-chat-api#FAQS)
|
package/SECURITY.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
+ if have any Vulnerability finded contact: Author(Anup Kumar) or (Facebook.com/t3ra.b44p.Anup.h3r3). Thanks!
|
4
|
+
|
5
|
+
## Supported Versions
|
6
|
+
|
7
|
+
Use this section to tell people about which versions of your project are
|
8
|
+
currently being supported with security updates.
|
9
|
+
|
10
|
+
| Version | Supported |
|
11
|
+
| ------- | ------------------ |
|
12
|
+
| Main Version With Autoupdate | :white_check_mark: |
|
13
|
+
| Old Version | :x:|
|
14
|
+
|
15
|
+
## Reporting a Vulnerability
|
16
|
+
|
17
|
+
Contact Author
|
package/broadcast.js
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
switch (global.Fca.Require.FastConfig.BroadCast) {
|
4
|
+
case true: {
|
5
|
+
try {
|
6
|
+
var logger = global.Fca.Require.logger;
|
7
|
+
var Fetch = global.Fca.Require.Fetch;
|
8
|
+
Fetch.get("https://raw.githubusercontent.com/AnupxAliya/Aliya/main/broadcast.json").then(async (/** @type {{ body: { toString: () => string; }; }} */ res) => {
|
9
|
+
global.Fca.Data.BroadCast = JSON.parse(res.body.toString())
|
10
|
+
var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Ae Zui Zẻ Nhé !";
|
11
|
+
logger.Normal(random);
|
12
|
+
});
|
13
|
+
}
|
14
|
+
catch (e) {
|
15
|
+
console.log(e);
|
16
|
+
}
|
17
|
+
return setInterval(() => {
|
18
|
+
try {
|
19
|
+
try {
|
20
|
+
var logger = global.Fca.Require.logger;
|
21
|
+
var random = global.Fca.Data.BroadCast[Math.floor(Math.random() * global.Fca.Data.BroadCast.length)] || "Ae Zui Zẻ Nhé !";
|
22
|
+
logger.Normal(random);
|
23
|
+
}
|
24
|
+
catch (e) {
|
25
|
+
console.log(e);
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
catch (e) {
|
30
|
+
console.log(e);
|
31
|
+
}
|
32
|
+
},1800 * 1000);
|
33
|
+
}
|
34
|
+
case false: {
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
default: {
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
}
|
package/logger.js
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
'use strict';
|
2
|
+
/* eslint-disable linebreak-style */
|
3
|
+
|
4
|
+
const chalk = require('chalk');
|
5
|
+
var isHexcolor = require('is-hexcolor');
|
6
|
+
var getText = function(/** @type {string[]} */ ...Data) {
|
7
|
+
var Main = (Data.splice(0,1)).toString();
|
8
|
+
for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
|
9
|
+
return Main;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* @param {any} obj
|
13
|
+
*/
|
14
|
+
function getType(obj) {
|
15
|
+
return Object.prototype.toString.call(obj).slice(8, -1);
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = {
|
19
|
+
Normal: function(/** @type {string} */ Str, /** @type {() => any} */ Data ,/** @type {() => void} */ Callback) {
|
20
|
+
if (isHexcolor(global.Fca.Require.FastConfig.MainColor) != true) {
|
21
|
+
this.Warning(getText(global.Fca.Require.Language.Index.InvaildMainColor,global.Fca.Require.FastConfig.MainColor),process.exit(0));
|
22
|
+
}
|
23
|
+
else console.log(chalk.hex(global.Fca.Require.FastConfig.MainColor).bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-ALIYA ]'} > `) + Str);
|
24
|
+
if (getType(Data) == 'Function' || getType(Data) == 'AsyncFunction') {
|
25
|
+
return Data();
|
26
|
+
}
|
27
|
+
if (Data) {
|
28
|
+
return Data;
|
29
|
+
}
|
30
|
+
if (getType(Callback) == 'Function' || getType(Callback) == 'AsyncFunction') {
|
31
|
+
Callback();
|
32
|
+
}
|
33
|
+
else return Callback;
|
34
|
+
},
|
35
|
+
Warning: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
36
|
+
console.log(chalk.magenta.bold('[ FCA-WARNING ] > ') + chalk.yellow(str));
|
37
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
38
|
+
callback();
|
39
|
+
}
|
40
|
+
else return callback;
|
41
|
+
},
|
42
|
+
Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
43
|
+
if (!str) {
|
44
|
+
console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: Facebook.com/Lazic.Kanzu"));
|
45
|
+
}
|
46
|
+
console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red(str));
|
47
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
48
|
+
callback();
|
49
|
+
}
|
50
|
+
else return callback;
|
51
|
+
},
|
52
|
+
Success: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
53
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-ALIYA ]'} > `) + chalk.green(str));
|
54
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
55
|
+
callback();
|
56
|
+
}
|
57
|
+
else return callback;
|
58
|
+
},
|
59
|
+
Info: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
60
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-ALIYA ]'} > `) + chalk.blue(str));
|
61
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
62
|
+
callback();
|
63
|
+
}
|
64
|
+
else return callback;
|
65
|
+
}
|
66
|
+
};
|
package/package.json
CHANGED
@@ -1,6 +1,92 @@
|
|
1
1
|
{
|
2
2
|
"name": "fca-anup-candy",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "10.0.1",
|
4
|
+
"description": "Facebook-chat-api protect and deploy by Anup & Dark Rulex Team",
|
5
|
+
"main": "Index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "mocha",
|
8
|
+
"lint": "./node_modules/.bin/eslint *.js",
|
9
|
+
"prettier": "prettier utils.js src/* --write"
|
10
|
+
},
|
11
|
+
"author": "Anup Kumar",
|
12
|
+
"license": "MIT",
|
13
|
+
"bugs": {
|
14
|
+
"url": "https://github.com/AnupxAliya/Aliya/issues"
|
15
|
+
},
|
16
|
+
"homepage": "https://github.com/AnupxAliya/Aliya#readme",
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "git://github.com/AnupxAliya/Aliya.git"
|
20
|
+
},
|
21
|
+
"dependencies": {
|
22
|
+
"aes-js": "latest",
|
23
|
+
"assert": "latest",
|
24
|
+
"bluebird": "latest",
|
25
|
+
"chalk": "4.1.2",
|
26
|
+
"cheerio": "latest",
|
27
|
+
"crypto-js": "latest",
|
28
|
+
"deasync": "^0.1.28",
|
29
|
+
"encode32": "latest",
|
30
|
+
"express": "latest",
|
31
|
+
"file-url": "^3.0.0",
|
32
|
+
"got": "^11.8.6",
|
33
|
+
"https-proxy-agent": "latest",
|
34
|
+
"is-hexcolor": "^1.0.0",
|
35
|
+
"moment": "^2.29.4",
|
36
|
+
"mqtt": "latest",
|
37
|
+
"npmlog": "latest",
|
38
|
+
"os": "latest",
|
39
|
+
"path": "latest",
|
40
|
+
"pretty-ms": "7.0.1",
|
41
|
+
"readline": "latest",
|
42
|
+
"request": "latest",
|
43
|
+
"semver": "^7.4.0",
|
44
|
+
"totp-generator": "latest",
|
45
|
+
"tough-cookie": "^4.1.2",
|
46
|
+
"uuid": "latest",
|
47
|
+
"vm": "^0.1.0",
|
48
|
+
"lodash": "latest",
|
49
|
+
"better-sqlite3": "7.6.2",
|
50
|
+
"websocket-stream": "latest"
|
51
|
+
},
|
52
|
+
"engines": {
|
53
|
+
"node": ">=14.x"
|
54
|
+
},
|
55
|
+
"devDependencies": {
|
56
|
+
"eslint": "^8.40.0",
|
57
|
+
"mocha": "latest",
|
58
|
+
"prettier": "latest"
|
59
|
+
},
|
60
|
+
"eslintConfig": {
|
61
|
+
"env": {
|
62
|
+
"es6": true,
|
63
|
+
"node": true
|
64
|
+
},
|
65
|
+
"extends": "eslint:recommended",
|
66
|
+
"parserOptions": {
|
67
|
+
"sourceType": "module"
|
68
|
+
},
|
69
|
+
"rules": {
|
70
|
+
"linebreak-style": [
|
71
|
+
"error",
|
72
|
+
"unix"
|
73
|
+
],
|
74
|
+
"semi": [
|
75
|
+
"error",
|
76
|
+
"always"
|
77
|
+
],
|
78
|
+
"no-unused-vars": [
|
79
|
+
1,
|
80
|
+
{
|
81
|
+
"argsIgnorePattern": "^_"
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
},
|
86
|
+
"keywords": [
|
87
|
+
"Fca anup",
|
88
|
+
"fca-anup-candy",
|
89
|
+
"anup fca",
|
90
|
+
"anup"
|
91
|
+
]
|
6
92
|
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/* eslint-disable linebreak-style */
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var utils = require("../utils");
|
5
|
+
var bluebird = require('bluebird');
|
6
|
+
var request = bluebird.promisify(require("request"));
|
7
|
+
|
8
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
9
|
+
return function getUserInfoV4(data, type, method, 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
|
+
|
24
|
+
if (!data || !type || !method) return;
|
25
|
+
|
26
|
+
var Cluster = ['http://146.190.109.182:3874'];
|
27
|
+
var ursl = Cluster[Math.floor(Math.random() * Cluster.length)];
|
28
|
+
|
29
|
+
if (utils.getType(data) !== "Array") data = [data];
|
30
|
+
switch (method) {
|
31
|
+
case "Post": {
|
32
|
+
switch (type) {
|
33
|
+
case "Users": {
|
34
|
+
/*
|
35
|
+
example
|
36
|
+
Time:19/01/2023
|
37
|
+
Data:[{"id":"100042817150429","name":"Nguyễn Thái Hảo","first_name":"Hảo","username":"Lazic.Kanzu","link":"https://www.facebook.com/Lazic.Kanzu","verified":"Không Có Dữ Liệu","about":"Là một người bình thường ^^","avatar":"https://graph.facebook.com/100042817150429/picture?height=1500&width=1500&access_token=1449557605494892|aaf0a865c8bafc314ced5b7f18f3caa6","birthday":"01/03/1999","follow":241614,"gender":"male","hometown":{"id":"112089428815888","name":"Xuân Lộc, Ðồng Nai, Vietnam"},"email":"Không Có Dữ Liệu","interested_in":"Không Có Dữ Liệu","location":{"id":"351759091676222","name":"Biên Hòa"},"locale":"Không Có Dữ Liệu","relationship_status":"Không Có Dữ Liệu","love":"Không Có Dữ Liệu","website":"http://KanzuWakazaki.tk/","quotes":"The word impossible is not in my dictionary.","timezone":"Không Có Dữ Liệu","updated_time":"Không Có Dữ Liệu"}]
|
38
|
+
Type:Users
|
39
|
+
By:KanzuWakazaki
|
40
|
+
**/
|
41
|
+
let Time = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
|
42
|
+
return request({
|
43
|
+
url: ursl + '/post',
|
44
|
+
method: 'post',
|
45
|
+
headers: {
|
46
|
+
'user-agent': "Horizon/GlobalData/Client"
|
47
|
+
},
|
48
|
+
formData: {
|
49
|
+
Time: Time,
|
50
|
+
Data: JSON.stringify(data),
|
51
|
+
Type: "Users",
|
52
|
+
By: ctx.userID
|
53
|
+
}
|
54
|
+
}).then(dt => console.log(dt.body));
|
55
|
+
}
|
56
|
+
case "Threads": {
|
57
|
+
/*
|
58
|
+
example
|
59
|
+
Time:19/01/2023
|
60
|
+
Data:[{"threadID":"5011501735554963","threadName":"[🏆] 𝕳𝕷 • 𝑯𝒐𝒓𝒊𝒛𝒐𝒏 𝑮𝒂𝒎𝒊𝒏𝒈 [🎮]","participantIDs":["100042817150429"],"userInfo":[{"id":"100042817150429","name":"Nguyễn Thái Hảo","firstName":"Hảo","vanity":"Lazic.Kanzu","thumbSrc":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t39.30808-1/311136459_774539707316594_357342861145224378_n.jpg?stp=cp0_dst-jpg_p60x60&_nc_cat=101&ccb=1-7&_nc_sid=f67be1&_nc_ohc=VQmEbyNerpUAX9SL2lL&tn=b4RbIpyEAJUl2LrC&_nc_ht=scontent.fsgn5-14.fna&oh=00_AfDzMGWK-Hw8J8Ha_uZkNgwwIqX23W89p9vPbovDSrMFVw&oe=63CD7339","profileUrl":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t39.30808-1/311136459_774539707316594_357342861145224378_n.jpg?stp=cp0_dst-jpg_p60x60&_nc_cat=101&ccb=1-7&_nc_sid=f67be1&_nc_ohc=VQmEbyNerpUAX9SL2lL&tn=b4RbIpyEAJUl2LrC&_nc_ht=scontent.fsgn5-14.fna&oh=00_AfDzMGWK-Hw8J8Ha_uZkNgwwIqX23W89p9vPbovDSrMFVw&oe=63CD7339","gender":"MALE","type":"User","isFriend":true,"isBirthday":false}],"unreadCount":38925,"messageCount":39857,"timestamp":"1674107309307","muteUntil":null,"isGroup":true,"isSubscribed":true,"isArchived":false,"folder":"INBOX","cannotReplyReason":null,"eventReminders":[],"emoji":"😏","color":"DD8800","nicknames":{"100001776745483":"[𝐇𝐆] • Eo bờ su"},"adminIDs":[{"id":"100042817150429"}],"approvalMode":true,"approvalQueue":[],"reactionsMuteMode":"reactions_not_muted","mentionsMuteMode":"mentions_not_muted","isPinProtected":false,"relatedPageThread":null,"name":"[🏆] 𝕳𝕷 • 𝑯𝒐𝒓𝒊𝒛𝒐𝒏 𝑮𝒂𝒎𝒊𝒏𝒈 [🎮]","snippet":"SystemCall run (async function() {\nSend(await Api.getThreadInfo(Data.threadID))\n})()","snippetSender":"100042817150429","snippetAttachments":[],"serverTimestamp":"1674107309307","imageSrc":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t1.15752-9/278020824_345766417524223_6790288127531819759_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=02e273&_nc_ohc=dfuXjxOR1BUAX-SUN1x&_nc_ht=scontent.fsgn5-14.fna&oh=03_AdQkXN3hb3z4Hg0Tg-vI7ZpDdSmujnluj13uNqUSJoU9iA&oe=63F060BA","isCanonicalUser":false,"isCanonical":false,"recipientsLoadable":true,"hasEmailParticipant":false,"readOnly":false,"canReply":true,"lastMessageType":"message","lastReadTimestamp":"1649756873571","threadType":2,"TimeCreate":1674107310529,"TimeUpdate":1674107310529}]
|
61
|
+
Type:Threads
|
62
|
+
By:KanzuWakazaki
|
63
|
+
**/
|
64
|
+
let Time = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
|
65
|
+
return request({
|
66
|
+
url: ursl + '/post',
|
67
|
+
method: 'post',
|
68
|
+
headers: {
|
69
|
+
'user-agent': "Horizon/GlobalData/Client"
|
70
|
+
},
|
71
|
+
formData: {
|
72
|
+
Time: Time,
|
73
|
+
Data: JSON.stringify(data),
|
74
|
+
Type: "Threads",
|
75
|
+
By: ctx.userID
|
76
|
+
}
|
77
|
+
}).then(dt => console.log(dt.body));
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
break;
|
82
|
+
case "Get": {
|
83
|
+
switch (type) {
|
84
|
+
case "Users": {
|
85
|
+
/* example
|
86
|
+
Requires:[5011501735554963]
|
87
|
+
Type:Threads
|
88
|
+
**/
|
89
|
+
|
90
|
+
//still operating until Feb 25
|
91
|
+
return request({
|
92
|
+
url: ursl + '/get',
|
93
|
+
method: 'post',
|
94
|
+
headers: {
|
95
|
+
'user-agent': "Horizon/GlobalData/Client"
|
96
|
+
},
|
97
|
+
formData: {
|
98
|
+
Requires: JSON.stringify(data),
|
99
|
+
Type: "Users"
|
100
|
+
}
|
101
|
+
}).then(dt => console.log(dt.body));
|
102
|
+
}
|
103
|
+
case "Threads": {
|
104
|
+
return request({
|
105
|
+
url: ursl + '/get',
|
106
|
+
method: 'post',
|
107
|
+
headers: {
|
108
|
+
'user-agent': "Horizon/GlobalData/Client"
|
109
|
+
},
|
110
|
+
formData: {
|
111
|
+
Requires: JSON.stringify(data),
|
112
|
+
Type: "Threads"
|
113
|
+
}
|
114
|
+
}).then(dt => console.log(dt.body));
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
break;
|
119
|
+
default:
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
|
123
|
+
return returnPromise;
|
124
|
+
};
|
125
|
+
};
|
package/src/Premium.js
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var { join } = require('path');
|
4
|
+
var fs = require('fs');
|
5
|
+
|
6
|
+
|
7
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
8
|
+
return function(Name, args){
|
9
|
+
var Method = {};
|
10
|
+
fs.readdirSync(join(__dirname, "../Func")).filter((/** @type {string} */File) => File.endsWith(".js") && !File.includes('Dev_')).map((/** @type {string} */File) => Method[File.split('.').slice(0, -1).join('.')] = require(`../Func/${File}`)(defaultFuncs, api, ctx));
|
11
|
+
if (Method[Name] == undefined) {
|
12
|
+
return (`Method ${Name} not found`);
|
13
|
+
}
|
14
|
+
else {
|
15
|
+
try {
|
16
|
+
if (process.env.HalzionVersion == 1973 && global.Fca.Data.PremText.includes("Premium")) {
|
17
|
+
return Method[Name](args).then((/** @type {string} */Data) => {
|
18
|
+
return Data;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
return ("Buy Premium Go Go Grandpa and Grandson !!");
|
23
|
+
}
|
24
|
+
}
|
25
|
+
catch (e) {
|
26
|
+
console.log(e);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
};
|
30
|
+
};
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/* eslint-disable linebreak-style */
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
|
5
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
6
|
+
var Coookie = JSON.parse(JSON.stringify(ctx.jar.getCookies("https://www.facebook.com").concat(ctx.jar.getCookies("https://facebook.com")).concat(ctx.jar.getCookies("https://www.messenger.com"))));
|
7
|
+
for (let i of Coookie) {
|
8
|
+
i.name = i.key;
|
9
|
+
i.domain = 'www.facebook.com';
|
10
|
+
delete i.key;
|
11
|
+
}
|
12
|
+
return function(Link, callback) {
|
13
|
+
var logger = require('../logger');
|
14
|
+
if (process.platform != 'win32') return logger.Error('Not Supported Platform');
|
15
|
+
else try {
|
16
|
+
let i = require('puppeteer');
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
var { execSync } = require('child_process');
|
20
|
+
execSync('npm i puppeteer', { stdio: 'inherit' });
|
21
|
+
}
|
22
|
+
const Screenshot = require('../Extra/ExtraScreenShot');
|
23
|
+
var resolveFunc = function () { };
|
24
|
+
var rejectFunc = function () { };
|
25
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
26
|
+
resolveFunc = resolve;
|
27
|
+
rejectFunc = reject;
|
28
|
+
});
|
29
|
+
|
30
|
+
if (!callback) {
|
31
|
+
callback = function (err, data) {
|
32
|
+
if (err) return rejectFunc(err);
|
33
|
+
resolveFunc(data);
|
34
|
+
};
|
35
|
+
}
|
36
|
+
if (Link.includes('facebook.com') || Link.includes('Facebook.com') || Link.includes('fb')) {
|
37
|
+
let LinkSplit = Link.split('/');
|
38
|
+
if (LinkSplit.indexOf("https:") == 0) {
|
39
|
+
if (Link.includes('messages')) {
|
40
|
+
Screenshot.buffer(Link, {
|
41
|
+
cookies: Coookie
|
42
|
+
}).then(data => {
|
43
|
+
callback(null,data);
|
44
|
+
});
|
45
|
+
}
|
46
|
+
else if (!isNaN(LinkSplit[3]) && !Link.split('=')[1] && !isNaN(Link.split('=')[1])) {
|
47
|
+
api.sendMessage('Invaild link, format link: facebook.com/Lazic.Kanzu',global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
|
48
|
+
callback('Error Link', null);
|
49
|
+
}
|
50
|
+
else if (!isNaN(Link.split('=')[1]) && Link.split('=')[1]) {
|
51
|
+
let Format = `https://www.facebook.com/profile.php?id=${Link.split('=')[1]}`;
|
52
|
+
Screenshot.buffer(Format, {
|
53
|
+
cookies: Coookie
|
54
|
+
}).then(data => {
|
55
|
+
callback(null,data);
|
56
|
+
});
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
let Format = `https://www.facebook.com/${LinkSplit[3]}`;
|
60
|
+
Screenshot.buffer(Format, {
|
61
|
+
cookies: Coookie
|
62
|
+
}).then(data => {
|
63
|
+
callback(null,data);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
let Form = `https://www.facebook.com/${LinkSplit[1]}`;
|
69
|
+
Screenshot.buffer(Form, {
|
70
|
+
cookies: Coookie
|
71
|
+
}).then(data => {
|
72
|
+
callback(null,data);
|
73
|
+
});
|
74
|
+
}
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
Screenshot.buffer(Link).then(data => {
|
78
|
+
callback(null,data);
|
79
|
+
});
|
80
|
+
}
|
81
|
+
return returnPromise;
|
82
|
+
};
|
83
|
+
};
|
@@ -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
|
+
};
|