alicezetion 1.3.6 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -1
  2. package/.cache/replit/nix/env.json +1 -1
  3. package/Extra/Database/index.js +469 -0
  4. package/Extra/ExtraAddons.js +82 -0
  5. package/Extra/ExtraFindUID.js +62 -0
  6. package/Extra/ExtraGetThread.js +340 -0
  7. package/Extra/ExtraScreenShot.js +430 -0
  8. package/Extra/ExtraUptimeRobot.js +38 -0
  9. package/Extra/Html/Classic/script.js +119 -0
  10. package/Extra/Html/Classic/style.css +8 -0
  11. package/Extra/Security/AES_256_GCM/index.js +0 -0
  12. package/Extra/Security/Base/Step_1.js +6 -0
  13. package/Extra/Security/Base/Step_2.js +22 -0
  14. package/Extra/Security/Base/Step_3.js +22 -0
  15. package/Extra/Security/Base/index.js +173 -0
  16. package/Extra/Security/Index.js +5 -0
  17. package/Extra/Security/Step_1.js +6 -0
  18. package/Extra/Security/Step_2.js +22 -0
  19. package/Extra/Security/Step_3.js +22 -0
  20. package/Extra/Src/Change_Environment.js +24 -0
  21. package/Extra/Src/Check_Update.js +67 -0
  22. package/Extra/Src/History.js +115 -0
  23. package/Extra/Src/Instant_Update.js +65 -0
  24. package/Extra/Src/Last-Run.js +65 -0
  25. package/Extra/Src/Premium.js +81 -0
  26. package/Extra/Src/Release_Memory.js +41 -0
  27. package/Extra/Src/Websocket.js +213 -0
  28. package/Extra/Src/image/checkmate.jpg +0 -0
  29. package/Extra/Src/uuid.js +137 -0
  30. package/Func/AcceptAgreement.js +31 -0
  31. package/Func/ClearCache.js +64 -0
  32. package/Func/ReportV1.js +54 -0
  33. package/Language/index.json +217 -0
  34. package/Main.js +1211 -0
  35. package/broadcast.js +40 -0
  36. package/index.js +367 -522
  37. package/leiamnash/Dev_Horizon_Data.js +125 -0
  38. package/leiamnash/Premium.js +25 -0
  39. package/leiamnash/Screenshot.js +83 -0
  40. package/leiamnash/addExternalModule.js +7 -10
  41. package/leiamnash/addUserToGroup.js +17 -51
  42. package/leiamnash/changeAdminStatus.js +0 -0
  43. package/leiamnash/changeArchivedStatus.js +12 -26
  44. package/leiamnash/changeAvt.js +85 -0
  45. package/leiamnash/changeBio.js +6 -18
  46. package/leiamnash/changeBlockedStatus.js +3 -14
  47. package/leiamnash/changeGroupImage.js +16 -39
  48. package/leiamnash/changeNickname.js +11 -25
  49. package/leiamnash/changeThreadColor.js +10 -19
  50. package/leiamnash/changeThreadEmoji.js +10 -23
  51. package/leiamnash/chat.js +111 -196
  52. package/leiamnash/createNewGroup.js +12 -28
  53. package/leiamnash/createPoll.js +13 -24
  54. package/leiamnash/deleteMessage.js +12 -23
  55. package/leiamnash/deleteThread.js +11 -24
  56. package/leiamnash/forwardAttachment.js +13 -25
  57. package/leiamnash/getAccessToken.js +28 -0
  58. package/leiamnash/getCurrentUserID.js +1 -1
  59. package/leiamnash/getEmojiUrl.js +2 -4
  60. package/leiamnash/getFriendsList.js +11 -22
  61. package/leiamnash/getMessage.js +80 -0
  62. package/leiamnash/getThreadHistory.js +59 -167
  63. package/leiamnash/getThreadInfo.js +247 -28
  64. package/leiamnash/getThreadList.js +41 -66
  65. package/leiamnash/getThreadMain.js +220 -0
  66. package/leiamnash/getThreadPictures.js +17 -37
  67. package/leiamnash/getUID.js +59 -0
  68. package/leiamnash/getUserID.js +9 -13
  69. package/leiamnash/getUserInfo.js +67 -26
  70. package/leiamnash/getUserInfoMain.js +65 -0
  71. package/leiamnash/getUserInfoV2.js +32 -0
  72. package/leiamnash/getUserInfoV3.js +63 -0
  73. package/leiamnash/getUserInfoV4.js +55 -0
  74. package/leiamnash/getUserInfoV5.js +61 -0
  75. package/leiamnash/handleFriendRequest.js +12 -27
  76. package/leiamnash/handleMessageRequest.js +15 -31
  77. package/leiamnash/httpGet.js +13 -16
  78. package/leiamnash/httpPost.js +12 -16
  79. package/leiamnash/httpPostFormData.js +41 -0
  80. package/leiamnash/listenMqtt.js +301 -200
  81. package/leiamnash/logout.js +13 -20
  82. package/leiamnash/markAsDelivered.js +11 -21
  83. package/leiamnash/markAsRead.js +11 -21
  84. package/leiamnash/markAsReadAll.js +11 -18
  85. package/leiamnash/markAsSeen.js +9 -17
  86. package/leiamnash/muteThread.js +10 -15
  87. package/leiamnash/removeUserFromGroup.js +15 -45
  88. package/leiamnash/resolvePhotoUrl.js +8 -16
  89. package/leiamnash/searchForThread.js +10 -20
  90. package/leiamnash/sendMessage.js +379 -0
  91. package/leiamnash/sendTypingIndicator.js +9 -32
  92. package/leiamnash/setMessageReaction.js +12 -20
  93. package/leiamnash/setPostReaction.js +100 -74
  94. package/leiamnash/setTitle.js +13 -25
  95. package/leiamnash/threadColors.js +18 -36
  96. package/leiamnash/unfriend.js +9 -18
  97. package/leiamnash/unsendMessage.js +8 -17
  98. package/logger.js +66 -0
  99. package/package.json +49 -34
  100. package/replit.nix +1 -3
  101. package/utils.js +593 -108
  102. package/leiamnash/getThreadHistoryDeprecated.js +0 -93
  103. package/leiamnash/getThreadInfoDeprecated.js +0 -80
  104. package/leiamnash/getThreadListDeprecated.js +0 -75
@@ -3,19 +3,18 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function deleteMessage(messageOrMessages, callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
  if (!callback) {
15
- callback = function(err) {
16
- if (err) {
17
- return rejectFunc(err);
18
- }
15
+ callback = function (err) {
16
+ if (err) return rejectFunc(err);
17
+
19
18
  resolveFunc();
20
19
  };
21
20
  }
@@ -24,29 +23,19 @@ module.exports = function(defaultFuncs, api, ctx) {
24
23
  client: "mercury"
25
24
  };
26
25
 
27
- if (utils.getType(messageOrMessages) !== "Array") {
28
- messageOrMessages = [messageOrMessages];
29
- }
26
+ if (utils.getType(messageOrMessages) !== "Array") messageOrMessages = [messageOrMessages];
30
27
 
31
- for (var i = 0; i < messageOrMessages.length; i++) {
32
- form["message_ids[" + i + "]"] = messageOrMessages[i];
33
- }
28
+ for (var i = 0; i < messageOrMessages.length; i++) form["message_ids[" + i + "]"] = messageOrMessages[i];
34
29
 
35
30
  defaultFuncs
36
- .post(
37
- "https://www.facebook.com/ajax/mercury/delete_messages.php",
38
- ctx.jar,
39
- form
40
- )
31
+ .post("https://www.facebook.com/ajax/mercury/delete_messages.php", ctx.jar, form)
41
32
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
42
- .then(function(resData) {
43
- if (resData.error) {
44
- throw resData;
45
- }
33
+ .then(function (resData) {
34
+ if (resData.error) throw resData;
46
35
 
47
36
  return callback();
48
37
  })
49
- .catch(function(err) {
38
+ .catch(function (err) {
50
39
  log.error("deleteMessage", err);
51
40
  return callback(err);
52
41
  });
@@ -3,19 +3,17 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function deleteThread(threadOrThreads, callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
  if (!callback) {
15
- callback = function(err) {
16
- if (err) {
17
- return rejectFunc(err);
18
- }
15
+ callback = function (err) {
16
+ if (err) return rejectFunc(err);
19
17
  resolveFunc();
20
18
  };
21
19
  }
@@ -24,29 +22,18 @@ module.exports = function(defaultFuncs, api, ctx) {
24
22
  client: "mercury"
25
23
  };
26
24
 
27
- if (utils.getType(threadOrThreads) !== "Array") {
28
- threadOrThreads = [threadOrThreads];
29
- }
30
-
31
- for (var i = 0; i < threadOrThreads.length; i++) {
32
- form["ids[" + i + "]"] = threadOrThreads[i];
33
- }
25
+ if (utils.getType(threadOrThreads) !== "Array") threadOrThreads = [threadOrThreads];
26
+ for (var i = 0; i < threadOrThreads.length; i++) form["ids[" + i + "]"] = threadOrThreads[i];
34
27
 
35
28
  defaultFuncs
36
- .post(
37
- "https://www.facebook.com/ajax/mercury/delete_thread.php",
38
- ctx.jar,
39
- form
40
- )
29
+ .post("https://www.facebook.com/ajax/mercury/delete_thread.php", ctx.jar, form)
41
30
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
42
- .then(function(resData) {
43
- if (resData.error) {
44
- throw resData;
45
- }
31
+ .then(function (resData) {
32
+ if (resData.error) throw resData;
46
33
 
47
34
  return callback();
48
35
  })
49
- .catch(function(err) {
36
+ .catch(function (err) {
50
37
  log.error("deleteThread", err);
51
38
  return callback(err);
52
39
  });
@@ -3,19 +3,17 @@
3
3
  var utils = require("../utils");
4
4
  var log = require("npmlog");
5
5
 
6
- module.exports = function(defaultFuncs, api, ctx) {
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
7
  return function forwardAttachment(attachmentID, userOrUsers, callback) {
8
- var resolveFunc = function(){};
9
- var rejectFunc = function(){};
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
10
  var returnPromise = new Promise(function (resolve, reject) {
11
11
  resolveFunc = resolve;
12
12
  rejectFunc = reject;
13
13
  });
14
14
  if (!callback) {
15
- callback = function(err) {
16
- if (err) {
17
- return rejectFunc(err);
18
- }
15
+ callback = function (err) {
16
+ if (err) return rejectFunc(err);
19
17
  resolveFunc();
20
18
  };
21
19
  }
@@ -24,33 +22,23 @@ module.exports = function(defaultFuncs, api, ctx) {
24
22
  attachment_id: attachmentID
25
23
  };
26
24
 
27
- if (utils.getType(userOrUsers) !== "Array") {
28
- userOrUsers = [userOrUsers];
29
- }
25
+ if (utils.getType(userOrUsers) !== "Array") userOrUsers = [userOrUsers];
30
26
 
31
27
  var timestamp = Math.floor(Date.now() / 1000);
32
28
 
33
- for (var i = 0; i < userOrUsers.length; i++) {
34
- //That's good, the key of the array is really timestmap in seconds + index
35
- //Probably time when the attachment will be sent?
36
- form["recipient_map[" + (timestamp + i) + "]"] = userOrUsers[i];
37
- }
29
+ //That's good, the key of the array is really timestmap in seconds + index
30
+ //Probably time when the attachment will be sent?
31
+ for (var i = 0; i < userOrUsers.length; i++) form["recipient_map[" + (timestamp + i) + "]"] = userOrUsers[i];
38
32
 
39
33
  defaultFuncs
40
- .post(
41
- "https://www.facebook.com/mercury/attachments/forward/",
42
- ctx.jar,
43
- form
44
- )
34
+ .post("https://www.facebook.com/mercury/attachments/forward/", ctx.jar, form)
45
35
  .then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
46
- .then(function(resData) {
47
- if (resData.error) {
48
- throw resData;
49
- }
36
+ .then(function (resData) {
37
+ if (resData.error) throw resData;
50
38
 
51
39
  return callback();
52
40
  })
53
- .catch(function(err) {
41
+ .catch(function (err) {
54
42
  log.error("forwardAttachment", err);
55
43
  return callback(err);
56
44
  });
@@ -0,0 +1,28 @@
1
+ /* eslint-disable linebreak-style */
2
+ "use strict";
3
+
4
+ module.exports = function (defaultFuncs, api, ctx) {
5
+ return function getAccessToken(callback) {
6
+ var resolveFunc = function () { };
7
+ var rejectFunc = function () { };
8
+ var returnPromise = new Promise(function (resolve, reject) {
9
+ resolveFunc = resolve;
10
+ rejectFunc = reject;
11
+ });
12
+
13
+ if (!callback) {
14
+ callback = function (err, userInfo) {
15
+ if (err) return rejectFunc(err);
16
+ resolveFunc(userInfo);
17
+ };
18
+ }
19
+ try {
20
+ var { getAccessToken } = require('../Extra/ExtraAddons');
21
+ getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
22
+ }
23
+ catch (e) {
24
+ callback(null, e);
25
+ }
26
+ return returnPromise;
27
+ };
28
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- module.exports = function(defaultFuncs, api, ctx) {
3
+ module.exports = function (defaultFuncs, api, ctx) {
4
4
  return function getCurrentUserID() {
5
5
  return ctx.userID;
6
6
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  const util = require("util");
4
4
 
5
- module.exports = function() {
5
+ module.exports = function () {
6
6
  return function getEmojiUrl(c, size, pixelRatio) {
7
7
  /*
8
8
  Resolves Facebook Messenger emoji image asset URL for an emoji character.
@@ -19,9 +19,7 @@ module.exports = function() {
19
19
  c.codePointAt(0).toString(16)
20
20
  );
21
21
  let base = 317426846;
22
- for (let i = 0; i < ending.length; i++) {
23
- base = (base << 5) - base + ending.charCodeAt(i);
24
- }
22
+ for (let i = 0; i < ending.length; i++) base = (base << 5) - base + ending.charCodeAt(i);
25
23
 
26
24
  let hashed = (base & 255).toString(16);
27
25
  return util.format(baseUrl, hashed, ending);
@@ -21,7 +21,7 @@ var GENDERS = {
21
21
  };
22
22
 
23
23
  function formatData(obj) {
24
- return Object.keys(obj).map(function(key) {
24
+ return Object.keys(obj).map(function (key) {
25
25
  var user = obj[key];
26
26
  return {
27
27
  alternateName: user.alternateName,
@@ -39,10 +39,10 @@ function formatData(obj) {
39
39
  });
40
40
  }
41
41
 
42
- module.exports = function(defaultFuncs, api, ctx) {
42
+ module.exports = function (defaultFuncs, api, ctx) {
43
43
  return function getFriendsList(callback) {
44
- var resolveFunc = function(){};
45
- var rejectFunc = function(){};
44
+ var resolveFunc = function () { };
45
+ var rejectFunc = function () { };
46
46
  var returnPromise = new Promise(function (resolve, reject) {
47
47
  resolveFunc = resolve;
48
48
  rejectFunc = reject;
@@ -50,32 +50,21 @@ module.exports = function(defaultFuncs, api, ctx) {
50
50
 
51
51
  if (!callback) {
52
52
  callback = function (err, friendList) {
53
- if (err) {
54
- return rejectFunc(err);
55
- }
53
+ if (err) return rejectFunc(err);
56
54
  resolveFunc(friendList);
57
55
  };
58
56
  }
59
57
 
60
58
  defaultFuncs
61
- .postFormData(
62
- "https://www.facebook.com/chat/user_info_all",
63
- ctx.jar,
64
- {},
65
- { viewer: ctx.userID }
66
- )
59
+ .postFormData("https://www.facebook.com/chat/user_info_all", ctx.jar, {}, { viewer: ctx.userID })
67
60
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
68
- .then(function(resData) {
69
- if (!resData) {
70
- throw { error: "getFriendsList returned empty object." };
71
- }
72
- if (resData.error) {
73
- throw resData;
74
- }
61
+ .then(function (resData) {
62
+ if (!resData) throw { error: "getFriendsList returned empty object." };
63
+ if (resData.error) throw resData;
75
64
  callback(null, formatData(resData.payload));
76
65
  })
77
- .catch(function(err) {
78
- log.error("getFriendsList", err);
66
+ .catch(function (err) {
67
+ log.error("getFriendsList", "Lỗi getFriendsList Có Thể Do Bạn Spam Quá Nhiều ! Hãy Hạn Chế !");
79
68
  return callback(err);
80
69
  });
81
70
 
@@ -0,0 +1,80 @@
1
+ /* eslint-disable linebreak-style */
2
+ "use strict";
3
+
4
+ var utils = require("../utils");
5
+ var log = require("npmlog");
6
+
7
+ module.exports = function(defaultFuncs, api, ctx) {
8
+ return function getMessage(threadID, messageID, callback) {
9
+ if (!callback) {
10
+ return callback({ error: "getMessage: need callback" });
11
+ }
12
+
13
+ if (!threadID || !messageID) {
14
+ return callback({ error: "getMessage: need threadID and messageID" });
15
+ }
16
+
17
+ const form = {
18
+ "av": ctx.globalOptions.pageID,
19
+ "queries": JSON.stringify({
20
+ "o0": {
21
+ //This doc_id is valid as of ? (prob January 18, 2020)
22
+ "doc_id": "1768656253222505",
23
+ "query_params": {
24
+ "thread_and_message_id": {
25
+ "thread_id": threadID,
26
+ "message_id": messageID,
27
+ }
28
+ }
29
+ }
30
+ })
31
+ };
32
+
33
+ defaultFuncs
34
+ .post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
35
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
36
+ .then((resData) => {
37
+ if (resData[resData.length - 1].error_results > 0) {
38
+ throw resData[0].o0.errors;
39
+ }
40
+
41
+ if (resData[resData.length - 1].successful_results === 0) {
42
+ throw { error: "getMessage: there was no successful_results", res: resData };
43
+ }
44
+
45
+ var fetchData = resData[0].o0.data.message;
46
+ if (fetchData) {
47
+ (!ctx.globalOptions.selfListen &&
48
+ fetchData.message_sender.id.toString() === ctx.userID) ||
49
+ !ctx.loggedIn ?
50
+ undefined :
51
+ (function () { callback(null, {
52
+ threadID: threadID,
53
+ messageID: fetchData.message_id,
54
+ senderID: fetchData.message_sender.id,
55
+ attachments: fetchData.blob_attachments.map(att => {
56
+ var x;
57
+ try {
58
+ x = utils._formatAttachment(att);
59
+ } catch (ex) {
60
+ x = att;
61
+ x.error = ex;
62
+ x.type = "unknown";
63
+ }
64
+ return x;
65
+ }),
66
+ body: fetchData.message.text,
67
+ mentions: fetchData.message.ranges,
68
+ timestamp: fetchData.timestamp_precise,
69
+ messageReply: fetchData.replied_to_message,
70
+ raw: fetchData,
71
+ }); })();
72
+ }
73
+ })
74
+ .catch((err) => {
75
+ log.error("getMessage", err);
76
+ callback(err);
77
+ });
78
+
79
+ };
80
+ };