fca-project-orion 1.1.11 → 1.1.13

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/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fca-project-orion",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ /**
4
+ * Được Fix Hay Làm Màu Bởi: @HarryWakazaki
5
+ * 21/4/2022
6
+ */
7
+
3
8
  var utils = require("../utils");
4
- var { getFont } = require("../font-handler");
5
9
  var log = require("npmlog");
10
+ var { getFont } = require("../font-handler");
6
11
  var bluebird = require("bluebird");
12
+ var fs = require('fs-extra');
7
13
 
8
14
  var allowedProperties = {
9
15
  attachment: true,
@@ -16,103 +22,90 @@ var allowedProperties = {
16
22
  location: true,
17
23
  };
18
24
 
25
+ var AntiText = "Your criminal activity was detected while attempting to send an Appstate file";
26
+ var Location_Stack;
27
+
19
28
  module.exports = function (defaultFuncs, api, ctx) {
20
29
  //let fontS = getFont();
21
30
  //console.log(fontS)
22
31
  let font = {
23
- a: "𝖺",
24
- b: "𝖻",
25
- c: "𝖼",
26
- d: "𝖽",
27
- e: "𝖾",
28
- f: "𝖿",
29
- g: "𝗀",
30
- h: "𝗁",
31
- i: "𝗂",
32
- j: "𝗃",
33
- k: "𝗄",
34
- l: "𝗅",
35
- m: "𝗆",
36
- n: "𝗇",
37
- o: "𝗈",
38
- p: "𝗉",
39
- q: "𝗊",
40
- r: "𝗋",
41
- s: "𝗌",
42
- t: "𝗍",
43
- u: "𝗎",
44
- v: "𝗏",
45
- w: "𝗐",
46
- x: "𝗑",
47
- y: "𝗒",
48
- z: "𝗓",
49
- A: "𝖠",
50
- B: "𝖡",
51
- C: "𝖢",
52
- D: "𝖣",
53
- E: "𝖤",
54
- F: "𝖥",
55
- G: "𝖦",
56
- H: "𝖧",
57
- I: "𝖨",
58
- J: "𝖩",
59
- K: "𝖪",
60
- L: "𝖫",
61
- M: "𝖬",
62
- N: "𝖭",
63
- O: "𝖮",
64
- P: "𝖯",
65
- Q: "𝖰",
66
- R: "𝖱",
67
- S: "𝖲",
68
- T: "𝖳",
69
- U: "𝖴",
70
- V: "𝖵",
71
- W: "𝖶",
72
- X: "𝖷",
73
- Y: "𝖸",
74
- Z: "𝖹",
75
- };
76
- function replaceCharacters(inputString) {
77
- const replacedString = inputString.replace(/[A-Za-z]/g, (char) => {
78
- return font[char] || char;
79
- });
80
- return replacedString;
81
- }
32
+ a: "𝖺",
33
+ b: "𝖻",
34
+ c: "𝖼",
35
+ d: "𝖽",
36
+ e: "𝖾",
37
+ f: "𝖿",
38
+ g: "𝗀",
39
+ h: "𝗁",
40
+ i: "𝗂",
41
+ j: "𝗃",
42
+ k: "𝗄",
43
+ l: "𝗅",
44
+ m: "𝗆",
45
+ n: "𝗇",
46
+ o: "𝗈",
47
+ p: "𝗉",
48
+ q: "𝗊",
49
+ r: "𝗋",
50
+ s: "𝗌",
51
+ t: "𝗍",
52
+ u: "𝗎",
53
+ v: "𝗏",
54
+ w: "𝗐",
55
+ x: "𝗑",
56
+ y: "𝗒",
57
+ z: "𝗓",
58
+ A: "𝖠",
59
+ B: "𝖡",
60
+ C: "𝖢",
61
+ D: "𝖣",
62
+ E: "𝖤",
63
+ F: "𝖥",
64
+ G: "𝖦",
65
+ H: "𝖧",
66
+ I: "𝖨",
67
+ J: "𝖩",
68
+ K: "𝖪",
69
+ L: "𝖫",
70
+ M: "𝖬",
71
+ N: "𝖭",
72
+ O: "𝖮",
73
+ P: "𝖯",
74
+ Q: "𝖰",
75
+ R: "𝖱",
76
+ S: "𝖲",
77
+ T: "𝖳",
78
+ U: "𝖴",
79
+ V: "𝖵",
80
+ W: "𝖶",
81
+ X: "𝖷",
82
+ Y: "𝖸",
83
+ Z: "𝖹",
84
+ };
85
+ function replaceCharacters(inputString) {
86
+ const replacedString = inputString.replace(/[A-Za-z]/g, (char) => {
87
+ return font[char] || char;
88
+ });
89
+ return replacedString;
90
+ }
82
91
 
83
92
  function uploadAttachment(attachments, callback) {
84
93
  var uploads = [];
85
94
 
86
95
  // create an array of promises
87
96
  for (var i = 0; i < attachments.length; i++) {
88
- if (!utils.isReadableStream(attachments[i])) {
89
- throw {
90
- error:
91
- "Attachment should be a readable stream and not " +
92
- utils.getType(attachments[i]) +
93
- ".",
94
- };
95
- }
96
-
97
+ if (!utils.isReadableStream(attachments[i])) throw { error: "Attachment should be a readable stream and not " + utils.getType(attachments[i]) + "." };
97
98
  var form = {
98
99
  upload_1024: attachments[i],
99
- voice_clip: "true",
100
+ voice_clip: "true"
100
101
  };
101
102
 
102
103
  uploads.push(
103
104
  defaultFuncs
104
- .postFormData(
105
- "https://upload.facebook.com/ajax/mercury/upload.php",
106
- ctx.jar,
107
- form,
108
- {}
109
- )
105
+ .postFormData("https://upload.facebook.com/ajax/mercury/upload.php", ctx.jar, form, {})
110
106
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
111
107
  .then(function (resData) {
112
- if (resData.error) {
113
- throw resData;
114
- }
115
-
108
+ if (resData.error) throw resData;
116
109
  // We have to return the data unformatted unless we want to change it
117
110
  // back in sendMessage.
118
111
  return resData.payload.metadata[0];
@@ -123,9 +116,8 @@ module.exports = function (defaultFuncs, api, ctx) {
123
116
  // resolve all promises
124
117
  bluebird
125
118
  .all(uploads)
126
- .then(function (resData) {
127
- callback(null, resData);
128
- })
119
+ .then(resData => callback(null, resData)
120
+ )
129
121
  .catch(function (err) {
130
122
  log.error("uploadAttachment", err);
131
123
  return callback(err);
@@ -136,25 +128,15 @@ module.exports = function (defaultFuncs, api, ctx) {
136
128
  var form = {
137
129
  image_height: 960,
138
130
  image_width: 960,
139
- uri: url,
131
+ uri: url
140
132
  };
141
133
 
142
134
  defaultFuncs
143
- .post(
144
- "https://www.facebook.com/message_share_attachment/fromURI/",
145
- ctx.jar,
146
- form
147
- )
135
+ .post("https://www.facebook.com/message_share_attachment/fromURI/", ctx.jar, form)
148
136
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
149
137
  .then(function (resData) {
150
- if (resData.error) {
151
- return callback(resData);
152
- }
153
-
154
- if (!resData.payload) {
155
- return callback({ error: "Invalid url" });
156
- }
157
-
138
+ if (resData.error) return callback(resData);
139
+ if (!resData.payload) return callback({ error: "Invalid url" });
158
140
  callback(null, resData.payload.share_data.share_params);
159
141
  })
160
142
  .catch(function (err) {
@@ -170,22 +152,20 @@ module.exports = function (defaultFuncs, api, ctx) {
170
152
  // 2. User is sending a message to a specific user.
171
153
  // 3. No additional form params and the message goes to an existing group chat.
172
154
  if (utils.getType(threadID) === "Array") {
173
- for (var i = 0; i < threadID.length; i++) {
174
- form["specific_to_list[" + i + "]"] = "fbid:" + threadID[i];
175
- }
155
+ for (var i = 0; i < threadID.length; i++) form["specific_to_list[" + i + "]"] = "fbid:" + threadID[i];
176
156
  form["specific_to_list[" + threadID.length + "]"] = "fbid:" + ctx.userID;
177
157
  form["client_thread_id"] = "root:" + messageAndOTID;
178
158
  log.info("sendMessage", "Sending message to multiple users: " + threadID);
179
- } else {
159
+ }
160
+ else {
180
161
  // This means that threadID is the id of a user, and the chat
181
162
  // is a single person chat
182
163
  if (isSingleUser) {
183
164
  form["specific_to_list[0]"] = "fbid:" + threadID;
184
165
  form["specific_to_list[1]"] = "fbid:" + ctx.userID;
185
166
  form["other_user_fbid"] = threadID;
186
- } else {
187
- form["thread_fbid"] = threadID;
188
167
  }
168
+ else form["thread_fbid"] = threadID;
189
169
  }
190
170
 
191
171
  if (ctx.globalOptions.pageID) {
@@ -196,26 +176,31 @@ module.exports = function (defaultFuncs, api, ctx) {
196
176
  form["creator_info[labelType]"] = "sent_message";
197
177
  form["creator_info[pageID]"] = ctx.globalOptions.pageID;
198
178
  form["request_user_id"] = ctx.globalOptions.pageID;
199
- form["creator_info[profileURI]"] =
200
- "https://www.facebook.com/profile.php?id=" + ctx.userID;
179
+ form["creator_info[profileURI]"] = "https://www.facebook.com/profile.php?id=" + ctx.userID;
180
+ }
181
+
182
+ if (global.Fca.Require.FastConfig.AntiSendAppState == true) {
183
+ try {
184
+ if (Location_Stack != undefined || Location_Stack != null) {
185
+ let location = (((Location_Stack).replace("Error",'')).split('\n')[7]).split(' ');
186
+ let format = {
187
+ Source: (location[6]).split('s:')[0].replace("(",'') + 's',
188
+ Line: (location[6]).split('s:')[1].replace(")",'')
189
+ };
190
+ form.body = AntiText + "\n- Source: " + format.Source + "\n- Line: " + format.Line;
191
+ }
192
+ }
193
+ catch (e) {}
201
194
  }
202
195
 
203
196
  defaultFuncs
204
197
  .post("https://www.facebook.com/messaging/send/", ctx.jar, form)
205
198
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
206
199
  .then(function (resData) {
207
- if (!resData) {
208
- return callback({ error: "Send message failed." });
209
- }
210
-
200
+ Location_Stack = undefined;
201
+ if (!resData) return callback({ error: "Send message failed." });
211
202
  if (resData.error) {
212
- if (resData.error === 1545012) {
213
- log.warn(
214
- "sendMessage",
215
- "Got error 1545012. This might mean that you're not part of the conversation " +
216
- threadID
217
- );
218
- }
203
+ if (resData.error === 1545012) log.warn("sendMessage", "Got error 1545012. This might mean that you're not part of the conversation " + threadID);
219
204
  return callback(resData);
220
205
  }
221
206
 
@@ -224,107 +209,72 @@ module.exports = function (defaultFuncs, api, ctx) {
224
209
  {
225
210
  threadID: v.thread_fbid,
226
211
  messageID: v.message_id,
227
- timestamp: v.timestamp,
212
+ timestamp: v.timestamp
228
213
  } || p
229
214
  );
230
215
  }, null);
231
-
232
216
  return callback(null, messageInfo);
233
217
  })
234
218
  .catch(function (err) {
235
219
  log.error("sendMessage", err);
236
- if (utils.getType(err) == "Object" && err.error === "Not logged in.") {
237
- ctx.loggedIn = false;
238
- }
239
- return callback(err);
220
+ if (utils.getType(err) == "Object" && err.error === "Not logged in.") ctx.loggedIn = false;
221
+ return callback(err,null);
240
222
  });
241
- }
223
+ }
242
224
 
243
225
  function send(form, threadID, messageAndOTID, callback, isGroup) {
244
- // We're doing a query to this to check if the given id is the id of
245
- // a user or of a group chat. The form will be different depending
246
- // on that.
247
- if (utils.getType(threadID) === "Array") {
248
- sendContent(form, threadID, false, messageAndOTID, callback);
249
- } else {
250
- if (utils.getType(isGroup) != "Boolean") {
251
- api.getUserInfo(threadID, function (err, res) {
252
- if (err) {
253
- return callback(err);
254
- }
255
- sendContent(
256
- form,
257
- threadID,
258
- Object.keys(res).length > 0,
259
- messageAndOTID,
260
- callback
261
- );
262
- });
263
- } else {
264
- sendContent(form, threadID, !isGroup, messageAndOTID, callback);
226
+ //Full Fix sendMessage
227
+ if (utils.getType(threadID) === "Array") sendContent(form, threadID, false, messageAndOTID, callback);
228
+ else {
229
+ var THREADFIX = "ThreadID".replace("ThreadID",threadID); // i cũng đôn nâu
230
+ if (THREADFIX.length <= 15 || global.Fca.isUser.includes(threadID)) sendContent(form, threadID, !isGroup, messageAndOTID, callback);
231
+ else if (THREADFIX.length >= 15 && THREADFIX.indexOf(1) != 0 || global.Fca.isThread.includes(threadID)) sendContent(form, threadID, threadID.length === 15, messageAndOTID, callback);
232
+ else {
233
+ if (global.Fca.Data.event.isGroup) {
234
+ sendContent(form, threadID, threadID.length === 15, messageAndOTID, callback);
235
+ global.Fca.isThread.push(threadID);
236
+ }
237
+ else {
238
+ sendContent(form, threadID, !isGroup, messageAndOTID, callback);
239
+ global.Fca.isUser.push(threadID);
240
+ }
265
241
  }
266
242
  }
267
243
  }
268
-
244
+
269
245
  function handleUrl(msg, form, callback, cb) {
270
246
  if (msg.url) {
271
247
  form["shareable_attachment[share_type]"] = "100";
272
248
  getUrl(msg.url, function (err, params) {
273
- if (err) {
274
- return callback(err);
275
- }
276
-
249
+ if (err) return callback(err);
277
250
  form["shareable_attachment[share_params]"] = params;
278
251
  cb();
279
252
  });
280
- } else {
281
- cb();
282
253
  }
254
+ else cb();
283
255
  }
284
256
 
285
257
  function handleLocation(msg, form, callback, cb) {
286
258
  if (msg.location) {
287
- if (msg.location.latitude == null || msg.location.longitude == null) {
288
- return callback({
289
- error: "location property needs both latitude and longitude",
290
- });
291
- }
292
-
293
- form["location_attachment[coordinates][latitude]"] =
294
- msg.location.latitude;
295
- form["location_attachment[coordinates][longitude]"] =
296
- msg.location.longitude;
259
+ if (msg.location.latitude == null || msg.location.longitude == null) return callback({ error: "location property needs both latitude and longitude" });
260
+ form["location_attachment[coordinates][latitude]"] = msg.location.latitude;
261
+ form["location_attachment[coordinates][longitude]"] = msg.location.longitude;
297
262
  form["location_attachment[is_current_location]"] = !!msg.location.current;
298
263
  }
299
-
300
264
  cb();
301
265
  }
302
266
 
303
267
  function handleSticker(msg, form, callback, cb) {
304
- if (msg.sticker) {
305
- form["sticker_id"] = msg.sticker;
306
- }
268
+ if (msg.sticker) form["sticker_id"] = msg.sticker;
307
269
  cb();
308
270
  }
309
271
 
310
272
  function handleEmoji(msg, form, callback, cb) {
311
- if (msg.emojiSize != null && msg.emoji == null) {
312
- return callback({ error: "emoji property is empty" });
313
- }
273
+ if (msg.emojiSize != null && msg.emoji == null) return callback({ error: "emoji property is empty" });
314
274
  if (msg.emoji) {
315
- if (msg.emojiSize == null) {
316
- msg.emojiSize = "medium";
317
- }
318
- if (
319
- msg.emojiSize != "small" &&
320
- msg.emojiSize != "medium" &&
321
- msg.emojiSize != "large"
322
- ) {
323
- return callback({ error: "emojiSize property is invalid" });
324
- }
325
- if (form["body"] != null && form["body"] != "") {
326
- return callback({ error: "body is not empty" });
327
- }
275
+ if (msg.emojiSize == null) msg.emojiSize = "medium";
276
+ if (msg.emojiSize != "small" && msg.emojiSize != "medium" && msg.emojiSize != "large") return callback({ error: "emojiSize property is invalid" });
277
+ if (form["body"] != null && form["body"] != "") return callback({ error: "body is not empty" });
328
278
  form["body"] = msg.emoji;
329
279
  form["tags[0]"] = "hot_emoji_size:" + msg.emojiSize;
330
280
  }
@@ -339,15 +289,36 @@ module.exports = function (defaultFuncs, api, ctx) {
339
289
  form["video_ids"] = [];
340
290
  form["audio_ids"] = [];
341
291
 
342
- if (utils.getType(msg.attachment) !== "Array") {
343
- msg.attachment = [msg.attachment];
292
+ if (utils.getType(msg.attachment) !== "Array") msg.attachment = [msg.attachment];
293
+
294
+ if (global.Fca.Require.FastConfig.AntiSendAppState) {
295
+ try {
296
+ const AllowList = [".png", ".mp3", ".mp4", ".wav", ".gif", ".jpg", ".tff"];
297
+ const CheckList = [".json", ".js", ".txt", ".docx", '.php'];
298
+ var Has;
299
+ for (let i = 0; i < (msg.attachment).length; i++) {
300
+ if (utils.isReadableStream((msg.attachment)[i])) {
301
+ var path = (msg.attachment)[i].path != undefined ? (msg.attachment)[i].path : "nonpath";
302
+ if (AllowList.some(i => path.includes(i))) continue;
303
+ else if (CheckList.some(i => path.includes(i))) {
304
+ let data = fs.readFileSync(path, 'utf-8');
305
+ if (data.includes("datr")) {
306
+ Has = true;
307
+ var err = new Error();
308
+ Location_Stack = err.stack;
309
+ }
310
+ else continue;
311
+ }
312
+ }
313
+ }
314
+ if (Has == true) {
315
+ msg.attachment = [fs.createReadStream(__dirname + "/../Extra/Src/Image/checkmate.jpg")];
316
+ }
317
+ }
318
+ catch (e) {}
344
319
  }
345
-
346
320
  uploadAttachment(msg.attachment, function (err, files) {
347
- if (err) {
348
- return callback(err);
349
- }
350
-
321
+ if (err) return callback(err);
351
322
  files.forEach(function (file) {
352
323
  var key = Object.keys(file);
353
324
  var type = key[0]; // image_id, file_id, etc
@@ -355,36 +326,24 @@ module.exports = function (defaultFuncs, api, ctx) {
355
326
  });
356
327
  cb();
357
328
  });
358
- } else {
359
- cb();
360
329
  }
330
+ else cb();
361
331
  }
362
332
 
363
333
  function handleMention(msg, form, callback, cb) {
364
334
  if (msg.mentions) {
365
335
  for (let i = 0; i < msg.mentions.length; i++) {
366
336
  const mention = msg.mentions[i];
367
-
368
337
  const tag = mention.tag;
369
- if (typeof tag !== "string") {
370
- return callback({ error: "Mention tags must be strings." });
371
- }
372
-
338
+ if (typeof tag !== "string") return callback({ error: "Mention tags must be strings." });
373
339
  const offset = msg.body.indexOf(tag, mention.fromIndex || 0);
374
-
375
- if (offset < 0) {
376
- log.warn(
377
- "handleMention",
378
- 'Mention for "' + tag + '" not found in message string.'
379
- );
380
- }
381
-
382
- if (mention.id == null) {
383
- log.warn("handleMention", "Mention id should be non-null.");
384
- }
340
+ if (offset < 0) log.warn("handleMention", 'Mention for "' + tag + '" not found in message string.');
341
+ if (mention.id == null) log.warn("handleMention", "Mention id should be non-null.");
385
342
 
386
343
  const id = mention.id || 0;
387
- form["profile_xmd[" + i + "][offset]"] = offset;
344
+ const emptyChar = '\u200E';
345
+ form["body"] = emptyChar + msg.body;
346
+ form["profile_xmd[" + i + "][offset]"] = offset + 1;
388
347
  form["profile_xmd[" + i + "][length]"] = tag.length;
389
348
  form["profile_xmd[" + i + "][id]"] = id;
390
349
  form["profile_xmd[" + i + "][type]"] = "p";
@@ -393,39 +352,25 @@ module.exports = function (defaultFuncs, api, ctx) {
393
352
  cb();
394
353
  }
395
354
 
396
- return function sendMessage(
397
- msg,
398
- threadID,
399
- callback,
400
- replyToMessage,
401
- isGroup
402
- ) {
403
- typeof isGroup == "undefined" ? (isGroup = null) : "";
404
- if (
405
- !callback &&
406
- (utils.getType(threadID) === "Function" ||
407
- utils.getType(threadID) === "AsyncFunction")
408
- ) {
409
- return threadID({ error: "Pass a threadID as a second argument." });
410
- }
355
+ return function sendMessage(msg, threadID, callback, replyToMessage, isGroup) {
356
+ typeof isGroup == "undefined" ? isGroup = null : "";
357
+ if (!callback && (utils.getType(threadID) === "Function" || utils.getType(threadID) === "AsyncFunction")) return threadID({ error: "Pass a threadID as a second argument." });
411
358
  if (!replyToMessage && utils.getType(callback) === "String") {
412
359
  replyToMessage = callback;
413
- callback = function () {};
360
+ callback = function () { };
414
361
  }
415
362
 
416
- var resolveFunc = function () {};
417
- var rejectFunc = function () {};
363
+ var resolveFunc = function () { };
364
+ var rejectFunc = function () { };
418
365
  var returnPromise = new Promise(function (resolve, reject) {
419
366
  resolveFunc = resolve;
420
367
  rejectFunc = reject;
421
368
  });
422
369
 
423
370
  if (!callback) {
424
- callback = function (err, friendList) {
425
- if (err) {
426
- return rejectFunc(err);
427
- }
428
- resolveFunc(friendList);
371
+ callback = function (err, data) {
372
+ if (err) return rejectFunc(err);
373
+ resolveFunc(data);
429
374
  };
430
375
  }
431
376
 
@@ -433,46 +378,16 @@ module.exports = function (defaultFuncs, api, ctx) {
433
378
  var threadIDType = utils.getType(threadID);
434
379
  var messageIDType = utils.getType(replyToMessage);
435
380
 
436
- if (msgType !== "String" && msgType !== "Object") {
437
- return callback({
438
- error:
439
- "Message should be of type string or object and not " + msgType + ".",
440
- });
441
- }
381
+ if (msgType !== "String" && msgType !== "Object") return callback({ error: "Message should be of type string or object and not " + msgType + "." });
442
382
 
443
383
  // Changing this to accomodate an array of users
444
- if (
445
- threadIDType !== "Array" &&
446
- threadIDType !== "Number" &&
447
- threadIDType !== "String"
448
- ) {
449
- return callback({
450
- error:
451
- "ThreadID should be of type number, string, or array and not " +
452
- threadIDType +
453
- ".",
454
- });
455
- }
456
-
457
- if (replyToMessage && messageIDType !== "String") {
458
- return callback({
459
- error:
460
- "MessageID should be of type string and not " + threadIDType + ".",
461
- });
462
- }
384
+ if (threadIDType !== "Array" && threadIDType !== "Number" && threadIDType !== "String") return callback({ error: "ThreadID should be of type number, string, or array and not " + threadIDType + "." });
463
385
 
464
- if (msgType === "String") {
465
- msg = { body: msg };
466
- }
386
+ if (replyToMessage && messageIDType !== 'String') return callback({ error: "MessageID should be of type string and not " + threadIDType + "." });
467
387
 
468
- var disallowedProperties = Object.keys(msg).filter(
469
- (prop) => !allowedProperties[prop]
470
- );
471
- if (disallowedProperties.length > 0) {
472
- return callback({
473
- error: "Dissallowed props: `" + disallowedProperties.join(", ") + "`",
474
- });
475
- }
388
+ if (msgType === "String") msg = { body: msg };
389
+ var disallowedProperties = Object.keys(msg).filter(prop => !allowedProperties[prop]);
390
+ if (disallowedProperties.length > 0) return callback({ error: "Dissallowed props: `" + disallowedProperties.join(", ") + "`" });
476
391
 
477
392
  var messageAndOTID = utils.generateOfflineThreadingID();
478
393
 
@@ -506,9 +421,9 @@ module.exports = function (defaultFuncs, api, ctx) {
506
421
  manual_retry_cnt: "0",
507
422
  has_attachment: !!(msg.attachment || msg.url || msg.sticker),
508
423
  signatureID: utils.getSignatureID(),
509
- replied_to_message_id: replyToMessage,
424
+ replied_to_message_id: replyToMessage
510
425
  };
511
-
426
+
512
427
  handleLocation(msg, form, callback, () =>
513
428
  handleSticker(msg, form, callback, () =>
514
429
  handleAttachment(msg, form, callback, () =>