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
@@ -5,25 +5,20 @@ var log = require("npmlog");
|
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function handleMessageRequest(threadID, accept, callback) {
|
8
|
-
if (utils.getType(accept) !== "Boolean")
|
9
|
-
throw {
|
10
|
-
error: "Please pass a boolean as a second argument."
|
11
|
-
};
|
12
|
-
}
|
8
|
+
if (utils.getType(accept) !== "Boolean")
|
9
|
+
throw { error: "Please pass a boolean as a second argument." };
|
13
10
|
|
14
|
-
var resolveFunc = function(){};
|
15
|
-
var rejectFunc = function(){};
|
16
|
-
var returnPromise = new Promise(function
|
11
|
+
var resolveFunc = function() {};
|
12
|
+
var rejectFunc = function() {};
|
13
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
17
14
|
resolveFunc = resolve;
|
18
15
|
rejectFunc = reject;
|
19
16
|
});
|
20
17
|
|
21
18
|
if (!callback) {
|
22
|
-
callback = function
|
23
|
-
if (err)
|
24
|
-
|
25
|
-
}
|
26
|
-
resolveFunc(friendList);
|
19
|
+
callback = function(err, data) {
|
20
|
+
if (err) return rejectFunc(err);
|
21
|
+
resolveFunc(data);
|
27
22
|
};
|
28
23
|
}
|
29
24
|
|
@@ -31,15 +26,12 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
31
26
|
client: "mercury"
|
32
27
|
};
|
33
28
|
|
34
|
-
if (utils.getType(threadID) !== "Array")
|
35
|
-
threadID = [threadID];
|
36
|
-
}
|
29
|
+
if (utils.getType(threadID) !== "Array") threadID = [threadID];
|
37
30
|
|
38
31
|
var messageBox = accept ? "inbox" : "other";
|
39
32
|
|
40
|
-
for (var i = 0; i < threadID.length; i++)
|
33
|
+
for (var i = 0; i < threadID.length; i++)
|
41
34
|
form[messageBox + "[" + i + "]"] = threadID[i];
|
42
|
-
}
|
43
35
|
|
44
36
|
defaultFuncs
|
45
37
|
.post(
|
@@ -49,9 +41,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
49
41
|
)
|
50
42
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
51
43
|
.then(function(resData) {
|
52
|
-
if (resData.error)
|
53
|
-
throw resData;
|
54
|
-
}
|
44
|
+
if (resData.error) throw resData;
|
55
45
|
|
56
46
|
return callback();
|
57
47
|
})
|
@@ -59,7 +49,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
59
49
|
log.error("handleMessageRequest", err);
|
60
50
|
return callback(err);
|
61
51
|
});
|
62
|
-
|
52
|
+
|
63
53
|
return returnPromise;
|
64
54
|
};
|
65
55
|
};
|
@@ -5,32 +5,36 @@ var log = require("npmlog");
|
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function httpGet(url, form, callback, notAPI) {
|
8
|
-
var resolveFunc = function(){};
|
9
|
-
var rejectFunc = function(){};
|
8
|
+
var resolveFunc = function() {};
|
9
|
+
var rejectFunc = function() {};
|
10
10
|
|
11
|
-
var returnPromise = new Promise(function
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
12
|
resolveFunc = resolve;
|
13
13
|
rejectFunc = reject;
|
14
14
|
});
|
15
15
|
|
16
|
-
if (
|
16
|
+
if (
|
17
|
+
!callback &&
|
18
|
+
(utils.getType(form) == "Function" ||
|
19
|
+
utils.getType(form) == "AsyncFunction")
|
20
|
+
) {
|
17
21
|
callback = form;
|
18
22
|
form = {};
|
19
23
|
}
|
20
|
-
|
24
|
+
|
21
25
|
form = form || {};
|
22
26
|
|
23
|
-
callback =
|
27
|
+
callback =
|
28
|
+
callback ||
|
29
|
+
function(err, data) {
|
24
30
|
if (err) return rejectFunc(err);
|
25
31
|
resolveFunc(data);
|
26
|
-
|
32
|
+
};
|
27
33
|
|
28
34
|
if (notAPI) {
|
29
35
|
utils
|
30
36
|
.get(url, ctx.jar, form, ctx.globalOptions)
|
31
|
-
.then(
|
32
|
-
callback(null, resData.body.toString());
|
33
|
-
})
|
37
|
+
.then(resData => callback(null, resData.body.toString()))
|
34
38
|
.catch(function(err) {
|
35
39
|
log.error("httpGet", err);
|
36
40
|
return callback(err);
|
@@ -38,9 +42,7 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
38
42
|
} else {
|
39
43
|
defaultFuncs
|
40
44
|
.get(url, ctx.jar, form)
|
41
|
-
.then(
|
42
|
-
callback(null, resData.body.toString());
|
43
|
-
})
|
45
|
+
.then(resData => callback(null, resData.body.toString()))
|
44
46
|
.catch(function(err) {
|
45
47
|
log.error("httpGet", err);
|
46
48
|
return callback(err);
|
@@ -5,32 +5,36 @@ var log = require("npmlog");
|
|
5
5
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
7
7
|
return function httpGet(url, form, callback, notAPI) {
|
8
|
-
var resolveFunc = function(){};
|
9
|
-
var rejectFunc = function(){};
|
8
|
+
var resolveFunc = function() {};
|
9
|
+
var rejectFunc = function() {};
|
10
10
|
|
11
|
-
var returnPromise = new Promise(function
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
12
|
resolveFunc = resolve;
|
13
13
|
rejectFunc = reject;
|
14
14
|
});
|
15
15
|
|
16
|
-
if (
|
16
|
+
if (
|
17
|
+
!callback &&
|
18
|
+
(utils.getType(form) == "Function" ||
|
19
|
+
utils.getType(form) == "AsyncFunction")
|
20
|
+
) {
|
17
21
|
callback = form;
|
18
22
|
form = {};
|
19
23
|
}
|
20
24
|
|
21
25
|
form = form || {};
|
22
26
|
|
23
|
-
callback =
|
27
|
+
callback =
|
28
|
+
callback ||
|
29
|
+
function(err, data) {
|
24
30
|
if (err) return rejectFunc(err);
|
25
31
|
resolveFunc(data);
|
26
|
-
|
32
|
+
};
|
27
33
|
|
28
34
|
if (notAPI) {
|
29
35
|
utils
|
30
36
|
.post(url, ctx.jar, form, ctx.globalOptions)
|
31
|
-
.then(
|
32
|
-
callback(null, resData.body.toString());
|
33
|
-
})
|
37
|
+
.then(resData => callback(null, resData.body.toString()))
|
34
38
|
.catch(function(err) {
|
35
39
|
log.error("httpPost", err);
|
36
40
|
return callback(err);
|
@@ -38,15 +42,12 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
38
42
|
} else {
|
39
43
|
defaultFuncs
|
40
44
|
.post(url, ctx.jar, form, {})
|
41
|
-
.then(
|
42
|
-
callback(null, resData.body.toString());
|
43
|
-
})
|
45
|
+
.then(resData => callback(null, resData.body.toString()))
|
44
46
|
.catch(function(err) {
|
45
47
|
log.error("httpPost", err);
|
46
48
|
return callback(err);
|
47
49
|
});
|
48
50
|
}
|
49
|
-
|
50
51
|
return returnPromise;
|
51
52
|
};
|
52
53
|
};
|
@@ -0,0 +1,46 @@
|
|
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 httpPostFormData(url, form, callback) {
|
8
|
+
var resolveFunc = function() {};
|
9
|
+
var rejectFunc = function() {};
|
10
|
+
|
11
|
+
var returnPromise = new Promise(function(resolve, reject) {
|
12
|
+
resolveFunc = resolve;
|
13
|
+
rejectFunc = reject;
|
14
|
+
});
|
15
|
+
|
16
|
+
if (
|
17
|
+
!callback &&
|
18
|
+
(utils.getType(form) == "Function" ||
|
19
|
+
utils.getType(form) == "AsyncFunction")
|
20
|
+
) {
|
21
|
+
callback = form;
|
22
|
+
form = {};
|
23
|
+
}
|
24
|
+
|
25
|
+
form = form || {};
|
26
|
+
|
27
|
+
callback =
|
28
|
+
callback ||
|
29
|
+
function(err, data) {
|
30
|
+
if (err) return rejectFunc(err);
|
31
|
+
resolveFunc(data);
|
32
|
+
};
|
33
|
+
|
34
|
+
defaultFuncs
|
35
|
+
.postFormData(url, ctx.jar, form)
|
36
|
+
.then(function(resData) {
|
37
|
+
callback(null, resData.body.toString());
|
38
|
+
})
|
39
|
+
.catch(function(err) {
|
40
|
+
log.error("httpPostFormData", err);
|
41
|
+
return callback(err);
|
42
|
+
});
|
43
|
+
|
44
|
+
return returnPromise;
|
45
|
+
};
|
46
|
+
};
|