alicezetion 1.7.0 → 1.7.1
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 +182 -495
- package/package.json +10 -8
- package/replit.nix +4 -6
- package/src/addExternalModule.js +15 -0
- package/{leiamnash → src}/addUserToGroup.js +16 -52
- package/src/changeAdminStatus.js +47 -0
- package/src/changeArchivedStatus.js +41 -0
- package/{leiamnash → src}/changeBio.js +6 -19
- package/{leiamnash → src}/changeBlockedStatus.js +3 -14
- package/{leiamnash → src}/changeGroupImage.js +16 -40
- package/src/changeNickname.js +43 -0
- package/{leiamnash → src}/changeThreadColor.js +10 -20
- package/src/changeThreadEmoji.js +41 -0
- package/src/chat.js +315 -0
- package/{leiamnash → src}/createNewGroup.js +12 -28
- package/{leiamnash → src}/createPoll.js +13 -25
- package/src/deleteMessage.js +44 -0
- package/src/deleteThread.js +42 -0
- package/src/forwardAttachment.js +47 -0
- package/src/forwardMessage.js +0 -0
- package/{leiamnash → src}/getCurrentUserID.js +1 -1
- package/{leiamnash → src}/getEmojiUrl.js +2 -4
- package/{leiamnash → src}/getFriendsList.js +10 -21
- package/{leiamnash → src}/getThreadHistory.js +58 -166
- package/{leiamnash → src}/getThreadHistoryDeprecated.js +20 -42
- package/src/getThreadInfo.js +171 -0
- package/src/getThreadInfoDeprecated.js +56 -0
- package/{leiamnash → src}/getThreadList.js +41 -66
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadPictures.js +59 -0
- package/{leiamnash → src}/getUserID.js +9 -14
- package/{leiamnash → src}/getUserInfo.js +12 -18
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +47 -0
- package/{leiamnash → src}/httpGet.js +12 -17
- package/{leiamnash → src}/httpPost.js +12 -17
- package/src/listen.js +553 -0
- package/src/listenMqtt-Test.js +687 -0
- package/src/listenMqtt.js +677 -0
- package/{leiamnash → src}/logout.js +13 -20
- package/{leiamnash → src}/markAsDelivered.js +11 -22
- package/{leiamnash → src}/markAsRead.js +11 -21
- package/{leiamnash → src}/markAsReadAll.js +10 -20
- package/{leiamnash → src}/markAsSeen.js +7 -18
- package/{leiamnash → src}/muteThread.js +11 -18
- package/src/removeUserFromGroup.js +45 -0
- package/{leiamnash → src}/resolvePhotoUrl.js +8 -17
- package/{leiamnash → src}/searchForThread.js +10 -21
- package/src/sendMessage.js +315 -0
- package/{leiamnash → src}/sendTypingIndicator.js +14 -47
- package/{leiamnash → src}/setMessageReaction.js +12 -26
- package/{leiamnash → src}/setPostReaction.js +13 -26
- package/{leiamnash → src}/setTitle.js +13 -29
- package/src/threadColors.js +41 -0
- package/{leiamnash → src}/unfriend.js +9 -19
- package/{leiamnash → src}/unsendMessage.js +9 -19
- 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 +1021 -1238
- package/leiamnash/addExternalModule.js +0 -19
- package/leiamnash/changeAdminStatus.js +0 -79
- package/leiamnash/changeApprovalMode.js +0 -80
- package/leiamnash/changeArchivedStatus.js +0 -55
- package/leiamnash/changeNickname.js +0 -59
- package/leiamnash/changeThreadEmoji.js +0 -55
- package/leiamnash/chat.js +0 -447
- package/leiamnash/deleteMessage.js +0 -56
- package/leiamnash/deleteThread.js +0 -56
- package/leiamnash/forwardAttachment.js +0 -60
- package/leiamnash/getThreadInfo.js +0 -212
- package/leiamnash/getThreadInfoDeprecated.js +0 -80
- package/leiamnash/getThreadListDeprecated.js +0 -75
- package/leiamnash/getThreadPictures.js +0 -79
- package/leiamnash/handleFriendRequest.js +0 -61
- package/leiamnash/handleMessageRequest.js +0 -65
- package/leiamnash/listenMqtt.js +0 -1129
- package/leiamnash/removeUserFromGroup.js +0 -79
- package/leiamnash/threadColors.js +0 -57
@@ -1,79 +0,0 @@
|
|
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 removeUserFromGroup(userID, 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
|
-
if (
|
16
|
-
utils.getType(threadID) !== "Number" &&
|
17
|
-
utils.getType(threadID) !== "String"
|
18
|
-
) {
|
19
|
-
throw {
|
20
|
-
error:
|
21
|
-
"threadID should be of type Number or String and not " +
|
22
|
-
utils.getType(threadID) +
|
23
|
-
"."
|
24
|
-
};
|
25
|
-
}
|
26
|
-
if (
|
27
|
-
utils.getType(userID) !== "Number" &&
|
28
|
-
utils.getType(userID) !== "String"
|
29
|
-
) {
|
30
|
-
throw {
|
31
|
-
error:
|
32
|
-
"userID should be of type Number or String and not " +
|
33
|
-
utils.getType(userID) +
|
34
|
-
"."
|
35
|
-
};
|
36
|
-
}
|
37
|
-
|
38
|
-
var resolveFunc = function(){};
|
39
|
-
var rejectFunc = function(){};
|
40
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
41
|
-
resolveFunc = resolve;
|
42
|
-
rejectFunc = reject;
|
43
|
-
});
|
44
|
-
|
45
|
-
if (!callback) {
|
46
|
-
callback = function (err, friendList) {
|
47
|
-
if (err) {
|
48
|
-
return rejectFunc(err);
|
49
|
-
}
|
50
|
-
resolveFunc(friendList);
|
51
|
-
};
|
52
|
-
}
|
53
|
-
|
54
|
-
var form = {
|
55
|
-
uid: userID,
|
56
|
-
tid: threadID
|
57
|
-
};
|
58
|
-
|
59
|
-
defaultFuncs
|
60
|
-
.post("https://www.facebook.com/chat/remove_participants", ctx.jar, form)
|
61
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
62
|
-
.then(function(resData) {
|
63
|
-
if (!resData) {
|
64
|
-
throw { error: "Remove from group failed." };
|
65
|
-
}
|
66
|
-
if (resData.error) {
|
67
|
-
throw resData;
|
68
|
-
}
|
69
|
-
|
70
|
-
return callback();
|
71
|
-
})
|
72
|
-
.catch(function(err) {
|
73
|
-
log.error("removeUserFromGroup", err);
|
74
|
-
return callback(err);
|
75
|
-
});
|
76
|
-
|
77
|
-
return returnPromise;
|
78
|
-
};
|
79
|
-
};
|
@@ -1,57 +0,0 @@
|
|
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
|
-
//Old hex colors.
|
7
|
-
////MessengerBlue: null,
|
8
|
-
////Viking: "#44bec7",
|
9
|
-
////GoldenPoppy: "#ffc300",
|
10
|
-
////RadicalRed: "#fa3c4c",
|
11
|
-
////Shocking: "#d696bb",
|
12
|
-
////PictonBlue: "#6699cc",
|
13
|
-
////FreeSpeechGreen: "#13cf13",
|
14
|
-
////Pumpkin: "#ff7e29",
|
15
|
-
////LightCoral: "#e68585",
|
16
|
-
////MediumSlateBlue: "#7646ff",
|
17
|
-
////DeepSkyBlue: "#20cef5",
|
18
|
-
////Fern: "#67b868",
|
19
|
-
////Cameo: "#d4a88c",
|
20
|
-
////BrilliantRose: "#ff5ca1",
|
21
|
-
////BilobaFlower: "#a695c7"
|
22
|
-
|
23
|
-
//#region This part is for backward compatibly
|
24
|
-
//trying to match the color one-by-one. kill me plz
|
25
|
-
MessengerBlue: "196241301102133", //DefaultBlue
|
26
|
-
Viking: "1928399724138152", //TealBlue
|
27
|
-
GoldenPoppy: "174636906462322", //Yellow
|
28
|
-
RadicalRed: "2129984390566328", //Red
|
29
|
-
Shocking: "2058653964378557", //LavenderPurple
|
30
|
-
FreeSpeechGreen: "2136751179887052", //Green
|
31
|
-
Pumpkin: "175615189761153", //Orange
|
32
|
-
LightCoral: "980963458735625", //CoralPink
|
33
|
-
MediumSlateBlue: "234137870477637", //BrightPurple
|
34
|
-
DeepSkyBlue: "2442142322678320", //AquaBlue
|
35
|
-
BrilliantRose: "169463077092846", //HotPink
|
36
|
-
//i've tried my best, everything else can't be mapped. (or is it?) -UIRI 2020
|
37
|
-
//#endregion
|
38
|
-
|
39
|
-
DefaultBlue: "196241301102133",
|
40
|
-
HotPink: "169463077092846",
|
41
|
-
AquaBlue: "2442142322678320",
|
42
|
-
BrightPurple: "234137870477637",
|
43
|
-
CoralPink: "980963458735625",
|
44
|
-
Orange: "175615189761153",
|
45
|
-
Green: "2136751179887052",
|
46
|
-
LavenderPurple: "2058653964378557",
|
47
|
-
Red: "2129984390566328",
|
48
|
-
Yellow: "174636906462322",
|
49
|
-
TealBlue: "1928399724138152",
|
50
|
-
Aqua: "417639218648241",
|
51
|
-
Mango: "930060997172551",
|
52
|
-
Berry: "164535220883264",
|
53
|
-
Citrus: "370940413392601",
|
54
|
-
Candy: "205488546921017",
|
55
|
-
//StarWars: "809305022860427" Removed.
|
56
|
-
};
|
57
|
-
};
|