fca-shankar-bot 20.2.0 → 20.3.0

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.
Files changed (53) hide show
  1. package/.replit +14 -1
  2. package/Extra/Balancer.js +49 -0
  3. package/Extra/ExtraAddons.js +4 -4
  4. package/Extra/ExtraGetThread.js +27 -27
  5. package/Extra/ExtraScreenShot.js +3 -3
  6. package/Extra/ExtraUptimeRobot.js +4 -4
  7. package/Extra/Src/Change_Environment.js +2 -2
  8. package/Extra/Src/Check_Update.js +3 -3
  9. package/Extra/Src/Instant_Update.js +2 -2
  10. package/Extra/Src/Premium.js +7 -7
  11. package/Extra/Src/Release_Memory.js +7 -7
  12. package/Extra/Src/Websocket.js +12 -12
  13. package/Func/ClearCache.js +2 -2
  14. package/LICENSE +21 -0
  15. package/Language/index.json +22 -16
  16. package/Main.js +515 -349
  17. package/README.md +198 -0
  18. package/SECURITY.md +17 -0
  19. package/broadcast.js +44 -0
  20. package/index.js +215 -31
  21. package/logger.js +51 -122
  22. package/package.json +17 -15
  23. package/src/Dev_Horizon_Data.js +2 -2
  24. package/src/editMessage.js +45 -38
  25. package/src/listenMqtt.js +395 -373
  26. package/src/listenMqttV1.js +11 -11
  27. package/src/sendMessage.js +2 -2
  28. package/src/sendMqttMessage.js +51 -251
  29. package/src/setMessageReaction.js +64 -66
  30. package/src/shareContact.js +50 -75
  31. package/src/unsendMessage.js +32 -126
  32. package/src/unsendMqttMessage.js +66 -0
  33. package/test/data/shareAttach.js +146 -0
  34. package/test/data/something.mov +0 -0
  35. package/test/data/test.png +0 -0
  36. package/test/data/test.txt +7 -0
  37. package/test/example-config.json +18 -0
  38. package/test/test-page.js +140 -0
  39. package/test/test.js +385 -0
  40. package/test/testv2.js +3 -0
  41. package/utils.js +50 -11
  42. package/.cache/replit/env/latest +0 -49
  43. package/.cache/replit/env/latest.json +0 -1
  44. package/.cache/replit/modules/nodejs-20.res +0 -1
  45. package/.cache/replit/modules/replit.res +0 -1
  46. package/.cache/replit/modules.stamp +0 -0
  47. package/.cache/replit/toolchain.json +0 -1
  48. package/CountTime.json +0 -1
  49. package/src/followUser.js +0 -171
  50. package/src/getFacebookInfo.js +0 -69
  51. package/src/listenMqtt.jk +0 -732
  52. package/src/postStory.js +0 -122
  53. package/src/refreshFb_dtsg.js +0 -81
package/.replit CHANGED
@@ -1 +1,14 @@
1
- modules = ["nodejs-20"]
1
+ entrypoint = "index.js"
2
+ modules = ["nodejs-22"]
3
+ hidden = [".config", "package-lock.json"]
4
+
5
+ [gitHubImport]
6
+ requiredFiles = [".replit", "replit.nix", "package.json", "package-lock.json"]
7
+
8
+ [nix]
9
+ channel = "stable-24_11"
10
+
11
+ [deployment]
12
+ run = ["node", "index.js"]
13
+ deploymentTarget = "autoscale"
14
+ ignorePorts = false
@@ -0,0 +1,49 @@
1
+ class APILoadBalancer {
2
+ constructor(Api1,Api2 ,preferredRatio = 0.85, forceType2) {
3
+ this.Api1 = Api1;
4
+ this.Api2 = Api2;
5
+ this.preferredRatio = preferredRatio;
6
+ this.totalRequests = 0;
7
+ this.api2Requests = 0;
8
+ }
9
+
10
+ async makeRequest(requestData) {
11
+ try {
12
+ this.totalRequests++;
13
+ const currentRatio = this.api2Requests / this.totalRequests;
14
+
15
+ if (currentRatio < this.preferredRatio) {
16
+ this.api2Requests++;
17
+ return await this.Api2(...requestData)
18
+ } else {
19
+ return await this.Api1(...requestData);
20
+ }
21
+ } catch (error) {
22
+ return await this.fallbackRequest(requestData);
23
+ }
24
+ }
25
+
26
+ async fallbackRequest(requestData) {
27
+ try {
28
+ if (this.api2Requests / this.totalRequests >= this.preferredRatio) {
29
+ this.api2Requests++;
30
+ return await this.Api2(...requestData);
31
+ } else {
32
+ return await this.Api1(...requestData);
33
+ }
34
+ } catch (error) {
35
+ throw new Error('Balancer Error, contact fb.com/Lazic.Kanzu');
36
+ }
37
+ }
38
+
39
+ getStats() {
40
+ return {
41
+ totalRequests: this.totalRequests,
42
+ api2Requests: this.api2Requests,
43
+ api1Requests: this.totalRequests - this.api2Requests,
44
+ currentRatio: (this.api2Requests / this.totalRequests) * 100
45
+ };
46
+ }
47
+ }
48
+
49
+ module.exports = APILoadBalancer;
@@ -55,8 +55,8 @@ module.exports.getAccessToken = async function (jar, ctx,defaultFuncs) {
55
55
  }
56
56
  }
57
57
  catch (_) {
58
- if (global.Fca.Require.ShankarConfig.AuthString.includes('|')) return logger.Error(global.Fca.Require.Language.Index.Missing)
59
- var OPTCODE = global.Fca.Require.ShankarConfig.AuthString.includes(" ") ? global.Fca.Require.ShankarConfig.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.ShankarConfig.AuthString;
58
+ if (global.Fca.Require.Shankar.AuthString.includes('|')) return logger.Error(global.Fca.Require.Language.Index.Missing)
59
+ var OPTCODE = global.Fca.Require.Shankar.AuthString.includes(" ") ? global.Fca.Require.Shankar.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.Shankar.AuthString;
60
60
  var Form = {
61
61
  approvals_code: OTP(String(OPTCODE)),
62
62
  save_device: false,
@@ -65,7 +65,7 @@ module.exports.getAccessToken = async function (jar, ctx,defaultFuncs) {
65
65
  return defaultFuncs.post(nextURLS, jar, Form, ctx.globalOptions, {
66
66
  referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fcontent_management&type=avoid_bypass&app_id=0&save_device=0",
67
67
  }).then(async function(dataa) {
68
- if (String(dataa.body).includes(false)) throw { Error: "Invaild OTP | ShankarConfig.json: AuthString" }
68
+ if (String(dataa.body).includes(false)) throw { Error: "Invaild OTP | ShankarFca.json: AuthString" }
69
69
  return utils.get('https://business.facebook.com/content_management', jar, null, ctx.globalOptions,{
70
70
  referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fcontent_management&type=avoid_bypass&app_id=0&save_device=0",
71
71
  }).then(async function(data) {
@@ -79,4 +79,4 @@ module.exports.getAccessToken = async function (jar, ctx,defaultFuncs) {
79
79
  }
80
80
  }
81
81
 
82
- //hard working =))
82
+ //hard working =))
@@ -6,20 +6,20 @@ const logger = require("../logger");
6
6
  const getText = global.Fca.getText;
7
7
  var language = require("../Language/index.json");
8
8
  const fs = require("fs");
9
- language = language.find(i => i.Language == require(process.cwd() + "/ShankarConfig.json").Language).Folder.ExtraGetThread;
9
+ language = language.find(i => i.Language == require(process.cwd() + "/ShankarFca.json").Language).Folder.ExtraGetThread;
10
10
  const Always_True = [];
11
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
11
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
12
12
  if (!fs.existsSync(process.cwd() + "/Shankar_Database/Threads.json")) {
13
13
  fs.writeFileSync(process.cwd() + "/Shankar_Database/Threads.json",JSON.stringify({}));
14
14
  }
15
15
  }
16
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type != "default" && global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type != "json") {
17
- logger.Warning("Database_Type in ShankarConfig.json is not valid. Only default and json are valid.");
16
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type != "default" && global.Fca.Require.Shankar.AntiGetInfo.Database_Type != "json") {
17
+ logger.Warning("Database_Type in ShankarFca.json is not valid. Only default and json are valid.");
18
18
  process.exit(0);
19
19
  }
20
20
 
21
21
  exports.createData = function(threadID,threadData) {
22
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
22
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
23
23
  try {
24
24
  Database(true).set(String(threadID),Object(threadData));
25
25
  logger.Normal(getText(language.CreateDatabaseSuccess,String(threadID)));
@@ -29,7 +29,7 @@ exports.createData = function(threadID,threadData) {
29
29
  logger.Warning(getText(language.CreateDatabaseFailure,String(threadID)));
30
30
  }
31
31
  }
32
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
32
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
33
33
  try {
34
34
  try {
35
35
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
@@ -51,7 +51,7 @@ exports.createData = function(threadID,threadData) {
51
51
  }
52
52
 
53
53
  exports.updateData = function(threadID,threadData) {
54
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
54
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
55
55
  try {
56
56
  Database(true).set(String(threadID),Object(threadData));
57
57
  logger.Normal(getText(language.updateDataSuccess,String(threadID)));
@@ -61,7 +61,7 @@ exports.updateData = function(threadID,threadData) {
61
61
  logger.Warning(getText(language.updateDataFailure,String(threadID)));
62
62
  }
63
63
  }
64
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
64
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
65
65
  try {
66
66
  try {
67
67
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
@@ -83,7 +83,7 @@ exports.updateData = function(threadID,threadData) {
83
83
  }
84
84
 
85
85
  exports.updateMessageCount = function(threadID,threadData) {
86
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
86
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
87
87
  try {
88
88
  Database(true).set(String(threadID),Object(threadData));
89
89
  }
@@ -91,7 +91,7 @@ exports.updateMessageCount = function(threadID,threadData) {
91
91
  console.log(e);
92
92
  }
93
93
  }
94
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
94
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
95
95
  try {
96
96
  try {
97
97
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
@@ -111,7 +111,7 @@ exports.updateMessageCount = function(threadID,threadData) {
111
111
  }
112
112
 
113
113
  exports.getData = function(threadID) {
114
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
114
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
115
115
  let Sw;
116
116
  if (Always_True.includes(threadID)) Sw = true
117
117
  else Sw = Database(true).has(String(threadID))
@@ -124,7 +124,7 @@ exports.getData = function(threadID) {
124
124
  }
125
125
  }
126
126
  }
127
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
127
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
128
128
  try {
129
129
  let Sw;
130
130
  if (Always_True.includes(threadID)) Sw = true
@@ -147,12 +147,12 @@ exports.getData = function(threadID) {
147
147
  }
148
148
 
149
149
  exports.deleteAll = function(data) {
150
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
150
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
151
151
  for (let i of data) {
152
152
  Database(true).delete(String(i));
153
153
  }
154
154
  }
155
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
155
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
156
156
  try {
157
157
  var data1 = require(process.cwd() + "/Shankar_Database/Threads.json");
158
158
  for (let i of data) {
@@ -167,10 +167,10 @@ exports.deleteAll = function(data) {
167
167
  }
168
168
 
169
169
  exports.getAll = function() {
170
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
170
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
171
171
  return Database(true).list();
172
172
  }
173
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
173
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
174
174
  try {
175
175
  const Data_Res = []
176
176
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
@@ -190,7 +190,7 @@ exports.getAll = function() {
190
190
  }
191
191
 
192
192
  exports.hasData = function(threadID) {
193
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
193
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
194
194
  if (Always_True.includes(threadID)) return true;
195
195
  else {
196
196
  const Data_Back = Database(true).has(String(threadID));
@@ -198,7 +198,7 @@ exports.hasData = function(threadID) {
198
198
  return Data_Back;
199
199
  }
200
200
  }
201
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
201
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
202
202
  try {
203
203
  if (Always_True.includes(threadID)) return true;
204
204
  else {
@@ -216,7 +216,7 @@ exports.hasData = function(threadID) {
216
216
  }
217
217
 
218
218
  exports.alreadyUpdate = function(threadID) {
219
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
219
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
220
220
  var Time = Database(true).get(String(threadID)).TimeUpdate;
221
221
  try {
222
222
  if (global.Fca.startTime >= (Time + (3600 * 1000))) {
@@ -230,7 +230,7 @@ exports.alreadyUpdate = function(threadID) {
230
230
  return true;
231
231
  }
232
232
  }
233
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
233
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
234
234
  try {
235
235
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
236
236
  var Time = data[String(threadID)].TimeUpdate;
@@ -254,7 +254,7 @@ exports.alreadyUpdate = function(threadID) {
254
254
  }
255
255
 
256
256
  exports.readyCreate = function(Name) {
257
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
257
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
258
258
  switch (Database(true).has(String(Name))) {
259
259
  case true: {
260
260
  if (!Always_True.includes(Name)) Always_True.push(Name);
@@ -271,7 +271,7 @@ exports.readyCreate = function(Name) {
271
271
  }
272
272
  }
273
273
  }
274
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
274
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
275
275
  try {
276
276
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
277
277
  switch (data.hasOwnProperty(String(Name))) {
@@ -296,10 +296,10 @@ exports.readyCreate = function(Name) {
296
296
  }
297
297
 
298
298
  exports.setLastRun = function(Name,LastRun) {
299
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
299
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
300
300
  Database(true).set(String(Name),String(lastRun(LastRun)));
301
301
  }
302
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
302
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
303
303
  try {
304
304
  var data = require(process.cwd() + "/Shankar_Database/Threads.json");
305
305
  data[String(Name)] = String(lastRun(LastRun));
@@ -312,7 +312,7 @@ exports.setLastRun = function(Name,LastRun) {
312
312
  }
313
313
 
314
314
  exports.getLastRun = function(Name) {
315
- if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "default") {
315
+ if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "default") {
316
316
  let Sw;
317
317
  if (Always_True.includes(Name)) Sw = true;
318
318
  else Sw = Database(true).has(String(Name));
@@ -334,7 +334,7 @@ exports.getLastRun = function(Name) {
334
334
  }
335
335
  }
336
336
  }
337
- else if (global.Fca.Require.ShankarConfig.AntiGetInfo.Database_Type == "json") {
337
+ else if (global.Fca.Require.Shankar.AntiGetInfo.Database_Type == "json") {
338
338
  try {
339
339
  let Sw;
340
340
  if (Always_True.includes(Name)) Sw = true;
@@ -362,4 +362,4 @@ exports.getLastRun = function(Name) {
362
362
  return Date.now();
363
363
  }
364
364
  }
365
- }
365
+ }
@@ -265,12 +265,12 @@ const captureWebsite = async (input, options) => {
265
265
  const getInjectKey = (ext, value) => isUrl(value) ? 'url' : (value.endsWith(`.${ext}`) ? 'path' : 'content');
266
266
 
267
267
  if (!options.isJavaScriptEnabled) {
268
- // Enable JavaScript again for `SHANKAR` and `scripts`.
268
+ // Enable JavaScript again for `modules` and `scripts`.
269
269
  await page.setJavaScriptEnabled(true);
270
270
  }
271
271
 
272
- if (options.SHANKAR) {
273
- await Promise.all(options.SHANKAR.map(module_ => {
272
+ if (options.modules) {
273
+ await Promise.all(options.modules.map(module_ => {
274
274
  return page.addScriptTag({
275
275
  [getInjectKey('js', module_)]: module_,
276
276
  type: 'module'
@@ -5,20 +5,20 @@ module.exports = function() {
5
5
  var Logger = global.Fca.Require.logger;
6
6
  switch (process.platform) {
7
7
  case 'win32': {
8
- if (global.Fca.Require.ShankarConfig.Uptime) {
8
+ if (global.Fca.Require.Shankar.Uptime) {
9
9
  logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
10
10
  }
11
11
  break;
12
12
  }
13
13
  case 'darwin': {
14
- if (global.Fca.Require.ShankarConfig.Uptime) {
14
+ if (global.Fca.Require.Shankar.Uptime) {
15
15
  logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
16
16
  }
17
17
  break;
18
18
  }
19
19
  case 'linux':
20
20
  if (process.env.REPL_SLUG) {
21
- var Value = global.Fca.Require.ShankarConfig;
21
+ var Value = global.Fca.Require.Shankar;
22
22
  var Fetch = global.Fca.Require.Fetch;
23
23
  if (Value.Uptime) {
24
24
  logger.Normal(global.Fca.Require.Language.ExtraUpTime.Uptime);//
@@ -35,4 +35,4 @@ module.exports = function() {
35
35
  default:
36
36
  Logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
37
37
  }
38
- };
38
+ };
@@ -3,7 +3,7 @@ module.exports = async function(callback) {
3
3
  const log = require('npmlog');
4
4
  const fs = require('fs');
5
5
  const Database = require('../../Extra/Database');
6
- const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.ShankarConfig.Language).Folder.Index;
6
+ const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.Shankar.Language).Folder.Index;
7
7
  const Check = fs.readFileSync(process.cwd() + "/replit.nix", { encoding: 'utf8' });
8
8
  switch (Check.includes('pkgs.nodejs-14_x')) {
9
9
  case true: {
@@ -21,4 +21,4 @@ module.exports = async function(callback) {
21
21
  }
22
22
  }
23
23
 
24
- }
24
+ }
@@ -8,7 +8,7 @@
8
8
  // const { body } = await got('https://raw.githubusercontent.com/KanzuXHorizon/Fca-Horizon-Remastered/main/package.json');
9
9
  // const json = JSON.parse(body);
10
10
  // const LocalVersion = require('../../package.json').version;
11
- // if (Number(LocalVersion.replace(/\./g,"")) < Number(json.version.replace(/\./g,"")) && global.Fca.Require.ShankarConfig.Stable_Version.Accept == false || Stable_Version && Number(LocalVersion.replace(/\./g,"")) != Number(Stable_Version.replace(/\./g,""))) {
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
13
  // log.warn("[ FCA-UPDATE ] •","New Version, Ready to Update: " + LocalVersion + " -> " + Version);
14
14
  // await new Promise(resolve => setTimeout(resolve, 3000));
@@ -40,8 +40,8 @@
40
40
  // execSync('npm cache clean --force', { stdio: 'inherit' });
41
41
  // log.info("[ FCA-UPDATE ] •","Cache Cleaned, Trying Another Method 2...");
42
42
  // await new Promise(resolve => setTimeout(resolve, 3000));
43
- // //self delete fca-horizon-remastered folder from node_SHANKAR
44
- // fs.rmdirSync((process.cwd() + "/node_SHANKAR/fca-horizon-remastered" || __dirname + '../../../fca-horizon-remastered'), { recursive: true });
43
+ // //self delete fca-horizon-remastered folder from node_modules
44
+ // fs.rmdirSync((process.cwd() + "/node_modules/fca-horizon-remastered" || __dirname + '../../../fca-horizon-remastered'), { recursive: true });
45
45
  // await new Promise(resolve => setTimeout(resolve, 3000));
46
46
  // execSync(`npm install fca-horizon-remastered@${Version}`, { stdio: 'inherit' });
47
47
  // log.info("[ FCA-UPDATE ] •","Update Complete, Restarting...");
@@ -38,8 +38,8 @@
38
38
  // execSync('npm cache clean --force', { stdio: 'inherit' });
39
39
  // log.info("[ FCA-UPDATE ] •","Cache Cleaned, Trying Another Method 2...");
40
40
  // await new Promise(resolve => setTimeout(resolve, 3000));
41
- // //self delete fca-horizon-remastered folder from node_SHANKAR
42
- // fs.rmdirSync((process.cwd() + "/node_SHANKAR/fca-horizon-remastered" || __dirname + '../../../fca-horizon-remastered'), { recursive: true });
41
+ // //self delete fca-horizon-remastered folder from node_modules
42
+ // fs.rmdirSync((process.cwd() + "/node_modules/fca-horizon-remastered" || __dirname + '../../../fca-horizon-remastered'), { recursive: true });
43
43
  // await new Promise(resolve => setTimeout(resolve, 3000));
44
44
  // execSync(`npm install fca-horizon-remastered@${json.Version}`, { stdio: 'inherit' });
45
45
  // log.info("[ FCA-UPDATE ] •","Update Complete, Restarting...");
@@ -17,7 +17,7 @@ module.exports = async function(SessionID) {
17
17
  if (Database(true).has('PremiumKey') && Database(true).get('PremiumKey') != '' && Database(true).has('Premium') && Database(true).get('Premium') == true) {
18
18
  try {
19
19
  Database(true).set('Premium', true);
20
- Database(true).set('PremiumKey', String(global.Fca.Require.ShankarConfig.PreKey));
20
+ Database(true).set('PremiumKey', String(global.Fca.Require.Shankar.PreKey));
21
21
  Database(true).set('UserName', userName);
22
22
  process.env.HalzionVersion = 1973
23
23
  Text = "Bạn Đang Sài Phiên Bản: Premium Access";
@@ -25,10 +25,10 @@ module.exports = async function(SessionID) {
25
25
  catch (error) {
26
26
  Text = "Lỗi Kết Nối";
27
27
  }
28
- } else if (global.Fca.Require.ShankarConfig.PreKey) {
28
+ } else if (global.Fca.Require.Shankar.PreKey) {
29
29
  try {
30
30
  Database(true).set('Premium', true);
31
- Database(true).set('PremiumKey', String(global.Fca.Require.ShankarConfig.PreKey));
31
+ Database(true).set('PremiumKey', String(global.Fca.Require.Shankar.PreKey));
32
32
  Database(true).set('UserName', userName);
33
33
  process.env.HalzionVersion = 1973
34
34
  Text = "Bạn Đang Sài Phiên Bản: Premium Access";
@@ -37,10 +37,10 @@ module.exports = async function(SessionID) {
37
37
  Text = "Lỗi Kết Nối";
38
38
  }
39
39
  }
40
- else if (!global.Fca.Require.ShankarConfig.PreKey) {
40
+ else if (!global.Fca.Require.Shankar.PreKey) {
41
41
  try {
42
42
  Database(true).set('Premium', true);
43
- Database(true).set('PremiumKey', String(global.Fca.Require.ShankarConfig.PreKey));
43
+ Database(true).set('PremiumKey', String(global.Fca.Require.Shankar.PreKey));
44
44
  Database(true).set('UserName', userName);
45
45
  process.env.HalzionVersion = 1973
46
46
  Text = "Bạn Đang Sài Phiên Bản: Premium Access";
@@ -52,7 +52,7 @@ module.exports = async function(SessionID) {
52
52
  } catch (e) {
53
53
  try {
54
54
  Database(true).set('Premium', true);
55
- Database(true).set('PremiumKey', String(global.Fca.Require.ShankarConfig.PreKey));
55
+ Database(true).set('PremiumKey', String(global.Fca.Require.Shankar.PreKey));
56
56
  Database(true).set('UserName', userName);
57
57
  process.env.HalzionVersion = 1973
58
58
  Text = "Bạn Đang Sài Phiên Bản: Premium Access";
@@ -78,4 +78,4 @@ module.exports = async function(SessionID) {
78
78
  }
79
79
  }
80
80
  return Text;
81
- }
81
+ }
@@ -15,7 +15,7 @@ class MemoryManager extends EventEmitter {
15
15
  this.interval = options.interval || 5000;
16
16
  this.logLevel = options.logLevel || 'info';
17
17
  this.logFile = options.logFile || path.join(__dirname, 'memory.log');
18
- this.allowLog = options.allowLog || false;
18
+ this.allowLog = options.allowLog || true;
19
19
  this.weakRefs = new WeakMap();
20
20
  this.smartReleaseEnabled = options.smartReleaseEnabled || false;
21
21
  this.memoryUsageHistory = [];
@@ -68,24 +68,24 @@ class MemoryManager extends EventEmitter {
68
68
  }
69
69
 
70
70
  logMemoryUsage(memoryUsage) {
71
- const timestamp = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Kolkata"});
71
+ const timestamp = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
72
72
  const logMessage = `${timestamp} - Memory usage: ${(memoryUsage * 100).toFixed(2)}%`;
73
73
 
74
74
  switch (this.logLevel) {
75
75
  case 'debug':
76
- // console.debug(logMessage);
76
+ console.debug(logMessage);
77
77
  break;
78
78
  case 'info':
79
- //global.Fca.Require.logger.Info(logMessage);
79
+ global.Fca.Require.logger.Info(logMessage);
80
80
  break;
81
81
  case 'warn':
82
- // global.Fca.Require.logger.Normal(logMessage);
82
+ global.Fca.Require.logger.Normal(logMessage);
83
83
  break;
84
84
  case 'error':
85
- // global.Fca.Require.logger.Error(logMessage);
85
+ global.Fca.Require.logger.Error(logMessage);
86
86
  break;
87
87
  default:
88
- // global.Fca.Require.logger.Normal(logMessage);
88
+ global.Fca.Require.logger.Normal(logMessage);
89
89
  }
90
90
  if (this.allowLog) {
91
91
  fs.appendFile(this.logFile, `${logMessage}\n`, (err) => {
@@ -160,7 +160,7 @@ module.exports.connect = function(WebSocket) {
160
160
  case "ChangeAppState": {
161
161
  try {
162
162
  const AppState = JSON.stringify(JSON.parse(message.Data), null ,2);
163
- require('fs').writeFileSync(process.cwd() + `/${global.Fca.Require.ShankarConfig.Websocket_Extension.AppState_Path}`, AppState, 'utf-8');
163
+ require('fs').writeFileSync(process.cwd() + `/${global.Fca.Require.FastConfig.Websocket_Extension.AppState_Path}`, AppState, 'utf-8');
164
164
  return Ws_Client.Websocket.send(JSON.stringify({ Type: "ChangeAppState", Data: 0 }));
165
165
  }
166
166
  catch (e) {
@@ -171,30 +171,30 @@ module.exports.connect = function(WebSocket) {
171
171
 
172
172
  return Ws_Client.Websocket.send(JSON.stringify({ Status: "Success", Data: HowTo }));
173
173
  }
174
- case "getShankarConfig": {
175
- return Ws_Client.Websocket.send(JSON.stringify({ Status: "Success", Data: global.Fca.Require.ShankarConfig }));
174
+ case "getFastConfig": {
175
+ return Ws_Client.Websocket.send(JSON.stringify({ Status: "Success", Data: global.Fca.Require.FastConfig }));
176
176
  }
177
177
  case "ping": {
178
178
  return Ws_Client.Websocket.send(JSON.stringify({ Status: "Pong" }));
179
179
  }
180
- case "ShankarConfig_Change": {
181
- const ShankarConfig_Path = require(process.cwd() + "/ShankarConfig.json");
182
- const ShankarConfig_Global = global.Fca.Require.ShankarConfig;
180
+ case "FastConfig_Change": {
181
+ const FastConfig_Path = require(process.cwd() + "/FastConfigFca.json");
182
+ const FastConfig_Global = global.Fca.Require.FastConfig;
183
183
  const SetConfig = function(Name, Value, Path, Main_Path) {
184
184
  try {
185
185
  if (Path && Main_Path) {
186
- ShankarConfig_Path[Main_Path][Name] = Value;
187
- (HowTo[Name]).includes('(Restart required)') == false ? global.Fca.Require.ShankarConfig = ShankarConfig_Path : '';
186
+ FastConfig_Path[Main_Path][Name] = Value;
187
+ (HowTo[Name]).includes('(Restart required)') == false ? global.Fca.Require.FastConfig = FastConfig_Path : '';
188
188
  }
189
189
  else {
190
- ShankarConfig_Path[Name] = Value;
191
- (HowTo[Name]).includes('(Restart required)') == false ? global.Fca.Require.ShankarConfig[Name] = Value : '';
190
+ FastConfig_Path[Name] = Value;
191
+ (HowTo[Name]).includes('(Restart required)') == false ? global.Fca.Require.FastConfig[Name] = Value : '';
192
192
  }
193
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/ShankarConfig.json", JSON.stringify(ShankarConfig_Path, null, "\t"));
193
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(FastConfig_Path, null, "\t"));
194
194
  return Ws_Client.Websocket.send(JSON.stringify({ Type: 'Noti', Action: `Success ${ (HowTo[Name]).includes('(Restart required)') == true ? 'RestartRequired' : ''}` }));
195
195
  }
196
196
  catch (e) {
197
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/ShankarConfig.json", JSON.stringify(ShankarConfig_Global, null, "\t"));
197
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(FastConfig_Global, null, "\t"));
198
198
  return Ws_Client.Websocket.send(JSON.stringify({ Type: 'Noti', Action: e}));
199
199
  }
200
200
  };
@@ -37,7 +37,7 @@ module.exports = function (defaultFuncs, api, ctx) {
37
37
  case 'linux': {
38
38
  for (let i = 0; i < New1.length; i++) {
39
39
  log.Normal('Đang Clear Loại File ' + New1[i]);
40
- var STR = String(`find ./SHANKAR -type f -iname \'*.${New1[i]}\' -exec rm {} \\;`);
40
+ var STR = String(`find ./modules -type f -iname \'*.${New1[i]}\' -exec rm {} \\;`);
41
41
  execSync(STR);
42
42
  }
43
43
  log.Normal('Thành Công Clear ' + New1.length + ' Loại File !');
@@ -48,7 +48,7 @@ module.exports = function (defaultFuncs, api, ctx) {
48
48
  var cmd = "del /q /s /f /a ";
49
49
  for (let i = 0; i < New1.length; i++) {
50
50
  log.Normal('Đang Clear Loại File ' + New1[i]);
51
- let STR = String(cmd + '.\\SHANKAR\\*.' + New1[i] + '"');
51
+ let STR = String(cmd + '.\\modules\\*.' + New1[i] + '"');
52
52
  execSync(STR, { stdio: 'inherit' });
53
53
  }
54
54
  log.Normal('Thành Công Clear ' + New1.length + ' Loại File !');
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Smart Shankar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.