alicezetion 1.2.4 → 1.2.6
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/index.js +10 -2
- package/leiamnash/addExternalModule.js +6 -10
- package/leiamnash/addUserToGroup.js +16 -52
- package/leiamnash/changeAdminStatus.js +37 -69
- package/leiamnash/changeArchivedStatus.js +12 -26
- package/leiamnash/changeBio.js +6 -19
- package/leiamnash/changeBlockedStatus.js +3 -14
- package/leiamnash/changeGroupImage.js +16 -40
- package/leiamnash/changeNickname.js +11 -27
- package/leiamnash/changeThreadColor.js +10 -20
- package/leiamnash/changeThreadEmoji.js +10 -24
- package/leiamnash/chat.js +279 -414
- package/leiamnash/createNewGroup.js +12 -28
- package/leiamnash/createPoll.js +13 -25
- package/leiamnash/deleteMessage.js +12 -24
- package/leiamnash/deleteThread.js +11 -25
- package/leiamnash/forwardAttachment.js +13 -26
- package/leiamnash/forwardMessage.js +0 -0
- package/leiamnash/getCurrentUserID.js +1 -1
- package/leiamnash/getEmojiUrl.js +2 -4
- package/leiamnash/getFriendsList.js +10 -21
- package/leiamnash/getThreadHistory.js +58 -166
- package/leiamnash/getThreadHistoryDeprecated.js +20 -42
- package/leiamnash/getThreadInfo.js +25 -60
- package/leiamnash/getThreadInfoDeprecated.js +18 -42
- package/leiamnash/getThreadList.js +41 -66
- package/leiamnash/getThreadListDeprecated.js +14 -43
- package/leiamnash/getThreadPictures.js +17 -37
- package/leiamnash/getUserID.js +9 -14
- package/leiamnash/getUserInfo.js +12 -18
- package/leiamnash/handleFriendRequest.js +37 -52
- package/leiamnash/handleMessageRequest.js +14 -32
- package/leiamnash/httpGet.js +12 -17
- package/leiamnash/httpPost.js +12 -17
- package/leiamnash/listen.js +553 -0
- package/leiamnash/listenMqtt-Test.js +687 -0
- package/leiamnash/listenMqtt.js +1 -2
- package/leiamnash/logout.js +13 -20
- package/leiamnash/markAsDelivered.js +11 -22
- package/leiamnash/markAsRead.js +11 -21
- package/leiamnash/markAsReadAll.js +10 -20
- package/leiamnash/markAsSeen.js +7 -18
- package/leiamnash/muteThread.js +11 -18
- package/leiamnash/removeUserFromGroup.js +14 -48
- package/leiamnash/resolvePhotoUrl.js +8 -17
- package/leiamnash/searchForThread.js +10 -21
- package/leiamnash/sendTypingIndicator.js +14 -47
- package/leiamnash/setMessageReaction.js +12 -26
- package/leiamnash/setPostReaction.js +13 -26
- package/leiamnash/setTitle.js +13 -29
- package/leiamnash/threadColors.js +28 -44
- package/leiamnash/unfriend.js +9 -19
- package/leiamnash/unsendMessage.js +9 -19
- package/package.json +1 -1
- package/replit.nix +1 -3
- package/utils.js +0 -0
@@ -3,34 +3,27 @@
|
|
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 changeThreadColor(color, threadID, 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
|
|
15
15
|
if (!callback) {
|
16
|
-
callback = function(err) {
|
17
|
-
if (err)
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
16
|
+
callback = function (err) {
|
17
|
+
if (err) return rejectFunc(err);
|
20
18
|
resolveFunc(err);
|
21
19
|
};
|
22
20
|
}
|
23
21
|
|
24
22
|
var validatedColor = color !== null ? color.toLowerCase() : color; // API only accepts lowercase letters in hex string
|
25
|
-
var colorList = Object.keys(api.threadColors).map(function(name) {
|
23
|
+
var colorList = Object.keys(api.threadColors).map(function (name) {
|
26
24
|
return api.threadColors[name];
|
27
25
|
});
|
28
|
-
if (!colorList.includes(validatedColor)) {
|
29
|
-
throw {
|
30
|
-
error:
|
31
|
-
"The color you are trying to use is not a valid thread color. Use api.threadColors to find acceptable values."
|
32
|
-
};
|
33
|
-
}
|
26
|
+
if (!colorList.includes(validatedColor)) throw { error: "The color you are trying to use is not a valid thread color. Use api.threadColors to find acceptable values." };
|
34
27
|
|
35
28
|
var form = {
|
36
29
|
dpr: 1,
|
@@ -54,14 +47,11 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
54
47
|
defaultFuncs
|
55
48
|
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
56
49
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
57
|
-
.then(function(resData) {
|
58
|
-
if (resData[resData.length - 1].error_results > 0)
|
59
|
-
throw resData[0].o0.errors;
|
60
|
-
}
|
61
|
-
|
50
|
+
.then(function (resData) {
|
51
|
+
if (resData[resData.length - 1].error_results > 0) throw resData[0].o0.errors;
|
62
52
|
return callback();
|
63
53
|
})
|
64
|
-
.catch(function(err) {
|
54
|
+
.catch(function (err) {
|
65
55
|
log.error("changeThreadColor", err);
|
66
56
|
return callback(err);
|
67
57
|
});
|
@@ -3,20 +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 changeThreadEmoji(emoji, threadID, 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
|
|
15
15
|
if (!callback) {
|
16
|
-
callback = function(err) {
|
17
|
-
if (err)
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
16
|
+
callback = function (err) {
|
17
|
+
if (err) return rejectFunc(err);
|
20
18
|
resolveFunc();
|
21
19
|
};
|
22
20
|
}
|
@@ -26,26 +24,14 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
26
24
|
};
|
27
25
|
|
28
26
|
defaultFuncs
|
29
|
-
.post(
|
30
|
-
"https://www.facebook.com/messaging/save_thread_emoji/?source=thread_settings&__pc=EXP1%3Amessengerdotcom_pkg",
|
31
|
-
ctx.jar,
|
32
|
-
form
|
33
|
-
)
|
27
|
+
.post("https://www.facebook.com/messaging/save_thread_emoji/?source=thread_settings&__pc=EXP1%3Amessengerdotcom_pkg", ctx.jar, form)
|
34
28
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
35
|
-
.then(function(resData) {
|
36
|
-
if (resData.error === 1357031) {
|
37
|
-
|
38
|
-
error:
|
39
|
-
"Trying to change emoji of a chat that doesn't exist. Have at least one message in the thread before trying to change the emoji."
|
40
|
-
};
|
41
|
-
}
|
42
|
-
if (resData.error) {
|
43
|
-
throw resData;
|
44
|
-
}
|
45
|
-
|
29
|
+
.then(function (resData) {
|
30
|
+
if (resData.error === 1357031) throw { error: "Trying to change emoji of a chat that doesn't exist. Have at least one message in the thread before trying to change the emoji." };
|
31
|
+
if (resData.error) throw resData;
|
46
32
|
return callback();
|
47
33
|
})
|
48
|
-
.catch(function(err) {
|
34
|
+
.catch(function (err) {
|
49
35
|
log.error("changeThreadEmoji", err);
|
50
36
|
return callback(err);
|
51
37
|
});
|