fca-priyansh 19.0.0 ā 20.0.0
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/.gitlab-ci.yml +22 -0
- package/CountTime.json +1 -0
- package/Extra/Balancer.js +49 -49
- package/Extra/BroadcastSystem.js +1 -0
- package/Extra/Bypass/956/index.js +233 -233
- package/Extra/Bypass/test/aaaa.json +169 -169
- package/Extra/Bypass/test/index.js +187 -187
- package/Extra/Database/index.js +468 -468
- package/Extra/ExtraAddons.js +82 -82
- package/Extra/ExtraFindUID.js +61 -61
- package/Extra/ExtraGetThread.js +365 -365
- package/Extra/ExtraScreenShot.js +430 -430
- package/Extra/ExtraUptimeRobot.js +142 -38
- package/Extra/Html/Classic/script.js +118 -118
- package/Extra/Html/Classic/style.css +7 -7
- package/Extra/Security/Base/Step_1.js +5 -5
- package/Extra/Security/Base/Step_2.js +22 -22
- package/Extra/Security/Base/Step_3.js +22 -22
- package/Extra/Security/Base/index.js +190 -190
- package/Extra/Security/Index.js +4 -4
- package/Extra/Security/Step_1.js +5 -5
- package/Extra/Security/Step_2.js +22 -22
- package/Extra/Security/Step_3.js +22 -22
- package/Extra/Src/Change_Environment.js +24 -24
- package/Extra/Src/Check_Update.js +66 -66
- package/Extra/Src/History.js +114 -114
- package/Extra/Src/Instant_Update.js +64 -64
- package/Extra/Src/Last-Run.js +64 -64
- package/Extra/Src/Premium.js +81 -81
- package/Extra/Src/Websocket.js +212 -212
- package/Extra/Src/uuid.js +137 -137
- package/Func/AcceptAgreement.js +31 -31
- package/Func/ClearCache.js +64 -64
- package/Func/ReportV1.js +54 -54
- package/LICENSE +21 -21
- package/Language/index.json +228 -228
- package/Main.js +1 -1290
- package/README.md +198 -198
- package/broadcast.js +1 -44
- package/errorHandler.js +151 -0
- package/index.js +1 -448
- package/logger.js +69 -66
- package/package.json +99 -98
- package/src/Dev_Horizon_Data.js +124 -124
- package/src/Dev_getThreadInfoOLD.js +421 -421
- package/src/Dev_shareTest2.js +68 -68
- package/src/Dev_shareTest3.js +71 -71
- package/src/Premium.js +24 -24
- package/src/Screenshot.js +82 -82
- package/src/addExternalModule.js +16 -16
- package/src/addUserToGroup.js +79 -79
- package/src/changeAdminStatus.js +79 -79
- package/src/changeArchivedStatus.js +41 -41
- package/src/changeAvt.js +84 -84
- package/src/changeBio.js +65 -65
- package/src/changeBlockedStatus.js +36 -36
- package/src/changeGroupImage.js +106 -106
- package/src/changeNickname.js +45 -45
- package/src/changeThreadColor.js +62 -62
- package/src/changeThreadEmoji.js +42 -42
- package/src/changeThreadTheme.js +263 -0
- package/src/comment.js +244 -0
- package/src/createNewGroup.js +70 -70
- package/src/createPoll.js +60 -60
- package/src/deleteMessage.js +45 -45
- package/src/deleteThread.js +43 -43
- package/src/editMessage.js +71 -53
- package/src/follow.js +119 -0
- package/src/forwardAttachment.js +48 -48
- package/src/friend.js +383 -0
- package/src/getAccessToken.js +27 -27
- package/src/getCurrentUserID.js +7 -7
- package/src/getEmojiUrl.js +27 -27
- package/src/getFriendsList.js +73 -73
- package/src/getMessage.js +102 -102
- package/src/getPendingFriendRequests.js +45 -0
- package/src/getThreadHistory.js +537 -537
- package/src/getThreadInfo.js +424 -423
- package/src/getThreadInfoOLD.js +421 -421
- package/src/getThreadList.js +213 -213
- package/src/getThreadMain.js +219 -219
- package/src/getThreadPictures.js +59 -59
- package/src/getUID.js +58 -58
- package/src/getUserID.js +62 -62
- package/src/getUserInfo.js +112 -112
- package/src/getUserInfoMain.js +64 -64
- package/src/getUserInfoV2.js +31 -31
- package/src/getUserInfoV3.js +62 -62
- package/src/getUserInfoV4.js +54 -54
- package/src/getUserInfoV5.js +60 -60
- package/src/handleFriendRequest.js +46 -46
- package/src/handleMessageRequest.js +49 -49
- package/src/httpGet.js +49 -49
- package/src/httpPost.js +48 -48
- package/src/httpPostFormData.js +40 -40
- package/src/listenMqtt.js +1 -956
- package/src/listenMqttV1.js +832 -846
- package/src/logout.js +68 -68
- package/src/markAsDelivered.js +48 -48
- package/src/markAsRead.js +70 -70
- package/src/markAsReadAll.js +42 -42
- package/src/markAsSeen.js +51 -51
- package/src/muteThread.js +47 -47
- package/src/notes.js +279 -0
- package/src/removeUserFromGroup.js +49 -49
- package/src/resolvePhotoUrl.js +37 -37
- package/src/searchForThread.js +43 -43
- package/src/sendMention.js +325 -0
- package/src/sendMessage.js +1 -386
- package/src/sendMqttMessage.js +70 -70
- package/src/sendTypingIndicator.js +79 -80
- package/src/setMessageReaction.js +109 -109
- package/src/setPostReaction.js +101 -101
- package/src/setTitle.js +74 -74
- package/src/share.js +98 -0
- package/src/shareContact.js +55 -55
- package/src/shareLink.js +58 -58
- package/src/stickers.js +525 -0
- package/src/story.js +267 -0
- package/src/threadColors.js +38 -38
- package/src/unfriend.js +43 -43
- package/src/unsendMessage.js +47 -47
- package/src/unsendMqttMessage.js +65 -65
- package/test/data/shareAttach.js +146 -146
- package/test/data/test.txt +7 -7
- package/test/example-config.json +18 -18
- package/test/test-page.js +140 -140
- package/test/test.js +385 -385
- package/test/testv2.js +2 -2
- package/userAgentManager.js +129 -0
- package/utils.js +1 -3077
- package/.github/workflows/publish.yml +0 -20
- package/Extra/Src/Release_Memory.js +0 -160
- package/Extra/Src/test.js +0 -28
- package/SECURITY.md +0 -17
package/errorHandler.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Optimized Error Handler for FCA
|
|
5
|
+
* Shows only ONE clear, actionable error message
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const chalk = require('chalk');
|
|
9
|
+
|
|
10
|
+
function handleLoginError(error, callback) {
|
|
11
|
+
// Determine the specific error type and show only ONE clear message
|
|
12
|
+
let errorMessage = null;
|
|
13
|
+
let errorType = 'unknown';
|
|
14
|
+
let errorString = error ? error.toString() : '';
|
|
15
|
+
|
|
16
|
+
// Check error object properties
|
|
17
|
+
const errorObj = error && typeof error === 'object' ? error : {};
|
|
18
|
+
const fullError = errorString + JSON.stringify(errorObj);
|
|
19
|
+
|
|
20
|
+
// Priority 1: Check for empty appstate
|
|
21
|
+
if (fullError.includes('empty appstate') || fullError.includes('EMPTY_APPSTATE')) {
|
|
22
|
+
errorType = 'empty_appstate';
|
|
23
|
+
errorMessage = chalk.red.bold('\nā APPSTATE FILE IS EMPTY\n\n') +
|
|
24
|
+
chalk.yellow('š Solution:\n') +
|
|
25
|
+
' 1. Your appstate.json file is empty\n' +
|
|
26
|
+
' 2. Add valid Facebook cookies to the file\n' +
|
|
27
|
+
' 3. Format should be JSON array: [{"key":"c_user", ...}]\n' +
|
|
28
|
+
' 4. Use cookie extension to get cookies from facebook.com\n' +
|
|
29
|
+
' 5. Restart the bot\n';
|
|
30
|
+
}
|
|
31
|
+
// Priority 2: Check for invalid JSON format
|
|
32
|
+
else if (fullError.includes('JSON') && (fullError.includes('parse') || fullError.includes('Unexpected') || fullError.includes('position'))) {
|
|
33
|
+
errorType = 'invalid_json';
|
|
34
|
+
errorMessage = chalk.red.bold('\nā APPSTATE JSON FORMAT IS INVALID\n\n') +
|
|
35
|
+
chalk.yellow('š Problem:\n') +
|
|
36
|
+
' ⢠Your appstate.json has incorrect JSON format\n' +
|
|
37
|
+
' ⢠There might be syntax errors or missing brackets\n\n' +
|
|
38
|
+
chalk.yellow('š Solution:\n') +
|
|
39
|
+
' 1. Open appstate.json in a text editor\n' +
|
|
40
|
+
' 2. Check for proper JSON format\n' +
|
|
41
|
+
' 3. Use online JSON validator (jsonlint.com)\n' +
|
|
42
|
+
' 4. OR delete file and create fresh appstate.json\n' +
|
|
43
|
+
' 5. Get new cookies using browser extension\n' +
|
|
44
|
+
' 6. Restart the bot\n';
|
|
45
|
+
}
|
|
46
|
+
// Priority 3: Check for missing appstate file
|
|
47
|
+
else if (fullError.includes('ENOENT') && (fullError.includes('appstate') || fullError.includes('Cannot find module'))) {
|
|
48
|
+
errorType = 'missing_appstate';
|
|
49
|
+
errorMessage = chalk.red.bold('\nā APPSTATE FILE MISSING\n\n') +
|
|
50
|
+
chalk.yellow('š Solution:\n') +
|
|
51
|
+
' 1. Create appstate.json file in your project root\n' +
|
|
52
|
+
' 2. Add your Facebook cookies to the file\n' +
|
|
53
|
+
' 3. Restart the bot\n';
|
|
54
|
+
}
|
|
55
|
+
// Priority 4: Check for runtime session expiration
|
|
56
|
+
else if (fullError.includes('Runtime session expired') ||
|
|
57
|
+
fullError.includes('Cannot read properties of undefined (reading \'uri\')')) {
|
|
58
|
+
errorType = 'runtime_session_expired';
|
|
59
|
+
errorMessage = chalk.red.bold('\nā SESSION EXPIRED DURING RUNTIME\n\n') +
|
|
60
|
+
chalk.yellow('š Problem:\n') +
|
|
61
|
+
' ⢠Your Facebook session expired while bot was running\n' +
|
|
62
|
+
' ⢠This happens when cookies become invalid after login\n\n' +
|
|
63
|
+
chalk.yellow('š Solution:\n') +
|
|
64
|
+
' 1. Open facebook.com in incognito/private browser\n' +
|
|
65
|
+
' 2. Login to your Facebook account\n' +
|
|
66
|
+
' 3. Use cookie extension to get fresh cookies\n' +
|
|
67
|
+
' 4. Replace appstate.json with new cookies\n' +
|
|
68
|
+
' 5. Restart the bot\n' +
|
|
69
|
+
' 6. If problem persists, check Facebook security settings\n';
|
|
70
|
+
}
|
|
71
|
+
// Priority 5: Check for expired/invalid cookies at login
|
|
72
|
+
else if (fullError.includes('ErrAppState') ||
|
|
73
|
+
fullError.includes('Wrong') ||
|
|
74
|
+
fullError.includes('ctx')) {
|
|
75
|
+
errorType = 'expired_cookies';
|
|
76
|
+
errorMessage = chalk.red.bold('\nā APPSTATE COOKIES EXPIRED OR INVALID\n\n') +
|
|
77
|
+
chalk.yellow('š Solution:\n') +
|
|
78
|
+
' 1. Open facebook.com in incognito/private browser\n' +
|
|
79
|
+
' 2. Login to your Facebook account\n' +
|
|
80
|
+
' 3. Use cookie extension to get fresh cookies\n' +
|
|
81
|
+
' 4. Replace appstate.json with new cookies\n' +
|
|
82
|
+
' 5. Restart the bot\n';
|
|
83
|
+
}
|
|
84
|
+
// Priority 6: Check for 2FA errors
|
|
85
|
+
else if (fullError.includes('2FA') || fullError.includes('TwoAuth') || fullError.includes('approvals')) {
|
|
86
|
+
errorType = '2fa_error';
|
|
87
|
+
errorMessage = chalk.red.bold('\nā TWO-FACTOR AUTHENTICATION ERROR\n\n') +
|
|
88
|
+
chalk.yellow('š Solution:\n') +
|
|
89
|
+
' 1. Make sure you entered correct 2FA code\n' +
|
|
90
|
+
' 2. Try using authenticator app code\n' +
|
|
91
|
+
' 3. Check PriyanshFca.json settings for Login2Fa\n';
|
|
92
|
+
}
|
|
93
|
+
// Priority 7: Check for checkpoint errors (excluding automation checkpoint which is auto-handled)
|
|
94
|
+
else if ((fullError.includes('checkpoint') || fullError.includes('CheckPoint')) && !fullError.includes('601051028565049')) {
|
|
95
|
+
errorType = 'checkpoint';
|
|
96
|
+
errorMessage = chalk.red.bold('\nā FACEBOOK CHECKPOINT DETECTED\n\n') +
|
|
97
|
+
chalk.yellow('š Solution:\n') +
|
|
98
|
+
' 1. Open facebook.com in your browser\n' +
|
|
99
|
+
' 2. Complete any security verification required\n' +
|
|
100
|
+
' 3. Get NEW cookies after verification\n' +
|
|
101
|
+
' 4. Update appstate.json\n';
|
|
102
|
+
}
|
|
103
|
+
// Priority 8: Network error
|
|
104
|
+
else if (fullError.includes('ECONNREFUSED') ||
|
|
105
|
+
fullError.includes('ETIMEDOUT') ||
|
|
106
|
+
fullError.includes('ENOTFOUND')) {
|
|
107
|
+
errorType = 'network_error';
|
|
108
|
+
errorMessage = chalk.red.bold('\nā NETWORK CONNECTION ERROR\n\n') +
|
|
109
|
+
chalk.yellow('š Solution:\n') +
|
|
110
|
+
' 1. Check your internet connection\n' +
|
|
111
|
+
' 2. Try again in a few moments\n' +
|
|
112
|
+
' 3. Check if Facebook is accessible\n';
|
|
113
|
+
}
|
|
114
|
+
// Priority 9: Invalid account credentials
|
|
115
|
+
else if (fullError.includes('InvaildAccount') || fullError.includes('Wrong Password')) {
|
|
116
|
+
errorType = 'invalid_credentials';
|
|
117
|
+
errorMessage = chalk.red.bold('\nā INVALID ACCOUNT OR PASSWORD\n\n') +
|
|
118
|
+
chalk.yellow('š Solution:\n') +
|
|
119
|
+
' 1. Check your email/phone and password\n' +
|
|
120
|
+
' 2. Make sure account is not locked\n' +
|
|
121
|
+
' 3. Use appstate login instead\n';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// If we identified the error, show ONLY that one message
|
|
125
|
+
if (errorMessage) {
|
|
126
|
+
console.log('\n' + chalk.gray('='.repeat(60)));
|
|
127
|
+
console.log(errorMessage);
|
|
128
|
+
console.log(chalk.gray('='.repeat(60)) + '\n');
|
|
129
|
+
|
|
130
|
+
// Call callback with simplified error
|
|
131
|
+
if (callback && typeof callback === 'function') {
|
|
132
|
+
callback({ error: errorType, message: errorMessage.replace(/\u001b\[\d+m/g, '') });
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Exit cleanly
|
|
136
|
+
process.exit(1);
|
|
137
|
+
} else {
|
|
138
|
+
// Unknown error - show minimal info without stack trace spam
|
|
139
|
+
console.log('\n' + chalk.gray('='.repeat(60)));
|
|
140
|
+
console.log(chalk.red.bold('\nā LOGIN ERROR\n'));
|
|
141
|
+
console.log(chalk.yellow('Error details:'), chalk.white(errorString.substring(0, 200)));
|
|
142
|
+
console.log(chalk.gray('='.repeat(60)) + '\n');
|
|
143
|
+
|
|
144
|
+
if (callback && typeof callback === 'function') {
|
|
145
|
+
callback(error);
|
|
146
|
+
}
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
module.exports = handleLoginError;
|