fb-anya 0.0.1-security → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fb-anya might be problematic. Click here for more details.

Files changed (107) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -0
  2. package/.cache/replit/modules.stamp +0 -0
  3. package/.cache/replit/nix/env.json +1 -0
  4. package/.config/configstore/update-notifier-npm.json +4 -0
  5. package/.gitattributes +2 -0
  6. package/Extra/ExtraAddons.js +78 -0
  7. package/Extra/ExtraFindUID.js +60 -0
  8. package/Extra/ExtraGetThread.js +118 -0
  9. package/Extra/ExtraTranslate.js +62 -0
  10. package/Extra/ExtraUptimeRobot.js +59 -0
  11. package/Extra/Html/Classic/script.js +231 -0
  12. package/Extra/Html/Classic/style.css +149 -0
  13. package/Extra/PM2/ecosystem.config.js +23 -0
  14. package/Extra/Security/Index.js +174 -0
  15. package/Extra/Security/Step_1.js +15 -0
  16. package/Extra/Security/Step_2.js +23 -0
  17. package/Extra/Security/Step_3.js +23 -0
  18. package/Extra/Src/History.js +115 -0
  19. package/Extra/Src/Last-Run.js +65 -0
  20. package/Extra/Src/Premium.js +85 -0
  21. package/Extra/Src/SecurityCheck.js +2 -0
  22. package/Func/AcceptAgreement.js +33 -0
  23. package/Func/ClearCache.js +63 -0
  24. package/Func/ReportV1.js +54 -0
  25. package/Language/index.json +176 -0
  26. package/OldSecurity.js +100 -0
  27. package/README.md +16 -3
  28. package/Settings/Database.js +21 -0
  29. package/Settings/Location.js +60 -0
  30. package/Settings/Location.json +24 -0
  31. package/Settings/Settings.js +60 -0
  32. package/StateCrypt.js +98 -0
  33. package/broadcast.js +38 -0
  34. package/index.js +1451 -0
  35. package/logger.js +65 -0
  36. package/package-anya/Database-Anya/index.js +358 -0
  37. package/package-anya/Database-Anya/package.json +63 -0
  38. package/package-anya/Database-Anya/readme.md +8 -0
  39. package/package-anya/anya-sp/README.md +11 -0
  40. package/package-anya/anya-sp/desktop.ini +2 -0
  41. package/package-anya/anya-sp/index.js +41 -0
  42. package/package-anya/anya-sp/logger.js +16 -0
  43. package/package-anya/anya-sp/package.json +54 -0
  44. package/package.json +84 -4
  45. package/src/K2IMG.js +8 -0
  46. package/src/Premium.js +30 -0
  47. package/src/Screenshot.js +77 -0
  48. package/src/T2S.js +8 -0
  49. package/src/addExternalModule.js +16 -0
  50. package/src/addUserToGroup.js +79 -0
  51. package/src/changeAdminStatus.js +79 -0
  52. package/src/changeArchivedStatus.js +41 -0
  53. package/src/changeAvt.js +85 -0
  54. package/src/changeBio.js +65 -0
  55. package/src/changeBlockedStatus.js +36 -0
  56. package/src/changeGroupImage.js +106 -0
  57. package/src/changeNickname.js +45 -0
  58. package/src/changeThreadColor.js +62 -0
  59. package/src/changeThreadEmoji.js +42 -0
  60. package/src/createNewGroup.js +70 -0
  61. package/src/createPoll.js +60 -0
  62. package/src/deleteMessage.js +45 -0
  63. package/src/deleteThread.js +43 -0
  64. package/src/desktop.ini +2 -0
  65. package/src/forwardAttachment.js +48 -0
  66. package/src/getAccessToken.js +32 -0
  67. package/src/getCurrentUserID.js +7 -0
  68. package/src/getEmojiUrl.js +27 -0
  69. package/src/getFriendsList.js +73 -0
  70. package/src/getMessage.js +80 -0
  71. package/src/getThreadHistory.js +537 -0
  72. package/src/getThreadInfo.js +346 -0
  73. package/src/getThreadList.js +213 -0
  74. package/src/getThreadMain.js +219 -0
  75. package/src/getThreadPictures.js +59 -0
  76. package/src/getUID.js +59 -0
  77. package/src/getUserID.js +62 -0
  78. package/src/getUserInfo.js +129 -0
  79. package/src/getUserInfoMain.js +65 -0
  80. package/src/getUserInfoV2.js +35 -0
  81. package/src/getUserInfoV3.js +63 -0
  82. package/src/getUserInfoV4.js +55 -0
  83. package/src/getUserInfoV5.js +61 -0
  84. package/src/handleFriendRequest.js +46 -0
  85. package/src/handleMessageRequest.js +49 -0
  86. package/src/httpGet.js +49 -0
  87. package/src/httpPost.js +48 -0
  88. package/src/httpPostFormData.js +41 -0
  89. package/src/listenMqtt.js +725 -0
  90. package/src/logout.js +68 -0
  91. package/src/markAsDelivered.js +48 -0
  92. package/src/markAsRead.js +70 -0
  93. package/src/markAsReadAll.js +43 -0
  94. package/src/markAsSeen.js +51 -0
  95. package/src/muteThread.js +47 -0
  96. package/src/removeUserFromGroup.js +49 -0
  97. package/src/resolvePhotoUrl.js +37 -0
  98. package/src/searchForThread.js +43 -0
  99. package/src/sendMessage.js +334 -0
  100. package/src/sendTypingIndicator.js +80 -0
  101. package/src/setMessageReaction.js +109 -0
  102. package/src/setPostReaction.js +102 -0
  103. package/src/setTitle.js +74 -0
  104. package/src/threadColors.js +39 -0
  105. package/src/unfriend.js +43 -0
  106. package/src/unsendMessage.js +40 -0
  107. package/utils.js +1648 -0
@@ -0,0 +1 @@
1
+ {"nonce":7037527388431223308,"last_updated":{"seconds":1676541746,"nanos":65030000}}
File without changes
@@ -0,0 +1 @@
1
+ {"entries":{"replit.nix":{"env":{"AR":"ar","AS":"as","CC":"gcc","CONFIG_SHELL":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","CXX":"g++","HOST_PATH":"/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/bin:/nix/store/7rfpsb04f2r6a755bqmmj1i90x8p1b18-typescript-language-server-3.1.0/bin:/nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19/bin:/nix/store/hqc964yg79161afx85fvcmg1a6879k5i-jest-cli-23.6.0/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/mydc6f4k2z73xlcz7ilif3v2lcaiqvza-findutils-4.9.0/bin:/nix/store/j9p3g8472iijd50vhdprx0nmk2fqn5gv-diffutils-3.8/bin:/nix/store/89zs7rms6x00xfq4dq6m7mjnhkr8a6r4-gnused-4.8/bin:/nix/store/86bp03jkmsl6f92w0yzg4s59g5mhxwmy-gnugrep-3.7/bin:/nix/store/hwcdqw4jrjnd37wxqgsd47hd0j8bnj09-gawk-5.1.1/bin:/nix/store/cfbhw8r8ags41vwqaz47r583d0p4h4a1-gnutar-1.34/bin:/nix/store/p3m1ndl1lapwrlh698bnb5lvvxh67378-gzip-1.12/bin:/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin/bin:/nix/store/mblgz65m3zv9x548a3d5m96fj2pbwr09-gnumake-4.3/bin:/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin:/nix/store/v7ljksji50mg3w61dykaa3n3y79n6nil-patch-2.7.6/bin:/nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin/bin:/nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43/bin","LD":"ld","LOCALE_ARCHIVE":"/usr/lib/locale/locale-archive","NIX_BINTOOLS":"/nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39","NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_BUILD_CORES":"16","NIX_BUILD_TOP":"/tmp","NIX_CC":"/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0","NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu":"1","NIX_CFLAGS_COMPILE":" -frandom-seed=7ya8xlq922 -isystem /nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/include -isystem /nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/include","NIX_ENFORCE_NO_NATIVE":"1","NIX_HARDENING_ENABLE":"fortify stackprotector pic strictoverflow format relro bindnow","NIX_INDENT_MAKE":"1","NIX_LDFLAGS":"-rpath /nix/store/7ya8xlq922h1fx115xra9kl0d0pfk2ab-nix-shell/lib64 -rpath /nix/store/7ya8xlq922h1fx115xra9kl0d0pfk2ab-nix-shell/lib ","NIX_STORE":"/nix/store","NM":"nm","NODE_PATH":"/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/lib/node_modules:/nix/store/7rfpsb04f2r6a755bqmmj1i90x8p1b18-typescript-language-server-3.1.0/lib/node_modules:/nix/store/hqc964yg79161afx85fvcmg1a6879k5i-jest-cli-23.6.0/lib/node_modules","OBJCOPY":"objcopy","OBJDUMP":"objdump","PATH":"/nix/store/bap4d0lpcrhpwmpb8ayjcgkmvfj62lnq-bash-interactive-5.1-p16/bin:/nix/store/pr5n59mb4jzmfx6kanwxly0l07p861fg-patchelf-0.15.0/bin:/nix/store/dq0xwmsk1g0i2ayg6pb7y87na2knzylh-gcc-wrapper-11.3.0/bin:/nix/store/1gf2flfqnpqbr1b4p4qz2f72y42bs56r-gcc-11.3.0/bin:/nix/store/57xv61c5zi8pphjbcwxxjlgc34p61ic9-glibc-2.35-163-bin/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39/bin:/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin:/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1/bin:/nix/store/7rfpsb04f2r6a755bqmmj1i90x8p1b18-typescript-language-server-3.1.0/bin:/nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19/bin:/nix/store/hqc964yg79161afx85fvcmg1a6879k5i-jest-cli-23.6.0/bin:/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin:/nix/store/mydc6f4k2z73xlcz7ilif3v2lcaiqvza-findutils-4.9.0/bin:/nix/store/j9p3g8472iijd50vhdprx0nmk2fqn5gv-diffutils-3.8/bin:/nix/store/89zs7rms6x00xfq4dq6m7mjnhkr8a6r4-gnused-4.8/bin:/nix/store/86bp03jkmsl6f92w0yzg4s59g5mhxwmy-gnugrep-3.7/bin:/nix/store/hwcdqw4jrjnd37wxqgsd47hd0j8bnj09-gawk-5.1.1/bin:/nix/store/cfbhw8r8ags41vwqaz47r583d0p4h4a1-gnutar-1.34/bin:/nix/store/p3m1ndl1lapwrlh698bnb5lvvxh67378-gzip-1.12/bin:/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin/bin:/nix/store/mblgz65m3zv9x548a3d5m96fj2pbwr09-gnumake-4.3/bin:/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin:/nix/store/v7ljksji50mg3w61dykaa3n3y79n6nil-patch-2.7.6/bin:/nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin/bin:/nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43/bin","RANLIB":"ranlib","READELF":"readelf","SIZE":"size","SOURCE_DATE_EPOCH":"315532800","STRINGS":"strings","STRIP":"strip","XDG_DATA_DIRS":"/nix/store/pr5n59mb4jzmfx6kanwxly0l07p861fg-patchelf-0.15.0/share","_":"/nix/store/a7gvj343m05j2s32xcnwr35v31ynlypr-coreutils-9.1/bin/env","__ETC_PROFILE_SOURCED":"1","buildInputs":"/nix/store/dj805sw07vvpbxx39c8g67x8qddg0ikw-nodejs-18.12.1 /nix/store/7rfpsb04f2r6a755bqmmj1i90x8p1b18-typescript-language-server-3.1.0 /nix/store/zdcnqq55qi214j46zgw2qa1jp4dpdf2m-yarn-1.22.19 /nix/store/hqc964yg79161afx85fvcmg1a6879k5i-jest-cli-23.6.0","buildPhase":"echo \"------------------------------------------------------------\" \u003e\u003e$out\necho \" WARNING: the existence of this path is not guaranteed.\" \u003e\u003e$out\necho \" It is an internal implementation detail for pkgs.mkShell.\" \u003e\u003e$out\necho \"------------------------------------------------------------\" \u003e\u003e$out\necho \u003e\u003e $out\n# Record all build inputs as runtime dependencies\nexport \u003e\u003e $out\n","builder":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","cmakeFlags":"","configureFlags":"","depsBuildBuild":"","depsBuildBuildPropagated":"","depsBuildTarget":"","depsBuildTargetPropagated":"","depsHostHost":"","depsHostHostPropagated":"","depsTargetTarget":"","depsTargetTargetPropagated":"","doCheck":"","doInstallCheck":"","mesonFlags":"","name":"nix-shell","nativeBuildInputs":"","out":"/nix/store/7ya8xlq922h1fx115xra9kl0d0pfk2ab-nix-shell","outputs":"out","patches":"","phases":"buildPhase","propagatedBuildInputs":"","propagatedNativeBuildInputs":"","shell":"/nix/store/dsd5gz46hdbdk2rfdimqddhq6m8m8fqs-bash-5.1-p16/bin/bash","shellHook":"","stdenv":"/nix/store/kmfaajdpyyyg319vfqni5jm9wkxjmf73-stdenv-linux","strictDeps":"","system":"x86_64-linux"},"dependencies":[{"path":"replit.nix","mod_time":"2023-01-20T17:24:06.730825035Z"}],"channel":"stable-22_11","channel_nix_path":"/nix/store/g9iaapk8lqfvi3mmgy550z6a5a1ffsif-nixpkgs-stable-22_11-22.11.tar.gz/nixpkgs-stable-22_11"}}}
@@ -0,0 +1,4 @@
1
+ {
2
+ "optOut": false,
3
+ "lastUpdateCheck": 1676541630821
4
+ }
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,78 @@
1
+ var utils = require('../utils');
2
+ var logger = require('../logger')
3
+ var OTP = require('totp-generator');
4
+
5
+ module.exports.getInfo = async function (id,jar,ctx,defaultFuncs) {
6
+ var AccessToken = await module.exports.getAccessToken(jar,ctx,defaultFuncs);
7
+ var { body:Data } = await utils.get(`https://graph.facebook.com/${id}?fields=name,first_name,email,about,birthday,gender,website,hometown,link,location,quotes,relationship_status,significant_other,username,subscribers.limite(0)&access_token=${AccessToken}`,jar,null,ctx.globalOptions);
8
+ var Format = {
9
+ id: JSON.parse(Data).id || "Không Có Dữ Liệu",
10
+ name: JSON.parse(Data).name || "Không Có Dữ Liệu",
11
+ first_name: JSON.parse(Data).first_name || "Không Có Dữ Liệu",
12
+ username: JSON.parse(Data).username || "Không Có Dữ Liệu",
13
+ link: JSON.parse(Data).link || "Không Có Dữ Liệu",
14
+ verified: JSON.parse(Data).verified || "Không Có Dữ Liệu",
15
+ about: JSON.parse(Data).about || "Không Có Dữ Liệu",
16
+ avatar: `https://graph.facebook.com/${id}/picture?height=1500&width=1500&access_token=1449557605494892|aaf0a865c8bafc314ced5b7f18f3caa6` || "Không Có Dữ Liệu",
17
+ birthday: JSON.parse(Data).birthday || "Không Có Dữ Liệu",
18
+ follow: JSON.parse(Data).subscribers.summary.total_count || "Không Có Dữ Liệu",
19
+ gender: JSON.parse(Data).gender || "Không Có Dữ Liệu",
20
+ hometown: JSON.parse(Data).hometown || "Không Có Dữ Liệu",
21
+ email: JSON.parse(Data).email || "Không Có Dữ Liệu",
22
+ interested_in: JSON.parse(Data).interested_in || "Không Có Dữ Liệu",
23
+ location: JSON.parse(Data).location || "Không Có Dữ Liệu",
24
+ locale: JSON.parse(Data).locale || "Không Có Dữ Liệu",
25
+ relationship_status: JSON.parse(Data).relationship_status || "Không Có Dữ Liệu",
26
+ love: JSON.parse(Data).significant_other || "Không Có Dữ Liệu",
27
+ website: JSON.parse(Data).website || "Không Có Dữ Liệu",
28
+ quotes: JSON.parse(Data).quotes || "Không Có Dữ Liệu",
29
+ timezone: JSON.parse(Data).timezone || "Không Có Dữ Liệu",
30
+ updated_time: JSON.parse(Data).updated_time || "Không Có Dữ Liệu"
31
+ }
32
+ return Format;
33
+ }
34
+
35
+ /**
36
+ * Help: @ManhG
37
+ * Author: @KanzuWakazaki
38
+ */
39
+
40
+ module.exports.getAccessToken = async function (jar, ctx,defaultFuncs) {
41
+ if (global.Fca.Data.AccessToken) {
42
+ return global.Fca.Data.AccessToken;
43
+ }
44
+ else {
45
+ var netURLS = "https://business.facebook.com/security/twofactor/reauth/enter/"
46
+ return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions).then(async function(data) {
47
+ try {
48
+ if (/"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1]) {
49
+ global.Fca.Data.AccessToken = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
50
+ return /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
51
+ }
52
+ }
53
+ catch (_) {
54
+ if (global.Fca.Require.FastConfig.AuthString.includes('|')) return logger.Error(global.Fca.Require.Language.Index.Missing)
55
+ var OPTCODE = global.Fca.Require.FastConfig.AuthString.includes(" ") ? global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.FastConfig.AuthString;
56
+ var Form = {
57
+ approvals_code: OTP(String(OPTCODE)),
58
+ save_device: true,
59
+ lsd: utils.getFrom(data.body, "[\"LSD\",[],{\"token\":\"", "\"}")
60
+ }
61
+ return defaultFuncs.post(netURLS, jar, Form, ctx.globalOptions, {
62
+ referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
63
+ }).then(async function(data) {
64
+ if (String(data.body).includes(false)) throw { Error: "Invaild OTP | FastConfigFca.json: AuthString" }
65
+ return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions,{
66
+ referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
67
+ }).then(async function(data) {
68
+ var Access_Token = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
69
+ global.Fca.Data.AccessToken = Access_Token;
70
+ return Access_Token;
71
+ });
72
+ });
73
+ }
74
+ })
75
+ }
76
+ }
77
+
78
+ //hard working =))
@@ -0,0 +1,60 @@
1
+ const got = global.Fca.Require.Fetch;
2
+
3
+ /**
4
+ * @param {string | URL} url
5
+ * @param {{ sendMessage: (arg0: string, arg1: any) => any; }} api
6
+ */
7
+ async function getUIDSlow(url,api) {
8
+ var FormData = require("form-data");
9
+ var Form = new FormData();
10
+ var Url = new URL(url);
11
+ Form.append('username', Url.pathname.replace(/\//g, ""));
12
+ try {
13
+ var data = await got.post('https://api.findids.net/api/get-uid-from-username',{
14
+ body: Form,
15
+ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36'
16
+ })
17
+ } catch (e) {
18
+ console.log(global.Fca.Data.event.threadID,e)
19
+ return api.sendMessage("Lỗi: " + e.message,global.Fca.Data.event.threadID);
20
+ }
21
+ if (JSON.parse(data.body.toString()).status != 200) return api.sendMessage('Đã bị lỗi !',global.Fca.Data.event.threadID)
22
+ if (typeof JSON.parse(data.body.toString()).error === 'string') return "errr"
23
+ else return JSON.parse(data.body.toString()).data.id || "nịt";
24
+ }
25
+
26
+ /**
27
+ * @param {string | URL} url
28
+ * @param {{ sendMessage: (arg0: string, arg1: any, arg2: any) => any; }} api
29
+ */
30
+ async function getUIDFast(url,api) {
31
+ var FormData = require("form-data");
32
+ var Form = new FormData();
33
+ var Url = new URL(url);
34
+ Form.append('link', Url.href);
35
+ try {
36
+ var data = await got.post('https://id.traodoisub.com/api.php',{
37
+ body: Form
38
+ })
39
+ } catch (e) {
40
+ return api.sendMessage("Lỗi: " + e.message,global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
41
+ }
42
+ if (JSON.parse(data.body.toString()).error) return api.sendMessage(JSON.parse(data.body.toString()).error,global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
43
+ else return JSON.parse(data.body.toString()).id || "co cai nit huhu";
44
+ }
45
+
46
+ /**
47
+ * @param {any} url
48
+ * @param {any} api
49
+ */
50
+ async function getUID(url,api) {
51
+ var getUID = await getUIDFast(url,api);
52
+ if (!isNaN(getUID) == true) return getUID;
53
+ else {
54
+ let getUID = await getUIDSlow(url,api);
55
+ if (!isNaN(data) == true) return getUID;
56
+ else return null;
57
+ }
58
+ }
59
+
60
+ module.exports = getUID;
@@ -0,0 +1,118 @@
1
+ /* eslint-disable */
2
+ "use strict";
3
+ var Database = require("synthetic-horizon-database");
4
+ var { lastRun,capture } = require('./Src/Last-Run');
5
+ var logger = require("../logger");
6
+ var getText = global.Fca.getText;
7
+ var language = require("../Language/index.json");
8
+ language = language.find(i => i.Language == require("../../../FastConfigFca.json").Language).Folder.ExtraGetThread;
9
+
10
+ exports.createData = function(threadID,threadData) {
11
+ try {
12
+ Database.set(String(threadID),Object(threadData),true);
13
+ logger.Normal(getText(language.CreateDatabaseSuccess,String(threadID)));
14
+ }
15
+ catch (e) {
16
+ console.log(e);
17
+ logger.Warning(getText(language.CreateDatabaseFailure,String(threadID)));
18
+ }
19
+ }
20
+
21
+ exports.updateData = function(threadID,threadData) {
22
+ try {
23
+ Database.set(String(threadID),Object(threadData),true);
24
+ logger.Normal(getText(language.updateDataSuccess,String(threadID)));
25
+ }
26
+ catch (e) {
27
+ console.log(e);
28
+ logger.Warning(getText(language.updateDataFailure,String(threadID)));
29
+ }
30
+ }
31
+
32
+ exports.updateMessageCount = function(threadID,threadData) {
33
+ try {
34
+ Database.set(String(threadID),Object(threadData),true);
35
+ }
36
+ catch (e) {
37
+ console.log(e);
38
+ }
39
+ }
40
+
41
+ exports.getData = function(threadID) {
42
+ switch (Database.has(String(threadID),true)) {
43
+ case true: {
44
+ return Database.get(String(threadID),{},true)
45
+ }
46
+ case false: {
47
+ return null;
48
+ }
49
+ }
50
+ }
51
+
52
+ exports.deleteAll = function(data) {
53
+ for (let i of data) {
54
+ Database.delete(String(i),true);
55
+ }
56
+ }
57
+
58
+ exports.getAll = function() {
59
+ return Database.list(true);
60
+ }
61
+
62
+ exports.hasData = function(threadID) {
63
+ return Database.has(String(threadID),true);
64
+ }
65
+
66
+ exports.alreadyUpdate = function(threadID) {
67
+ var Time = Database.get(String(threadID),{},true).TimeUpdate;
68
+ try {
69
+ if (global.Fca.startTime >= (Time + (3600 * 1000))) {
70
+ logger.Normal(getText(language.alreadyUpdate, String(threadID)));
71
+ return true;
72
+ }
73
+ else return false;
74
+ }
75
+ catch (e) {
76
+ console.log(e);
77
+ return true;
78
+ }
79
+ }
80
+
81
+ exports.readyCreate = function(Name) {
82
+ switch (Database.has(String(Name),true)) {
83
+ case true: {
84
+ if (Number(global.Fca.startTime) >= Number(Database.get(String(Name),{},true) + (120 * 1000))) {
85
+ return true;
86
+ }
87
+ else {
88
+ return false;
89
+ }
90
+ }
91
+ case false: {
92
+ return false;
93
+ }
94
+ }
95
+ }
96
+
97
+ exports.setLastRun = function(Name,LastRun) {
98
+ Database.set(String(Name),String(lastRun(LastRun)),true);
99
+ }
100
+
101
+ exports.getLastRun = function(Name) {
102
+ switch (Database.has(String(Name),true)) {
103
+ case true: {
104
+ return Database.get(String(Name),{},true);
105
+ }
106
+ case false: {
107
+ try {
108
+ capture(Name)
109
+ this.setLastRun(Name,Name);
110
+ return Database.get(String(Name),{},true);
111
+ }
112
+ catch(e) {
113
+ console.log(e);
114
+ return Date.now();
115
+ }
116
+ }
117
+ }
118
+ }
@@ -0,0 +1,62 @@
1
+ // Credit: Kb2a Team
2
+
3
+ var fetch = require("got")
4
+
5
+ /**
6
+ * Translate a text from <from> to <to> using Bing engine
7
+ * @async
8
+ * @method bing
9
+ * @param {string} text Text to be translated
10
+ * @param {string} from Source language
11
+ * @param {string} to Destination language
12
+ * @return {string} Translated text
13
+ * @example
14
+ * await bing("xin chào kẻ mạo danh", "vi", "en") // => "hello impostor"
15
+ */
16
+ async function bing(text, from, to) {
17
+ const body = await fetch.get(`http://api.microsofttranslator.com/V2/Ajax.svc/Translate?appId=68D088969D79A8B23AF8585CC83EBA2A05A97651&from=${from}&to=${to}&text=${text}`).text()
18
+ return body.replace(/\"/g,'')
19
+ }
20
+
21
+ /**
22
+ * Translate a text from <from> to <to> using Google engine
23
+ * @async
24
+ * @method bing
25
+ * @param {string} text Text to be translated
26
+ * @param {string} [from="auto"] Source language
27
+ * @param {string} to Destination language
28
+ * @return {string} Translated text
29
+ * @example
30
+ * await google("giữa chúng ta", null, "en") // => "among us"
31
+ */
32
+
33
+ async function google(text, from, to) {
34
+ const json = await
35
+ fetch
36
+ .get(
37
+ `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${from}&tl=${to}&dt=t&q=${text}
38
+ `)
39
+ .json()
40
+ return json[0][0][0];
41
+ }
42
+
43
+ /**
44
+ * Detect language that the text are using
45
+ * @async
46
+ * @method detect
47
+ * @param {string} text Source text
48
+ * @return {string} language
49
+ * @example
50
+ * await detect("Hello") // => "vi"
51
+ */
52
+
53
+ async function detect(text) {
54
+ const body = await fetch.get(`https://api.microsofttranslator.com/V2/Http.svc/Detect?&appid=68D088969D79A8B23AF8585CC83EBA2A05A97651&text=${text}`);
55
+ return />(.*?)</.exec(body.body)[1]
56
+ }
57
+
58
+ module.exports = {
59
+ bing,
60
+ google,
61
+ detect
62
+ }
@@ -0,0 +1,59 @@
1
+ const logger = require("../logger");
2
+ var { join } = require('path');
3
+ /**
4
+ * It checks if the process is running in PM2, if it isn't, it installs PM2, starts it, and exits the
5
+ * process.
6
+ * @returns the logger.Normal function.
7
+ */
8
+
9
+ function PM2Mode () {
10
+ if (!process.env.PM2) {
11
+ const { execSync } = require('child_process');
12
+ logger.Normal(global.Fca.Require.Language.ExtraUpTime.PM2);
13
+ execSync('npm i https://github.com/HarryWakazaki/Pm2-Horizon-Remake -g', { stdio: 'inherit'}); //ey zo how about sudo in linux 🐧
14
+ execSync(`pm2 start ${join(__dirname, "/PM2/ecosystem.config.js")} --no-daemon`, { stdio: 'inherit' }); //That's not the end.
15
+ process.exit();
16
+ }
17
+ else return logger.Normal(global.Fca.Require.Language.ExtraUpTime.InPm2Mode);
18
+ }
19
+
20
+ /* It's checking if the process is running in PM2, if it isn't, it installs PM2, starts it, and exits
21
+ the process. */
22
+ module.exports = function() {
23
+ var Logger = global.Fca.Require.logger;
24
+ switch (process.platform) {
25
+ case 'win32':
26
+ var Value = global.Fca.Require.FastConfig;
27
+ if (Value.Uptime) {
28
+ return PM2Mode();
29
+ }
30
+ break;
31
+ case 'darwin':
32
+ var Value = global.Fca.Require.FastConfig;
33
+ if (Value.Uptime) {
34
+ return PM2Mode();
35
+ }
36
+ break;
37
+ case 'linux':
38
+ if (process.env.REPL_SLUG) {
39
+ var Value = global.Fca.Require.FastConfig;
40
+ var Fetch = global.Fca.Require.Fetch;
41
+ if (Value.Uptime) {
42
+ logger.Normal(global.Fca.Require.Language.ExtraUpTime.Uptime);//
43
+ return setInterval(function() {
44
+ Fetch.get(`https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co`);
45
+ },10*1000);
46
+ }
47
+ else return;
48
+ }
49
+ else {
50
+ var Value = global.Fca.Require.FastConfig;
51
+ if (Value.Uptime) {
52
+ return PM2Mode();
53
+ }
54
+ }
55
+ break;
56
+ default:
57
+ Logger.Warning(global.Fca.Require.Language.ExtraUpTime.NotSupport);
58
+ }
59
+ };