@dongdev/fca-unofficial 3.0.25 → 3.0.27
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 +3 -0
- package/Fca_Database/database.sqlite +0 -0
- package/LICENSE-MIT +1 -1
- package/module/config.js +3 -7
- package/module/login.js +2 -4
- package/module/loginHelper.js +479 -287
- package/package.json +6 -7
- package/src/api/messaging/changeGroupImage.js +2 -1
- package/src/api/messaging/createPoll.js +28 -28
- package/src/api/messaging/deleteMessage.js +110 -30
- package/src/api/messaging/removeUserFromGroup.js +28 -73
- package/src/api/messaging/sendMessage.js +15 -17
- package/src/api/messaging/setMessageReaction.js +34 -37
- package/src/api/messaging/uploadAttachment.js +471 -73
- package/src/api/socket/core/getSeqID.js +292 -10
- package/src/api/socket/listenMqtt.js +15 -3
- package/src/utils/client.js +2 -312
- package/src/utils/cookies.js +68 -0
- package/src/utils/format.js +117 -90
- package/src/utils/loginParser.js +347 -0
- package/src/utils/messageFormat.js +1173 -0
package/CHANGELOG.md
CHANGED
|
Binary file
|
package/LICENSE-MIT
CHANGED
package/module/config.js
CHANGED
|
@@ -5,6 +5,8 @@ const defaultConfig = {
|
|
|
5
5
|
autoUpdate: true,
|
|
6
6
|
mqtt: { enabled: true, reconnectInterval: 3600 },
|
|
7
7
|
autoLogin: true,
|
|
8
|
+
apiServer: "https://minhdong.site",
|
|
9
|
+
apiKey: "",
|
|
8
10
|
credentials: { email: "", password: "", twofactor: "" }
|
|
9
11
|
};
|
|
10
12
|
|
|
@@ -12,13 +14,7 @@ function loadConfig() {
|
|
|
12
14
|
const configPath = path.join(process.cwd(), "fca-config.json");
|
|
13
15
|
let config;
|
|
14
16
|
if (!fs.existsSync(configPath)) {
|
|
15
|
-
|
|
16
|
-
fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
17
|
-
config = defaultConfig;
|
|
18
|
-
} catch (err) {
|
|
19
|
-
logger(`Error writing config file: ${err.message}`, "error");
|
|
20
|
-
config = defaultConfig;
|
|
21
|
-
}
|
|
17
|
+
config = defaultConfig;
|
|
22
18
|
} else {
|
|
23
19
|
try {
|
|
24
20
|
const fileContent = fs.readFileSync(configPath, "utf8");
|
package/module/login.js
CHANGED
|
@@ -48,8 +48,7 @@ if (!global.fca._errorHandlersInstalled) {
|
|
|
48
48
|
// For other unhandled rejections, log but don't crash
|
|
49
49
|
logger(`Unhandled promise rejection (non-fatal): ${reason && reason.message ? reason.message : String(reason)}`, "error");
|
|
50
50
|
} catch (e) {
|
|
51
|
-
// Fallback if logger fails
|
|
52
|
-
console.error("[FCA-ERROR] Unhandled promise rejection:", reason);
|
|
51
|
+
// Fallback if logger fails - silent
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
|
|
@@ -78,8 +77,7 @@ if (!global.fca._errorHandlersInstalled) {
|
|
|
78
77
|
// Note: We don't exit here to allow bot to continue running
|
|
79
78
|
// In production, you might want to restart the process instead
|
|
80
79
|
} catch (e) {
|
|
81
|
-
// Fallback if logger fails
|
|
82
|
-
console.error("[FCA-ERROR] Uncaught exception:", error);
|
|
80
|
+
// Fallback if logger fails - silent
|
|
83
81
|
}
|
|
84
82
|
});
|
|
85
83
|
}
|