alicezetion 1.7.5 → 1.7.7
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/.travis.yml +6 -0
- package/index.js +120 -655
- package/package.json +25 -37
- package/replit.nix +4 -3
- package/src/addExternalModule.js +5 -13
- package/src/addUserToGroup.js +12 -36
- package/src/changeAdminStatus.js +37 -85
- package/src/changeArchivedStatus.js +9 -15
- package/src/changeBio.js +8 -13
- package/src/changeBlockedStatus.js +8 -14
- package/src/changeGroupImage.js +13 -28
- package/src/changeNickname.js +11 -22
- package/src/changeThreadColor.js +10 -16
- package/src/changeThreadEmoji.js +9 -18
- package/src/chat.js +280 -401
- package/src/createNewGroup.js +10 -18
- package/src/createPoll.js +11 -17
- package/src/deleteMessage.js +10 -17
- package/src/deleteThread.js +10 -17
- package/src/forwardAttachment.js +9 -15
- package/src/forwardMessage.js +0 -0
- package/src/getCurrentUserID.js +1 -1
- package/src/getEmojiUrl.js +2 -3
- package/src/getFriendsList.js +10 -18
- package/src/getThreadHistory.js +59 -156
- package/src/getThreadHistoryDeprecated.js +15 -26
- package/src/getThreadInfo.js +42 -68
- package/src/getThreadInfoDeprecated.js +13 -25
- package/src/getThreadList.js +53 -112
- package/src/getThreadListDeprecated.js +12 -30
- package/src/getThreadPictures.js +13 -25
- package/src/getUserID.js +7 -9
- package/src/getUserInfo.js +10 -12
- package/src/handleFriendRequest.js +35 -36
- package/src/handleMessageRequest.js +10 -18
- package/src/httpGet.js +13 -20
- package/src/httpPost.js +13 -19
- package/src/listen.js +553 -0
- package/src/listenMqtt-Test.js +687 -0
- package/src/listenMqtt.js +621 -1224
- package/src/logout.js +13 -18
- package/src/markAsDelivered.js +10 -17
- package/src/markAsRead.js +24 -36
- package/src/{seen.js → markAsReadAll.js} +10 -17
- package/src/markAsSeen.js +12 -22
- package/src/muteThread.js +9 -15
- package/src/removeUserFromGroup.js +11 -38
- package/src/resolvePhotoUrl.js +6 -9
- package/src/searchForThread.js +8 -14
- package/src/sendMessage.js +315 -0
- package/src/sendTypingIndicator.js +19 -44
- package/src/{react.js → setMessageReaction.js} +9 -20
- package/src/setPostReaction.js +22 -63
- package/src/setTitle.js +12 -22
- package/src/threadColors.js +19 -17
- package/src/unfriend.js +9 -15
- package/src/{unsend.js → unsendMessage.js} +8 -9
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +27 -120
- package/Extra/Database/index.js +0 -399
- package/Extra/Database/methods.js +0 -286
- package/Extra/ExtraAddons.js +0 -213
- package/Extra/ExtraGetThread.js +0 -1
- package/Extra/ExtraUptimeRobot.js +0 -59
- package/Extra/PM2/ecosystem.config.js +0 -23
- package/Extra/Src/Last-Run.js +0 -48
- package/Language/index.json +0 -151
- package/StateCrypt.js +0 -22
- package/broadcast.js +0 -42
- package/logger.js +0 -21
- package/src/changeAvt.js +0 -91
- package/src/getAccessToken.js +0 -32
- package/src/getMessage.js +0 -84
- package/src/getUserInfoV2.js +0 -35
- package/src/httpPostFormData.js +0 -46
package/src/changeThreadColor.js
CHANGED
@@ -3,31 +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() {};
|
10
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
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(err) {
|
16
|
+
callback = function (err) {
|
17
17
|
if (err) return rejectFunc(err);
|
18
18
|
resolveFunc(err);
|
19
19
|
};
|
20
20
|
}
|
21
21
|
|
22
22
|
var validatedColor = color !== null ? color.toLowerCase() : color; // API only accepts lowercase letters in hex string
|
23
|
-
var colorList = Object.keys(api.threadColors).map(function(name) {
|
23
|
+
var colorList = Object.keys(api.threadColors).map(function (name) {
|
24
24
|
return api.threadColors[name];
|
25
25
|
});
|
26
|
-
if (!colorList.includes(validatedColor))
|
27
|
-
throw {
|
28
|
-
error:
|
29
|
-
"The color you are trying to use is not a valid thread color. Use api.threadColors to find acceptable values."
|
30
|
-
};
|
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." };
|
31
27
|
|
32
28
|
var form = {
|
33
29
|
dpr: 1,
|
@@ -51,13 +47,11 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
51
47
|
defaultFuncs
|
52
48
|
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
53
49
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
54
|
-
.then(function(resData) {
|
55
|
-
if (resData[resData.length - 1].error_results > 0)
|
56
|
-
throw resData[0].o0.errors;
|
57
|
-
|
50
|
+
.then(function (resData) {
|
51
|
+
if (resData[resData.length - 1].error_results > 0) throw resData[0].o0.errors;
|
58
52
|
return callback();
|
59
53
|
})
|
60
|
-
.catch(function(err) {
|
54
|
+
.catch(function (err) {
|
61
55
|
log.error("changeThreadColor", err);
|
62
56
|
return callback(err);
|
63
57
|
});
|
package/src/changeThreadEmoji.js
CHANGED
@@ -3,17 +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 changeThreadEmoji(emoji, threadID, callback) {
|
8
|
-
var resolveFunc = function() {};
|
9
|
-
var rejectFunc = function() {};
|
10
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
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(err) {
|
16
|
+
callback = function (err) {
|
17
17
|
if (err) return rejectFunc(err);
|
18
18
|
resolveFunc();
|
19
19
|
};
|
@@ -24,23 +24,14 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
24
24
|
};
|
25
25
|
|
26
26
|
defaultFuncs
|
27
|
-
.post(
|
28
|
-
"https://www.facebook.com/messaging/save_thread_emoji/?source=thread_settings&__pc=EXP1%3Amessengerdotcom_pkg",
|
29
|
-
ctx.jar,
|
30
|
-
form
|
31
|
-
)
|
27
|
+
.post("https://www.facebook.com/messaging/save_thread_emoji/?source=thread_settings&__pc=EXP1%3Amessengerdotcom_pkg", ctx.jar, form)
|
32
28
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
33
|
-
.then(function(resData) {
|
34
|
-
if (resData.error === 1357031)
|
35
|
-
throw {
|
36
|
-
error:
|
37
|
-
"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."
|
38
|
-
};
|
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." };
|
39
31
|
if (resData.error) throw resData;
|
40
|
-
|
41
32
|
return callback();
|
42
33
|
})
|
43
|
-
.catch(function(err) {
|
34
|
+
.catch(function (err) {
|
44
35
|
log.error("changeThreadEmoji", err);
|
45
36
|
return callback(err);
|
46
37
|
});
|