@dongdev/fca-unofficial 3.0.29 → 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 -4
- 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,12 +1,14 @@
|
|
|
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
14
|
const regions = [
|
|
@@ -569,7 +571,7 @@ async function tryAutoLoginIfNeeded(currentHtml, currentCookies, globalOptions,
|
|
|
569
571
|
|
|
570
572
|
// Check if auto-login is enabled (support both true and "true")
|
|
571
573
|
if (config.autoLogin === false || config.autoLogin === "false") {
|
|
572
|
-
throw new Error("AppState
|
|
574
|
+
throw new Error("AppState expired — Auto-login is disabled");
|
|
573
575
|
}
|
|
574
576
|
|
|
575
577
|
// Try API login
|
|
@@ -879,7 +881,7 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
879
881
|
const initial = await get("https://www.facebook.com/", jar, null, globalOptions).then(saveCookies(jar));
|
|
880
882
|
return (await ctx.bypassAutomation(initial, jar)) || initial;
|
|
881
883
|
}
|
|
882
|
-
logger("AppState
|
|
884
|
+
logger("AppState expired — proceeding to email/password login", "warn");
|
|
883
885
|
return get("https://www.facebook.com/", null, null, globalOptions)
|
|
884
886
|
.then(saveCookies(jar))
|
|
885
887
|
.then(makeLogin(jar, email, password, globalOptions))
|
|
@@ -1119,6 +1121,7 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1119
1121
|
}
|
|
1120
1122
|
});
|
|
1121
1123
|
logger("FCA fix/update by DongDev (Donix-VN)", "info");
|
|
1124
|
+
const emitter = new EventEmitter();
|
|
1122
1125
|
const ctxMain = {
|
|
1123
1126
|
userID,
|
|
1124
1127
|
jar,
|
|
@@ -1137,7 +1140,8 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1137
1140
|
clientId: getFrom(html, '["MqttWebDeviceID",[],{"clientID":"', '"}') || "",
|
|
1138
1141
|
wsReqNumber: 0,
|
|
1139
1142
|
wsTaskNumber: 0,
|
|
1140
|
-
tasks: new Map()
|
|
1143
|
+
tasks: new Map(),
|
|
1144
|
+
_emitter: emitter
|
|
1141
1145
|
};
|
|
1142
1146
|
ctxMain.options = globalOptions;
|
|
1143
1147
|
ctxMain.bypassAutomation = ctx.bypassAutomation.bind(ctxMain);
|
|
@@ -1171,9 +1175,64 @@ function loginHelper(appState, Cookie, email, password, globalOptions, callback)
|
|
|
1171
1175
|
},
|
|
1172
1176
|
getLatestCookieFromDB: async function (uid = userID) {
|
|
1173
1177
|
return await getLatestBackup(uid, "cookie");
|
|
1174
|
-
}
|
|
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)
|
|
1175
1183
|
};
|
|
1176
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
|
+
}
|
|
1177
1236
|
const srcRoot = path.join(__dirname, "../src/api");
|
|
1178
1237
|
let loaded = 0;
|
|
1179
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) {
|
|
@@ -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 unsendMessage(messageID, threadID, callback) {
|