chards-script 1.0.1
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.
Potentially problematic release.
This version of chards-script might be problematic. Click here for more details.
- package/.cache/replit/__replit_disk_meta.json +1 -0
- package/.cache/replit/modules.stamp +1 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.config/configstore/update-notifier-npm.json +4 -0
- package/.replit +89 -0
- package/.upm/store.json +1 -0
- package/CountTime.json +1 -0
- package/Extra/Database/index.js +469 -0
- package/Extra/ExtraAddons.js +82 -0
- package/Extra/ExtraFindUID.js +62 -0
- package/Extra/ExtraGetThread.js +340 -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 +60 -0
- package/Extra/Security/Index.js +173 -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/Release_Memory.js +41 -0
- package/Extra/Src/Websocket.js +213 -0
- package/Extra/Src/image/checkmate.jpg +0 -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/Index.js +383 -0
- package/Language/index.json +217 -0
- package/Main.js +1228 -0
- package/README.md +390 -0
- package/SECURITY.md +18 -0
- package/broadcast.js +40 -0
- package/logger.js +66 -0
- package/package.json +133 -0
- package/rawscript.zip +0 -0
- package/replit.nix +9 -0
- package/src/Dev_Horizon_Data.js +125 -0
- package/src/Premium.js +25 -0
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +79 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +28 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadInfo.js +425 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadMain.js +220 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +113 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +34 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +797 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +379 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/test/Database_Test.js +4 -0
- package/test/Db2.js +530 -0
- package/test/Horizon_Database/A_README.md +1 -0
- package/test/Horizon_Database/Database.db +0 -0
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/env/.env +0 -0
- package/test/example-config.json +18 -0
- package/test/example-db.db +0 -0
- package/test/memoryleak.js +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/test/testv2.js +18 -0
- package/utils.js +1684 -0
package/README.md
ADDED
@@ -0,0 +1,390 @@
|
|
1
|
+
# UNOFFICIAL FACEBOOK CHAT API
|
2
|
+
|
3
|
+
<h1 align="center">
|
4
|
+
<code></code>
|
5
|
+
</h1>
|
6
|
+
<h3 align="center"></h3>
|
7
|
+
<p align="center">
|
8
|
+
<a aria-label="NPM Version" href="https://www.npmjs.com/package/chards-script">
|
9
|
+
<img alt="" src="https://img.shields.io/npm/v/chards-script.svg?label=NPM&logo=npm&style=for-the-badge&color=F2984A&logoColor=white">
|
10
|
+
</a>
|
11
|
+
<a aria-label="NPM Download Count" href="https://www.npmjs.com/package/chards-script">
|
12
|
+
<img alt="" src="https://img.shields.io/npm/dt/chards-script?label=Downloads&style=for-the-badge&color=D2667B">
|
13
|
+
</a>
|
14
|
+
<a aria-label="chards-script Size" href="https://www.npmjs.com/package/chards-script">
|
15
|
+
<img alt="" src="https://img.shields.io/bundlephobia/minzip/chards-script?style=for-the-badge&color=8B77CD">
|
16
|
+
</a>
|
17
|
+
<a aria-label="Join the community on Slack" href="https://join.slack.com/t/chards-scriptworkspace/shared_invite/zt-1y1g3570m-Hx_N3IShMYBMkR6jpRyRjw">
|
18
|
+
<img alt="" src="https://img.shields.io/badge/Slack-339AE0?style=for-the-badge&logo=slack&logoColor=white&label=Community">
|
19
|
+
</a>
|
20
|
+
</p>
|
21
|
+
|
22
|
+
## 🤝🏻 Connect With ChardsBot
|
23
|
+
|
24
|
+
[](https://github.com/prettier/prettier)
|
25
|
+
|
26
|
+
## Important !
|
27
|
+
|
28
|
+
This package requires NodeJS 14.17.0 to work properly.
|
29
|
+
|
30
|
+
## Support For :
|
31
|
+
|
32
|
+
+ Support English, Vietnamese !,
|
33
|
+
+ All bots if using listenMqtt first.
|
34
|
+
|
35
|
+
# API for Messenger Chatbots
|
36
|
+
|
37
|
+
Facebook now has API for creating chatbots 😪 Here => [Here](https://developers.facebook.com/docs/messenger-platform).
|
38
|
+
|
39
|
+
### This API might cause your account to be flagged like you've never experienced before, be careful =))
|
40
|
+
|
41
|
+
Note! If you want to use this API, check the document at [Here](https://github.com/Schmavery/facebook-chat-api).
|
42
|
+
|
43
|
+
## Download
|
44
|
+
|
45
|
+
#### If you have a chards-script.zip file
|
46
|
+
|
47
|
+
##### Sample Replit SETUP
|
48
|
+
|
49
|
+
1st step:
|
50
|
+
```shell
|
51
|
+
unzip chards-script
|
52
|
+
```
|
53
|
+
|
54
|
+
2nd step:
|
55
|
+
```shell
|
56
|
+
cd chards-script
|
57
|
+
```
|
58
|
+
|
59
|
+
3rd step:
|
60
|
+
```shell
|
61
|
+
npm i
|
62
|
+
```
|
63
|
+
|
64
|
+
then back to local
|
65
|
+
```shell
|
66
|
+
cd ..
|
67
|
+
```
|
68
|
+
|
69
|
+
### If want to installed from npm
|
70
|
+
|
71
|
+
```shell
|
72
|
+
npm i chards-script@latest
|
73
|
+
```
|
74
|
+
|
75
|
+
## If You Want to Test the API
|
76
|
+
|
77
|
+
The benefits for doing this are that you won't waste time on flagged accounts and you'll have an account 😪
|
78
|
+
Use it with a testing account => [Facebook Whitehat Accounts](https://www.facebook.com/whitehat/accounts/).
|
79
|
+
|
80
|
+
## How to Use
|
81
|
+
|
82
|
+
```javascript
|
83
|
+
const login = require("chards-script"); // get it from the library
|
84
|
+
|
85
|
+
// logging in
|
86
|
+
login({email: "email", password: "password"}, (err, api) => {
|
87
|
+
|
88
|
+
if(err) return console.error(err); // error case
|
89
|
+
|
90
|
+
// create a bot that mimics you automatically:
|
91
|
+
api.listenMqtt((err, message) => {
|
92
|
+
api.sendMessage(message.body, message.threadID);
|
93
|
+
});
|
94
|
+
|
95
|
+
});
|
96
|
+
```
|
97
|
+
|
98
|
+
The result is that it will mimic you as shown below:
|
99
|
+
<img width="517" alt="screen shot 2016-11-04 at 14 36 00.jpg" src="https://cloud.githubusercontent.com/assets/4534692/20023545/f8c24130-a29d-11e6-9ef7-47568bdbc1f2.png">
|
100
|
+
|
101
|
+
If you want advanced usage, use the listed types of bots above!
|
102
|
+
|
103
|
+
## List
|
104
|
+
|
105
|
+
You can read the full API documentation at => [here](DOCS.md).
|
106
|
+
|
107
|
+
## Installation for Mirai:
|
108
|
+
|
109
|
+
You need to go to the Mirai.js file, then find this line
|
110
|
+
```js
|
111
|
+
var login = require('a bot');
|
112
|
+
/* It can be :
|
113
|
+
var login = require('chards-script');
|
114
|
+
...
|
115
|
+
*/
|
116
|
+
```
|
117
|
+
|
118
|
+
And replace it with:
|
119
|
+
|
120
|
+
```js
|
121
|
+
var login = require('chards-script')
|
122
|
+
```
|
123
|
+
|
124
|
+
After that, just run it as usual!
|
125
|
+
|
126
|
+
## Self Study
|
127
|
+
|
128
|
+
If you want to study or create a bot for yourself, go to this link to read its features and how to use it => [Link](https://github.com/Schmavery/facebook-chat-api#Unofficial%20Facebook%20Chat%20API)
|
129
|
+
|
130
|
+
------------------------------------
|
131
|
+
|
132
|
+
### Saving Login Information.
|
133
|
+
|
134
|
+
To save it, you need a state like (Cookie, etc,..) to save it or use the login code above to log in!
|
135
|
+
|
136
|
+
And this mode is already available in some Vietnamese bots, so you can rest assured!
|
137
|
+
|
138
|
+
__Guide to Using AppState__
|
139
|
+
|
140
|
+
```js
|
141
|
+
const fs = require("fs");
|
142
|
+
const login = require("chards-script");
|
143
|
+
|
144
|
+
var credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"}; // account information
|
145
|
+
|
146
|
+
login(credentials, (err, api) => {
|
147
|
+
if(err) return console.error(err);
|
148
|
+
// logging in
|
149
|
+
fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState(), null,'\t')); // create appstate
|
150
|
+
});
|
151
|
+
```
|
152
|
+
|
153
|
+
Or, easier (more professional), you can use => [c3c-fbstate](https://github.com/c3cbot/c3c-fbstate) to get Fbstate and then rename it to Apstate! (appstate.json)
|
154
|
+
|
155
|
+
------------------------------------
|
156
|
+
|
157
|
+
## FAQs
|
158
|
+
|
159
|
+
FAQs => [Link](https://github.com/Schmavery/facebook-chat-api#FAQS)
|
160
|
+
|
161
|
+
## Documentation
|
162
|
+
|
163
|
+
- [`login`](DOCS.md#login)
|
164
|
+
- [`api.addUserToGroup`](DOCS.md#addUserToGroup)
|
165
|
+
- [`api.changeAdminStatus`](DOCS.md#changeAdminStatus)
|
166
|
+
- [`api.changeApprovalMode`](DOCS.md#changeApprovalMode)
|
167
|
+
- [`api.changeArchivedStatus`](DOCS.md#changeArchivedStatus)
|
168
|
+
- [`api.changeBlockedStatus`](DOCS.md#changeBlockedStatus)
|
169
|
+
- [`api.changeGroupImage`](DOCS.md#changeGroupImage)
|
170
|
+
- [`api.changeNickname`](DOCS.md#changeNickname)
|
171
|
+
- [`api.changeThreadColor`](DOCS.md#changeThreadColor)
|
172
|
+
- [`api.changeThreadEmoji`](DOCS.md#changeThreadEmoji)
|
173
|
+
- [`api.createPoll`](DOCS.md#createPoll)
|
174
|
+
- [`api.deleteMessage`](DOCS.md#deleteMessage)
|
175
|
+
- [`api.deleteThread`](DOCS.md#deleteThread)
|
176
|
+
- [`api.forwardAttachment`](DOCS.md#forwardAttachment)
|
177
|
+
- [`api.getAppState`](DOCS.md#getAppState)
|
178
|
+
- [`api.getCurrentUserID`](DOCS.md#getCurrentUserID)
|
179
|
+
- [`api.getFriendsList`](DOCS.md#getFriendsList)
|
180
|
+
- [`api.getThreadHistory`](DOCS.md#getThreadHistory)
|
181
|
+
- [`api.getThreadInfo`](DOCS.md#getThreadInfo)
|
182
|
+
- [`api.getThreadList`](DOCS.md#getThreadList)
|
183
|
+
- [`api.getThreadPictures`](DOCS.md#getThreadPictures)
|
184
|
+
- [`api.getUserID`](DOCS.md#getUserID)
|
185
|
+
- [`api.getUserInfo`](DOCS.md#getUserInfo)
|
186
|
+
- [`api.handleMessageRequest`](DOCS.md#handleMessageRequest)
|
187
|
+
- [`api.listen`](DOCS.md#listen)
|
188
|
+
- [`api.listenMqtt`](DOCS.md#listenMqtt)
|
189
|
+
- [`api.logout`](DOCS.md#logout)
|
190
|
+
- [`api.markAsRead`](DOCS.md#markAsRead)
|
191
|
+
- [`api.markAsReadAll`](DOCS.md#markAsReadAll)
|
192
|
+
- [`api.muteThread`](DOCS.md#muteThread)
|
193
|
+
- [`api.removeUserFromGroup`](DOCS.md#removeUserFromGroup)
|
194
|
+
- [`api.resolvePhotoUrl`](DOCS.md#resolvePhotoUrl)
|
195
|
+
- [`api.searchForThread`](DOCS.md#searchForThread)
|
196
|
+
- [`api.sendMessage`](DOCS.md#sendMessage)
|
197
|
+
- [`api.sendTypingIndicator`](DOCS.md#sendTypingIndicator)
|
198
|
+
- [`api.setMessageReaction`](DOCS.md#setMessageReaction)
|
199
|
+
- [`api.setOptions`](DOCS.md#setOptions)
|
200
|
+
- [`api.setTitle`](DOCS.md#setTitle)
|
201
|
+
- [`api.unsendMessage`](DOCS.md#unsendMessage)
|
202
|
+
|
203
|
+
## Main Functionality
|
204
|
+
|
205
|
+
### Sending a message
|
206
|
+
|
207
|
+
#### api.sendMessage(message, threadID[, callback][, messageid])
|
208
|
+
|
209
|
+
Various types of message can be sent:
|
210
|
+
|
211
|
+
- _Regular:_ set field `body` to the desired message as a string.
|
212
|
+
- _Sticker:_ set a field `sticker` to the desired sticker ID.
|
213
|
+
- _File or image:_ Set field `attachment` to a readable stream or an array of readable streams.
|
214
|
+
- _URL:_ set a field `url` to the desired URL.
|
215
|
+
- _Emoji:_ set field `emoji` to the desired emoji as a string and set field `emojiSize` with size of the emoji (`small`, `medium`, `large`)
|
216
|
+
|
217
|
+
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.
|
218
|
+
|
219
|
+
**Tip**: to find your own ID, you can look inside the cookies. The `userID` is under the name `c_user`.
|
220
|
+
|
221
|
+
**Example (Basic Message)**
|
222
|
+
|
223
|
+
```js
|
224
|
+
const login = require("chards-script");
|
225
|
+
|
226
|
+
login({ email: "FB_EMAIL", password: "FB_PASSWORD" }, (err, api) => {
|
227
|
+
if (err) return console.error(err);
|
228
|
+
|
229
|
+
var yourID = "000000000000000";
|
230
|
+
var msg = "Hey!";
|
231
|
+
api.sendMessage(msg, yourID);
|
232
|
+
});
|
233
|
+
```
|
234
|
+
|
235
|
+
**Example (File upload)**
|
236
|
+
|
237
|
+
```js
|
238
|
+
const login = require("chards-script");
|
239
|
+
|
240
|
+
login({ email: "FB_EMAIL", password: "FB_PASSWORD" }, (err, api) => {
|
241
|
+
if (err) return console.error(err);
|
242
|
+
|
243
|
+
// Note this example uploads an image called image.jpg
|
244
|
+
var yourID = "000000000000000";
|
245
|
+
var msg = {
|
246
|
+
body: "Hey!",
|
247
|
+
attachment: fs.createReadStream(__dirname + "/image.jpg"),
|
248
|
+
};
|
249
|
+
api.sendMessage(msg, yourID);
|
250
|
+
});
|
251
|
+
```
|
252
|
+
|
253
|
+
---
|
254
|
+
|
255
|
+
### Saving session.
|
256
|
+
|
257
|
+
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.
|
258
|
+
|
259
|
+
**Example**
|
260
|
+
|
261
|
+
```js
|
262
|
+
const fs = require("fs");
|
263
|
+
const login = require("chards-script");
|
264
|
+
|
265
|
+
var credentials = { email: "FB_EMAIL", password: "FB_PASSWORD" };
|
266
|
+
|
267
|
+
login(credentials, (err, api) => {
|
268
|
+
if (err) return console.error(err);
|
269
|
+
|
270
|
+
fs.writeFileSync("appstate.json", JSON.stringify(api.getAppState()));
|
271
|
+
});
|
272
|
+
```
|
273
|
+
|
274
|
+
Alternative: Use [c3c-fbstate](https://github.com/lequanglam/c3c-fbstate) to get fbstate.json (appstate.json)
|
275
|
+
|
276
|
+
---
|
277
|
+
|
278
|
+
### Listening to a chat
|
279
|
+
|
280
|
+
#### api.listen(callback)
|
281
|
+
|
282
|
+
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})`.
|
283
|
+
|
284
|
+
**Example**
|
285
|
+
|
286
|
+
```js
|
287
|
+
const fs = require("fs");
|
288
|
+
const login = require("chards-script");
|
289
|
+
|
290
|
+
// Simple echo bot. It will repeat everything that you say.
|
291
|
+
// Will stop when you say '/stop'
|
292
|
+
login(
|
293
|
+
{ appState: JSON.parse(fs.readFileSync("appstate.json", "utf8")) },
|
294
|
+
(err, api) => {
|
295
|
+
if (err) return console.error(err);
|
296
|
+
|
297
|
+
api.setOptions({ listenEvents: true });
|
298
|
+
|
299
|
+
var stopListening = api.listenMqtt((err, event) => {
|
300
|
+
if (err) return console.error(err);
|
301
|
+
|
302
|
+
api.markAsRead(event.threadID, (err) => {
|
303
|
+
if (err) console.error(err);
|
304
|
+
});
|
305
|
+
|
306
|
+
switch (event.type) {
|
307
|
+
case "message":
|
308
|
+
if (event.body === "/stop") {
|
309
|
+
api.sendMessage("Goodbye…", event.threadID);
|
310
|
+
return stopListening();
|
311
|
+
}
|
312
|
+
api.sendMessage("TEST BOT: " + event.body, event.threadID);
|
313
|
+
break;
|
314
|
+
case "event":
|
315
|
+
console.log(event);
|
316
|
+
break;
|
317
|
+
}
|
318
|
+
});
|
319
|
+
}
|
320
|
+
);
|
321
|
+
```
|
322
|
+
|
323
|
+
## FAQS
|
324
|
+
|
325
|
+
1. How do I run tests?
|
326
|
+
|
327
|
+
> 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`.
|
328
|
+
|
329
|
+
2. Why doesn't `sendMessage` always work when I'm logged in as a page?
|
330
|
+
|
331
|
+
> Pages can't start conversations with users directly; this is to prevent pages from spamming users.
|
332
|
+
|
333
|
+
3. What do I do when `login` doesn't work?
|
334
|
+
|
335
|
+
> 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).
|
336
|
+
|
337
|
+
4. How can I avoid logging in every time? Can I log into a previous session?
|
338
|
+
|
339
|
+
> 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.
|
340
|
+
|
341
|
+
5. Do you support sending messages as a page?
|
342
|
+
|
343
|
+
> Yes, set the pageID option on login (this doesn't work if you set it using api.setOptions, it affects the login process).
|
344
|
+
>
|
345
|
+
> ```js
|
346
|
+
> login(credentials, {pageID: "000000000000000"}, (err, api) => { … }
|
347
|
+
> ```
|
348
|
+
|
349
|
+
6. I'm getting some crazy weird syntax error like `SyntaxError: Unexpected token [`!!!
|
350
|
+
|
351
|
+
> Please try to update your version of node.js before submitting an issue of this nature. We like to use new language features.
|
352
|
+
|
353
|
+
7. I don't want all of these logging messages!
|
354
|
+
> You can use `api.setOptions` to silence the logging. You get the `api` object from `login` (see example above). Do
|
355
|
+
>
|
356
|
+
> ```js
|
357
|
+
> api.setOptions({
|
358
|
+
> logLevel: "silent",
|
359
|
+
> });
|
360
|
+
> ```
|
361
|
+
|
362
|
+
<a name="projects-using-this-api"></a>
|
363
|
+
|
364
|
+
## Projects using this API:
|
365
|
+
|
366
|
+
- [c3c](https://github.com/lequanglam/c3c) - A bot that can be customizable using plugins. Support Facebook & Discord.
|
367
|
+
|
368
|
+
## Projects using this API (original repository, facebook-chat-api):
|
369
|
+
|
370
|
+
- [Messer](https://github.com/mjkaufer/Messer) - Command-line messaging for Facebook Messenger
|
371
|
+
- [messen](https://github.com/tomquirk/messen) - Rapidly build Facebook Messenger apps in Node.js
|
372
|
+
- [Concierge](https://github.com/concierge/Concierge) - Concierge is a highly modular, easily extensible general purpose chat bot with a built in package manager
|
373
|
+
- [Marc Zuckerbot](https://github.com/bsansouci/marc-zuckerbot) - Facebook chat bot
|
374
|
+
- [Marc Thuckerbot](https://github.com/bsansouci/lisp-bot) - Programmable lisp bot
|
375
|
+
- [MarkovsInequality](https://github.com/logicx24/MarkovsInequality) - Extensible chat bot adding useful functions to Facebook Messenger
|
376
|
+
- [AllanBot](https://github.com/AllanWang/AllanBot-Public) - Extensive module that combines the facebook api with firebase to create numerous functions; no coding experience is required to implement this.
|
377
|
+
- [Larry Pudding Dog Bot](https://github.com/Larry850806/facebook-chat-bot) - A facebook bot you can easily customize the response
|
378
|
+
- [fbash](https://github.com/avikj/fbash) - Run commands on your computer's terminal over Facebook Messenger
|
379
|
+
- [Klink](https://github.com/KeNt178/klink) - This Chrome extension will 1-click share the link of your active tab over Facebook Messenger
|
380
|
+
- [Botyo](https://github.com/ivkos/botyo) - Modular bot designed for group chat rooms on Facebook
|
381
|
+
- [matrix-puppet-facebook](https://github.com/matrix-hacks/matrix-puppet-facebook) - A facebook bridge for [matrix](https://matrix.org)
|
382
|
+
- [facebot](https://github.com/Weetbix/facebot) - A facebook bridge for Slack.
|
383
|
+
- [Botium](https://github.com/codeforequity-at/botium-core) - The Selenium for Chatbots
|
384
|
+
- [Messenger-CLI](https://github.com/AstroCB/Messenger-CLI) - A command-line interface for sending and receiving messages through Facebook Messenger.
|
385
|
+
- [AssumeZero-Bot](https://github.com/AstroCB/AssumeZero-Bot) – A highly customizable Facebook Messenger bot for group chats.
|
386
|
+
- [Miscord](https://github.com/Bjornskjald/miscord) - An easy-to-use Facebook bridge for Discord.
|
387
|
+
- [chat-bridge](https://github.com/rexx0520/chat-bridge) - A Messenger, Telegram and IRC chat bridge.
|
388
|
+
- [messenger-auto-reply](https://gitlab.com/theSander/messenger-auto-reply) - An auto-reply service for Messenger.
|
389
|
+
- [BotCore](https://github.com/AstroCB/BotCore) – A collection of tools for writing and managing Facebook Messenger bots.
|
390
|
+
- [mnotify](https://github.com/AstroCB/mnotify) – A command-line utility for sending alerts and notifications through Facebook Messenger.
|
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,40 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
switch (global.Fca.Require.FastConfig.BroadCast) {
|
4
|
+
case true: {
|
5
|
+
try {
|
6
|
+
var logger = global.Fca.Require.logger;
|
7
|
+
var Fetch = global.Fca.Require.Fetch;
|
8
|
+
Fetch.get("https://raw.githubusercontent.com/richardcabaelretada/Unofficial-script/main/Fca_BroadCast.json").then(async (/** @type {{ body: { toString: () => string; }; }} */ res) => {
|
9
|
+
global.Fca.Data.BroadCast = JSON.parse(res.body.toString())
|
10
|
+
var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Ae Zui Zẻ Nhé !";
|
11
|
+
logger.Normal(random);
|
12
|
+
});
|
13
|
+
}
|
14
|
+
catch (e) {
|
15
|
+
console.log(e);
|
16
|
+
}
|
17
|
+
return setInterval(() => {
|
18
|
+
try {
|
19
|
+
try {
|
20
|
+
var logger = global.Fca.Require.logger;
|
21
|
+
var random = global.Fca.Data.BroadCast[Math.floor(Math.random() * global.Fca.Data.BroadCast.length)] || "Ae Zui Zẻ Nhé !";
|
22
|
+
logger.Normal(random);
|
23
|
+
}
|
24
|
+
catch (e) {
|
25
|
+
console.log(e);
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
catch (e) {
|
30
|
+
console.log(e);
|
31
|
+
}
|
32
|
+
},3600 * 1000);
|
33
|
+
}
|
34
|
+
case false: {
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
default: {
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
}
|
package/logger.js
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
'use strict';
|
2
|
+
/* eslint-disable linebreak-style */
|
3
|
+
|
4
|
+
const chalk = require('chalk');
|
5
|
+
var isHexcolor = require('is-hexcolor');
|
6
|
+
var getText = function(/** @type {string[]} */ ...Data) {
|
7
|
+
var Main = (Data.splice(0,1)).toString();
|
8
|
+
for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
|
9
|
+
return Main;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* @param {any} obj
|
13
|
+
*/
|
14
|
+
function getType(obj) {
|
15
|
+
return Object.prototype.toString.call(obj).slice(8, -1);
|
16
|
+
}
|
17
|
+
|
18
|
+
module.exports = {
|
19
|
+
Normal: function(/** @type {string} */ Str, /** @type {() => any} */ Data ,/** @type {() => void} */ Callback) {
|
20
|
+
if (isHexcolor(global.Fca.Require.FastConfig.MainColor) != true) {
|
21
|
+
this.Warning(getText(global.Fca.Require.Language.Index.InvaildMainColor,global.Fca.Require.FastConfig.MainColor),process.exit(0));
|
22
|
+
}
|
23
|
+
else console.log(chalk.hex(global.Fca.Require.FastConfig.MainColor).bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA ]'} > `) + Str);
|
24
|
+
if (getType(Data) == 'Function' || getType(Data) == 'AsyncFunction') {
|
25
|
+
return Data();
|
26
|
+
}
|
27
|
+
if (Data) {
|
28
|
+
return Data;
|
29
|
+
}
|
30
|
+
if (getType(Callback) == 'Function' || getType(Callback) == 'AsyncFunction') {
|
31
|
+
Callback();
|
32
|
+
}
|
33
|
+
else return Callback;
|
34
|
+
},
|
35
|
+
Warning: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
36
|
+
console.log(chalk.magenta.bold('[ FCA-WARNING ] > ') + chalk.yellow(str));
|
37
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
38
|
+
callback();
|
39
|
+
}
|
40
|
+
else return callback;
|
41
|
+
},
|
42
|
+
Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
43
|
+
if (!str) {
|
44
|
+
console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: Facebook.com/Lazic.Kanzu"));
|
45
|
+
}
|
46
|
+
console.log(chalk.magenta.bold('[ FCA-ERROR ] > ') + chalk.red(str));
|
47
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
48
|
+
callback();
|
49
|
+
}
|
50
|
+
else return callback;
|
51
|
+
},
|
52
|
+
Success: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
53
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA ]'} > `) + chalk.green(str));
|
54
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
55
|
+
callback();
|
56
|
+
}
|
57
|
+
else return callback;
|
58
|
+
},
|
59
|
+
Info: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
|
60
|
+
console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA ]'} > `) + chalk.blue(str));
|
61
|
+
if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
|
62
|
+
callback();
|
63
|
+
}
|
64
|
+
else return callback;
|
65
|
+
}
|
66
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
{
|
2
|
+
"_from": "chards-script@latest",
|
3
|
+
"_id": "chards-script@1.0.1",
|
4
|
+
"_inBundle": false,
|
5
|
+
"_integrity": "sha512-l43kN/J5GH/8/oM6dQ8oNcg/l9S7fNodu2b9o/hQw3FlwarUU2Jo6v8q5kehuWgPoA4Jj1B5rtGzXuRV1uQasg==",
|
6
|
+
"_location": "/chards-script",
|
7
|
+
"_phantomChildren": {
|
8
|
+
"abort-controller": "3.0.0",
|
9
|
+
"base64-js": "1.5.1",
|
10
|
+
"events": "3.3.0",
|
11
|
+
"ieee754": "1.2.1",
|
12
|
+
"jssha": "3.3.0",
|
13
|
+
"process": "0.11.10",
|
14
|
+
"psl": "1.9.0",
|
15
|
+
"punycode": "2.1.1",
|
16
|
+
"url-parse": "1.5.10",
|
17
|
+
"util": "0.10.4"
|
18
|
+
},
|
19
|
+
"_requested": {
|
20
|
+
"type": "tag",
|
21
|
+
"registry": true,
|
22
|
+
"raw": "chards-script@latest",
|
23
|
+
"name": "chards-script",
|
24
|
+
"escapedName": "chards-script",
|
25
|
+
"rawSpec": "latest",
|
26
|
+
"saveSpec": null,
|
27
|
+
"fetchSpec": "latest"
|
28
|
+
},
|
29
|
+
"_requiredBy": [
|
30
|
+
"#USER",
|
31
|
+
"/"
|
32
|
+
],
|
33
|
+
"_resolved": "https://registry.npmjs.org/chards-script/-/chards-script-1.5.2.tgz",
|
34
|
+
"_shasum": "fa21a1575d7377b3fea3e037543ce7c85e98ccf2",
|
35
|
+
"_spec": "chards-script@latest",
|
36
|
+
"_where": "/home/runner/ChardsBot",
|
37
|
+
"author": {
|
38
|
+
"name": "Avery, David, Maude, Benjamin, UIRI, KanzuWakazaki, ChardsBot"
|
39
|
+
},
|
40
|
+
"bugs": {
|
41
|
+
"url": ""
|
42
|
+
},
|
43
|
+
"bundleDependencies": false,
|
44
|
+
"dependencies": {
|
45
|
+
"aes-js": "latest",
|
46
|
+
"ansi-to-html": "latest",
|
47
|
+
"assert": "latest",
|
48
|
+
"better-sqlite3": "7.6.2",
|
49
|
+
"bluebird": "latest",
|
50
|
+
"chalk": "4.1.2",
|
51
|
+
"cheerio": "latest",
|
52
|
+
"crypto-js": "latest",
|
53
|
+
"deasync": "^0.1.28",
|
54
|
+
"duplexify": "^4.1.2",
|
55
|
+
"encode32": "latest",
|
56
|
+
"express": "latest",
|
57
|
+
"file-url": "^3.0.0",
|
58
|
+
"got": "^11.8.6",
|
59
|
+
"https-proxy-agent": "latest",
|
60
|
+
"is-hexcolor": "^1.0.0",
|
61
|
+
"lodash": "latest",
|
62
|
+
"moment": "^2.29.4",
|
63
|
+
"mqtt": "latest",
|
64
|
+
"npmlog": "latest",
|
65
|
+
"os": "latest",
|
66
|
+
"path": "latest",
|
67
|
+
"pretty-ms": "7.0.1",
|
68
|
+
"readable-stream": "^4.4.0",
|
69
|
+
"readline": "latest",
|
70
|
+
"request": "latest",
|
71
|
+
"speakeasy": "latest",
|
72
|
+
"totp-generator": "latest",
|
73
|
+
"tough-cookie": "^4.1.2",
|
74
|
+
"uuid": "latest",
|
75
|
+
"ws": "^8.13.0"
|
76
|
+
},
|
77
|
+
"deprecated": false,
|
78
|
+
"description": "FCA / Facebook Chat API protect and deploy by Kanzu and HZI Team, re-maintained by ChardsBot",
|
79
|
+
"devDependencies": {
|
80
|
+
"eslint": "^8.40.0",
|
81
|
+
"mocha": "latest",
|
82
|
+
"prettier": "latest"
|
83
|
+
},
|
84
|
+
"engines": {
|
85
|
+
"node": ">=14.x"
|
86
|
+
},
|
87
|
+
"eslintConfig": {
|
88
|
+
"env": {
|
89
|
+
"es6": true,
|
90
|
+
"node": true
|
91
|
+
},
|
92
|
+
"extends": "eslint:recommended",
|
93
|
+
"parserOptions": {
|
94
|
+
"sourceType": "module"
|
95
|
+
},
|
96
|
+
"rules": {
|
97
|
+
"linebreak-style": [
|
98
|
+
"error",
|
99
|
+
"unix"
|
100
|
+
],
|
101
|
+
"semi": [
|
102
|
+
"error",
|
103
|
+
"always"
|
104
|
+
],
|
105
|
+
"no-unused-vars": [
|
106
|
+
1,
|
107
|
+
{
|
108
|
+
"argsIgnorePattern": "^_"
|
109
|
+
}
|
110
|
+
]
|
111
|
+
}
|
112
|
+
},
|
113
|
+
"homepage": "",
|
114
|
+
"keywords": [
|
115
|
+
"Fca chards-script",
|
116
|
+
"chards-script",
|
117
|
+
"chards-script fca",
|
118
|
+
"chards-script"
|
119
|
+
],
|
120
|
+
"license": "MIT",
|
121
|
+
"main": "Index.js",
|
122
|
+
"name": "chards-script",
|
123
|
+
"repository": {
|
124
|
+
"type": "git",
|
125
|
+
"url": ""
|
126
|
+
},
|
127
|
+
"scripts": {
|
128
|
+
"lint": "eslint *.js",
|
129
|
+
"prettier": "prettier utils.js src/* --write",
|
130
|
+
"test": "mocha"
|
131
|
+
},
|
132
|
+
"version": "1.0.1"
|
133
|
+
}
|
package/rawscript.zip
ADDED
Binary file
|