alicezetion 1.5.3 → 1.5.5
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 +576 -382
- package/leiamnash/addExternalModule.js +19 -16
- package/leiamnash/addUserToGroup.js +113 -79
- package/leiamnash/changeAdminStatus.js +79 -79
- package/leiamnash/changeArchivedStatus.js +55 -41
- package/leiamnash/changeBio.js +77 -65
- package/leiamnash/changeBlockedStatus.js +47 -36
- package/leiamnash/changeGroupImage.js +129 -106
- package/leiamnash/changeNickname.js +59 -45
- package/leiamnash/changeThreadColor.js +71 -62
- package/leiamnash/changeThreadEmoji.js +55 -42
- package/leiamnash/chat.js +459 -374
- package/leiamnash/createNewGroup.js +86 -70
- package/leiamnash/createPoll.js +71 -60
- package/leiamnash/deleteMessage.js +56 -45
- package/leiamnash/deleteThread.js +56 -43
- package/leiamnash/forwardAttachment.js +60 -48
- package/leiamnash/getCurrentUserID.js +7 -7
- package/leiamnash/getEmojiUrl.js +29 -27
- package/leiamnash/getFriendsList.js +84 -73
- package/leiamnash/getThreadHistory.js +645 -537
- package/leiamnash/getThreadHistoryDeprecated.js +93 -0
- package/leiamnash/getThreadInfo.js +206 -425
- package/leiamnash/getThreadInfoDeprecated.js +80 -0
- package/leiamnash/getThreadList.js +238 -213
- package/leiamnash/getThreadListDeprecated.js +75 -0
- package/leiamnash/getThreadPictures.js +79 -59
- package/leiamnash/getUserID.js +66 -62
- package/leiamnash/getUserInfo.js +72 -113
- package/leiamnash/handleFriendRequest.js +61 -46
- package/leiamnash/handleMessageRequest.js +65 -49
- package/leiamnash/httpGet.js +52 -49
- package/leiamnash/httpPost.js +52 -48
- package/leiamnash/listenMqtt.js +789 -787
- package/leiamnash/logout.js +75 -68
- package/leiamnash/markAsDelivered.js +58 -48
- package/leiamnash/markAsRead.js +80 -70
- package/leiamnash/markAsReadAll.js +49 -42
- package/leiamnash/markAsSeen.js +59 -51
- package/leiamnash/muteThread.js +52 -47
- package/leiamnash/removeUserFromGroup.js +79 -49
- package/leiamnash/resolvePhotoUrl.js +45 -37
- package/leiamnash/searchForThread.js +53 -43
- package/leiamnash/sendTypingIndicator.js +103 -80
- package/leiamnash/setMessageReaction.js +117 -109
- package/leiamnash/setPostReaction.js +76 -102
- package/leiamnash/setTitle.js +86 -74
- package/leiamnash/threadColors.js +57 -39
- package/leiamnash/unfriend.js +52 -43
- package/leiamnash/unsendMessage.js +49 -40
- package/package.json +72 -90
- package/utils.js +1356 -1684
- package/Extra/Database/index.js +0 -469
- package/Extra/ExtraAddons.js +0 -82
- package/Extra/ExtraFindUID.js +0 -62
- package/Extra/ExtraGetThread.js +0 -340
- package/Extra/ExtraScreenShot.js +0 -430
- package/Extra/ExtraUptimeRobot.js +0 -38
- package/Extra/Html/Classic/script.js +0 -119
- package/Extra/Html/Classic/style.css +0 -8
- package/Extra/Security/AES_256_GCM/index.js +0 -0
- package/Extra/Security/Base/Step_1.js +0 -6
- package/Extra/Security/Base/Step_2.js +0 -22
- package/Extra/Security/Base/Step_3.js +0 -22
- package/Extra/Security/Base/index.js +0 -174
- package/Extra/Security/Index.js +0 -5
- package/Extra/Security/Step_1.js +0 -6
- package/Extra/Security/Step_2.js +0 -22
- package/Extra/Security/Step_3.js +0 -22
- package/Extra/Src/Change_Environment.js +0 -24
- package/Extra/Src/Check_Update.js +0 -67
- package/Extra/Src/History.js +0 -115
- package/Extra/Src/Instant_Update.js +0 -65
- package/Extra/Src/Last-Run.js +0 -65
- package/Extra/Src/Premium.js +0 -81
- package/Extra/Src/Release_Memory.js +0 -41
- package/Extra/Src/Websocket.js +0 -213
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/uuid.js +0 -137
- package/Func/AcceptAgreement.js +0 -31
- package/Func/ClearCache.js +0 -64
- package/Func/ReportV1.js +0 -54
- package/Language/index.json +0 -217
- package/Main.js +0 -1270
- package/broadcast.js +0 -40
- package/leiamnash/Dev_Horizon_Data.js +0 -125
- package/leiamnash/Premium.js +0 -25
- package/leiamnash/Screenshot.js +0 -83
- package/leiamnash/changeAvt.js +0 -85
- package/leiamnash/getAccessToken.js +0 -28
- package/leiamnash/getMessage.js +0 -80
- package/leiamnash/getThreadMain.js +0 -220
- package/leiamnash/getUID.js +0 -59
- package/leiamnash/getUserInfoMain.js +0 -65
- package/leiamnash/getUserInfoV2.js +0 -32
- package/leiamnash/getUserInfoV3.js +0 -63
- package/leiamnash/getUserInfoV4.js +0 -55
- package/leiamnash/getUserInfoV5.js +0 -61
- package/leiamnash/httpPostFormData.js +0 -41
- package/leiamnash/sendMessage.js +0 -379
- package/logger.js +0 -66
package/broadcast.js
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
switch (global.Fca.Require.FastConfig.BroadCast) {
|
4
|
-
case true: {
|
5
|
-
try {
|
6
|
-
var logger = global.Fca.Require.logger;
|
7
|
-
var Fetch = global.Fca.Require.Fetch;
|
8
|
-
Fetch.get("https://raw.githubusercontent.com/KanzuXHorizon/Global_Horizon/main/Fca_BroadCast.json").then(async (/** @type {{ body: { toString: () => string; }; }} */ res) => {
|
9
|
-
global.Fca.Data.BroadCast = JSON.parse(res.body.toString())
|
10
|
-
var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Ae Zui Zẻ Nhé !";
|
11
|
-
logger.Normal(random);
|
12
|
-
});
|
13
|
-
}
|
14
|
-
catch (e) {
|
15
|
-
console.log(e);
|
16
|
-
}
|
17
|
-
return setInterval(() => {
|
18
|
-
try {
|
19
|
-
try {
|
20
|
-
var logger = global.Fca.Require.logger;
|
21
|
-
var random = global.Fca.Data.BroadCast[Math.floor(Math.random() * global.Fca.Data.BroadCast.length)] || "Ae Zui Zẻ Nhé !";
|
22
|
-
logger.Normal(random);
|
23
|
-
}
|
24
|
-
catch (e) {
|
25
|
-
console.log(e);
|
26
|
-
return;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
catch (e) {
|
30
|
-
console.log(e);
|
31
|
-
}
|
32
|
-
},3600 * 1000);
|
33
|
-
}
|
34
|
-
case false: {
|
35
|
-
break;
|
36
|
-
}
|
37
|
-
default: {
|
38
|
-
break;
|
39
|
-
}
|
40
|
-
}
|
@@ -1,125 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
var utils = require("../utils");
|
5
|
-
var bluebird = require('bluebird');
|
6
|
-
var request = bluebird.promisify(require("request"));
|
7
|
-
|
8
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
9
|
-
return function getUserInfoV4(data, type, method, callback) {
|
10
|
-
var resolveFunc = function () { };
|
11
|
-
var rejectFunc = function () { };
|
12
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
13
|
-
resolveFunc = resolve;
|
14
|
-
rejectFunc = reject;
|
15
|
-
});
|
16
|
-
|
17
|
-
if (!callback) {
|
18
|
-
callback = function (err, userInfo) {
|
19
|
-
if (err) return rejectFunc(err);
|
20
|
-
resolveFunc(userInfo);
|
21
|
-
};
|
22
|
-
}
|
23
|
-
|
24
|
-
if (!data || !type || !method) return;
|
25
|
-
|
26
|
-
var Cluster = ['http://146.190.109.182:3874'];
|
27
|
-
var ursl = Cluster[Math.floor(Math.random() * Cluster.length)];
|
28
|
-
|
29
|
-
if (utils.getType(data) !== "Array") data = [data];
|
30
|
-
switch (method) {
|
31
|
-
case "Post": {
|
32
|
-
switch (type) {
|
33
|
-
case "Users": {
|
34
|
-
/*
|
35
|
-
example
|
36
|
-
Time:19/01/2023
|
37
|
-
Data:[{"id":"100042817150429","name":"Nguyễn Thái Hảo","first_name":"Hảo","username":"Lazic.Kanzu","link":"https://www.facebook.com/Lazic.Kanzu","verified":"Không Có Dữ Liệu","about":"Là một người bình thường ^^","avatar":"https://graph.facebook.com/100042817150429/picture?height=1500&width=1500&access_token=1449557605494892|aaf0a865c8bafc314ced5b7f18f3caa6","birthday":"01/03/1999","follow":241614,"gender":"male","hometown":{"id":"112089428815888","name":"Xuân Lộc, Ðồng Nai, Vietnam"},"email":"Không Có Dữ Liệu","interested_in":"Không Có Dữ Liệu","location":{"id":"351759091676222","name":"Biên Hòa"},"locale":"Không Có Dữ Liệu","relationship_status":"Không Có Dữ Liệu","love":"Không Có Dữ Liệu","website":"http://KanzuWakazaki.tk/","quotes":"The word impossible is not in my dictionary.","timezone":"Không Có Dữ Liệu","updated_time":"Không Có Dữ Liệu"}]
|
38
|
-
Type:Users
|
39
|
-
By:KanzuWakazaki
|
40
|
-
**/
|
41
|
-
let Time = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
|
42
|
-
return request({
|
43
|
-
url: ursl + '/post',
|
44
|
-
method: 'post',
|
45
|
-
headers: {
|
46
|
-
'user-agent': "Horizon/GlobalData/Client"
|
47
|
-
},
|
48
|
-
formData: {
|
49
|
-
Time: Time,
|
50
|
-
Data: JSON.stringify(data),
|
51
|
-
Type: "Users",
|
52
|
-
By: ctx.userID
|
53
|
-
}
|
54
|
-
}).then(dt => console.log(dt.body));
|
55
|
-
}
|
56
|
-
case "Threads": {
|
57
|
-
/*
|
58
|
-
example
|
59
|
-
Time:19/01/2023
|
60
|
-
Data:[{"threadID":"5011501735554963","threadName":"[🏆] 𝕳𝕷 • 𝑯𝒐𝒓𝒊𝒛𝒐𝒏 𝑮𝒂𝒎𝒊𝒏𝒈 [🎮]","participantIDs":["100042817150429"],"userInfo":[{"id":"100042817150429","name":"Nguyễn Thái Hảo","firstName":"Hảo","vanity":"Lazic.Kanzu","thumbSrc":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t39.30808-1/311136459_774539707316594_357342861145224378_n.jpg?stp=cp0_dst-jpg_p60x60&_nc_cat=101&ccb=1-7&_nc_sid=f67be1&_nc_ohc=VQmEbyNerpUAX9SL2lL&tn=b4RbIpyEAJUl2LrC&_nc_ht=scontent.fsgn5-14.fna&oh=00_AfDzMGWK-Hw8J8Ha_uZkNgwwIqX23W89p9vPbovDSrMFVw&oe=63CD7339","profileUrl":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t39.30808-1/311136459_774539707316594_357342861145224378_n.jpg?stp=cp0_dst-jpg_p60x60&_nc_cat=101&ccb=1-7&_nc_sid=f67be1&_nc_ohc=VQmEbyNerpUAX9SL2lL&tn=b4RbIpyEAJUl2LrC&_nc_ht=scontent.fsgn5-14.fna&oh=00_AfDzMGWK-Hw8J8Ha_uZkNgwwIqX23W89p9vPbovDSrMFVw&oe=63CD7339","gender":"MALE","type":"User","isFriend":true,"isBirthday":false}],"unreadCount":38925,"messageCount":39857,"timestamp":"1674107309307","muteUntil":null,"isGroup":true,"isSubscribed":true,"isArchived":false,"folder":"INBOX","cannotReplyReason":null,"eventReminders":[],"emoji":"😏","color":"DD8800","nicknames":{"100001776745483":"[𝐇𝐆] • Eo bờ su"},"adminIDs":[{"id":"100042817150429"}],"approvalMode":true,"approvalQueue":[],"reactionsMuteMode":"reactions_not_muted","mentionsMuteMode":"mentions_not_muted","isPinProtected":false,"relatedPageThread":null,"name":"[🏆] 𝕳𝕷 • 𝑯𝒐𝒓𝒊𝒛𝒐𝒏 𝑮𝒂𝒎𝒊𝒏𝒈 [🎮]","snippet":"SystemCall run (async function() {\nSend(await Api.getThreadInfo(Data.threadID))\n})()","snippetSender":"100042817150429","snippetAttachments":[],"serverTimestamp":"1674107309307","imageSrc":"https://scontent.fsgn5-14.fna.fbcdn.net/v/t1.15752-9/278020824_345766417524223_6790288127531819759_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=02e273&_nc_ohc=dfuXjxOR1BUAX-SUN1x&_nc_ht=scontent.fsgn5-14.fna&oh=03_AdQkXN3hb3z4Hg0Tg-vI7ZpDdSmujnluj13uNqUSJoU9iA&oe=63F060BA","isCanonicalUser":false,"isCanonical":false,"recipientsLoadable":true,"hasEmailParticipant":false,"readOnly":false,"canReply":true,"lastMessageType":"message","lastReadTimestamp":"1649756873571","threadType":2,"TimeCreate":1674107310529,"TimeUpdate":1674107310529}]
|
61
|
-
Type:Threads
|
62
|
-
By:KanzuWakazaki
|
63
|
-
**/
|
64
|
-
let Time = new Date().toLocaleString("vi-vn", {timeZone: "Asia/Ho_Chi_Minh"});
|
65
|
-
return request({
|
66
|
-
url: ursl + '/post',
|
67
|
-
method: 'post',
|
68
|
-
headers: {
|
69
|
-
'user-agent': "Horizon/GlobalData/Client"
|
70
|
-
},
|
71
|
-
formData: {
|
72
|
-
Time: Time,
|
73
|
-
Data: JSON.stringify(data),
|
74
|
-
Type: "Threads",
|
75
|
-
By: ctx.userID
|
76
|
-
}
|
77
|
-
}).then(dt => console.log(dt.body));
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
81
|
-
break;
|
82
|
-
case "Get": {
|
83
|
-
switch (type) {
|
84
|
-
case "Users": {
|
85
|
-
/* example
|
86
|
-
Requires:[5011501735554963]
|
87
|
-
Type:Threads
|
88
|
-
**/
|
89
|
-
|
90
|
-
//still operating until Feb 25
|
91
|
-
return request({
|
92
|
-
url: ursl + '/get',
|
93
|
-
method: 'post',
|
94
|
-
headers: {
|
95
|
-
'user-agent': "Horizon/GlobalData/Client"
|
96
|
-
},
|
97
|
-
formData: {
|
98
|
-
Requires: JSON.stringify(data),
|
99
|
-
Type: "Users"
|
100
|
-
}
|
101
|
-
}).then(dt => console.log(dt.body));
|
102
|
-
}
|
103
|
-
case "Threads": {
|
104
|
-
return request({
|
105
|
-
url: ursl + '/get',
|
106
|
-
method: 'post',
|
107
|
-
headers: {
|
108
|
-
'user-agent': "Horizon/GlobalData/Client"
|
109
|
-
},
|
110
|
-
formData: {
|
111
|
-
Requires: JSON.stringify(data),
|
112
|
-
Type: "Threads"
|
113
|
-
}
|
114
|
-
}).then(dt => console.log(dt.body));
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
break;
|
119
|
-
default:
|
120
|
-
return;
|
121
|
-
}
|
122
|
-
|
123
|
-
return returnPromise;
|
124
|
-
};
|
125
|
-
};
|
package/leiamnash/Premium.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var { join } = require('path');
|
4
|
-
var fs = require('fs');
|
5
|
-
|
6
|
-
|
7
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
8
|
-
return function(Name, args){
|
9
|
-
var Method = {};
|
10
|
-
fs.readdirSync(join(__dirname, "../Func")).filter((/** @type {string} */File) => File.endsWith(".js") && !File.includes('Dev_')).map((/** @type {string} */File) => Method[File.split('.').slice(0, -1).join('.')] = require(`../Func/${File}`)(defaultFuncs, api, ctx));
|
11
|
-
if (Method[Name] == undefined) {
|
12
|
-
return (`Method ${Name} not found`);
|
13
|
-
}
|
14
|
-
else {
|
15
|
-
try {
|
16
|
-
return Method[Name](args).then((/** @type {string} */Data) => {
|
17
|
-
return Data;
|
18
|
-
});
|
19
|
-
}
|
20
|
-
catch (e) {
|
21
|
-
console.log(e);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
};
|
25
|
-
};
|
package/leiamnash/Screenshot.js
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
|
5
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
6
|
-
var Coookie = JSON.parse(JSON.stringify(ctx.jar.getCookies("https://www.facebook.com").concat(ctx.jar.getCookies("https://facebook.com")).concat(ctx.jar.getCookies("https://www.messenger.com"))));
|
7
|
-
for (let i of Coookie) {
|
8
|
-
i.name = i.key;
|
9
|
-
i.domain = 'www.facebook.com';
|
10
|
-
delete i.key;
|
11
|
-
}
|
12
|
-
return function(Link, callback) {
|
13
|
-
var logger = require('../logger');
|
14
|
-
if (process.platform != 'win32') return logger.Error('Not Supported Platform');
|
15
|
-
else try {
|
16
|
-
let i = require('puppeteer');
|
17
|
-
}
|
18
|
-
catch (e) {
|
19
|
-
var { execSync } = require('child_process');
|
20
|
-
execSync('npm i puppeteer', { stdio: 'inherit' });
|
21
|
-
}
|
22
|
-
const Screenshot = require('../Extra/ExtraScreenShot');
|
23
|
-
var resolveFunc = function () { };
|
24
|
-
var rejectFunc = function () { };
|
25
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
26
|
-
resolveFunc = resolve;
|
27
|
-
rejectFunc = reject;
|
28
|
-
});
|
29
|
-
|
30
|
-
if (!callback) {
|
31
|
-
callback = function (err, data) {
|
32
|
-
if (err) return rejectFunc(err);
|
33
|
-
resolveFunc(data);
|
34
|
-
};
|
35
|
-
}
|
36
|
-
if (Link.includes('facebook.com') || Link.includes('Facebook.com') || Link.includes('fb')) {
|
37
|
-
let LinkSplit = Link.split('/');
|
38
|
-
if (LinkSplit.indexOf("https:") == 0) {
|
39
|
-
if (Link.includes('messages')) {
|
40
|
-
Screenshot.buffer(Link, {
|
41
|
-
cookies: Coookie
|
42
|
-
}).then(data => {
|
43
|
-
callback(null,data);
|
44
|
-
});
|
45
|
-
}
|
46
|
-
else if (!isNaN(LinkSplit[3]) && !Link.split('=')[1] && !isNaN(Link.split('=')[1])) {
|
47
|
-
api.sendMessage('Invaild link, format link: facebook.com/Lazic.Kanzu',global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
|
48
|
-
callback('Error Link', null);
|
49
|
-
}
|
50
|
-
else if (!isNaN(Link.split('=')[1]) && Link.split('=')[1]) {
|
51
|
-
let Format = `https://www.facebook.com/profile.php?id=${Link.split('=')[1]}`;
|
52
|
-
Screenshot.buffer(Format, {
|
53
|
-
cookies: Coookie
|
54
|
-
}).then(data => {
|
55
|
-
callback(null,data);
|
56
|
-
});
|
57
|
-
}
|
58
|
-
else {
|
59
|
-
let Format = `https://www.facebook.com/${LinkSplit[3]}`;
|
60
|
-
Screenshot.buffer(Format, {
|
61
|
-
cookies: Coookie
|
62
|
-
}).then(data => {
|
63
|
-
callback(null,data);
|
64
|
-
});
|
65
|
-
}
|
66
|
-
}
|
67
|
-
else {
|
68
|
-
let Form = `https://www.facebook.com/${LinkSplit[1]}`;
|
69
|
-
Screenshot.buffer(Form, {
|
70
|
-
cookies: Coookie
|
71
|
-
}).then(data => {
|
72
|
-
callback(null,data);
|
73
|
-
});
|
74
|
-
}
|
75
|
-
}
|
76
|
-
else {
|
77
|
-
Screenshot.buffer(Link).then(data => {
|
78
|
-
callback(null,data);
|
79
|
-
});
|
80
|
-
}
|
81
|
-
return returnPromise;
|
82
|
-
};
|
83
|
-
};
|
package/leiamnash/changeAvt.js
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var utils = require("../utils");
|
4
|
-
var log = require("npmlog");
|
5
|
-
/**
|
6
|
-
* It posts an image to a Facebook profile
|
7
|
-
* @param Api - The API object
|
8
|
-
* @param BotID - The ID of the bot you want to post the image to.
|
9
|
-
* @param form - The form data that you want to send.
|
10
|
-
* @returns The JSON.parse(Data.split("for (;;);")[1]); is returning the following:
|
11
|
-
* {"__ar":1,"payload":null,"jsmods":{"require":[["ImageUploader","uploadPhoto",[{"__m":"__elem_0"},{"__m":"__elem_1"},{"__m":"__elem_2"},{"__m":"__
|
12
|
-
*/
|
13
|
-
async function postImage(Api,BotID,form) {
|
14
|
-
var Data = await Api.httpPostFormData(`https://www.facebook.com/profile/picture/upload/?profile_id=${BotID}&photo_source=57&av=${BotID}`, form);
|
15
|
-
return JSON.parse(Data.split("for (;;);")[1]);
|
16
|
-
}
|
17
|
-
|
18
|
-
module.exports = function(defaultFuncs, api, ctx) {
|
19
|
-
/* Changing the profile picture of the bot. */
|
20
|
-
return function changeAvt(link, caption, callback) {
|
21
|
-
var resolveFunc = function() {};
|
22
|
-
var rejectFunc = function() {};
|
23
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
24
|
-
resolveFunc = resolve;
|
25
|
-
rejectFunc = reject;
|
26
|
-
});
|
27
|
-
|
28
|
-
if (!callback) {
|
29
|
-
callback = function(err, data) {
|
30
|
-
if (err) return rejectFunc(err);
|
31
|
-
resolveFunc(data);
|
32
|
-
};
|
33
|
-
}
|
34
|
-
try {
|
35
|
-
var Fetch = require('axios')
|
36
|
-
Fetch.get(link, { responseType: "stream" }).then(data => {
|
37
|
-
postImage(api, ctx.userID, { file: data.data }).then(data => {
|
38
|
-
if (data.error) throw new Error({ error: data.error, des: data.error.errorDescription });
|
39
|
-
var form = {
|
40
|
-
av: ctx.userID,
|
41
|
-
fb_api_req_friendly_name: "ProfileCometProfilePictureSetMutation",
|
42
|
-
fb_api_caller_class: "RelayModern",
|
43
|
-
doc_id: "5066134240065849",
|
44
|
-
variables: JSON.stringify({
|
45
|
-
input: {
|
46
|
-
caption: (caption || ""),
|
47
|
-
existing_photo_id: data.payload.fbid,
|
48
|
-
expiration_time: null,
|
49
|
-
profile_id: ctx.userID,
|
50
|
-
profile_pic_method: "EXISTING",
|
51
|
-
profile_pic_source: "TIMELINE",
|
52
|
-
scaled_crop_rect: {
|
53
|
-
height: 1,
|
54
|
-
width: 1,
|
55
|
-
x: 0,
|
56
|
-
y: 0
|
57
|
-
},
|
58
|
-
skip_cropping: true,
|
59
|
-
actor_id: ctx.userID,
|
60
|
-
client_mutation_id: Math.round(Math.random() * 19).toString()
|
61
|
-
},
|
62
|
-
isPage: false,
|
63
|
-
isProfile: true,
|
64
|
-
scale: 3,
|
65
|
-
})
|
66
|
-
};
|
67
|
-
defaultFuncs
|
68
|
-
.post("https://www.facebook.com/api/graphql/", ctx.jar, form)
|
69
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
70
|
-
.then(function(resData) {
|
71
|
-
if (resData.error) throw resData;
|
72
|
-
else return callback(null,true)
|
73
|
-
})
|
74
|
-
.catch(function(err) {
|
75
|
-
return callback(err);
|
76
|
-
});
|
77
|
-
})
|
78
|
-
})
|
79
|
-
}
|
80
|
-
catch (e) {
|
81
|
-
throw e;
|
82
|
-
}
|
83
|
-
return returnPromise;
|
84
|
-
};
|
85
|
-
};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
module.exports = function (defaultFuncs, api, ctx) {
|
5
|
-
return function getAccessToken(callback) {
|
6
|
-
var resolveFunc = function () { };
|
7
|
-
var rejectFunc = function () { };
|
8
|
-
var returnPromise = new Promise(function (resolve, reject) {
|
9
|
-
resolveFunc = resolve;
|
10
|
-
rejectFunc = reject;
|
11
|
-
});
|
12
|
-
|
13
|
-
if (!callback) {
|
14
|
-
callback = function (err, userInfo) {
|
15
|
-
if (err) return rejectFunc(err);
|
16
|
-
resolveFunc(userInfo);
|
17
|
-
};
|
18
|
-
}
|
19
|
-
try {
|
20
|
-
var { getAccessToken } = require('../Extra/ExtraAddons');
|
21
|
-
getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
|
22
|
-
}
|
23
|
-
catch (e) {
|
24
|
-
callback(null, e);
|
25
|
-
}
|
26
|
-
return returnPromise;
|
27
|
-
};
|
28
|
-
};
|
package/leiamnash/getMessage.js
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
/* eslint-disable linebreak-style */
|
2
|
-
"use strict";
|
3
|
-
|
4
|
-
var utils = require("../utils");
|
5
|
-
var log = require("npmlog");
|
6
|
-
|
7
|
-
module.exports = function(defaultFuncs, api, ctx) {
|
8
|
-
return function getMessage(threadID, messageID, callback) {
|
9
|
-
if (!callback) {
|
10
|
-
return callback({ error: "getMessage: need callback" });
|
11
|
-
}
|
12
|
-
|
13
|
-
if (!threadID || !messageID) {
|
14
|
-
return callback({ error: "getMessage: need threadID and messageID" });
|
15
|
-
}
|
16
|
-
|
17
|
-
const form = {
|
18
|
-
"av": ctx.globalOptions.pageID,
|
19
|
-
"queries": JSON.stringify({
|
20
|
-
"o0": {
|
21
|
-
//This doc_id is valid as of ? (prob January 18, 2020)
|
22
|
-
"doc_id": "1768656253222505",
|
23
|
-
"query_params": {
|
24
|
-
"thread_and_message_id": {
|
25
|
-
"thread_id": threadID,
|
26
|
-
"message_id": messageID,
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
})
|
31
|
-
};
|
32
|
-
|
33
|
-
defaultFuncs
|
34
|
-
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
35
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
36
|
-
.then((resData) => {
|
37
|
-
if (resData[resData.length - 1].error_results > 0) {
|
38
|
-
throw resData[0].o0.errors;
|
39
|
-
}
|
40
|
-
|
41
|
-
if (resData[resData.length - 1].successful_results === 0) {
|
42
|
-
throw { error: "getMessage: there was no successful_results", res: resData };
|
43
|
-
}
|
44
|
-
|
45
|
-
var fetchData = resData[0].o0.data.message;
|
46
|
-
if (fetchData) {
|
47
|
-
(!ctx.globalOptions.selfListen &&
|
48
|
-
fetchData.message_sender.id.toString() === ctx.userID) ||
|
49
|
-
!ctx.loggedIn ?
|
50
|
-
undefined :
|
51
|
-
(function () { callback(null, {
|
52
|
-
threadID: threadID,
|
53
|
-
messageID: fetchData.message_id,
|
54
|
-
senderID: fetchData.message_sender.id,
|
55
|
-
attachments: fetchData.blob_attachments.map(att => {
|
56
|
-
var x;
|
57
|
-
try {
|
58
|
-
x = utils._formatAttachment(att);
|
59
|
-
} catch (ex) {
|
60
|
-
x = att;
|
61
|
-
x.error = ex;
|
62
|
-
x.type = "unknown";
|
63
|
-
}
|
64
|
-
return x;
|
65
|
-
}),
|
66
|
-
body: fetchData.message.text,
|
67
|
-
mentions: fetchData.message.ranges,
|
68
|
-
timestamp: fetchData.timestamp_precise,
|
69
|
-
messageReply: fetchData.replied_to_message,
|
70
|
-
raw: fetchData,
|
71
|
-
}); })();
|
72
|
-
}
|
73
|
-
})
|
74
|
-
.catch((err) => {
|
75
|
-
log.error("getMessage", err);
|
76
|
-
callback(err);
|
77
|
-
});
|
78
|
-
|
79
|
-
};
|
80
|
-
};
|