fca-rqzax-remake 0.0.1-security → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fca-rqzax-remake might be problematic. Click here for more details.
- package/.cache/replit/__replit_disk_meta.json +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.gitattributes +2 -0
- package/.travis.yml +6 -0
- package/CHANGELOG.md +2 -0
- package/DOCS.md +1738 -0
- package/LICENSE-MIT +21 -0
- package/README.md +213 -3
- package/index.html +1200 -0
- package/index.js +542 -0
- package/package.json +65 -3
- package/replit.nix +9 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +78 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -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/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadHistoryDeprecated.js +71 -0
- package/src/getThreadInfo.js +171 -0
- package/src/getThreadInfoDeprecated.js +56 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadListDeprecated.js +46 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +66 -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/listenMqtt.js +663 -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 +321 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +64 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +41 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -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/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +1234 -0
package/LICENSE-MIT
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Avery, Benjamin, David, Maude
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
@@ -1,5 +1,215 @@
|
|
1
|
-
|
1
|
+
Lưu Ý! Đây Là Sản Phẩm Được RqzaX Remake ( Chính Bởi Facebook-Chat-Api Của Schmavery, Tác Giả Không Chịu Trách Nghiệm Nào !), Nếu Có Lỗi Hãy Thử Sử Dụng Sang Sản Phẩm Khác !
|
2
2
|
|
3
|
-
|
3
|
+
## Support For :
|
4
|
+
* RqzaX Pr0ject
|
5
|
+
+ MiraiPr0ject
|
6
|
+
+ C3C
|
7
|
+
+ Kb2a
|
8
|
+
+ LawerBot
|
9
|
+
+ Lazic (Private)
|
10
|
+
+ Goat
|
11
|
+
+ Jabd
|
12
|
+
+ Sumi
|
4
13
|
|
5
|
-
|
14
|
+
|
15
|
+
# Api Cho ChatBot Messenger
|
16
|
+
|
17
|
+
Facebook Giờ Đã Có Api Cho ChatBot 😪 Tại Đey => [Đây Nè](https://developers.facebook.com/docs/messenger-platform).
|
18
|
+
|
19
|
+
Api Này Có Thể Khiến Cho Bạn Payy Acc Như Cách Acc Bạn Chưa Từng Có, Hãy Chú Ý Nhé =))
|
20
|
+
|
21
|
+
Lưu Ý ! Nếu Bạn Muốn Sài Api Này Hãy Xem Document Tại [Đây Nè](https://github.com/Schmavery/facebook-chat-api).
|
22
|
+
|
23
|
+
## Tải Về
|
24
|
+
Nếu Bạn Muốn Sử Dụng, Hãy Tải Nó Bằng Cách:
|
25
|
+
```bash
|
26
|
+
npm i fca-rqzax-remake
|
27
|
+
```
|
28
|
+
or
|
29
|
+
```bash
|
30
|
+
npm install fca-rqzax-remake
|
31
|
+
```
|
32
|
+
|
33
|
+
Nó Sẽ Tải Vô node_modules (Lib Của Bạn)
|
34
|
+
|
35
|
+
### Tải Bản Mới Nhất Hoặc Update
|
36
|
+
Nếu Bạn Muốn Sử Dụng Phiên Bản Mới Nhất Hay Cập Nhật Thì Hãy Vô Terminal Hoặc Command Promt Nhập :
|
37
|
+
```bash
|
38
|
+
npm install fca-rqzax-remake@latest
|
39
|
+
```
|
40
|
+
Hoặc
|
41
|
+
```bash
|
42
|
+
npm i fca-rqzax-remake@latest
|
43
|
+
```
|
44
|
+
|
45
|
+
## Nếu Bạn Muốn Test Api
|
46
|
+
Lợi Ích Cho Việc Này Thì Bạn Sẽ Không Tốn Thời Gian Pay Acc Và Có Acc 😪
|
47
|
+
Hãy Sử Dụng Với Tài Khoản Thử Nghiệm => [Facebook Whitehat Accounts](https://www.facebook.com/whitehat/accounts/).
|
48
|
+
|
49
|
+
## Cách Sử Dụng
|
50
|
+
```javascript
|
51
|
+
const login = require("fca-rqzax-remake"); // lấy từ lib ra
|
52
|
+
|
53
|
+
// đăng nhập
|
54
|
+
login({email: "Gmail Account", password: "Mật Khẩu Facebook Của Bạn"}, (err, api) => {
|
55
|
+
|
56
|
+
if(err) return console.error(err); // trường hợp lỗi
|
57
|
+
|
58
|
+
// tạo bot tự động nhái theo bạn:
|
59
|
+
api.listen((err, message) => {
|
60
|
+
api.sendMessage(message.body, message.threadID);
|
61
|
+
});
|
62
|
+
|
63
|
+
});
|
64
|
+
```
|
65
|
+
|
66
|
+
Kết Quả Là Nó Sẽ Nhái Bạn Như Hình Dưới:
|
67
|
+
<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">
|
68
|
+
|
69
|
+
Nếu Bạn Muốn Sử Dụng Nâng Cao Thì Hãy Sử Dụng Các Loại Bot Được Liệt Kê Ở Trên !
|
70
|
+
|
71
|
+
|
72
|
+
## Danh Sách
|
73
|
+
|
74
|
+
Bạn Có Thể Đọc Full Api Tại => [here](DOCS.md).
|
75
|
+
|
76
|
+
## Main Functionality
|
77
|
+
|
78
|
+
### Sending a message
|
79
|
+
#### api.sendMessage(message, threadID[, calblack][, messageID])
|
80
|
+
|
81
|
+
Various types of message can be sent:
|
82
|
+
* *Regular:* set field `body` to the desired message as a string.
|
83
|
+
* *Sticker:* set a field `sticker` to the desired sticker ID.
|
84
|
+
* *File or image:* Set field `attachment` to a readable stream or an array of readable streams.
|
85
|
+
* *URL:* set a field `url` to the desired URL.
|
86
|
+
* *Emoji:* set field `emoji` to the desired emoji as a string and set field `emojiSize` with size of the emoji (`small`, `medium`, `large`)
|
87
|
+
|
88
|
+
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.
|
89
|
+
|
90
|
+
__Tip__: to find your own ID, you can look inside the cookies. The `userID` is under the name `c_user`.
|
91
|
+
|
92
|
+
__Example (Basic Message)__
|
93
|
+
```js
|
94
|
+
const login = require("fca-rqzax-remake");
|
95
|
+
|
96
|
+
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
|
97
|
+
if(err) return console.error(err);
|
98
|
+
|
99
|
+
var yourID = "000000000000000"; // id facebook của bạn
|
100
|
+
var msg = "Hey!";
|
101
|
+
api.sendMessage(msg, yourID);
|
102
|
+
});
|
103
|
+
```
|
104
|
+
|
105
|
+
__Example (Cách Upload File Qua Tin Nhắn)__
|
106
|
+
```js
|
107
|
+
const login = require("fca-rqzax-remake");
|
108
|
+
|
109
|
+
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {
|
110
|
+
if(err) return console.error(err);
|
111
|
+
|
112
|
+
// Note this example uploads an image called image.jpg
|
113
|
+
var yourID = "000000000000000";
|
114
|
+
var msg = {
|
115
|
+
body: "Hey!",
|
116
|
+
attachment: fs.createReadStream(__dirname + '/image.jpg')
|
117
|
+
}
|
118
|
+
api.sendMessage(msg, yourID);
|
119
|
+
});
|
120
|
+
```
|
121
|
+
|
122
|
+
------------------------------------
|
123
|
+
### Lưu Lại Thông Tin Đăng Nhập.
|
124
|
+
|
125
|
+
Để Lưu Lại Thì Bạn Cần 1 Apstate Kiểu (Cookie, etc,..) Để Lưu Lại Hoặc Là Sử Dụng Mã Login Như Trên Để Đăng Nhập !
|
126
|
+
__Hướng Dẫn Với Appstate__
|
127
|
+
|
128
|
+
```js
|
129
|
+
const fs = require("fs");
|
130
|
+
const login = require("fca-rqzax-remake");
|
131
|
+
|
132
|
+
var credentials = {email: "FB_EMAIL", password: "FB_PASSWORD"}; // thông tin tk
|
133
|
+
|
134
|
+
login(credentials, (err, api) => {
|
135
|
+
if(err) return console.error(err);
|
136
|
+
// đăng nhập
|
137
|
+
fs.writeFileSync('appstate.json', JSON.stringify(api.getAppState())); //tạo appstate
|
138
|
+
});
|
139
|
+
```
|
140
|
+
|
141
|
+
Hoặc Dễ Dàng Hơn ( Chuyên Nghiệp ) Bạn Có Thể Dùng => [c3c-fbstate](https://github.com/c3cbot/c3c-fbstate) Để Lấy Fbstate And Rename Lại Thành Apstate Cũng Được ! (appstate.json)
|
142
|
+
|
143
|
+
------------------------------------
|
144
|
+
|
145
|
+
### Listening to a chat
|
146
|
+
#### api.listen(callback)
|
147
|
+
|
148
|
+
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})`.
|
149
|
+
|
150
|
+
__Example__
|
151
|
+
|
152
|
+
```js
|
153
|
+
const fs = require("fs");
|
154
|
+
const login = require("fca-rqzax-remake");
|
155
|
+
|
156
|
+
// Simple echo bot. It will repeat everything that you say.
|
157
|
+
// Will stop when you say '/stop'
|
158
|
+
login({appState: JSON.parse(fs.readFileSync('appstate.json', 'utf8'))}, (err, api) => {
|
159
|
+
if(err) return console.error(err);
|
160
|
+
|
161
|
+
api.setOptions({listenEvents: true});
|
162
|
+
|
163
|
+
var stopListening = api.listenMqtt((err, event) => {
|
164
|
+
if(err) return console.error(err);
|
165
|
+
|
166
|
+
api.markAsRead(event.threadID, (err) => {
|
167
|
+
if(err) console.error(err);
|
168
|
+
});
|
169
|
+
|
170
|
+
switch(event.type) {
|
171
|
+
case "message":
|
172
|
+
if(event.body === '/stop') {
|
173
|
+
api.sendMessage("Goodbye…", event.threadID);
|
174
|
+
return stopListening();
|
175
|
+
}
|
176
|
+
api.sendMessage("TEST BOT: " + event.body, event.threadID);
|
177
|
+
break;
|
178
|
+
case "event":
|
179
|
+
console.log(event);
|
180
|
+
break;
|
181
|
+
}
|
182
|
+
});
|
183
|
+
});
|
184
|
+
```
|
185
|
+
|
186
|
+
## FAQS
|
187
|
+
|
188
|
+
1. How do I run tests?
|
189
|
+
> 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`.
|
190
|
+
|
191
|
+
2. Why doesn't `sendMessage` always work when I'm logged in as a page?
|
192
|
+
> Pages can't start conversations with users directly; this is to prevent pages from spamming users.
|
193
|
+
|
194
|
+
3. What do I do when `login` doesn't work?
|
195
|
+
> 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).
|
196
|
+
|
197
|
+
4. How can I avoid logging in every time? Can I log into a previous session?
|
198
|
+
> 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.
|
199
|
+
|
200
|
+
5. Do you support sending messages as a page?
|
201
|
+
> Yes, set the pageID option on login (this doesn't work if you set it using api.setOptions, it affects the login process).
|
202
|
+
> ```js
|
203
|
+
> login(credentials, {pageID: "000000000000000"}, (err, api) => { … }
|
204
|
+
> ```
|
205
|
+
|
206
|
+
6. I'm getting some crazy weird syntax error like `SyntaxError: Unexpected token [`!!!
|
207
|
+
> Please try to update your version of node.js before submitting an issue of this nature. We like to use new language features.
|
208
|
+
|
209
|
+
7. I don't want all of these logging messages!
|
210
|
+
> You can use `api.setOptions` to silence the logging. You get the `api` object from `login` (see example above). Do
|
211
|
+
> ```js
|
212
|
+
> api.setOptions({
|
213
|
+
> logLevel: "silent"
|
214
|
+
> });
|
215
|
+
> ```
|