fca-smart-shankar 13.0.0 → 16.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/.cache/replit/env/latest +56 -0
- package/.cache/replit/env/latest.json +1 -0
- package/.cache/replit/modules/nodejs-14.res +1 -0
- package/.cache/replit/modules/replit.res +1 -0
- package/.cache/replit/modules/web.res +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/typescript/5.5/package.json +1 -0
- package/.config/configstore/update-notifier-npm.json +4 -0
- package/.gitattributes +2 -0
- package/.replit +3 -12
- package/.upm/store.json +1 -1
- package/Extra/Balancer.js +49 -0
- package/Extra/Bypass/956/index.js +234 -0
- package/Extra/Bypass/test/aaaa.json +170 -0
- package/Extra/Bypass/test/index.js +188 -0
- package/Extra/Database/index.js +469 -0
- package/Extra/ExtraAddons.js +82 -0
- package/Extra/ExtraFindUID.js +62 -0
- package/Extra/ExtraGetThread.js +365 -0
- package/Extra/ExtraScreenShot.js +430 -0
- package/Extra/ExtraUptimeRobot.js +38 -0
- package/Extra/Html/Classic/script.js +119 -0
- package/Extra/Html/Classic/style.css +8 -0
- package/Extra/Security/AES_256_GCM/index.js +0 -0
- package/Extra/Security/Base/Step_1.js +6 -0
- package/Extra/Security/Base/Step_2.js +22 -0
- package/Extra/Security/Base/Step_3.js +22 -0
- package/Extra/Security/Base/index.js +191 -0
- package/Extra/Security/Index.js +5 -0
- package/Extra/Security/Step_1.js +6 -0
- package/Extra/Security/Step_2.js +22 -0
- package/Extra/Security/Step_3.js +22 -0
- package/Extra/Src/Change_Environment.js +24 -0
- package/Extra/Src/Check_Update.js +67 -0
- package/Extra/Src/History.js +115 -0
- package/Extra/Src/Instant_Update.js +65 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Premium.js +81 -0
- package/Extra/Src/Release_Memory.js +160 -0
- package/Extra/Src/Websocket.js +213 -0
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/test.js +28 -0
- package/Extra/Src/uuid.js +137 -0
- package/Func/AcceptAgreement.js +31 -0
- package/Func/ClearCache.js +64 -0
- package/Func/ReportV1.js +54 -0
- package/LICENSE +678 -0
- package/Language/index.json +228 -0
- package/Main.js +1444 -0
- package/README.md +30 -175
- package/SECURITY.md +18 -0
- package/broadcast.js +44 -0
- package/index.js +414 -511
- package/logger.js +66 -0
- package/package.json +85 -370
- package/src/Dev_Horizon_Data.js +125 -0
- package/src/Dev_getThreadInfoOLD.js +422 -0
- package/src/Dev_shareTest2.js +68 -0
- package/src/Dev_shareTest3.js +71 -0
- package/src/Premium.js +25 -0
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +5 -14
- package/src/addUserToGroup.js +20 -56
- package/src/changeAdminStatus.js +20 -44
- package/src/changeArchivedStatus.js +11 -25
- package/src/{changeAvatarV2.js → changeAvt.js} +2 -3
- package/src/changeBio.js +15 -26
- package/src/changeBlockedStatus.js +8 -21
- package/src/changeGroupImage.js +24 -53
- package/src/changeNickname.js +13 -27
- package/src/changeThreadColor.js +19 -22
- package/src/changeThreadEmoji.js +11 -24
- package/src/createNewGroup.js +20 -38
- package/src/createPoll.js +16 -27
- package/src/deleteMessage.js +13 -24
- package/src/deleteThread.js +12 -25
- package/src/editMessage.js +53 -71
- package/src/forwardAttachment.js +15 -27
- package/src/getAccessToken.js +28 -0
- package/src/getCurrentUserID.js +1 -1
- package/src/getEmojiUrl.js +8 -10
- package/src/getFriendsList.js +15 -25
- package/src/getMessage.js +81 -813
- package/src/getThreadHistory.js +98 -241
- package/src/getThreadInfo.js +287 -90
- package/src/getThreadInfoOLD.js +422 -0
- package/src/getThreadList.js +157 -214
- package/src/getThreadMain.js +220 -0
- package/src/getThreadPictures.js +19 -39
- package/src/getUID.js +50 -113
- package/src/getUserID.js +14 -18
- package/src/getUserInfo.js +71 -65
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +32 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +13 -24
- package/src/handleMessageRequest.js +20 -36
- package/src/httpGet.js +18 -34
- package/src/httpPost.js +18 -35
- package/src/httpPostFormData.js +24 -53
- package/src/listenMqtt.js +944 -680
- package/src/listenMqttV1.js +846 -0
- package/src/logout.js +15 -22
- package/src/markAsDelivered.js +15 -25
- package/src/markAsRead.js +27 -45
- package/src/markAsReadAll.js +14 -21
- package/src/markAsSeen.js +18 -28
- package/src/muteThread.js +12 -17
- package/src/removeUserFromGroup.js +17 -47
- package/src/resolvePhotoUrl.js +13 -21
- package/src/searchForThread.js +13 -23
- package/src/sendMessage.js +117 -178
- package/src/sendMqttMessage.js +71 -0
- package/src/sendTypingIndicator.js +16 -46
- package/src/setMessageReaction.js +20 -33
- package/src/setPostReaction.js +95 -105
- package/src/setTitle.js +18 -34
- package/src/shareContact.js +37 -92
- package/src/shareLink.js +4 -5
- package/src/threadColors.js +18 -110
- package/src/unfriend.js +9 -18
- package/src/unsendMessage.js +34 -31
- package/src/unsendMqttMessage.js +66 -0
- package/test/Database_Test.js +4 -0
- package/test/Db2.js +530 -0
- package/test/Shankar_Database/A_README.md +1 -0
- package/test/Shankar_Database/Database.db +0 -0
- package/test/data/shareAttach.js +1 -1
- package/test/env/.env +0 -0
- package/test/example-db.db +0 -0
- package/test/memoryleak.js +18 -0
- package/test/test.js +1 -1
- package/test/testname.js +1342 -0
- package/test/testv2.js +3 -0
- package/utils.js +2918 -1393
- package/CHANGELOG.md +0 -2
- package/LICENSE-MIT +0 -21
- package/generated-icon.png +0 -0
- package/replit.nix +0 -5
- package/shankar-fca.json +0 -4
- package/src/changeAvatar.js +0 -136
- package/src/changeBlockedStatusMqtt.js +0 -80
- package/src/changeCover.js +0 -73
- package/src/changeName.js +0 -79
- package/src/changeUsername.js +0 -59
- package/src/createCommentPost.js +0 -230
- package/src/createPost.js +0 -277
- package/src/data/getThreadInfo.json +0 -1
- package/src/editMessageOld.js +0 -67
- package/src/follow.js +0 -74
- package/src/getAccess.js +0 -112
- package/src/getAvatarUser.js +0 -78
- package/src/getRegion.js +0 -7
- package/src/getThreadHistoryDeprecated.js +0 -93
- package/src/getThreadInfoDeprecated.js +0 -80
- package/src/getThreadListDeprecated.js +0 -75
- package/src/listenNotification.js +0 -85
- package/src/pinMessage.js +0 -59
- package/src/refreshFb_dtsg.js +0 -89
- package/src/searchStickers.js +0 -53
- package/src/sendMessageMqtt.js +0 -322
- package/src/sendTypingIndicatorV2.js +0 -28
- package/src/setMessageReactionMqtt.js +0 -62
- package/src/setProfileGuard.js +0 -45
- package/src/setStoryReaction.js +0 -64
- package/src/stopListenMqtt.js +0 -26
- package/src/uploadAttachment.js +0 -94
package/README.md
CHANGED
@@ -1,198 +1,53 @@
|
|
1
|
-
|
1
|
+
[](https://www.npmjs.com/package/fca-smart-shankar)
|
2
2
|
|
3
|
-
#
|
3
|
+
# The following are not allowed here and a little note:
|
4
4
|
|
5
|
-
|
5
|
+
🎆
|
6
6
|
|
7
|
-
|
7
|
+
## Important !
|
8
8
|
|
9
|
-
|
9
|
+
<img width="517" alt="Reason" src="https://i.imgur.com/IEwl35Q.gif">
|
10
|
+
This project is no longer being developed because the project owner lacks high security capabilities, leading to potential security vulnerabilities. Therefore, the project will be permanently suspended.
|
10
11
|
|
11
|
-
|
12
|
+
Special Thanks:
|
13
|
+

|
12
14
|
|
13
|
-
##
|
14
|
-
If you just want to use fca-disme, you should use this command:
|
15
|
-
```bash
|
16
|
-
npm install fca-smart-shankar
|
17
|
-
```
|
18
|
-
It will download `fca-smart-shankar` from NPM repositories
|
19
|
-
|
20
|
-
### Bleeding edge
|
21
|
-
If you want to use bleeding edge (directly from github) to test new features or submit bug report, this is the command for you:
|
22
|
-
```bash
|
23
|
-
npm install fca-smart-shankar
|
24
|
-
```
|
25
|
-
|
26
|
-
## Testing your bots
|
27
|
-
If you want to test your bots without creating another account on Facebook, you can use [Facebook Whitehat Accounts](https://www.facebook.com/whitehat/accounts/).
|
28
|
-
|
29
|
-
## Example Usage
|
30
|
-
```javascript
|
31
|
-
const login = require("fca-smart-shankar");
|
32
|
-
|
33
|
-
// Create simple echo bot
|
34
|
-
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
|
35
|
-
if(err) return console.error(err);
|
36
|
-
|
37
|
-
api.listen((err, message) => {
|
38
|
-
api.sendMessage(message.body, message.threadID);
|
39
|
-
});
|
40
|
-
});
|
41
|
-
```
|
42
|
-
|
43
|
-
Result:
|
15
|
+
## Important !
|
44
16
|
|
45
|
-
|
17
|
+
This package require NodeJS 14.17.0 to work properly.
|
46
18
|
|
19
|
+
## Notification !
|
47
20
|
|
48
|
-
|
21
|
+
Original Project(Deprecated): https://github.com/SHANKAR-PROJECT/fca-smart-shankar
|
49
22
|
|
50
|
-
You can see it [here](DOCS.md).
|
51
23
|
|
52
|
-
|
24
|
+
SHANKAR-PROJECT(22/11/2024)
|
53
25
|
|
54
|
-
|
55
|
-
#### api.sendMessage(message, threadID[, callback][, messageID])
|
26
|
+
## Support For :
|
56
27
|
|
57
|
-
|
58
|
-
|
59
|
-
* *Sticker:* set a field `sticker` to the desired sticker ID.
|
60
|
-
* *File or image:* Set field `attachment` to a readable stream or an array of readable streams.
|
61
|
-
* *URL:* set a field `url` to the desired URL.
|
62
|
-
* *Emoji:* set field `emoji` to the desired emoji as a string and set field `emojiSize` with size of the emoji (`small`, `medium`, `large`)
|
28
|
+
+ Support English, India !,
|
29
|
+
+ All bot if using listenMqtt first.
|
63
30
|
|
64
|
-
|
31
|
+
# Api Cho ChatBot Messenger
|
65
32
|
|
66
|
-
|
67
|
-
|
68
|
-
__Example (Basic Message)__
|
69
|
-
```js
|
70
|
-
const login = require("fca-smart-shankar");
|
71
|
-
|
72
|
-
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
|
73
|
-
if(err) return console.error(err);
|
74
|
-
|
75
|
-
var yourID = "000000000000000";
|
76
|
-
var msg = "Hey!";
|
77
|
-
api.sendMessage(msg, yourID);
|
78
|
-
});
|
33
|
+
```bash
|
34
|
+
npm i fca-smart-shankar
|
79
35
|
```
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
const login = require("fca-smart-shankar");
|
84
|
-
|
85
|
-
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
|
86
|
-
if(err) return console.error(err);
|
87
|
-
|
88
|
-
// Note this example uploads an image called image.jpg
|
89
|
-
var yourID = "000000000000000";
|
90
|
-
var msg = {
|
91
|
-
body: "Hey!",
|
92
|
-
attachment: fs.createReadStream(__dirname + '/image.jpg')
|
93
|
-
}
|
94
|
-
api.sendMessage(msg, yourID);
|
95
|
-
});
|
36
|
+
or
|
37
|
+
```bash
|
38
|
+
npm install fca-smart-shankar
|
96
39
|
```
|
97
40
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
To avoid logging in every time you should save AppState (cookies etc.) to a file, then you can use it without having password in your scripts.
|
102
|
-
|
103
|
-
__Example__
|
104
|
-
|
105
|
-
```js
|
106
|
-
const fs = require("fs");
|
107
|
-
const login = require("fca-smart-shankar");
|
108
|
-
|
109
|
-
var credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"};
|
110
|
-
|
111
|
-
login(credentials, (err, api) => {
|
112
|
-
if(err) return console.error(err);
|
113
|
-
|
114
|
-
fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState()));
|
115
|
-
});
|
41
|
+
```bash
|
42
|
+
npm install fca-smart-shankard@latest
|
116
43
|
```
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
------------------------------------
|
121
|
-
|
122
|
-
### Listening to a chat
|
123
|
-
#### api.listen(callback)
|
124
|
-
|
125
|
-
Listen watches for messages sent in a chat. By default this won't receive events (joining/leaving a chat, title change etc…) but it can be activated with `api.setOptions({listenEvents: true})`. This will by default ignore messages sent by the current account, you can enable listening to your own messages with `api.setOptions({selfListen: true})`.
|
126
|
-
|
127
|
-
__Example__
|
128
|
-
|
129
|
-
```js
|
130
|
-
const fs = require("fs");
|
131
|
-
const login = require("fca-smart-shankar");
|
132
|
-
|
133
|
-
// Simple echo bot. It will repeat everything that you say.
|
134
|
-
// Will stop when you say '/stop'
|
135
|
-
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, api) => {
|
136
|
-
if(err) return console.error(err);
|
137
|
-
|
138
|
-
api.setOptions({listenEvents: true});
|
139
|
-
|
140
|
-
var stopListening = api.listenMqtt((err, event) => {
|
141
|
-
if(err) return console.error(err);
|
142
|
-
|
143
|
-
api.markAsRead(event.threadID, (err) => {
|
144
|
-
if(err) console.error(err);
|
145
|
-
});
|
146
|
-
|
147
|
-
switch(event.type) {
|
148
|
-
case "message":
|
149
|
-
if(event.body === '/stop') {
|
150
|
-
api.sendMessage("Goodbye…", event.threadID);
|
151
|
-
return stopListening();
|
152
|
-
}
|
153
|
-
api.sendMessage("TEST BOT: " + event.body, event.threadID);
|
154
|
-
break;
|
155
|
-
case "event":
|
156
|
-
console.log(event);
|
157
|
-
break;
|
158
|
-
}
|
159
|
-
});
|
160
|
-
});
|
44
|
+
and
|
45
|
+
```bash
|
46
|
+
npm i fca-smart-shankar@latest
|
161
47
|
```
|
162
48
|
|
163
|
-
##
|
164
|
-
|
165
|
-
1. How do I run tests?
|
166
|
-
> For tests, create a `test-config.json` file that resembles `example-config.json` and put it in the `test` directory. From the root >directory, run `npm test`.
|
167
|
-
|
168
|
-
2. Why doesn't `sendMessage` always work when I'm logged in as a page?
|
169
|
-
> Pages can't start conversations with users directly; this is to prevent pages from spamming users.
|
170
|
-
|
171
|
-
3. What do I do when `login` doesn't work?
|
172
|
-
> First check that you can login to Facebook using the website. If login approvals are enabled, you might be logging in incorrectly. For how to handle login approvals, read our docs on [`login`](DOCS.md#login).
|
173
|
-
|
174
|
-
4. How can I avoid logging in every time? Can I log into a previous session?
|
175
|
-
> We support caching everything relevant for you to bypass login. `api.getAppState()` returns an object that you can save and pass into login as `{appState: mySavedAppState}` instead of the credentials object. If this fails, your session has expired.
|
176
|
-
|
177
|
-
5. Do you support sending messages as a page?
|
178
|
-
> Yes, set the pageID option on login (this doesn't work if you set it using api.setOptions, it affects the login process).
|
179
|
-
> ```js
|
180
|
-
> login(credentials, {pageID: "000000000000000"}, (err, api) => { … }
|
181
|
-
> ```
|
182
|
-
|
183
|
-
6. I'm getting some crazy weird syntax error like `SyntaxError: Unexpected token [`!!!
|
184
|
-
> Please try to update your version of node.js before submitting an issue of this nature. We like to use new language features.
|
185
|
-
|
186
|
-
7. I don't want all of these logging messages!
|
187
|
-
> You can use `api.setOptions` to silence the logging. You get the `api` object from `login` (see example above). Do
|
188
|
-
> ```js
|
189
|
-
> api.setOptions({
|
190
|
-
> logLevel: "silent"
|
191
|
-
> });
|
192
|
-
> ```
|
49
|
+
## SHANKAR PROJECT
|
193
50
|
|
194
|
-
|
195
|
-
## Projects using this API:
|
51
|
+
## FACEBOOK
|
196
52
|
|
197
|
-
|
198
|
-
- [SMART-SHANKAR-BOT](https://github.com/SHANKAR-PROJECT/SMART-SHANKAR-BOT) - A simple Facebook Messenger Bot made by Smart Shankar.
|
53
|
+
FACEBOOK => [Link](https://www.facebook.com/shankar.suman.98622733?mibextid=JRoKGi)
|
package/SECURITY.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
+ if have any Vulnerability finded contact: Author(KanzuWakazaki.Main@proton.me) or (Facebook.com/Lazic.Kanzu). Thanks!
|
4
|
+
|
5
|
+
## Supported Versions
|
6
|
+
|
7
|
+
Use this section to tell people about which versions of your project are
|
8
|
+
currently being supported with security updates.
|
9
|
+
|
10
|
+
| Version | Supported |
|
11
|
+
| ------- | ------------------ |
|
12
|
+
| StableVersion | :white_check_mark: |
|
13
|
+
| AutoUpdate | :white_check_mark:|
|
14
|
+
| Modified | :x:
|
15
|
+
|
16
|
+
## Reporting a Vulnerability
|
17
|
+
|
18
|
+
Contact Author or create pull!
|
package/broadcast.js
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const logger = require('./logger');
|
4
|
+
const Fetch = require('got');
|
5
|
+
|
6
|
+
const broadcastConfig = {
|
7
|
+
enabled: false,
|
8
|
+
data: [],
|
9
|
+
};
|
10
|
+
|
11
|
+
const fetchBroadcastData = async () => {
|
12
|
+
try {
|
13
|
+
const response = await Fetch.get('https://raw.githubusercontent.com/SHANKAR-PROJECT/Global_Shankar/main/Fca_BroadCast.json');
|
14
|
+
broadcastConfig.data = JSON.parse(response.body.toString());
|
15
|
+
return broadcastConfig.data;
|
16
|
+
} catch (error) {
|
17
|
+
logger.Error(`Failed to fetch broadcast data: ${error.message}`);
|
18
|
+
broadcastConfig.data = [];
|
19
|
+
return [];
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
const broadcastRandomMessage = () => {
|
24
|
+
const randomMessage = broadcastConfig.data.length > 0 ? broadcastConfig.data[Math.floor(Math.random() * broadcastConfig.data.length)] : 'Stay Cheerful!';
|
25
|
+
logger.Normal(randomMessage);
|
26
|
+
};
|
27
|
+
|
28
|
+
const startBroadcasting = async (enabled) => {
|
29
|
+
enabled = global.Fca.Require.ShankarConfig.BroadCast
|
30
|
+
|
31
|
+
if (enabled) {
|
32
|
+
try {
|
33
|
+
await fetchBroadcastData();
|
34
|
+
broadcastRandomMessage();
|
35
|
+
setInterval(broadcastRandomMessage, 3600 * 1000);
|
36
|
+
} catch (error) {
|
37
|
+
logger.Error(`Failed to start broadcasting: ${error.message}`);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
module.exports = {
|
43
|
+
startBroadcasting,
|
44
|
+
};
|