@dongdev/fca-unofficial 3.0.28 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +229 -132
- package/DOCS.md +82 -3
- package/README.md +524 -632
- package/func/logAdapter.js +33 -0
- package/index.d.ts +6 -0
- package/module/config.js +11 -1
- package/module/loginHelper.js +63 -7
- package/package.json +88 -81
- package/src/api/action/changeAvatar.js +1 -1
- package/src/api/action/changeBio.js +1 -1
- package/src/api/action/handleFriendRequest.js +1 -1
- package/src/api/action/logout.js +1 -1
- package/src/api/action/refreshFb_dtsg.js +1 -1
- package/src/api/action/setPostReaction.js +1 -1
- package/src/api/action/unfriend.js +1 -1
- package/src/api/http/postFormData.js +1 -1
- package/src/api/messaging/changeArchivedStatus.js +1 -1
- package/src/api/messaging/changeBlockedStatus.js +1 -1
- package/src/api/messaging/changeGroupImage.js +1 -1
- package/src/api/messaging/changeNickname.js +1 -1
- package/src/api/messaging/changeThreadEmoji.js +1 -1
- package/src/api/messaging/createNewGroup.js +1 -1
- package/src/api/messaging/createThemeAI.js +1 -1
- package/src/api/messaging/deleteMessage.js +1 -1
- package/src/api/messaging/deleteThread.js +1 -1
- package/src/api/messaging/getFriendsList.js +1 -1
- package/src/api/messaging/getMessage.js +1 -1
- package/src/api/messaging/getThemePictures.js +1 -1
- package/src/api/messaging/handleMessageRequest.js +1 -1
- package/src/api/messaging/markAsDelivered.js +1 -1
- package/src/api/messaging/markAsRead.js +1 -1
- package/src/api/messaging/markAsReadAll.js +1 -1
- package/src/api/messaging/markAsSeen.js +1 -1
- package/src/api/messaging/muteThread.js +1 -1
- package/src/api/messaging/resolvePhotoUrl.js +1 -1
- package/src/api/messaging/sendMessage.js +1 -1
- package/src/api/messaging/setTitle.js +1 -1
- package/src/api/messaging/unsendMessage.js +1 -1
- package/src/api/messaging/uploadAttachment.js +1 -1
- package/src/api/socket/core/connectMqtt.js +16 -8
- package/src/api/socket/core/emitAuth.js +4 -0
- package/src/api/socket/core/getSeqID.js +6 -8
- package/src/api/socket/core/getTaskResponseData.js +3 -0
- package/src/api/socket/core/parseDelta.js +9 -0
- package/src/api/socket/detail/buildStream.js +11 -4
- package/src/api/socket/detail/constants.js +4 -0
- package/src/api/socket/listenMqtt.js +11 -5
- package/src/api/threads/getThreadHistory.js +1 -1
- package/src/api/threads/getThreadInfo.js +245 -388
- package/src/api/threads/getThreadList.js +1 -1
- package/src/api/threads/getThreadPictures.js +1 -1
- package/src/api/users/getUserID.js +1 -1
- package/src/api/users/getUserInfo.js +80 -8
- package/src/database/models/thread.js +5 -0
- package/src/remote/remoteClient.js +123 -0
- package/src/utils/broadcast.js +51 -0
- package/src/utils/loginParser.js +19 -1
- package/src/utils/request.js +33 -6
- package/.gitattributes +0 -2
- package/Fca_Database/database.sqlite +0 -0
- package/LICENSE-MIT +0 -21
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const logger = require("./logger");
|
|
2
|
+
|
|
3
|
+
function formatArgs(args) {
|
|
4
|
+
const [prefix, msg] = args;
|
|
5
|
+
|
|
6
|
+
// Single argument: log as-is
|
|
7
|
+
if (msg === undefined) {
|
|
8
|
+
if (prefix instanceof Error) {
|
|
9
|
+
return prefix.stack || prefix.message || String(prefix);
|
|
10
|
+
}
|
|
11
|
+
return String(prefix);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Two arguments: mimic npmlog("tag", message)
|
|
15
|
+
const tag = prefix == null ? "" : String(prefix);
|
|
16
|
+
if (msg instanceof Error) {
|
|
17
|
+
const base = msg.message || String(msg);
|
|
18
|
+
return tag ? `${tag}: ${base}` : base;
|
|
19
|
+
}
|
|
20
|
+
const text = msg == null ? "" : String(msg);
|
|
21
|
+
return tag ? `${tag}: ${text}` : text;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const log = {
|
|
25
|
+
info: (...args) => logger(formatArgs(args), "info"),
|
|
26
|
+
warn: (...args) => logger(formatArgs(args), "warn"),
|
|
27
|
+
error: (...args) => logger(formatArgs(args), "error"),
|
|
28
|
+
verbose: (...args) => logger(formatArgs(args), "info"),
|
|
29
|
+
silly: (...args) => logger(formatArgs(args), "info")
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = log;
|
|
33
|
+
|
package/index.d.ts
CHANGED
|
@@ -184,6 +184,12 @@ declare module '@dongdev/fca-unofficial' {
|
|
|
184
184
|
listen: (callback?: (err: Error | null, message: IFCAU_ListenMessage) => void) => EventEmitter;
|
|
185
185
|
listenMqtt: (callback?: (err: Error | null, message: IFCAU_ListenMessage) => void) => EventEmitter & { stopListening: (callback?: () => void) => void };
|
|
186
186
|
|
|
187
|
+
// Lifecycle & Remote Events
|
|
188
|
+
on: (event: string, listener: (...args: any[]) => void) => IFCAU_Api;
|
|
189
|
+
once: (event: string, listener: (...args: any[]) => void) => IFCAU_Api;
|
|
190
|
+
off: (event: string, listener: (...args: any[]) => void) => IFCAU_Api;
|
|
191
|
+
removeAllListeners: (event?: string) => IFCAU_Api;
|
|
192
|
+
|
|
187
193
|
// Middleware System
|
|
188
194
|
useMiddleware: (middleware: IFCAU_Middleware | string, fn?: IFCAU_Middleware) => () => void;
|
|
189
195
|
removeMiddleware: (identifier: string | IFCAU_Middleware) => boolean;
|
package/module/config.js
CHANGED
|
@@ -7,7 +7,17 @@ const defaultConfig = {
|
|
|
7
7
|
autoLogin: true,
|
|
8
8
|
apiServer: "https://minhdong.site",
|
|
9
9
|
apiKey: "",
|
|
10
|
-
credentials: { email: "", password: "", twofactor: "" }
|
|
10
|
+
credentials: { email: "", password: "", twofactor: "" },
|
|
11
|
+
antiGetInfo: {
|
|
12
|
+
AntiGetThreadInfo: false,
|
|
13
|
+
AntiGetUserInfo: false
|
|
14
|
+
},
|
|
15
|
+
remoteControl: {
|
|
16
|
+
enabled: false,
|
|
17
|
+
url: "",
|
|
18
|
+
token: "",
|
|
19
|
+
autoReconnect: true
|
|
20
|
+
}
|
|
11
21
|
};
|
|
12
22
|
|
|
13
23
|
function loadConfig() {
|
package/module/loginHelper.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const path = require("path");
|
|
4
|
+
const EventEmitter = require("events");
|
|
4
5
|
const models = require("../src/database/models");
|
|
5
6
|
const logger = require("../func/logger");
|
|
6
7
|
const { get, post, jar, makeDefaults } = require("../src/utils/request");
|
|
7
8
|
const { saveCookies, getAppState } = require("../src/utils/client");
|
|
8
9
|
const { getFrom } = require("../src/utils/constants");
|
|
9
10
|
const { loadConfig } = require("./config");
|
|
11
|
+
const { createRemoteClient } = require("../src/remote/remoteClient");
|
|
10
12
|
const { config } = loadConfig();
|
|
11
13
|
const axiosBase = require("axios");
|
|
12
|
-
const parseUserHtml = require("./parseUseerHtml");
|
|
13
|
-
|
|
14
14
|
const regions = [
|
|
15
15
|
{ code: "PRN", name: "Pacific Northwest Region", location: "Khu vực Tây Bắc Thái Bình Dương" },
|
|
16
16
|
{ code: "VLL", name: "Valley Region", location: "Valley" },
|
|
@@ -571,7 +571,7 @@ async function tryAutoLoginIfNeeded(currentHtml, currentCookies, globalOptions,
|
|
|
571
571
|
|
|
572
572
|
// Check if auto-login is enabled (support both true and "true")
|
|
573
573
|
if (config.autoLogin === false || config.autoLogin === "false") {
|
|
574
|
-
throw new Error("AppState
|
|
574
|
+
throw new Error("AppState expired — Auto-login is disabled");
|
|
575
575
|
}
|
|
576
576
|
|
|
577
577
|
// Try API login
|
|
@@ -881,7 +881,7 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
881
881
|
const initial = await get("https://www.facebook.com/", jar, null, globalOptions).then(saveCookies(jar));
|
|
882
882
|
return (await ctx.bypassAutomation(initial, jar)) || initial;
|
|
883
883
|
}
|
|
884
|
-
logger("AppState
|
|
884
|
+
logger("AppState expired — proceeding to email/password login", "warn");
|
|
885
885
|
return get("https://www.facebook.com/", null, null, globalOptions)
|
|
886
886
|
.then(saveCookies(jar))
|
|
887
887
|
.then(makeLogin(jar, email, password, globalOptions))
|
|
@@ -1056,7 +1056,6 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1056
1056
|
let fb_dtsg;
|
|
1057
1057
|
let irisSeqID;
|
|
1058
1058
|
try {
|
|
1059
|
-
parseUserHtml(html);
|
|
1060
1059
|
const m1 = html.match(/"endpoint":"([^"]+)"/);
|
|
1061
1060
|
const m2 = m1 ? null : html.match(/endpoint\\":\\"([^\\"]+)\\"/);
|
|
1062
1061
|
const raw = (m1 && m1[1]) || (m2 && m2[1]);
|
|
@@ -1122,6 +1121,7 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1122
1121
|
}
|
|
1123
1122
|
});
|
|
1124
1123
|
logger("FCA fix/update by DongDev (Donix-VN)", "info");
|
|
1124
|
+
const emitter = new EventEmitter();
|
|
1125
1125
|
const ctxMain = {
|
|
1126
1126
|
userID,
|
|
1127
1127
|
jar,
|
|
@@ -1140,7 +1140,8 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1140
1140
|
clientId: getFrom(html, '["MqttWebDeviceID",[],{"clientID":"', '"}') || "",
|
|
1141
1141
|
wsReqNumber: 0,
|
|
1142
1142
|
wsTaskNumber: 0,
|
|
1143
|
-
tasks: new Map()
|
|
1143
|
+
tasks: new Map(),
|
|
1144
|
+
_emitter: emitter
|
|
1144
1145
|
};
|
|
1145
1146
|
ctxMain.options = globalOptions;
|
|
1146
1147
|
ctxMain.bypassAutomation = ctx.bypassAutomation.bind(ctxMain);
|
|
@@ -1174,9 +1175,64 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1174
1175
|
},
|
|
1175
1176
|
getLatestCookieFromDB: async function (uid = userID) {
|
|
1176
1177
|
return await getLatestBackup(uid, "cookie");
|
|
1177
|
-
}
|
|
1178
|
+
},
|
|
1179
|
+
on: emitter.on.bind(emitter),
|
|
1180
|
+
once: emitter.once.bind(emitter),
|
|
1181
|
+
off: emitter.removeListener.bind(emitter),
|
|
1182
|
+
removeAllListeners: emitter.removeAllListeners.bind(emitter)
|
|
1178
1183
|
};
|
|
1179
1184
|
const defaultFuncs = makeDefaults(html, userID, ctxMain);
|
|
1185
|
+
|
|
1186
|
+
// Attach lightweight DB updaters for realtime events (MQTT)
|
|
1187
|
+
try {
|
|
1188
|
+
const Thread = models && models.Thread;
|
|
1189
|
+
if (!Thread) {
|
|
1190
|
+
throw new Error("Thread model not available");
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
ctxMain._updateThreadFromMessage = async msg => {
|
|
1194
|
+
try {
|
|
1195
|
+
if (!msg || !msg.threadID) return;
|
|
1196
|
+
const id = String(msg.threadID);
|
|
1197
|
+
// Fast path: increment messageCount column directly
|
|
1198
|
+
let affected = 0;
|
|
1199
|
+
try {
|
|
1200
|
+
const res = await Thread.increment("messageCount", { by: 1, where: { threadID: id } });
|
|
1201
|
+
if (Array.isArray(res) && typeof res[0] === "number") {
|
|
1202
|
+
affected = res[0];
|
|
1203
|
+
}
|
|
1204
|
+
} catch {
|
|
1205
|
+
// Ignore increment errors, we'll try to create below
|
|
1206
|
+
}
|
|
1207
|
+
// If no row was updated, ensure a row exists
|
|
1208
|
+
if (!affected) {
|
|
1209
|
+
try {
|
|
1210
|
+
await Thread.create({ threadID: id, messageCount: 1, data: { threadID: id } });
|
|
1211
|
+
} catch {
|
|
1212
|
+
// Ignore create races / duplicates
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
} catch (e) {
|
|
1216
|
+
const msgText = e && e.message ? e.message : String(e);
|
|
1217
|
+
logger(`updateThreadFromMessage error: ${msgText}`, "warn");
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
} catch {
|
|
1221
|
+
// If DB layer is unavailable, skip realtime thread updates
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// Attach remote control client if enabled in config
|
|
1225
|
+
let remote = null;
|
|
1226
|
+
try {
|
|
1227
|
+
if (config && config.remoteControl && config.remoteControl.enabled) {
|
|
1228
|
+
remote = createRemoteClient(api, ctxMain, config.remoteControl);
|
|
1229
|
+
}
|
|
1230
|
+
} catch (e) {
|
|
1231
|
+
logger(`Remote control initialization failed: ${e && e.message ? e.message : String(e)}`, "warn");
|
|
1232
|
+
}
|
|
1233
|
+
if (remote) {
|
|
1234
|
+
api.remote = remote;
|
|
1235
|
+
}
|
|
1180
1236
|
const srcRoot = path.join(__dirname, "../src/api");
|
|
1181
1237
|
let loaded = 0;
|
|
1182
1238
|
let skipped = 0;
|
package/package.json
CHANGED
|
@@ -1,81 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dongdev/fca-unofficial",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "Unofficial Facebook Chat API for Node.js - Interact with Facebook Messenger programmatically",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"require": "./index.js",
|
|
10
|
-
"default": "./index.js",
|
|
11
|
-
"types": "./index.d.ts"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@dongdev/fca-unofficial",
|
|
3
|
+
"version": "3.0.30",
|
|
4
|
+
"description": "Unofficial Facebook Chat API for Node.js - Interact with Facebook Messenger programmatically",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./index.js",
|
|
10
|
+
"default": "./index.js",
|
|
11
|
+
"types": "./index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"index.d.ts",
|
|
17
|
+
"module/",
|
|
18
|
+
"func/",
|
|
19
|
+
"src/",
|
|
20
|
+
"DOCS.md",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"CHANGELOG.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "mocha",
|
|
27
|
+
"lint": "eslint ."
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/dongp06/fca-unofficial.git"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"facebook",
|
|
35
|
+
"chat",
|
|
36
|
+
"api",
|
|
37
|
+
"messenger",
|
|
38
|
+
"bot",
|
|
39
|
+
"unofficial",
|
|
40
|
+
"automation",
|
|
41
|
+
"facebook-api",
|
|
42
|
+
"facebook-chat",
|
|
43
|
+
"facebook-messenger",
|
|
44
|
+
"chatbot",
|
|
45
|
+
"nodejs",
|
|
46
|
+
"fca"
|
|
47
|
+
],
|
|
48
|
+
"author": {
|
|
49
|
+
"name": "DongDev",
|
|
50
|
+
"url": "https://www.facebook.com/mdong.dev"
|
|
51
|
+
},
|
|
52
|
+
"contributors": [
|
|
53
|
+
{
|
|
54
|
+
"name": "DongDev",
|
|
55
|
+
"url": "https://github.com/dongp06"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/dongp06/fca-unofficial/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://github.com/dongp06/fca-unofficial#readme",
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=12.0.0"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"axios": "^1.13.5",
|
|
68
|
+
"axios-cookiejar-support": "^5.0.5",
|
|
69
|
+
"bluebird": "^3.7.2",
|
|
70
|
+
"chalk": "^4.1.2",
|
|
71
|
+
"cheerio": "^1.0.0-rc.10",
|
|
72
|
+
"duplexify": "^4.1.3",
|
|
73
|
+
"gradient-string": "^2.0.2",
|
|
74
|
+
"https-proxy-agent": "^4.0.0",
|
|
75
|
+
"mqtt": "^4.3.8",
|
|
76
|
+
"sequelize": "^6.37.6",
|
|
77
|
+
"totp-generator": "^1.0.0",
|
|
78
|
+
"ws": "^8.18.1"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"eslint": "^8.50.0",
|
|
82
|
+
"mocha": "^10.2.0"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public",
|
|
86
|
+
"registry": "https://registry.npmjs.org/"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { isReadableStream } = require("../../utils/constants");
|
|
5
5
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
6
6
|
const { formatID, getType } = require("../../utils/format");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
package/src/api/action/logout.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getFrom } = require("../../utils/constants");
|
|
6
6
|
const { saveCookies } = require("../../utils/client");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { formatID } = require("../../utils/format");
|
|
5
5
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
5
5
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
6
6
|
return function changeBlockedStatus(userID, block, callback) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { generateOfflineThreadingID } = require("../../utils/format.js");
|
|
4
|
-
const log = require("
|
|
4
|
+
const log = require("../../../func/logAdapter");
|
|
5
5
|
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
7
|
return function changeNickname(nickname, threadID, participantID, callback) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { generateOfflineThreadingID } = require("../../utils/format");
|
|
4
|
-
const log = require("
|
|
4
|
+
const log = require("../../../func/logAdapter");
|
|
5
5
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
7
7
|
function changeThreadEmojiNoMqtt(emoji, threadID, callback) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { _formatAttachment } = require("../../utils/format");
|
|
5
5
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
6
6
|
function formatMessage(threadID, data) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const log = require("
|
|
2
|
+
const log = require("../../../func/logAdapter");
|
|
3
3
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
4
4
|
const { getType } = require("../../utils/format");
|
|
5
5
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
5
5
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
6
6
|
return function markAsReadAll(callback) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const log = require("
|
|
3
|
+
const log = require("../../../func/logAdapter");
|
|
4
4
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
5
5
|
const { getType } = require("../../utils/format");
|
|
6
6
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const log = require("
|
|
2
|
+
const log = require("../../../func/logAdapter");
|
|
3
3
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
4
4
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
5
5
|
// muteSecond: -1=permanent mute, 0=unmute, 60=one minute, 3600=one hour, etc.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const log = require("
|
|
2
|
+
const log = require("../../../func/logAdapter");
|
|
3
3
|
const { parseAndCheckLogin, saveCookies } = require("../../utils/client");
|
|
4
4
|
module.exports = function(defaultFuncs, api, ctx) {
|
|
5
5
|
return function resolvePhotoUrl(photoID, callback) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
"use strict";
|
|
14
|
-
const log = require("
|
|
14
|
+
const log = require("../../../func/logAdapter");
|
|
15
15
|
const { getType } = require("../../utils/format");
|
|
16
16
|
const { isReadableStream } = require("../../utils/constants");
|
|
17
17
|
const { generateOfflineThreadingID } = require("../../utils/format");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { getType, generateOfflineThreadingID, generateTimestampRelative, generateThreadingID, getCurrentTimestamp } = require("../../utils/format");
|
|
4
4
|
const { parseAndCheckLogin } = require("../../utils/client");
|
|
5
|
-
const log = require("
|
|
5
|
+
const log = require("../../../func/logAdapter");
|
|
6
6
|
|
|
7
7
|
module.exports = function (defaultFuncs, api, ctx) {
|
|
8
8
|
function setTitleNoMqtt(newTitle, threadID, callback) {
|