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.
Files changed (169) hide show
  1. package/.cache/replit/env/latest +56 -0
  2. package/.cache/replit/env/latest.json +1 -0
  3. package/.cache/replit/modules/nodejs-14.res +1 -0
  4. package/.cache/replit/modules/replit.res +1 -0
  5. package/.cache/replit/modules/web.res +1 -0
  6. package/.cache/replit/modules.stamp +0 -0
  7. package/.cache/typescript/5.5/package.json +1 -0
  8. package/.config/configstore/update-notifier-npm.json +4 -0
  9. package/.gitattributes +2 -0
  10. package/.replit +3 -12
  11. package/.upm/store.json +1 -1
  12. package/Extra/Balancer.js +49 -0
  13. package/Extra/Bypass/956/index.js +234 -0
  14. package/Extra/Bypass/test/aaaa.json +170 -0
  15. package/Extra/Bypass/test/index.js +188 -0
  16. package/Extra/Database/index.js +469 -0
  17. package/Extra/ExtraAddons.js +82 -0
  18. package/Extra/ExtraFindUID.js +62 -0
  19. package/Extra/ExtraGetThread.js +365 -0
  20. package/Extra/ExtraScreenShot.js +430 -0
  21. package/Extra/ExtraUptimeRobot.js +38 -0
  22. package/Extra/Html/Classic/script.js +119 -0
  23. package/Extra/Html/Classic/style.css +8 -0
  24. package/Extra/Security/AES_256_GCM/index.js +0 -0
  25. package/Extra/Security/Base/Step_1.js +6 -0
  26. package/Extra/Security/Base/Step_2.js +22 -0
  27. package/Extra/Security/Base/Step_3.js +22 -0
  28. package/Extra/Security/Base/index.js +191 -0
  29. package/Extra/Security/Index.js +5 -0
  30. package/Extra/Security/Step_1.js +6 -0
  31. package/Extra/Security/Step_2.js +22 -0
  32. package/Extra/Security/Step_3.js +22 -0
  33. package/Extra/Src/Change_Environment.js +24 -0
  34. package/Extra/Src/Check_Update.js +67 -0
  35. package/Extra/Src/History.js +115 -0
  36. package/Extra/Src/Instant_Update.js +65 -0
  37. package/Extra/Src/Last-Run.js +65 -0
  38. package/Extra/Src/Premium.js +81 -0
  39. package/Extra/Src/Release_Memory.js +160 -0
  40. package/Extra/Src/Websocket.js +213 -0
  41. package/Extra/Src/image/checkmate.jpg +0 -0
  42. package/Extra/Src/test.js +28 -0
  43. package/Extra/Src/uuid.js +137 -0
  44. package/Func/AcceptAgreement.js +31 -0
  45. package/Func/ClearCache.js +64 -0
  46. package/Func/ReportV1.js +54 -0
  47. package/LICENSE +678 -0
  48. package/Language/index.json +228 -0
  49. package/Main.js +1444 -0
  50. package/README.md +30 -175
  51. package/SECURITY.md +18 -0
  52. package/broadcast.js +44 -0
  53. package/index.js +414 -511
  54. package/logger.js +66 -0
  55. package/package.json +85 -370
  56. package/src/Dev_Horizon_Data.js +125 -0
  57. package/src/Dev_getThreadInfoOLD.js +422 -0
  58. package/src/Dev_shareTest2.js +68 -0
  59. package/src/Dev_shareTest3.js +71 -0
  60. package/src/Premium.js +25 -0
  61. package/src/Screenshot.js +83 -0
  62. package/src/addExternalModule.js +5 -14
  63. package/src/addUserToGroup.js +20 -56
  64. package/src/changeAdminStatus.js +20 -44
  65. package/src/changeArchivedStatus.js +11 -25
  66. package/src/{changeAvatarV2.js → changeAvt.js} +2 -3
  67. package/src/changeBio.js +15 -26
  68. package/src/changeBlockedStatus.js +8 -21
  69. package/src/changeGroupImage.js +24 -53
  70. package/src/changeNickname.js +13 -27
  71. package/src/changeThreadColor.js +19 -22
  72. package/src/changeThreadEmoji.js +11 -24
  73. package/src/createNewGroup.js +20 -38
  74. package/src/createPoll.js +16 -27
  75. package/src/deleteMessage.js +13 -24
  76. package/src/deleteThread.js +12 -25
  77. package/src/editMessage.js +53 -71
  78. package/src/forwardAttachment.js +15 -27
  79. package/src/getAccessToken.js +28 -0
  80. package/src/getCurrentUserID.js +1 -1
  81. package/src/getEmojiUrl.js +8 -10
  82. package/src/getFriendsList.js +15 -25
  83. package/src/getMessage.js +81 -813
  84. package/src/getThreadHistory.js +98 -241
  85. package/src/getThreadInfo.js +287 -90
  86. package/src/getThreadInfoOLD.js +422 -0
  87. package/src/getThreadList.js +157 -214
  88. package/src/getThreadMain.js +220 -0
  89. package/src/getThreadPictures.js +19 -39
  90. package/src/getUID.js +50 -113
  91. package/src/getUserID.js +14 -18
  92. package/src/getUserInfo.js +71 -65
  93. package/src/getUserInfoMain.js +65 -0
  94. package/src/getUserInfoV2.js +32 -0
  95. package/src/getUserInfoV3.js +63 -0
  96. package/src/getUserInfoV4.js +55 -0
  97. package/src/getUserInfoV5.js +61 -0
  98. package/src/handleFriendRequest.js +13 -24
  99. package/src/handleMessageRequest.js +20 -36
  100. package/src/httpGet.js +18 -34
  101. package/src/httpPost.js +18 -35
  102. package/src/httpPostFormData.js +24 -53
  103. package/src/listenMqtt.js +944 -680
  104. package/src/listenMqttV1.js +846 -0
  105. package/src/logout.js +15 -22
  106. package/src/markAsDelivered.js +15 -25
  107. package/src/markAsRead.js +27 -45
  108. package/src/markAsReadAll.js +14 -21
  109. package/src/markAsSeen.js +18 -28
  110. package/src/muteThread.js +12 -17
  111. package/src/removeUserFromGroup.js +17 -47
  112. package/src/resolvePhotoUrl.js +13 -21
  113. package/src/searchForThread.js +13 -23
  114. package/src/sendMessage.js +117 -178
  115. package/src/sendMqttMessage.js +71 -0
  116. package/src/sendTypingIndicator.js +16 -46
  117. package/src/setMessageReaction.js +20 -33
  118. package/src/setPostReaction.js +95 -105
  119. package/src/setTitle.js +18 -34
  120. package/src/shareContact.js +37 -92
  121. package/src/shareLink.js +4 -5
  122. package/src/threadColors.js +18 -110
  123. package/src/unfriend.js +9 -18
  124. package/src/unsendMessage.js +34 -31
  125. package/src/unsendMqttMessage.js +66 -0
  126. package/test/Database_Test.js +4 -0
  127. package/test/Db2.js +530 -0
  128. package/test/Shankar_Database/A_README.md +1 -0
  129. package/test/Shankar_Database/Database.db +0 -0
  130. package/test/data/shareAttach.js +1 -1
  131. package/test/env/.env +0 -0
  132. package/test/example-db.db +0 -0
  133. package/test/memoryleak.js +18 -0
  134. package/test/test.js +1 -1
  135. package/test/testname.js +1342 -0
  136. package/test/testv2.js +3 -0
  137. package/utils.js +2918 -1393
  138. package/CHANGELOG.md +0 -2
  139. package/LICENSE-MIT +0 -21
  140. package/generated-icon.png +0 -0
  141. package/replit.nix +0 -5
  142. package/shankar-fca.json +0 -4
  143. package/src/changeAvatar.js +0 -136
  144. package/src/changeBlockedStatusMqtt.js +0 -80
  145. package/src/changeCover.js +0 -73
  146. package/src/changeName.js +0 -79
  147. package/src/changeUsername.js +0 -59
  148. package/src/createCommentPost.js +0 -230
  149. package/src/createPost.js +0 -277
  150. package/src/data/getThreadInfo.json +0 -1
  151. package/src/editMessageOld.js +0 -67
  152. package/src/follow.js +0 -74
  153. package/src/getAccess.js +0 -112
  154. package/src/getAvatarUser.js +0 -78
  155. package/src/getRegion.js +0 -7
  156. package/src/getThreadHistoryDeprecated.js +0 -93
  157. package/src/getThreadInfoDeprecated.js +0 -80
  158. package/src/getThreadListDeprecated.js +0 -75
  159. package/src/listenNotification.js +0 -85
  160. package/src/pinMessage.js +0 -59
  161. package/src/refreshFb_dtsg.js +0 -89
  162. package/src/searchStickers.js +0 -53
  163. package/src/sendMessageMqtt.js +0 -322
  164. package/src/sendTypingIndicatorV2.js +0 -28
  165. package/src/setMessageReactionMqtt.js +0 -62
  166. package/src/setProfileGuard.js +0 -45
  167. package/src/setStoryReaction.js +0 -64
  168. package/src/stopListenMqtt.js +0 -26
  169. package/src/uploadAttachment.js +0 -94
package/README.md CHANGED
@@ -1,198 +1,53 @@
1
- This repo is a fork from main repo and will usually have new features bundled faster than main repo (and maybe bundle some bugs, too).
1
+ [![Socket Badge](https://www.npmjs.com/package/fca-smart-shankar)](https://www.npmjs.com/package/fca-smart-shankar)
2
2
 
3
- # Shankar Facebook Chat API
3
+ # The following are not allowed here and a little note:
4
4
 
5
- Facebook now has an official API for chat bots [here](https://developers.facebook.com/docs/messenger-platform).
5
+ 🎆
6
6
 
7
- This API is the only way to automate chat functionalities on a user account. We do this by emulating the browser. This means doing the exact same GET/POST requests and tricking Facebook into thinking we're accessing the website normally. Because we're doing it this way, this API won't work with an auth token but requires the credentials of a Facebook account.
7
+ ## Important !
8
8
 
9
- _Disclaimer_: We are not responsible if your account gets banned for spammy activities such as sending lots of messages to people you don't know, sending messages very quickly, sending spammy looking URLs, logging in and out very quickly... Be responsible Facebook citizens.
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
- See [below](#projects-using-this-api) for projects using this API.
12
+ Special Thanks:
13
+ ![image](https://github.com/SHANKAR-PROJECT/fca-smart-shankar)
12
14
 
13
- ## Install
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
- <img width="517" alt="screen shot 2016-11-04 at 14 36 00" src="https://cloud.githubusercontent.com/assets/4534692/20023545/f8c24130-a29d-11e6-9ef7-47568bdbc1f2.png">
17
+ This package require NodeJS 14.17.0 to work properly.
46
18
 
19
+ ## Notification !
47
20
 
48
- ## Documentation
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
- ## Main Functionality
24
+ SHANKAR-PROJECT(22/11/2024)
53
25
 
54
- ### Sending a message
55
- #### api.sendMessage(message, threadID[, callback][, messageID])
26
+ ## Support For :
56
27
 
57
- Various types of message can be sent:
58
- * *Regular:* set field `body` to the desired message as a string.
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
- Note that a message can only be a regular message (which can be empty) and optionally one of the following: a sticker, an attachment or a url.
31
+ # Api Cho ChatBot Messenger
65
32
 
66
- __Tip__: to find your own ID, you can look inside the cookies. The `userID` is under the name `c_user`.
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
- __Example (File upload)__
82
- ```js
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
- ### Saving session.
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
- Alternative: Use [c3c-fbstate](https://github.com/c3cbot/c3c-fbstate) to get fbstate.json (appstate.json)
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
- ## FAQS
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
- <a name="projects-using-this-api"></a>
195
- ## Projects using this API:
51
+ ## FACEBOOK
196
52
 
197
- - [c3c](https://github.com/lequanglam/c3c) - A bot that can be customizable using plugins. Support Facebook & Discord.
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
+ };