alicezetion 1.6.6 → 1.6.8
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 +804 -381
- package/leiamnash/addExternalModule.js +19 -19
- package/leiamnash/addUserToGroup.js +113 -113
- package/leiamnash/changeAdminStatus.js +79 -79
- package/leiamnash/changeApprovalMode.js +80 -0
- package/leiamnash/changeArchivedStatus.js +55 -55
- package/leiamnash/changeBio.js +77 -77
- package/leiamnash/changeBlockedStatus.js +47 -47
- package/leiamnash/changeGroupImage.js +129 -129
- package/leiamnash/changeNickname.js +59 -59
- package/leiamnash/changeThreadColor.js +71 -71
- package/leiamnash/changeThreadEmoji.js +55 -55
- package/leiamnash/chat.js +447 -459
- package/leiamnash/createNewGroup.js +86 -86
- package/leiamnash/createPoll.js +71 -71
- package/leiamnash/deleteMessage.js +56 -56
- package/leiamnash/deleteThread.js +56 -56
- package/leiamnash/forwardAttachment.js +60 -60
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +29 -29
- package/leiamnash/getFriendsList.js +84 -84
- package/leiamnash/getThreadHistory.js +645 -645
- package/leiamnash/getThreadHistoryDeprecated.js +93 -93
- package/leiamnash/getThreadInfo.js +212 -206
- package/leiamnash/getThreadInfoDeprecated.js +80 -80
- package/leiamnash/getThreadList.js +238 -238
- package/leiamnash/getThreadListDeprecated.js +75 -75
- package/leiamnash/getThreadPictures.js +79 -79
- package/leiamnash/getUserID.js +66 -66
- package/leiamnash/getUserInfo.js +72 -72
- package/leiamnash/handleFriendRequest.js +61 -61
- package/leiamnash/handleMessageRequest.js +65 -65
- package/leiamnash/httpGet.js +52 -52
- package/leiamnash/httpPost.js +52 -52
- package/leiamnash/listenMqtt.js +1129 -789
- package/leiamnash/logout.js +75 -75
- package/leiamnash/markAsDelivered.js +58 -58
- package/leiamnash/markAsRead.js +80 -80
- package/leiamnash/markAsReadAll.js +49 -49
- package/leiamnash/markAsSeen.js +59 -59
- package/leiamnash/muteThread.js +52 -52
- package/leiamnash/removeUserFromGroup.js +79 -79
- package/leiamnash/resolvePhotoUrl.js +45 -45
- package/leiamnash/searchForThread.js +53 -53
- package/leiamnash/sendTypingIndicator.js +103 -103
- package/leiamnash/setMessageReaction.js +117 -117
- package/leiamnash/setPostReaction.js +76 -76
- package/leiamnash/setTitle.js +86 -86
- package/leiamnash/threadColors.js +57 -57
- package/leiamnash/unfriend.js +52 -52
- package/leiamnash/unsendMessage.js +49 -49
- package/package.json +72 -72
- package/replit.nix +3 -0
- package/utils.js +196 -71
- package/leiamnash/listen.js +0 -553
@@ -1,71 +1,71 @@
|
|
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 changeThreadColor(color, threadID, 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) {
|
17
|
-
if (err) {
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
20
|
-
resolveFunc(err);
|
21
|
-
};
|
22
|
-
}
|
23
|
-
|
24
|
-
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) {
|
26
|
-
return api.threadColors[name];
|
27
|
-
});
|
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
|
-
}
|
34
|
-
|
35
|
-
var form = {
|
36
|
-
dpr: 1,
|
37
|
-
queries: JSON.stringify({
|
38
|
-
o0: {
|
39
|
-
//This doc_id is valid as of January 31, 2020
|
40
|
-
doc_id: "1727493033983591",
|
41
|
-
query_params: {
|
42
|
-
data: {
|
43
|
-
actor_id: ctx.userID,
|
44
|
-
client_mutation_id: "0",
|
45
|
-
source: "SETTINGS",
|
46
|
-
theme_id: validatedColor,
|
47
|
-
thread_id: threadID
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}
|
51
|
-
})
|
52
|
-
};
|
53
|
-
|
54
|
-
defaultFuncs
|
55
|
-
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
56
|
-
.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
|
-
|
62
|
-
return callback();
|
63
|
-
})
|
64
|
-
.catch(function(err) {
|
65
|
-
log.error("changeThreadColor", err);
|
66
|
-
return callback(err);
|
67
|
-
});
|
68
|
-
|
69
|
-
return returnPromise;
|
70
|
-
};
|
71
|
-
};
|
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 changeThreadColor(color, threadID, 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) {
|
17
|
+
if (err) {
|
18
|
+
return rejectFunc(err);
|
19
|
+
}
|
20
|
+
resolveFunc(err);
|
21
|
+
};
|
22
|
+
}
|
23
|
+
|
24
|
+
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) {
|
26
|
+
return api.threadColors[name];
|
27
|
+
});
|
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
|
+
}
|
34
|
+
|
35
|
+
var form = {
|
36
|
+
dpr: 1,
|
37
|
+
queries: JSON.stringify({
|
38
|
+
o0: {
|
39
|
+
//This doc_id is valid as of January 31, 2020
|
40
|
+
doc_id: "1727493033983591",
|
41
|
+
query_params: {
|
42
|
+
data: {
|
43
|
+
actor_id: ctx.userID,
|
44
|
+
client_mutation_id: "0",
|
45
|
+
source: "SETTINGS",
|
46
|
+
theme_id: validatedColor,
|
47
|
+
thread_id: threadID
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
})
|
52
|
+
};
|
53
|
+
|
54
|
+
defaultFuncs
|
55
|
+
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
56
|
+
.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
|
+
|
62
|
+
return callback();
|
63
|
+
})
|
64
|
+
.catch(function(err) {
|
65
|
+
log.error("changeThreadColor", err);
|
66
|
+
return callback(err);
|
67
|
+
});
|
68
|
+
|
69
|
+
return returnPromise;
|
70
|
+
};
|
71
|
+
};
|
@@ -1,55 +1,55 @@
|
|
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 changeThreadEmoji(emoji, threadID, 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) {
|
17
|
-
if (err) {
|
18
|
-
return rejectFunc(err);
|
19
|
-
}
|
20
|
-
resolveFunc();
|
21
|
-
};
|
22
|
-
}
|
23
|
-
var form = {
|
24
|
-
emoji_choice: emoji,
|
25
|
-
thread_or_other_fbid: threadID
|
26
|
-
};
|
27
|
-
|
28
|
-
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
|
-
)
|
34
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
35
|
-
.then(function(resData) {
|
36
|
-
if (resData.error === 1357031) {
|
37
|
-
throw {
|
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
|
-
|
46
|
-
return callback();
|
47
|
-
})
|
48
|
-
.catch(function(err) {
|
49
|
-
log.error("changeThreadEmoji", err);
|
50
|
-
return callback(err);
|
51
|
-
});
|
52
|
-
|
53
|
-
return returnPromise;
|
54
|
-
};
|
55
|
-
};
|
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 changeThreadEmoji(emoji, threadID, 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) {
|
17
|
+
if (err) {
|
18
|
+
return rejectFunc(err);
|
19
|
+
}
|
20
|
+
resolveFunc();
|
21
|
+
};
|
22
|
+
}
|
23
|
+
var form = {
|
24
|
+
emoji_choice: emoji,
|
25
|
+
thread_or_other_fbid: threadID
|
26
|
+
};
|
27
|
+
|
28
|
+
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
|
+
)
|
34
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
35
|
+
.then(function(resData) {
|
36
|
+
if (resData.error === 1357031) {
|
37
|
+
throw {
|
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
|
+
|
46
|
+
return callback();
|
47
|
+
})
|
48
|
+
.catch(function(err) {
|
49
|
+
log.error("changeThreadEmoji", err);
|
50
|
+
return callback(err);
|
51
|
+
});
|
52
|
+
|
53
|
+
return returnPromise;
|
54
|
+
};
|
55
|
+
};
|