alicezetion 1.7.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/replit/__replit_disk_meta.json +1 -1
- package/.cache/replit/nix/env.json +1 -1
- package/Extra/Database/index.js +399 -0
- package/Extra/Database/methods.js +286 -0
- package/Extra/ExtraAddons.js +213 -0
- package/Extra/ExtraGetThread.js +1 -0
- package/Extra/ExtraUptimeRobot.js +59 -0
- package/Extra/PM2/ecosystem.config.js +23 -0
- package/Extra/Src/Last-Run.js +48 -0
- package/Language/index.json +151 -0
- package/StateCrypt.js +22 -0
- package/broadcast.js +42 -0
- package/index.js +755 -533
- package/logger.js +21 -0
- package/package.json +35 -21
- package/replit.nix +0 -3
- package/src/addExternalModule.js +23 -0
- package/{leiamnash → src}/addUserToGroup.js +11 -23
- package/{leiamnash → src}/changeAdminStatus.js +32 -16
- package/{leiamnash → src}/changeArchivedStatus.js +9 -17
- package/src/changeAvt.js +91 -0
- package/{leiamnash → src}/changeBio.js +16 -24
- package/{leiamnash → src}/changeBlockedStatus.js +13 -18
- package/{leiamnash → src}/changeGroupImage.js +14 -23
- package/{leiamnash → src}/changeNickname.js +9 -14
- package/{leiamnash → src}/changeThreadColor.js +6 -10
- package/{leiamnash → src}/changeThreadEmoji.js +6 -11
- package/{leiamnash → src}/chat.js +116 -127
- package/{leiamnash → src}/createNewGroup.js +19 -27
- package/{leiamnash → src}/createPoll.js +6 -12
- package/{leiamnash → src}/deleteMessage.js +8 -13
- package/{leiamnash → src}/deleteThread.js +7 -14
- package/{leiamnash → src}/forwardAttachment.js +9 -16
- package/src/getAccessToken.js +32 -0
- package/{leiamnash → src}/getCurrentUserID.js +0 -0
- package/{leiamnash → src}/getEmojiUrl.js +1 -2
- package/{leiamnash → src}/getFriendsList.js +11 -14
- package/src/getMessage.js +84 -0
- package/{leiamnash → src}/getThreadHistory.js +27 -38
- package/{leiamnash → src}/getThreadHistoryDeprecated.js +14 -25
- package/src/getThreadInfo.js +197 -0
- package/{leiamnash → src}/getThreadInfoDeprecated.js +12 -24
- package/{leiamnash → src}/getThreadList.js +122 -88
- package/{leiamnash → src}/getThreadListDeprecated.js +9 -20
- package/{leiamnash → src}/getThreadPictures.js +9 -17
- package/{leiamnash → src}/getUserID.js +8 -11
- package/{leiamnash → src}/getUserInfo.js +12 -16
- package/src/getUserInfoV2.js +35 -0
- package/src/handleFriendRequest.js +47 -0
- package/{leiamnash → src}/handleMessageRequest.js +12 -22
- package/{leiamnash → src}/httpGet.js +15 -13
- package/{leiamnash → src}/httpPost.js +14 -13
- package/src/httpPostFormData.js +46 -0
- package/src/listenMqtt.js +1280 -0
- package/{leiamnash → src}/logout.js +7 -9
- package/{leiamnash → src}/markAsDelivered.js +14 -18
- package/{leiamnash → src}/markAsRead.js +30 -28
- package/{leiamnash → src}/markAsSeen.js +18 -19
- package/{leiamnash → src}/muteThread.js +7 -8
- package/{leiamnash/setMessageReaction.js → src/react.js} +15 -18
- package/{leiamnash → src}/removeUserFromGroup.js +13 -20
- package/{leiamnash → src}/resolvePhotoUrl.js +7 -13
- package/{leiamnash → src}/searchForThread.js +8 -13
- package/{leiamnash/markAsReadAll.js → src/seen.js} +10 -13
- package/{leiamnash → src}/sendTypingIndicator.js +23 -31
- package/src/setPostReaction.js +104 -0
- package/{leiamnash → src}/setTitle.js +15 -21
- package/src/threadColors.js +39 -0
- package/{leiamnash → src}/unfriend.js +9 -13
- package/{leiamnash/unsendMessage.js → src/unsend.js} +7 -16
- package/utils.js +1112 -1236
- package/leiamnash/addExternalModule.js +0 -19
- package/leiamnash/changeApprovalMode.js +0 -80
- package/leiamnash/getThreadInfo.js +0 -212
- package/leiamnash/handleFriendRequest.js +0 -61
- package/leiamnash/listenMqtt.js +0 -1129
- package/leiamnash/setPostReaction.js +0 -76
- package/leiamnash/threadColors.js +0 -57
@@ -0,0 +1,104 @@
|
|
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:
|
15
|
+
resData.feedback_react.feedback.viewer_feedback_reaction_info,
|
16
|
+
supported_reactions: resData.feedback_react.feedback.supported_reactions,
|
17
|
+
top_reactions: resData.feedback_react.feedback.top_reactions.edges,
|
18
|
+
reaction_count: resData.feedback_react.feedback.reaction_count
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
module.exports = function(defaultFuncs, api, ctx) {
|
23
|
+
return function setPostReaction(postID, type, callback) {
|
24
|
+
var resolveFunc = function() {};
|
25
|
+
var rejectFunc = function() {};
|
26
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
27
|
+
resolveFunc = resolve;
|
28
|
+
rejectFunc = reject;
|
29
|
+
});
|
30
|
+
|
31
|
+
if (!callback) {
|
32
|
+
if (
|
33
|
+
utils.getType(type) === "Function" ||
|
34
|
+
utils.getType(type) === "AsyncFunction"
|
35
|
+
) {
|
36
|
+
callback = type;
|
37
|
+
type = 0;
|
38
|
+
} else {
|
39
|
+
callback = function(err, data) {
|
40
|
+
if (err) {
|
41
|
+
return rejectFunc(err);
|
42
|
+
}
|
43
|
+
resolveFunc(data);
|
44
|
+
};
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
var map = {
|
49
|
+
unlike: 0,
|
50
|
+
like: 1,
|
51
|
+
heart: 2,
|
52
|
+
love: 16,
|
53
|
+
haha: 4,
|
54
|
+
wow: 3,
|
55
|
+
sad: 7,
|
56
|
+
angry: 8
|
57
|
+
};
|
58
|
+
|
59
|
+
if (utils.getType(type) !== "Number" && utils.getType(type) === "String") {
|
60
|
+
type = map[type.toLowerCase()];
|
61
|
+
} else {
|
62
|
+
throw {
|
63
|
+
error: "setPostReaction: Invalid reaction type"
|
64
|
+
};
|
65
|
+
}
|
66
|
+
|
67
|
+
var form = {
|
68
|
+
av: ctx.userID,
|
69
|
+
fb_api_caller_class: "RelayModern",
|
70
|
+
fb_api_req_friendly_name: "CometUFIFeedbackReactMutation",
|
71
|
+
doc_id: "4769042373179384",
|
72
|
+
variables: JSON.stringify({
|
73
|
+
input: {
|
74
|
+
actor_id: ctx.userID,
|
75
|
+
feedback_id: new Buffer.from("feedback:" + postID).toString("base64"),
|
76
|
+
feedback_reaction: type,
|
77
|
+
feedback_source: "OBJECT",
|
78
|
+
is_tracking_encrypted: true,
|
79
|
+
tracking: [],
|
80
|
+
session_id: "f7dd50dd-db6e-4598-8cd9-561d5002b423",
|
81
|
+
client_mutation_id: Math.round(Math.random() * 19).toString()
|
82
|
+
},
|
83
|
+
useDefaultActor: false,
|
84
|
+
scale: 3
|
85
|
+
})
|
86
|
+
};
|
87
|
+
|
88
|
+
defaultFuncs
|
89
|
+
.post("https://www.facebook.com/api/graphql/", ctx.jar, form)
|
90
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
91
|
+
.then(function(resData) {
|
92
|
+
if (resData.errors) {
|
93
|
+
throw resData;
|
94
|
+
}
|
95
|
+
return callback(null, formatData(resData.data));
|
96
|
+
})
|
97
|
+
.catch(function(err) {
|
98
|
+
log.error("setPostReaction", err);
|
99
|
+
return callback(err);
|
100
|
+
});
|
101
|
+
|
102
|
+
return returnPromise;
|
103
|
+
};
|
104
|
+
};
|
@@ -9,23 +9,20 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
9
9
|
!callback &&
|
10
10
|
(utils.getType(threadID) === "Function" ||
|
11
11
|
utils.getType(threadID) === "AsyncFunction")
|
12
|
-
)
|
12
|
+
)
|
13
13
|
throw { error: "please pass a threadID as a second argument." };
|
14
|
-
}
|
15
14
|
|
16
|
-
var resolveFunc = function(){};
|
17
|
-
var rejectFunc = function(){};
|
18
|
-
var returnPromise = new Promise(function
|
15
|
+
var resolveFunc = function() {};
|
16
|
+
var rejectFunc = function() {};
|
17
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
19
18
|
resolveFunc = resolve;
|
20
19
|
rejectFunc = reject;
|
21
20
|
});
|
22
21
|
|
23
22
|
if (!callback) {
|
24
|
-
callback = function
|
25
|
-
if (err)
|
26
|
-
|
27
|
-
}
|
28
|
-
resolveFunc(friendList);
|
23
|
+
callback = function(err, data) {
|
24
|
+
if (err) return rejectFunc(err);
|
25
|
+
resolveFunc(data);
|
29
26
|
};
|
30
27
|
}
|
31
28
|
|
@@ -59,21 +56,18 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
59
56
|
};
|
60
57
|
|
61
58
|
defaultFuncs
|
62
|
-
.post(
|
59
|
+
.post(
|
60
|
+
"https://www.facebook.com/messaging/set_thread_name/",
|
61
|
+
ctx.jar,
|
62
|
+
form
|
63
|
+
)
|
63
64
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
64
65
|
.then(function(resData) {
|
65
|
-
if (resData.error && resData.error === 1545012)
|
66
|
+
if (resData.error && resData.error === 1545012)
|
66
67
|
throw { error: "Cannot change chat title: Not member of chat." };
|
67
|
-
|
68
|
-
|
69
|
-
if (resData.error && resData.error === 1545003) {
|
68
|
+
if (resData.error && resData.error === 1545003)
|
70
69
|
throw { error: "Cannot set title of single-user chat." };
|
71
|
-
|
72
|
-
|
73
|
-
if (resData.error) {
|
74
|
-
throw resData;
|
75
|
-
}
|
76
|
-
|
70
|
+
if (resData.error) throw resData;
|
77
71
|
return callback();
|
78
72
|
})
|
79
73
|
.catch(function(err) {
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(_defaultFuncs, _api, _ctx) {
|
4
|
+
// Currently the only colors that can be passed to api.changeThreadColor(); may change if Facebook adds more
|
5
|
+
return {
|
6
|
+
////MessengerBlue: null,
|
7
|
+
////Viking: "#44bec7",
|
8
|
+
////GoldenPoppy: "#ffc300",
|
9
|
+
////RadicalRed: "#fa3c4c",
|
10
|
+
////Shocking: "#d696bb",
|
11
|
+
////PictonBlue: "#6699cc",
|
12
|
+
////FreeSpeechGreen: "#13cf13",
|
13
|
+
////Pumpkin: "#ff7e29",
|
14
|
+
////LightCoral: "#e68585",
|
15
|
+
////MediumSlateBlue: "#7646ff",
|
16
|
+
////DeepSkyBlue: "#20cef5",
|
17
|
+
////Fern: "#67b868",
|
18
|
+
////Cameo: "#d4a88c",
|
19
|
+
////BrilliantRose: "#ff5ca1",
|
20
|
+
////BilobaFlower: "#a695c7"
|
21
|
+
DefaultBlue: "196241301102133",
|
22
|
+
HotPink: "169463077092846",
|
23
|
+
AquaBlue: "2442142322678320",
|
24
|
+
BrightPurple: "234137870477637",
|
25
|
+
CoralPink: "980963458735625",
|
26
|
+
Orange: "175615189761153",
|
27
|
+
Green: "2136751179887052",
|
28
|
+
LavenderPurple: "2058653964378557",
|
29
|
+
Red: "2129984390566328",
|
30
|
+
Yellow: "174636906462322",
|
31
|
+
TealBlue: "1928399724138152",
|
32
|
+
Aqua: "417639218648241",
|
33
|
+
Mango: "930060997172551",
|
34
|
+
Berry: "164535220883264",
|
35
|
+
Citrus: "370940413392601",
|
36
|
+
Candy: "205488546921017",
|
37
|
+
StarWars: "809305022860427"
|
38
|
+
};
|
39
|
+
};
|
@@ -4,19 +4,17 @@ var utils = require("../utils");
|
|
4
4
|
var log = require("npmlog");
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
|
-
return function
|
8
|
-
var resolveFunc = function(){};
|
9
|
-
var rejectFunc = function(){};
|
10
|
-
var returnPromise = new Promise(function
|
7
|
+
return function unfriend(userID, callback) {
|
8
|
+
var resolveFunc = function() {};
|
9
|
+
var rejectFunc = function() {};
|
10
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
11
11
|
resolveFunc = resolve;
|
12
12
|
rejectFunc = reject;
|
13
13
|
});
|
14
14
|
|
15
15
|
if (!callback) {
|
16
|
-
callback = function
|
17
|
-
if (err)
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
16
|
+
callback = function(err, friendList) {
|
17
|
+
if (err) return rejectFunc(err);
|
20
18
|
resolveFunc(friendList);
|
21
19
|
};
|
22
20
|
}
|
@@ -25,7 +23,8 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
25
23
|
uid: userID,
|
26
24
|
unref: "bd_friends_tab",
|
27
25
|
floc: "friends_tab",
|
28
|
-
"nctr[_mod]":
|
26
|
+
"nctr[_mod]":
|
27
|
+
"pagelet_timeline_app_collection_" + ctx.userID + ":2356318349:2"
|
29
28
|
};
|
30
29
|
|
31
30
|
defaultFuncs
|
@@ -36,10 +35,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
36
35
|
)
|
37
36
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
38
37
|
.then(function(resData) {
|
39
|
-
if (resData.error)
|
40
|
-
throw resData;
|
41
|
-
}
|
42
|
-
|
38
|
+
if (resData.error) throw resData;
|
43
39
|
return callback();
|
44
40
|
})
|
45
41
|
.catch(function(err) {
|
@@ -5,18 +5,16 @@ var log = require("npmlog");
|
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function unsendMessage(messageID, callback) {
|
8
|
-
var resolveFunc = function(){};
|
9
|
-
var rejectFunc = function(){};
|
10
|
-
var returnPromise = new Promise(function
|
8
|
+
var resolveFunc = function() {};
|
9
|
+
var rejectFunc = function() {};
|
10
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
11
11
|
resolveFunc = resolve;
|
12
12
|
rejectFunc = reject;
|
13
13
|
});
|
14
14
|
|
15
15
|
if (!callback) {
|
16
|
-
callback = function
|
17
|
-
if (err)
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
16
|
+
callback = function(err, friendList) {
|
17
|
+
if (err) return rejectFunc(err);
|
20
18
|
resolveFunc(friendList);
|
21
19
|
};
|
22
20
|
}
|
@@ -26,17 +24,10 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
26
24
|
};
|
27
25
|
|
28
26
|
defaultFuncs
|
29
|
-
.post(
|
30
|
-
"https://www.facebook.com/messaging/unsend_message/",
|
31
|
-
ctx.jar,
|
32
|
-
form
|
33
|
-
)
|
27
|
+
.post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
|
34
28
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
35
29
|
.then(function(resData) {
|
36
|
-
if (resData.error)
|
37
|
-
throw resData;
|
38
|
-
}
|
39
|
-
|
30
|
+
if (resData.error) throw resData;
|
40
31
|
return callback();
|
41
32
|
})
|
42
33
|
.catch(function(err) {
|