alicezetion 1.5.2 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -1
  2. package/.cache/replit/nix/env.json +1 -1
  3. package/index.js +601 -386
  4. package/leiamnash/addExternalModule.js +19 -16
  5. package/leiamnash/addUserToGroup.js +113 -79
  6. package/leiamnash/changeAdminStatus.js +79 -79
  7. package/leiamnash/changeArchivedStatus.js +55 -41
  8. package/leiamnash/changeBio.js +77 -65
  9. package/leiamnash/changeBlockedStatus.js +47 -36
  10. package/leiamnash/changeGroupImage.js +129 -106
  11. package/leiamnash/changeNickname.js +59 -45
  12. package/leiamnash/changeThreadColor.js +71 -62
  13. package/leiamnash/changeThreadEmoji.js +55 -42
  14. package/leiamnash/chat.js +459 -374
  15. package/leiamnash/createNewGroup.js +86 -70
  16. package/leiamnash/createPoll.js +71 -60
  17. package/leiamnash/deleteMessage.js +56 -45
  18. package/leiamnash/deleteThread.js +56 -43
  19. package/leiamnash/forwardAttachment.js +60 -48
  20. package/leiamnash/getCurrentUserID.js +7 -7
  21. package/leiamnash/getEmojiUrl.js +29 -27
  22. package/leiamnash/getFriendsList.js +84 -73
  23. package/leiamnash/getThreadHistory.js +645 -537
  24. package/leiamnash/getThreadHistoryDeprecated.js +93 -0
  25. package/leiamnash/getThreadInfo.js +206 -425
  26. package/leiamnash/getThreadInfoDeprecated.js +80 -0
  27. package/leiamnash/getThreadList.js +238 -213
  28. package/leiamnash/getThreadListDeprecated.js +75 -0
  29. package/leiamnash/getThreadPictures.js +79 -59
  30. package/leiamnash/getUserID.js +66 -62
  31. package/leiamnash/getUserInfo.js +72 -113
  32. package/leiamnash/handleFriendRequest.js +61 -46
  33. package/leiamnash/handleMessageRequest.js +65 -49
  34. package/leiamnash/httpGet.js +52 -49
  35. package/leiamnash/httpPost.js +52 -48
  36. package/leiamnash/listenMqtt.js +789 -787
  37. package/leiamnash/logout.js +75 -68
  38. package/leiamnash/markAsDelivered.js +58 -48
  39. package/leiamnash/markAsRead.js +80 -70
  40. package/leiamnash/markAsReadAll.js +49 -42
  41. package/leiamnash/markAsSeen.js +59 -51
  42. package/leiamnash/muteThread.js +52 -47
  43. package/leiamnash/removeUserFromGroup.js +79 -49
  44. package/leiamnash/resolvePhotoUrl.js +45 -37
  45. package/leiamnash/searchForThread.js +53 -43
  46. package/leiamnash/sendTypingIndicator.js +103 -80
  47. package/leiamnash/setMessageReaction.js +117 -109
  48. package/leiamnash/setPostReaction.js +76 -102
  49. package/leiamnash/setTitle.js +86 -74
  50. package/leiamnash/threadColors.js +57 -39
  51. package/leiamnash/unfriend.js +52 -43
  52. package/leiamnash/unsendMessage.js +49 -40
  53. package/package.json +71 -88
  54. package/utils.js +1356 -1684
  55. package/Extra/Database/index.js +0 -469
  56. package/Extra/ExtraAddons.js +0 -82
  57. package/Extra/ExtraFindUID.js +0 -62
  58. package/Extra/ExtraGetThread.js +0 -340
  59. package/Extra/ExtraScreenShot.js +0 -430
  60. package/Extra/ExtraUptimeRobot.js +0 -38
  61. package/Extra/Html/Classic/script.js +0 -119
  62. package/Extra/Html/Classic/style.css +0 -8
  63. package/Extra/Security/AES_256_GCM/index.js +0 -0
  64. package/Extra/Security/Base/Step_1.js +0 -6
  65. package/Extra/Security/Base/Step_2.js +0 -22
  66. package/Extra/Security/Base/Step_3.js +0 -22
  67. package/Extra/Security/Base/index.js +0 -174
  68. package/Extra/Security/Index.js +0 -5
  69. package/Extra/Security/Step_1.js +0 -6
  70. package/Extra/Security/Step_2.js +0 -22
  71. package/Extra/Security/Step_3.js +0 -22
  72. package/Extra/Src/Change_Environment.js +0 -24
  73. package/Extra/Src/Check_Update.js +0 -67
  74. package/Extra/Src/History.js +0 -115
  75. package/Extra/Src/Instant_Update.js +0 -65
  76. package/Extra/Src/Last-Run.js +0 -65
  77. package/Extra/Src/Premium.js +0 -81
  78. package/Extra/Src/Release_Memory.js +0 -41
  79. package/Extra/Src/Websocket.js +0 -213
  80. package/Extra/Src/image/checkmate.jpg +0 -0
  81. package/Extra/Src/uuid.js +0 -137
  82. package/Func/AcceptAgreement.js +0 -31
  83. package/Func/ClearCache.js +0 -64
  84. package/Func/ReportV1.js +0 -54
  85. package/Language/index.json +0 -217
  86. package/Main.js +0 -1273
  87. package/broadcast.js +0 -40
  88. package/leiamnash/Dev_Horizon_Data.js +0 -125
  89. package/leiamnash/Premium.js +0 -25
  90. package/leiamnash/Screenshot.js +0 -83
  91. package/leiamnash/changeAvt.js +0 -85
  92. package/leiamnash/getAccessToken.js +0 -28
  93. package/leiamnash/getMessage.js +0 -80
  94. package/leiamnash/getThreadMain.js +0 -220
  95. package/leiamnash/getUID.js +0 -59
  96. package/leiamnash/getUserInfoMain.js +0 -65
  97. package/leiamnash/getUserInfoV2.js +0 -32
  98. package/leiamnash/getUserInfoV3.js +0 -63
  99. package/leiamnash/getUserInfoV4.js +0 -55
  100. package/leiamnash/getUserInfoV5.js +0 -61
  101. package/leiamnash/httpPostFormData.js +0 -41
  102. package/leiamnash/sendMessage.js +0 -379
  103. package/logger.js +0 -66
@@ -1,109 +1,117 @@
1
- "use strict";
2
-
3
- var utils = require("../utils");
4
- var log = require("npmlog");
5
-
6
- module.exports = function (defaultFuncs, api, ctx) {
7
- return function setMessageReaction(reaction, messageID, callback, forceCustomReaction) {
8
- var resolveFunc = function () { };
9
- var rejectFunc = function () { };
10
- var returnPromise = new Promise(function (resolve, reject) {
11
- resolveFunc = resolve;
12
- rejectFunc = reject;
13
- });
14
-
15
- if (!callback) {
16
- callback = function (err, data) {
17
- if (err) return rejectFunc(err);
18
- resolveFunc(data);
19
- };
20
- }
21
-
22
- switch (reaction) {
23
- case "\uD83D\uDE0D": //:heart_eyes:
24
- case "\uD83D\uDE06": //:laughing:
25
- case "\uD83D\uDE2E": //:open_mouth:
26
- case "\uD83D\uDE22": //:cry:
27
- case "\uD83D\uDE20": //:angry:
28
- case "\uD83D\uDC4D": //:thumbsup:
29
- case "\uD83D\uDC4E": //:thumbsdown:
30
- case "\u2764": //:heart:
31
- case "\uD83D\uDC97": //:glowingheart:
32
- case "":
33
- //valid
34
- break;
35
- case ":heart_eyes:":
36
- case ":love:":
37
- reaction = "\uD83D\uDE0D";
38
- break;
39
- case ":laughing:":
40
- case ":haha:":
41
- reaction = "\uD83D\uDE06";
42
- break;
43
- case ":open_mouth:":
44
- case ":wow:":
45
- reaction = "\uD83D\uDE2E";
46
- break;
47
- case ":cry:":
48
- case ":sad:":
49
- reaction = "\uD83D\uDE22";
50
- break;
51
- case ":angry:":
52
- reaction = "\uD83D\uDE20";
53
- break;
54
- case ":thumbsup:":
55
- case ":like:":
56
- reaction = "\uD83D\uDC4D";
57
- break;
58
- case ":thumbsdown:":
59
- case ":dislike:":
60
- reaction = "\uD83D\uDC4E";
61
- break;
62
- case ":heart:":
63
- reaction = "\u2764";
64
- break;
65
- case ":glowingheart:":
66
- reaction = "\uD83D\uDC97";
67
- break;
68
- default:
69
- if (forceCustomReaction) break;
70
- return callback({ error: "Reaction is not a valid emoji." });
71
- }
72
-
73
- var variables = {
74
- data: {
75
- client_mutation_id: ctx.clientMutationId++,
76
- actor_id: ctx.userID,
77
- action: reaction == "" ? "REMOVE_REACTION" : "ADD_REACTION",
78
- message_id: messageID,
79
- reaction: reaction
80
- }
81
- };
82
-
83
- var qs = {
84
- doc_id: "1491398900900362",
85
- variables: JSON.stringify(variables),
86
- dpr: 1
87
- };
88
-
89
- defaultFuncs
90
- .postFormData(
91
- "https://www.facebook.com/webgraphql/mutation/",
92
- ctx.jar,
93
- {},
94
- qs
95
- )
96
- .then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
97
- .then(function (resData) {
98
- if (!resData) throw { error: "setReaction returned empty object." };
99
- if (resData.error) throw resData;
100
- callback(null);
101
- })
102
- .catch(function (err) {
103
- log.error("setReaction", err);
104
- return callback(err);
105
- });
106
-
107
- return returnPromise;
108
- };
109
- };
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function(defaultFuncs, api, ctx) {
7
+ return function setMessageReaction(reaction, messageID, callback, forceCustomReaction) {
8
+ var resolveFunc = function(){};
9
+ var rejectFunc = function(){};
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+
15
+ if (!callback) {
16
+ callback = function (err, friendList) {
17
+ if (err) {
18
+ return rejectFunc(err);
19
+ }
20
+ resolveFunc(friendList);
21
+ };
22
+ }
23
+
24
+ switch (reaction) {
25
+ case "\uD83D\uDE0D": //:heart_eyes:
26
+ case "\uD83D\uDE06": //:laughing:
27
+ case "\uD83D\uDE2E": //:open_mouth:
28
+ case "\uD83D\uDE22": //:cry:
29
+ case "\uD83D\uDE20": //:angry:
30
+ case "\uD83D\uDC4D": //:thumbsup:
31
+ case "\uD83D\uDC4E": //:thumbsdown:
32
+ case "\u2764": //:heart:
33
+ case "\uD83D\uDC97": //:glowingheart:
34
+ case "":
35
+ //valid
36
+ break;
37
+ case ":heart_eyes:":
38
+ case ":love:":
39
+ reaction = "\uD83D\uDE0D";
40
+ break;
41
+ case ":laughing:":
42
+ case ":haha:":
43
+ reaction = "\uD83D\uDE06";
44
+ break;
45
+ case ":open_mouth:":
46
+ case ":wow:":
47
+ reaction = "\uD83D\uDE2E";
48
+ break;
49
+ case ":cry:":
50
+ case ":sad:":
51
+ reaction = "\uD83D\uDE22";
52
+ break;
53
+ case ":angry:":
54
+ reaction = "\uD83D\uDE20";
55
+ break;
56
+ case ":thumbsup:":
57
+ case ":like:":
58
+ reaction = "\uD83D\uDC4D";
59
+ break;
60
+ case ":thumbsdown:":
61
+ case ":dislike:":
62
+ reaction = "\uD83D\uDC4E";
63
+ break;
64
+ case ":heart:":
65
+ reaction = "\u2764";
66
+ break;
67
+ case ":glowingheart:":
68
+ reaction = "\uD83D\uDC97";
69
+ break;
70
+ default:
71
+ if (forceCustomReaction) {
72
+ break;
73
+ }
74
+ return callback({ error: "Reaction is not a valid emoji." });
75
+ }
76
+
77
+ var variables = {
78
+ data: {
79
+ client_mutation_id: ctx.clientMutationId++,
80
+ actor_id: ctx.userID,
81
+ action: reaction == "" ? "REMOVE_REACTION" : "ADD_REACTION",
82
+ message_id: messageID,
83
+ reaction: reaction
84
+ }
85
+ };
86
+
87
+ var qs = {
88
+ doc_id: "1491398900900362",
89
+ variables: JSON.stringify(variables),
90
+ dpr: 1
91
+ };
92
+
93
+ defaultFuncs
94
+ .postFormData(
95
+ "https://www.facebook.com/webgraphql/mutation/",
96
+ ctx.jar,
97
+ {},
98
+ qs
99
+ )
100
+ .then(utils.parseAndCheckLogin(ctx.jar, defaultFuncs))
101
+ .then(function(resData) {
102
+ if (!resData) {
103
+ throw { error: "setReaction returned empty object." };
104
+ }
105
+ if (resData.error) {
106
+ throw resData;
107
+ }
108
+ callback(null);
109
+ })
110
+ .catch(function(err) {
111
+ log.error("setReaction", err);
112
+ return callback(err);
113
+ });
114
+
115
+ return returnPromise;
116
+ };
117
+ };
@@ -1,102 +1,76 @@
1
- /**
2
- * @fix by NTKhang
3
- * update as Thursday, 10 February 2022
4
- * do not remove the author name to get more updates
5
- */
6
-
7
- "use strict";
8
-
9
- var utils = require("../utils");
10
- var log = require("npmlog");
11
-
12
- function formatData(resData) {
13
- return {
14
- viewer_feedback_reaction_info: resData.feedback_react.feedback.viewer_feedback_reaction_info,
15
- supported_reactions: resData.feedback_react.feedback.supported_reactions,
16
- top_reactions: resData.feedback_react.feedback.top_reactions.edges,
17
- reaction_count: resData.feedback_react.feedback.reaction_count
18
- };
19
- }
20
-
21
- module.exports = function(defaultFuncs, api, ctx) {
22
- return function setPostReaction(postID, type, callback) {
23
- var resolveFunc = function(){};
24
- var rejectFunc = function(){};
25
- var returnPromise = new Promise(function (resolve, reject) {
26
- resolveFunc = resolve;
27
- rejectFunc = reject;
28
- });
29
-
30
- if (!callback) {
31
- if (utils.getType(type) === "Function" || utils.getType(type) === "AsyncFunction") {
32
- callback = type;
33
- type = 0;
34
- }
35
- else {
36
- callback = function (err, data) {
37
- if (err) {
38
- return rejectFunc(err);
39
- }
40
- resolveFunc(data);
41
- };
42
- }
43
- }
44
-
45
- var map = {
46
- unlike: 0,
47
- like: 1,
48
- heart: 2,
49
- love: 16,
50
- haha: 4,
51
- wow: 3,
52
- sad: 7,
53
- angry: 8
54
- };
55
-
56
- if (utils.getType(type) !== "Number" && utils.getType(type) === "String") {
57
- type = map[type.toLowerCase()];
58
- }
59
- else {
60
- throw {
61
- error: "setPostReaction: Invalid reaction type"
62
- };
63
- }
64
-
65
- var form = {
66
- av: ctx.userID,
67
- fb_api_caller_class: "RelayModern",
68
- fb_api_req_friendly_name: "CometUFIFeedbackReactMutation",
69
- doc_id: "4769042373179384",
70
- variables: JSON.stringify({
71
- input: {
72
- actor_id: ctx.userID,
73
- feedback_id: (new Buffer.from("feedback:" + postID)).toString("base64"),
74
- feedback_reaction: type,
75
- feedback_source: "OBJECT",
76
- is_tracking_encrypted: true,
77
- tracking: [],
78
- session_id: "f7dd50dd-db6e-4598-8cd9-561d5002b423",
79
- client_mutation_id: Math.round(Math.random() * 19).toString()
80
- },
81
- useDefaultActor: false,
82
- scale: 3
83
- })
84
- };
85
-
86
- defaultFuncs
87
- .post("https://www.facebook.com/api/graphql/", ctx.jar, form)
88
- .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
89
- .then(function(resData) {
90
- if (resData.errors) {
91
- throw resData;
92
- }
93
- return callback(null, formatData(resData.data));
94
- })
95
- .catch(function(err) {
96
- log.error("setPostReaction", err);
97
- return callback(err);
98
- });
99
-
100
- return returnPromise;
101
- };
102
- };
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function(defaultFuncs, api, ctx) {
7
+ return function unsendMessage(postID, type, callback) {
8
+ var resolveFunc = function(){};
9
+ var rejectFunc = function(){};
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+
15
+ if (!callback) {
16
+ callback = function (err, friendList) {
17
+ if (err) {
18
+ return rejectFunc(err);
19
+ }
20
+ resolveFunc(friendList);
21
+ };
22
+ }
23
+
24
+ var map = {
25
+ like: 1,
26
+ heart: 2,
27
+ wow: 3,
28
+ haha: 4,
29
+ sad: 7,
30
+ angry: 8
31
+ };
32
+ if (typeof type != "number") {
33
+ type = map[type.toLocaleLowerCase()];
34
+ if (!type) {
35
+ type = 1;
36
+ }
37
+ }
38
+ var form = {
39
+ av: ctx.userID,
40
+ fb_api_caller_class: "RelayModern",
41
+ fb_api_req_friendly_name: "UFI2FeedbackReactMutation",
42
+ //This doc_id is valid as of January 17th, 2020
43
+ doc_id: "2580813318646067",
44
+ variables: JSON.stringify({
45
+ input: {
46
+ client_mutation_id: "7",
47
+ actor_id: ctx.userID,
48
+ feedback_reaction: type,
49
+
50
+ },
51
+ useDefaultActor: true
52
+ })
53
+ };
54
+
55
+ defaultFuncs
56
+ .post(
57
+ "https://www.facebook.com/api/graphql/",
58
+ ctx.jar,
59
+ form
60
+ )
61
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
62
+ .then(function(resData) {
63
+ if (resData.error) {
64
+ throw resData;
65
+ }
66
+
67
+ return callback();
68
+ })
69
+ .catch(function(err) {
70
+ log.error("setPostReaction", err);
71
+ return callback(err);
72
+ });
73
+
74
+ return returnPromise;
75
+ };
76
+ };
@@ -1,74 +1,86 @@
1
- "use strict";
2
-
3
- var utils = require("../utils");
4
- var log = require("npmlog");
5
-
6
- module.exports = function (defaultFuncs, api, ctx) {
7
- return function setTitle(newTitle, threadID, callback) {
8
- if (
9
- !callback &&
10
- (utils.getType(threadID) === "Function" ||
11
- utils.getType(threadID) === "AsyncFunction")
12
- ) throw { error: "please pass a threadID as a second argument." };
13
-
14
-
15
- var resolveFunc = function () { };
16
- var rejectFunc = function () { };
17
- var returnPromise = new Promise(function (resolve, reject) {
18
- resolveFunc = resolve;
19
- rejectFunc = reject;
20
- });
21
-
22
- if (!callback) {
23
- callback = function (err, data) {
24
- if (err) return rejectFunc(err);
25
- resolveFunc(data);
26
- };
27
- }
28
-
29
- var messageAndOTID = utils.generateOfflineThreadingID();
30
- var form = {
31
- client: "mercury",
32
- action_type: "ma-type:log-message",
33
- author: "fbid:" + ctx.userID,
34
- author_email: "",
35
- coordinates: "",
36
- timestamp: Date.now(),
37
- timestamp_absolute: "Today",
38
- timestamp_relative: utils.generateTimestampRelative(),
39
- timestamp_time_passed: "0",
40
- is_unread: false,
41
- is_cleared: false,
42
- is_forward: false,
43
- is_filtered_content: false,
44
- is_spoof_warning: false,
45
- source: "source:chat:web",
46
- "source_tags[0]": "source:chat",
47
- status: "0",
48
- offline_threading_id: messageAndOTID,
49
- message_id: messageAndOTID,
50
- threading_id: utils.generateThreadingID(ctx.clientID),
51
- manual_retry_cnt: "0",
52
- thread_fbid: threadID,
53
- thread_name: newTitle,
54
- thread_id: threadID,
55
- log_message_type: "log:thread-name"
56
- };
57
-
58
- defaultFuncs
59
- .post("https://www.facebook.com/messaging/set_thread_name/", ctx.jar, form)
60
- .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
61
- .then(function (resData) {
62
- if (resData.error && resData.error === 1545012) throw { error: "Cannot change chat title: Not member of chat." };
63
- if (resData.error && resData.error === 1545003) throw { error: "Cannot set title of single-user chat." };
64
- if (resData.error) throw resData;
65
- return callback();
66
- })
67
- .catch(function (err) {
68
- log.error("setTitle", err);
69
- return callback(err);
70
- });
71
-
72
- return returnPromise;
73
- };
74
- };
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function(defaultFuncs, api, ctx) {
7
+ return function setTitle(newTitle, threadID, callback) {
8
+ if (
9
+ !callback &&
10
+ (utils.getType(threadID) === "Function" ||
11
+ utils.getType(threadID) === "AsyncFunction")
12
+ ) {
13
+ throw { error: "please pass a threadID as a second argument." };
14
+ }
15
+
16
+ var resolveFunc = function(){};
17
+ var rejectFunc = function(){};
18
+ var returnPromise = new Promise(function (resolve, reject) {
19
+ resolveFunc = resolve;
20
+ rejectFunc = reject;
21
+ });
22
+
23
+ if (!callback) {
24
+ callback = function (err, friendList) {
25
+ if (err) {
26
+ return rejectFunc(err);
27
+ }
28
+ resolveFunc(friendList);
29
+ };
30
+ }
31
+
32
+ var messageAndOTID = utils.generateOfflineThreadingID();
33
+ var form = {
34
+ client: "mercury",
35
+ action_type: "ma-type:log-message",
36
+ author: "fbid:" + ctx.userID,
37
+ author_email: "",
38
+ coordinates: "",
39
+ timestamp: Date.now(),
40
+ timestamp_absolute: "Today",
41
+ timestamp_relative: utils.generateTimestampRelative(),
42
+ timestamp_time_passed: "0",
43
+ is_unread: false,
44
+ is_cleared: false,
45
+ is_forward: false,
46
+ is_filtered_content: false,
47
+ is_spoof_warning: false,
48
+ source: "source:chat:web",
49
+ "source_tags[0]": "source:chat",
50
+ status: "0",
51
+ offline_threading_id: messageAndOTID,
52
+ message_id: messageAndOTID,
53
+ threading_id: utils.generateThreadingID(ctx.clientID),
54
+ manual_retry_cnt: "0",
55
+ thread_fbid: threadID,
56
+ thread_name: newTitle,
57
+ thread_id: threadID,
58
+ log_message_type: "log:thread-name"
59
+ };
60
+
61
+ defaultFuncs
62
+ .post("https://www.facebook.com/messaging/set_thread_name/", ctx.jar, form)
63
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
64
+ .then(function(resData) {
65
+ if (resData.error && resData.error === 1545012) {
66
+ throw { error: "Cannot change chat title: Not member of chat." };
67
+ }
68
+
69
+ if (resData.error && resData.error === 1545003) {
70
+ throw { error: "Cannot set title of single-user chat." };
71
+ }
72
+
73
+ if (resData.error) {
74
+ throw resData;
75
+ }
76
+
77
+ return callback();
78
+ })
79
+ .catch(function(err) {
80
+ log.error("setTitle", err);
81
+ return callback(err);
82
+ });
83
+
84
+ return returnPromise;
85
+ };
86
+ };