meta-horizonn 1.2.7 → 1.2.9
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/Extra/Html/Classic/script.js +38 -33
- package/Extra/Src/Check_Update.js +13 -13
- package/Extra/Src/Instant_Update.js +12 -12
- package/Main.js +5 -9
- package/README.md +37 -40
- package/broadcast.js +10 -0
- package/font-handler.js +25 -3
- package/index.js +8 -8
- package/logger.js +52 -3
- package/package.json +1 -1
@@ -13,45 +13,48 @@ c.height = 100; // Set to font size
|
|
13
13
|
|
14
14
|
var whitePixels = [];
|
15
15
|
var points = [];
|
16
|
-
var point = function(x,y,vx,vy){
|
16
|
+
var point = function(x, y, vx, vy) {
|
17
17
|
this.x = x;
|
18
18
|
this.y = y;
|
19
19
|
this.vx = vx || 1;
|
20
20
|
this.vy = vy || 1;
|
21
21
|
};
|
22
|
+
|
22
23
|
point.prototype.update = function() {
|
23
24
|
ctx.beginPath();
|
24
25
|
ctx.fillStyle = "#95a5a6";
|
25
|
-
ctx.arc(this.x,this.y,1,0,2*Math.PI);
|
26
|
+
ctx.arc(this.x, this.y, 1, 0, 2 * Math.PI);
|
26
27
|
ctx.fill();
|
27
28
|
ctx.closePath();
|
28
29
|
|
29
30
|
// Change direction if running into black pixel
|
30
|
-
if (this.x+this.vx >= c.width || this.x+this.vx < 0 || mask.data[coordsToI(this.x+this.vx, this.y, mask.width)] != 255) {
|
31
|
+
if (this.x + this.vx >= c.width || this.x + this.vx < 0 || mask.data[coordsToI(this.x + this.vx, this.y, mask.width)] != 255) {
|
31
32
|
this.vx *= -1;
|
32
|
-
this.x += this.vx*2;
|
33
|
-
}
|
34
|
-
|
33
|
+
this.x += this.vx * 2;
|
34
|
+
};
|
35
|
+
|
36
|
+
if (this.y + this.vy >= c.height || this.y + this.vy < 0 || mask.data[coordsToI(this.x, this.y + this.vy, mask.width)] != 255) {
|
35
37
|
this.vy *= -1;
|
36
|
-
this.y += this.vy*2;
|
38
|
+
this.y += this.vy * 2;
|
37
39
|
}
|
38
40
|
|
39
|
-
for (var k = 0, m = points.length; k<m; k++) {
|
41
|
+
for (var k = 0, m = points.length; k < m; k++) {
|
40
42
|
if (points[k]===this) continue;
|
41
43
|
|
42
|
-
var d = Math.sqrt(Math.pow(this.x-points[k].x,2)+Math.pow(this.y-points[k].y,2));
|
44
|
+
var d = Math.sqrt(Math.pow(this.x - points[k].x, 2) + Math.pow(this.y - points[k].y, 2));
|
43
45
|
if (d < 5) {
|
44
46
|
ctx.lineWidth = .2;
|
45
47
|
ctx.beginPath();
|
46
|
-
ctx.moveTo(this.x,this.y);
|
47
|
-
ctx.lineTo(points[k].x,points[k].y);
|
48
|
+
ctx.moveTo(this.x, this.y);
|
49
|
+
ctx.lineTo(points[k].x, points[k].y);
|
48
50
|
ctx.stroke();
|
49
51
|
}
|
52
|
+
|
50
53
|
if (d < 20) {
|
51
54
|
ctx.lineWidth = .1;
|
52
55
|
ctx.beginPath();
|
53
|
-
ctx.moveTo(this.x,this.y);
|
54
|
-
ctx.lineTo(points[k].x,points[k].y);
|
56
|
+
ctx.moveTo(this.x, this.y);
|
57
|
+
ctx.lineTo(points[k].x, points[k].y);
|
55
58
|
ctx.stroke();
|
56
59
|
}
|
57
60
|
}
|
@@ -61,7 +64,7 @@ point.prototype.update = function() {
|
|
61
64
|
};
|
62
65
|
|
63
66
|
function loop() {
|
64
|
-
ctx.clearRect(0,0,c.width,c.height);
|
67
|
+
ctx.clearRect(0, 0, c.width, c.height);
|
65
68
|
for (var k = 0, m = points.length; k < m; k++) {
|
66
69
|
points[k].update();
|
67
70
|
}
|
@@ -71,24 +74,24 @@ function init() {
|
|
71
74
|
// Draw text
|
72
75
|
ctx.beginPath();
|
73
76
|
ctx.fillStyle = "#000";
|
74
|
-
ctx.rect(0,0,c.width,c.height);
|
77
|
+
ctx.rect(0, 0, c.width, c.height);
|
75
78
|
ctx.fill();
|
76
79
|
ctx.font = fontStr;
|
77
80
|
ctx.textAlign = "left";
|
78
81
|
ctx.fillStyle = "#fff";
|
79
|
-
ctx.fillText(str,0,c.height/2+(c.height / 2));
|
82
|
+
ctx.fillText(str, 0, c.height / 2 + (c.height / 2));
|
80
83
|
ctx.closePath();
|
81
84
|
|
82
85
|
// Save mask
|
83
|
-
mask = ctx.getImageData(0,0,c.width,c.height);
|
86
|
+
mask = ctx.getImageData(0, 0, c.width, c.height);
|
84
87
|
|
85
88
|
// Draw background
|
86
|
-
ctx.clearRect(0,0,c.width,c.height);
|
89
|
+
ctx.clearRect(0, 0, c.width, c.height);
|
87
90
|
|
88
91
|
// Save all white pixels in an array
|
89
92
|
for (var i = 0; i < mask.data.length; i += 4) {
|
90
|
-
if (mask.data[i] == 255 && mask.data[i+1] == 255 && mask.data[i+2] == 255 && mask.data[i+3] == 255) {
|
91
|
-
whitePixels.push([iToX(i,mask.width),iToY(i,mask.width)]);
|
93
|
+
if (mask.data[i] == 255 && mask.data[i + 1] == 255 && mask.data[i + 2] == 255 && mask.data[i + 3] == 255) {
|
94
|
+
whitePixels.push([iToX(i, mask.width), iToY(i, mask.width)]);
|
92
95
|
}
|
93
96
|
}
|
94
97
|
|
@@ -98,22 +101,24 @@ function init() {
|
|
98
101
|
}
|
99
102
|
|
100
103
|
function addPoint() {
|
101
|
-
var spawn = whitePixels[Math.floor(Math.random()*whitePixels.length)];
|
104
|
+
var spawn = whitePixels[Math.floor(Math.random() * whitePixels.length)];
|
102
105
|
|
103
|
-
var p = new point(spawn[0],spawn[1], Math.floor(Math.random()*2-1), Math.floor(Math.random()*2-1));
|
106
|
+
var p = new point(spawn[0], spawn[1], Math.floor(Math.random() * 2 - 1), Math.floor(Math.random() * 2 - 1));
|
104
107
|
points.push(p);
|
105
|
-
}
|
108
|
+
};
|
106
109
|
|
107
|
-
function iToX(i,w) {
|
108
|
-
return ((i%(4*w))/4);
|
109
|
-
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
110
|
+
function iToX(i, w) {
|
111
|
+
return ((i % (4 * w)) / 4);
|
112
|
+
};
|
113
|
+
|
114
|
+
function iToY(i, w) {
|
115
|
+
return (Math.floor(i / (4 * w)));
|
116
|
+
};
|
117
|
+
|
118
|
+
function coordsToI(x, y, w) {
|
119
|
+
return ((mask.width * y) + x) * 4;
|
120
|
+
};
|
115
121
|
|
116
|
-
}
|
117
122
|
|
118
|
-
setInterval(loop,50);
|
123
|
+
setInterval(loop, 50);
|
119
124
|
init();
|
@@ -10,11 +10,11 @@ module.exports = async function(Stable_Version) {
|
|
10
10
|
const LocalVersion = require('../../package.json').version;
|
11
11
|
if (Number(LocalVersion.replace(/\./g,"")) < Number(json.version.replace(/\./g,"")) && global.Fca.Require.FastConfig.Stable_Version.Accept == false || Stable_Version && Number(LocalVersion.replace(/\./g,"")) != Number(Stable_Version.replace(/\./g,""))) {
|
12
12
|
var Version = Stable_Version != undefined ? Stable_Version : json.version;
|
13
|
-
log.warn("[ FCA-UPDATE ] ➣","New Version, Ready to Update: " + LocalVersion + " ➣ " + Version);
|
13
|
+
log.warn("[ FCA-UPDATE ] ➣", "New Version, Ready to Update: " + LocalVersion + " ➣ " + Version);
|
14
14
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
15
15
|
try {
|
16
|
-
execSync(`npm install meta-
|
17
|
-
log.info("[ FCA-UPDATE ] ➣","Update Complete, Restarting...");
|
16
|
+
execSync(`npm install meta-horizonn@${Version}`, { stdio: 'inherit' });
|
17
|
+
log.info("[ FCA-UPDATE ] ➣", "Update Complete, Restarting...");
|
18
18
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
19
19
|
Database().set("Instant_Update", Date.now());
|
20
20
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
@@ -23,10 +23,10 @@ module.exports = async function(Stable_Version) {
|
|
23
23
|
catch (err) {
|
24
24
|
try {
|
25
25
|
console.log(err);
|
26
|
-
log.warn("[ FCA-UPDATE ] ➣","Update Failed, Trying Another Method 1...");
|
26
|
+
log.warn("[ FCA-UPDATE ] ➣", "Update Failed, Trying Another Method 1...");
|
27
27
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
28
|
-
execSync(`npm install meta-
|
29
|
-
log.info("[ FCA-UPDATE ] ➣","Update Complete, Restarting...");
|
28
|
+
execSync(`npm install meta-horizonn@${Version} --force`, { stdio: 'inherit' });
|
29
|
+
log.info("[ FCA-UPDATE ] ➣", "Update Complete, Restarting...");
|
30
30
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
31
31
|
Database().set("Instant_Update", Date.now());
|
32
32
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
@@ -35,16 +35,16 @@ module.exports = async function(Stable_Version) {
|
|
35
35
|
catch (err) {
|
36
36
|
try {
|
37
37
|
console.log(err);
|
38
|
-
log.warn("[ FCA-UPDATE ] ➣","Update Failed, Trying to clean Database() cache...");
|
38
|
+
log.warn("[ FCA-UPDATE ] ➣", "Update Failed, Trying to clean Database() cache...");
|
39
39
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
40
40
|
execSync('npm cache clean --force', { stdio: 'inherit' });
|
41
|
-
log.info("[ FCA-UPDATE ] ➣","Cache Cleaned, Trying Another Method 2...");
|
41
|
+
log.info("[ FCA-UPDATE ] ➣", "Cache Cleaned, Trying Another Method 2...");
|
42
42
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
43
43
|
//self delete fca-horizon-remastered folder from node_modules
|
44
|
-
fs.rmdirSync((process.cwd() + "/node_modules/meta-
|
44
|
+
fs.rmdirSync((process.cwd() + "/node_modules/meta-horizonn" || __dirname + '../../../meta-horizonn'), { recursive: true });
|
45
45
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
46
|
-
execSync(`npm install meta-
|
47
|
-
log.info("[ FCA-UPDATE ] ➣","Update Complete, Restarting...");
|
46
|
+
execSync(`npm install meta-horizonn@${Version}`, { stdio: 'inherit' });
|
47
|
+
log.info("[ FCA-UPDATE ] ➣", "Update Complete, Restarting...");
|
48
48
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
49
49
|
Database().set("Instant_Update", Date.now(), true);
|
50
50
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
@@ -52,9 +52,9 @@ module.exports = async function(Stable_Version) {
|
|
52
52
|
}
|
53
53
|
catch (e) {
|
54
54
|
console.log(e);
|
55
|
-
log.error("[ FCA-UPDATE ] ➣","Update Failed, Please Update Manually");
|
55
|
+
log.error("[ FCA-UPDATE ] ➣", "Update Failed, Please Update Manually");
|
56
56
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
57
|
-
log.warn("[ FCA-UPDATE ] ➣","Please contact to owner about update failed and screentshot error log at fb.com/kemsadboiz");
|
57
|
+
log.warn("[ FCA-UPDATE ] ➣", "Please contact to owner about update failed and screentshot error log at fb.com/kemsadboiz");
|
58
58
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
59
59
|
process.exit(1);
|
60
60
|
}
|
@@ -9,8 +9,8 @@ module.exports = async function() {
|
|
9
9
|
const json = JSON.parse(body);
|
10
10
|
const LocalVersion = require('../../package.json').version;
|
11
11
|
if (Number(LocalVersion.replace(/\./g,"")) < Number(json.Version.replace(/\./g,"")) ) {
|
12
|
-
log.warn("[ FCA-UPDATE ] ➣","Found a command that requires downloading an important Version to avoid errors, update onions: " + LocalVersion + " ➣ " + json.Version);
|
13
|
-
log.warn("[ FCA-UPDATE ] ➣","Problem Description: " + json.Problem);
|
12
|
+
log.warn("[ FCA-UPDATE ] ➣", "Found a command that requires downloading an important Version to avoid errors, update onions: " + LocalVersion + " ➣ " + json.Version);
|
13
|
+
log.warn("[ FCA-UPDATE ] ➣", "Problem Description: " + json.Problem);
|
14
14
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
15
15
|
try {
|
16
16
|
execSync(`npm install meta-horizon@${json.Version}`, { stdio: 'inherit' });
|
@@ -22,10 +22,10 @@ module.exports = async function() {
|
|
22
22
|
}
|
23
23
|
catch (err) {
|
24
24
|
try {
|
25
|
-
log.warn("[ FCA-UPDATE ] ➣","Update Failed, Trying Another Method 1...");
|
25
|
+
log.warn("[ FCA-UPDATE ] ➣", "Update Failed, Trying Another Method 1...");
|
26
26
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
27
|
-
execSync(`npm install meta-
|
28
|
-
log.info("[ FCA-UPDATE ] ➣","Update Complete, Restarting...");
|
27
|
+
execSync(`npm install meta-horizonn@${json.Version} --force`, { stdio: 'inherit' });
|
28
|
+
log.info("[ FCA-UPDATE ] ➣", "Update Complete, Restarting...");
|
29
29
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
30
30
|
Database(true).set("Instant_Update", Date.now());
|
31
31
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
@@ -33,16 +33,16 @@ module.exports = async function() {
|
|
33
33
|
}
|
34
34
|
catch (err) {
|
35
35
|
try {
|
36
|
-
log.warn("[ FCA-UPDATE ] ➣","Update Failed, Trying to clean package cache...");
|
36
|
+
log.warn("[ FCA-UPDATE ] ➣", "Update Failed, Trying to clean package cache...");
|
37
37
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
38
38
|
execSync('npm cache clean --force', { stdio: 'inherit' });
|
39
|
-
log.info("[ FCA-UPDATE ] ➣","Cache Cleaned, Trying Another Method 2...");
|
39
|
+
log.info("[ FCA-UPDATE ] ➣", "Cache Cleaned, Trying Another Method 2...");
|
40
40
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
41
41
|
//self delete fca-horizon-remastered folder from node_modules
|
42
|
-
fs.rmdirSync((process.cwd() + "/node_modules/meta-
|
42
|
+
fs.rmdirSync((process.cwd() + "/node_modules/meta-horizonn" || __dirname + '../../../meta-horizonn'), { recursive: true });
|
43
43
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
44
|
-
execSync(`npm install meta-
|
45
|
-
log.info("[ FCA-UPDATE ] ➣","Update Complete, Restarting...");
|
44
|
+
execSync(`npm install meta-horizonn@${json.Version}`, { stdio: 'inherit' });
|
45
|
+
log.info("[ FCA-UPDATE ] ➣", "Update Complete, Restarting...");
|
46
46
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
47
47
|
Database(true).set("Instant_Update", Date.now());
|
48
48
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
@@ -50,9 +50,9 @@ module.exports = async function() {
|
|
50
50
|
}
|
51
51
|
catch (e) {
|
52
52
|
console.log(e);
|
53
|
-
log.error("[ FCA-UPDATE ] ➣","Update Failed, Please Update Manually");
|
53
|
+
log.error("[ FCA-UPDATE ] ➣", "Update Failed, Please Update Manually");
|
54
54
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
55
|
-
log.warn("[ FCA-UPDATE ] ➣","Please contact to owner about update failed and screentshot error log at fb.com/kemsadboiz");
|
55
|
+
log.warn("[ FCA-UPDATE ] ➣", "Please contact to owner about update failed and screentshot error log at fb.com/kemsadboiz");
|
56
56
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
57
57
|
process.exit(1);
|
58
58
|
}
|
package/Main.js
CHANGED
@@ -393,10 +393,6 @@ else userID = maybeUser[0].cookieString().split("=")[1].toString();
|
|
393
393
|
if (region && mqttEndpoint) {
|
394
394
|
//do sth
|
395
395
|
} else {
|
396
|
-
// else {
|
397
|
-
// log.warn("login", getText(Language.NoAreaData));
|
398
|
-
// api["htmlData"] = html;
|
399
|
-
// }
|
400
396
|
if (bypass_region) {
|
401
397
|
logger.Normal(Language.NoAreaDataBypass);
|
402
398
|
} else {
|
@@ -451,7 +447,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
451
447
|
form.lgnjs = ~~(Date.now() / 1000);
|
452
448
|
|
453
449
|
html.split("\"_js_").slice(1).map((val) => {
|
454
|
-
jar.setCookie(utils.formatCookie(JSON.parse("[\"" + utils.getFrom(val, "", "]") + "]"), "facebook"),"https://www.facebook.com")
|
450
|
+
jar.setCookie(utils.formatCookie(JSON.parse("[\"" + utils.getFrom(val, "", "]") + "]"), "facebook"), "https://www.facebook.com")
|
455
451
|
});
|
456
452
|
|
457
453
|
logger.Normal(Language.OnLogin);
|
@@ -603,12 +599,12 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
603
599
|
Database().delete('Through2Fa');
|
604
600
|
}
|
605
601
|
const Otp_code = require('totp-generator');
|
606
|
-
const Code = global.Fca.Require.FastConfig.AuthString.includes('|') == false ? Otp_code(global.Fca.Require.FastConfig.AuthString.includes(" ") ? global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.FastConfig.AuthString) :
|
602
|
+
const Code = global.Fca.Require.FastConfig.AuthString.includes('|') == false ? Otp_code(global.Fca.Require.FastConfig.AuthString.includes(" ") ? global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.FastConfig.AuthString) : question(Language.EnterSecurityCode);
|
607
603
|
try {
|
608
604
|
const approvals = function(N_Code) {
|
609
605
|
form.approvals_code = N_Code;
|
610
606
|
form['submit[Continue]'] = $("#checkpointSubmitButton").html();
|
611
|
-
var prResolve,prReject;
|
607
|
+
var prResolve, prReject;
|
612
608
|
var rtPromise = new Promise((resolve, reject) => { prResolve = resolve; prReject = reject; });
|
613
609
|
|
614
610
|
if (typeof N_Code == "string") {
|
@@ -716,7 +712,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
716
712
|
continue: function submit2FA(code) {
|
717
713
|
form.approvals_code = code;
|
718
714
|
form['submit[Continue]'] = $("#checkpointSubmitButton").html(); //'Continue';
|
719
|
-
var prResolve,prReject;
|
715
|
+
var prResolve, prReject;
|
720
716
|
var rtPromise = new Promise((resolve, reject) => { prResolve = resolve; prReject = reject; });
|
721
717
|
if (typeof code == "string") {
|
722
718
|
utils
|
@@ -1005,7 +1001,7 @@ try {
|
|
1005
1001
|
|
1006
1002
|
let redirect = [1, "https://m.facebook.com/"];
|
1007
1003
|
let bypass_region_err = false;
|
1008
|
-
var ctx,api;
|
1004
|
+
var ctx, api;
|
1009
1005
|
mainPromise = mainPromise
|
1010
1006
|
.then(function(res) {
|
1011
1007
|
var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
|
package/README.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
[](https://socket.dev/npm/package/meta-horizonn)
|
2
2
|
[](https://github.com/JustKemForFun/JustKemForFun)
|
3
|
-

|
3
|
+

|
4
|
+
<!-- [](https://www.npmjs.com/package/meta-horizonn) -->
|
5
|
+
<!-- [](https://www.npmjs.org/package/meta-horizonn)
|
6
|
+
[](https://npmjs.com/package/meta-horizonn) -->
|
7
|
+
<!-- <p align="center">
|
8
|
+
<a href="https://nodejs.org/dist/v16.20.0">
|
9
|
+
<img src="https://img.shields.io/badge/Nodejs%20Support-16.x-brightgreen.svg?style=flat-square" alt="Nodejs Support v16.x">
|
10
|
+
</a>
|
11
|
+
</p> -->
|
12
|
+
|
13
|
+
> [!NOTE]
|
14
|
+
This is a messenger chat bot using a personal account. [Origin here](https://github.com/Schmavery/facebook-chat-api) and this may lead to facebook account being locked due to spam or other reasons.
|
15
|
+
So, I recommend using a clone account (one that you're willing to throw away at any time)<br>
|
16
|
+
***I am not responsible for any problems that may arise from using this bot.***
|
4
17
|
|
5
18
|
> [!IMPORTANT]
|
6
19
|
The contents of this repository may not be used for AI or anything else that Kem deems equivalent.
|
@@ -22,52 +35,19 @@
|
|
22
35
|
> [!WARNING]
|
23
36
|
> Critical content comes here. -->
|
24
37
|
|
25
|
-
# NPM Status
|
26
|
-
|
27
|
-
[](https://www.npmjs.com/package/meta-horizonn)
|
28
|
-
[](https://www.npmjs.org/package/meta-horizonn)
|
29
|
-
[](https://npmjs.com/package/meta-horizonn)
|
30
|
-
<!-- <p align="center">
|
31
|
-
<a href="https://nodejs.org/dist/v16.20.0">
|
32
|
-
<img src="https://img.shields.io/badge/Nodejs%20Support-16.x-brightgreen.svg?style=flat-square" alt="Nodejs Support v16.x">
|
33
|
-
</a>
|
34
|
-
</p> -->
|
35
|
-
<!-- [](https://npmjs.com/package/meta-horizonn)
|
36
|
-
|
37
|
-
## Install Package
|
38
|
-
[](https://packagephobia.now.sh/result?p=meta-horizonn)
|
39
|
-
[](https://bundlephobia.com/package/meta-horizonn@latest)
|
40
|
-
|
41
|
-
# Downloads
|
42
|
-
[](https://npmjs.com/package/meta-horizonn)
|
43
|
-
[](https://npmjs.com/package/meta-horizonn)
|
44
|
-
### Total Downloads
|
45
|
-
[](https://npmjs.com/package/meta-horizonn) -->
|
46
|
-
|
47
38
|
<!-- ## **List Info**
|
48
39
|
|
49
|
-
- [📝 **Note**](#-note)
|
50
40
|
- [🚧 **Requirement**](#-requirement)
|
51
|
-
- [📝 **Tutorial**](#-tutorial)
|
52
|
-
- [🔔 **How to get notification when have new update?**](#-how-to-get-notification-when-have-new-update)
|
53
|
-
- [🆙 **How to Update**](#-how-to-update)
|
54
|
-
- [🛠️ **How to create new commands**](#️-how-to-create-new-commands)
|
55
|
-
- [💭 **Support**](#-support)
|
56
41
|
- [📚 **Support Languages in source code**](#-support-languages-in-source-code)
|
57
|
-
- [📌 **Common Problems**](#-common-problems)
|
58
|
-
- [❌ **DO NOT USE THE ORIGINAL UNDERGRADUATE VERSION**](#-do-not-use-the-original-undergraduate-version)
|
59
|
-
- [✨ **Copyright (C)**](#-copyright-c)
|
60
42
|
- [📜 **License**](#-license)
|
61
|
-
|
62
|
-
<hr>
|
63
|
-
|
64
|
-
## 📝 **Note**
|
65
|
-
- This is a messenger chat bot using a personal account, using an [unofficial api](https://github.com/ntkhang03/fb-chat-api/blob/master/DOCS.md) ([Origin here](https://github.com/Schmavery/facebook-chat-api)) and this may lead to facebook account being locked due to spam or other reasons.
|
66
|
-
- So, I recommend using a clone account (one that you're willing to throw away at any time)
|
67
|
-
- ***I am not responsible for any problems that may arise from using this bot.*** -->
|
43
|
+
-->
|
68
44
|
> [!WARNING]
|
69
45
|
> *There is a risk of your account being banned after running the code, so please ensure proper account management and handling. If it happens, please try logging in again and retrieve your AppState.*
|
70
46
|
|
47
|
+
## 🚧 **Requirement**
|
48
|
+
- Node.JS 14.x [Download](https://nodejs.org/dist/v14.17.0) | [Home](https://nodejs.org/en/download/) | [Other versions](https://nodejs.org/en/download/releases/)
|
49
|
+
- Knowledge of **programming**, JavaScript, Node.JS
|
50
|
+
|
71
51
|
## **📝 Important Note <br> Quan Trọng !!!**
|
72
52
|
|
73
53
|
[ ENG ]: This package require NodeJS 14.17.0 to work properly.
|
@@ -92,9 +72,20 @@ Cảm Ơn Vì Đã Sài Sản Phẩm của HZI, Thân Ái.
|
|
92
72
|
***KANZUWAKAZAKI(15/04/2023)<br>
|
93
73
|
KEM.RELEASE(25/08/2023) | (09/12/2023)***
|
94
74
|
|
95
|
-
## **📚 Support
|
75
|
+
## **📚 Support Languages in source code**
|
76
|
+
- Currently, FCA supports 2 languages:
|
77
|
+
- [x] `en: English`
|
78
|
+
- [x] `vi: Vietnamese`
|
96
79
|
|
97
80
|
+ Support English, VietNamese !,
|
81
|
+
+ Change language in `FastConfigFca.json` file
|
82
|
+
```json
|
83
|
+
"Language": "vi"
|
84
|
+
```
|
85
|
+
+ Find Line Language Change:
|
86
|
+
```json
|
87
|
+
"Language": "en"
|
88
|
+
```
|
98
89
|
+ All bot if using listenMqtt first.
|
99
90
|
|
100
91
|
# **📜 API Cho ChatBot Messenger**
|
@@ -219,6 +210,12 @@ login(credentials, (err, api) => {
|
|
219
210
|
|
220
211
|
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 Và Đổi Tên Lại Thành AppState Cũng Được ! (appstate.json)
|
221
212
|
|
213
|
+
## ***📜 License***
|
214
|
+
|
215
|
+
• Give us a star! <br/>
|
216
|
+
• This project is licensed under the MIT License <br/>
|
217
|
+
• Go to [LICENSE](https://github.com/JustKemForFun/Meta-Horizon/blob/main/LICENSE) file
|
218
|
+
|
222
219
|
------------------------------------
|
223
220
|
|
224
221
|
## ***📌 FAQs***
|
package/broadcast.js
CHANGED
@@ -45,11 +45,21 @@
|
|
45
45
|
const logger = require('./logger');
|
46
46
|
const Fetch = require('got');
|
47
47
|
|
48
|
+
/**
|
49
|
+
* Configuration for broadcasting messages.
|
50
|
+
* @typedef {Object} broadcastConfig
|
51
|
+
* @property {boolean} enabled - Indicates if broadcasting is enabled.
|
52
|
+
* @property {string[]} data - Array of messages to be broadcasted.
|
53
|
+
*/
|
48
54
|
const broadcastConfig = {
|
49
55
|
enabled: false,
|
50
56
|
data: [],
|
51
57
|
};
|
52
58
|
|
59
|
+
/**
|
60
|
+
* Fetches broadcast data from a remote JSON file.
|
61
|
+
* @returns {Promise<string[]>} - Promise that resolves to an array of messages.
|
62
|
+
*/
|
53
63
|
const fetchBroadcastData = async () => {
|
54
64
|
try {
|
55
65
|
const response = await Fetch.get('https://raw.githubusercontent.com/JustKemForFun/Global_MetaHorizon/main/Fca_BroadCast.json');
|
package/font-handler.js
CHANGED
@@ -1,11 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* A module for managing font settings.
|
3
|
+
* @module fontManager
|
4
|
+
* An object to store font data.
|
5
|
+
* @type {Object}
|
6
|
+
*/
|
1
7
|
let data = {};
|
2
8
|
|
9
|
+
/**
|
10
|
+
* Sets the font for the application.
|
11
|
+
* @param {string} font - The name of the font to be set.
|
12
|
+
* @returns {void}
|
13
|
+
*/
|
3
14
|
function setFont(font) {
|
4
15
|
data["font"] = font;
|
5
|
-
console.log(font)
|
6
|
-
}
|
16
|
+
console.log(font);
|
17
|
+
};
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Retrieves the current font setting.
|
21
|
+
* @returns {string} - The name of the current font.
|
22
|
+
*/
|
7
23
|
function getFont() {
|
8
24
|
return data["font"];
|
9
|
-
}
|
25
|
+
};
|
10
26
|
|
27
|
+
/**
|
28
|
+
* Exports the setFont and getFont functions.
|
29
|
+
* @type {Object}
|
30
|
+
* @property {function} setFont - Sets the font for the application.
|
31
|
+
* @property {function} getFont - Retrieves the current font setting.
|
32
|
+
*/
|
11
33
|
module.exports = { setFont, getFont };
|
package/index.js
CHANGED
@@ -204,14 +204,14 @@ try {
|
|
204
204
|
process.exit(1);
|
205
205
|
}
|
206
206
|
|
207
|
-
try {
|
208
|
-
|
209
|
-
}
|
210
|
-
catch (e) {
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
207
|
+
try {
|
208
|
+
var Data_Setting = require(process.cwd() + "/FastConfigFca.json");
|
209
|
+
}
|
210
|
+
catch (e) {
|
211
|
+
global.Fca.Require.logger.Error('Detect Your FastConfigFca Settings Invalid!, Carry out default restoration');
|
212
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
|
213
|
+
process.exit(1)
|
214
|
+
}
|
215
215
|
if (global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
|
216
216
|
|
217
217
|
for (let i of All_Variable) {
|
package/logger.js
CHANGED
@@ -3,19 +3,48 @@
|
|
3
3
|
|
4
4
|
const chalk = require('chalk');
|
5
5
|
var isHexcolor = require('is-hexcolor');
|
6
|
+
/**
|
7
|
+
* A function to get text with placeholders replaced by provided data.
|
8
|
+
* @param {string[]}...Data - The data to replace placeholders in the main string.
|
9
|
+
* @returns {string} The main string with placeholders replaced by provided data.
|
10
|
+
*/
|
6
11
|
var getText = function(/** @type {string[]} */ ...Data) {
|
7
|
-
var Main = (Data.splice(0,1)).toString();
|
12
|
+
var Main = (Data.splice(0, 1)).toString();
|
8
13
|
for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
|
9
14
|
return Main;
|
10
15
|
};
|
16
|
+
|
11
17
|
/**
|
12
|
-
* @param {any} obj
|
18
|
+
* @param {any} obj - The object to get the type of.
|
19
|
+
* @returns {string} The type of the object.
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* getType(123); // returns "Number"
|
23
|
+
* getType("Hello"); // returns "String"
|
24
|
+
* getType(true); // returns "Boolean"
|
25
|
+
* getType([]); // returns "Array"
|
26
|
+
* getType({}); // returns "Object"
|
27
|
+
* getType(null); // returns "Null"
|
28
|
+
* getType(undefined); // returns "Undefined"
|
29
|
+
* getType(function() {}); // returns "Function"
|
30
|
+
* getType(new Date()); // returns "Date"
|
31
|
+
* getType(new RegExp()); // returns "RegExp"
|
32
|
+
* getType(new Error()); // returns "Error"
|
33
|
+
* getType(Promise.resolve()); // returns "Promise"
|
34
|
+
* getType(Symbol()); // returns "Symbol"
|
35
|
+
* getType(BigInt(123)); // returns "BigInt"
|
13
36
|
*/
|
14
37
|
function getType(obj) {
|
15
38
|
return Object.prototype.toString.call(obj).slice(8, -1);
|
16
|
-
}
|
39
|
+
};
|
17
40
|
|
18
41
|
module.exports = {
|
42
|
+
/**
|
43
|
+
* A function to log a normal message with color and prefix.
|
44
|
+
* @param {string} Str - The message to log.
|
45
|
+
* @param {() => any} Data - An optional function or value to be returned.
|
46
|
+
* @param {() => void} Callback - An optional function to be called.
|
47
|
+
*/
|
19
48
|
Normal: function(/** @type {string} */ Str, /** @type {() => any} */ Data ,/** @type {() => void} */ Callback) {
|
20
49
|
if (isHexcolor(global.Fca.Require.FastConfig.MainColor) != true) {
|
21
50
|
this.Warning(getText(global.Fca.Require.Language.Index.InvaildMainColor, global.Fca.Require.FastConfig.MainColor), process.exit(0));
|
@@ -32,6 +61,11 @@ module.exports = {
|
|
32
61
|
}
|
33
62
|
else return Callback;
|
34
63
|
},
|
64
|
+
/**
|
65
|
+
* A function to log an info message with color and prefix.
|
66
|
+
* @param {unknown} str - The message to log.
|
67
|
+
* @param {() => void} callback - An optional function to be called.
|
68
|
+
*/
|
35
69
|
Warning: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
36
70
|
console.log(chalk.magenta.bold('[ FCA-WARNING ] ➣ ') + chalk.yellow(str));
|
37
71
|
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
@@ -39,6 +73,11 @@ module.exports = {
|
|
39
73
|
}
|
40
74
|
else return callback;
|
41
75
|
},
|
76
|
+
/**
|
77
|
+
* A function to log an info message with color and prefix.
|
78
|
+
* @param {unknown} str - The message to log.
|
79
|
+
* @param {() => void} callback - An optional function to be called.
|
80
|
+
*/
|
42
81
|
Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
43
82
|
if (!str) {
|
44
83
|
console.log(chalk.magenta.bold('[ FCA-ERROR ] ➣ ') + chalk.red("Already Faulty, Please Contact: Facebook.com/kemsadboiz"));
|
@@ -49,6 +88,11 @@ module.exports = {
|
|
49
88
|
}
|
50
89
|
else return callback;
|
51
90
|
},
|
91
|
+
/**
|
92
|
+
* A function to log an info message with color and prefix.
|
93
|
+
* @param {unknown} str - The message to log.
|
94
|
+
* @param {() => void} callback - An optional function to be called.
|
95
|
+
*/
|
52
96
|
Success: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
53
97
|
console.log(chalk.hex('#00FFFF').bold(`${global.Fca.Require.FastConfig.MainName || '[ META-HZI ]'} ➣ `) + chalk.green(str));
|
54
98
|
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
@@ -56,6 +100,11 @@ module.exports = {
|
|
56
100
|
}
|
57
101
|
else return callback;
|
58
102
|
},
|
103
|
+
/**
|
104
|
+
* A function to log an info message with color and prefix.
|
105
|
+
* @param {unknown} str - The message to log.
|
106
|
+
* @param {() => void} callback - An optional function to be called.
|
107
|
+
*/
|
59
108
|
Info: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
60
109
|
console.log(chalk.hex('#00FFFF').bold(`${global.Fca.Require.FastConfig.MainName || '[ META-HZI ]'} ➣ `) + chalk.blue(str));
|
61
110
|
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "meta-horizonn",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.9",
|
4
4
|
"description": "Facebook-Chat-API Protect and Deploy by Kanzu and HZI Team. Kem is redeveloped. Rename package is Meta Horizonn and package supported ChatBot Messenger.",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|