alicezetion 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -1
  2. package/.cache/replit/nix/env.json +1 -1
  3. package/Extra/Database/index.js +469 -0
  4. package/Extra/ExtraAddons.js +82 -0
  5. package/Extra/ExtraFindUID.js +62 -0
  6. package/Extra/ExtraGetThread.js +340 -0
  7. package/Extra/ExtraScreenShot.js +430 -0
  8. package/Extra/ExtraUptimeRobot.js +38 -0
  9. package/Extra/Html/Classic/script.js +119 -0
  10. package/Extra/Html/Classic/style.css +8 -0
  11. package/Extra/Security/AES_256_GCM/index.js +0 -0
  12. package/Extra/Security/Base/Step_1.js +6 -0
  13. package/Extra/Security/Base/Step_2.js +22 -0
  14. package/Extra/Security/Base/Step_3.js +22 -0
  15. package/Extra/Security/Base/index.js +173 -0
  16. package/Extra/Security/Index.js +5 -0
  17. package/Extra/Security/Step_1.js +6 -0
  18. package/Extra/Security/Step_2.js +22 -0
  19. package/Extra/Security/Step_3.js +22 -0
  20. package/Extra/Src/Change_Environment.js +24 -0
  21. package/Extra/Src/Check_Update.js +67 -0
  22. package/Extra/Src/History.js +115 -0
  23. package/Extra/Src/Instant_Update.js +65 -0
  24. package/Extra/Src/Last-Run.js +65 -0
  25. package/Extra/Src/Premium.js +81 -0
  26. package/Extra/Src/Release_Memory.js +41 -0
  27. package/Extra/Src/Websocket.js +213 -0
  28. package/Extra/Src/image/checkmate.jpg +0 -0
  29. package/Extra/Src/uuid.js +137 -0
  30. package/Func/AcceptAgreement.js +31 -0
  31. package/Func/ClearCache.js +64 -0
  32. package/Func/ReportV1.js +54 -0
  33. package/Language/index.json +217 -0
  34. package/Main.js +1211 -0
  35. package/broadcast.js +40 -0
  36. package/index.js +367 -522
  37. package/leiamnash/Dev_Horizon_Data.js +125 -0
  38. package/leiamnash/Premium.js +25 -0
  39. package/leiamnash/Screenshot.js +83 -0
  40. package/leiamnash/addExternalModule.js +7 -10
  41. package/leiamnash/addUserToGroup.js +17 -51
  42. package/leiamnash/changeAdminStatus.js +0 -0
  43. package/leiamnash/changeArchivedStatus.js +12 -26
  44. package/leiamnash/changeAvt.js +85 -0
  45. package/leiamnash/changeBio.js +6 -18
  46. package/leiamnash/changeBlockedStatus.js +3 -14
  47. package/leiamnash/changeGroupImage.js +16 -39
  48. package/leiamnash/changeNickname.js +11 -25
  49. package/leiamnash/changeThreadColor.js +10 -19
  50. package/leiamnash/changeThreadEmoji.js +10 -23
  51. package/leiamnash/chat.js +111 -196
  52. package/leiamnash/createNewGroup.js +12 -28
  53. package/leiamnash/createPoll.js +13 -24
  54. package/leiamnash/deleteMessage.js +12 -23
  55. package/leiamnash/deleteThread.js +11 -24
  56. package/leiamnash/forwardAttachment.js +13 -25
  57. package/leiamnash/getAccessToken.js +28 -0
  58. package/leiamnash/getCurrentUserID.js +1 -1
  59. package/leiamnash/getEmojiUrl.js +2 -4
  60. package/leiamnash/getFriendsList.js +11 -22
  61. package/leiamnash/getMessage.js +80 -0
  62. package/leiamnash/getThreadHistory.js +59 -167
  63. package/leiamnash/getThreadInfo.js +247 -28
  64. package/leiamnash/getThreadList.js +41 -66
  65. package/leiamnash/getThreadMain.js +220 -0
  66. package/leiamnash/getThreadPictures.js +17 -37
  67. package/leiamnash/getUID.js +59 -0
  68. package/leiamnash/getUserID.js +9 -13
  69. package/leiamnash/getUserInfo.js +67 -26
  70. package/leiamnash/getUserInfoMain.js +65 -0
  71. package/leiamnash/getUserInfoV2.js +32 -0
  72. package/leiamnash/getUserInfoV3.js +63 -0
  73. package/leiamnash/getUserInfoV4.js +55 -0
  74. package/leiamnash/getUserInfoV5.js +61 -0
  75. package/leiamnash/handleFriendRequest.js +12 -27
  76. package/leiamnash/handleMessageRequest.js +15 -31
  77. package/leiamnash/httpGet.js +13 -16
  78. package/leiamnash/httpPost.js +12 -16
  79. package/leiamnash/httpPostFormData.js +41 -0
  80. package/leiamnash/listenMqtt.js +301 -200
  81. package/leiamnash/logout.js +13 -20
  82. package/leiamnash/markAsDelivered.js +11 -21
  83. package/leiamnash/markAsRead.js +11 -21
  84. package/leiamnash/markAsReadAll.js +11 -18
  85. package/leiamnash/markAsSeen.js +9 -17
  86. package/leiamnash/muteThread.js +10 -15
  87. package/leiamnash/removeUserFromGroup.js +15 -45
  88. package/leiamnash/resolvePhotoUrl.js +8 -16
  89. package/leiamnash/searchForThread.js +10 -20
  90. package/leiamnash/sendMessage.js +379 -0
  91. package/leiamnash/sendTypingIndicator.js +9 -32
  92. package/leiamnash/setMessageReaction.js +12 -20
  93. package/leiamnash/setPostReaction.js +100 -74
  94. package/leiamnash/setTitle.js +13 -25
  95. package/leiamnash/threadColors.js +18 -36
  96. package/leiamnash/unfriend.js +9 -18
  97. package/leiamnash/unsendMessage.js +8 -17
  98. package/logger.js +66 -0
  99. package/package.json +49 -34
  100. package/replit.nix +1 -3
  101. package/utils.js +593 -108
  102. package/leiamnash/getThreadHistoryDeprecated.js +0 -93
  103. package/leiamnash/getThreadInfoDeprecated.js +0 -80
  104. package/leiamnash/getThreadListDeprecated.js +0 -75
@@ -29,10 +29,10 @@ function formatAttachmentsGraphQLResponse(attachment) {
29
29
  // @Undocumented
30
30
  attributionApp: attachment.attribution_app
31
31
  ? {
32
- attributionAppID: attachment.attribution_app.id,
33
- name: attachment.attribution_app.name,
34
- logo: attachment.attribution_app.square_logo
35
- }
32
+ attributionAppID: attachment.attribution_app.id,
33
+ name: attachment.attribution_app.name,
34
+ logo: attachment.attribution_app.square_logo
35
+ }
36
36
  : null
37
37
 
38
38
  // @TODO No idea what this is, should we expose it?
@@ -78,10 +78,10 @@ function formatAttachmentsGraphQLResponse(attachment) {
78
78
  // @Undocumented
79
79
  attributionApp: attachment.attribution_app
80
80
  ? {
81
- attributionAppID: attachment.attribution_app.id,
82
- name: attachment.attribution_app.name,
83
- logo: attachment.attribution_app.square_logo
84
- }
81
+ attributionAppID: attachment.attribution_app.id,
82
+ name: attachment.attribution_app.name,
83
+ logo: attachment.attribution_app.square_logo
84
+ }
85
85
  : null
86
86
  };
87
87
  case "MessageVideo":
@@ -144,56 +144,15 @@ function formatExtensibleAttachment(attachment) {
144
144
  url: attachment.story_attachment.url,
145
145
 
146
146
  title: attachment.story_attachment.title_with_entities.text,
147
- description:
148
- attachment.story_attachment.description &&
149
- attachment.story_attachment.description.text,
150
- source:
151
- attachment.story_attachment.source == null
152
- ? null
153
- : attachment.story_attachment.source.text,
154
-
155
- image:
156
- attachment.story_attachment.media == null
157
- ? null
158
- : attachment.story_attachment.media.animated_image == null &&
159
- attachment.story_attachment.media.image == null
160
- ? null
161
- : (
162
- attachment.story_attachment.media.animated_image ||
163
- attachment.story_attachment.media.image
164
- ).uri,
165
- width:
166
- attachment.story_attachment.media == null
167
- ? null
168
- : attachment.story_attachment.media.animated_image == null &&
169
- attachment.story_attachment.media.image == null
170
- ? null
171
- : (
172
- attachment.story_attachment.media.animated_image ||
173
- attachment.story_attachment.media.image
174
- ).width,
175
- height:
176
- attachment.story_attachment.media == null
177
- ? null
178
- : attachment.story_attachment.media.animated_image == null &&
179
- attachment.story_attachment.media.image == null
180
- ? null
181
- : (
182
- attachment.story_attachment.media.animated_image ||
183
- attachment.story_attachment.media.image
184
- ).height,
185
- playable:
186
- attachment.story_attachment.media == null
187
- ? null
188
- : attachment.story_attachment.media.is_playable,
189
- duration:
190
- attachment.story_attachment.media == null
191
- ? null
192
- : attachment.story_attachment.media.playable_duration_in_ms,
193
- playableUrl:
194
- attachment.story_attachment.media == null
195
- ? null
196
- : attachment.story_attachment.media.playable_url,
147
+ description: attachment.story_attachment.description && attachment.story_attachment.description.text,
148
+ source: attachment.story_attachment.source == null ? null : attachment.story_attachment.source.text,
149
+
150
+ image: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).uri,
151
+ width: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).width,
152
+ height: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).height,
153
+ playable: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.is_playable,
154
+ duration: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.playable_duration_in_ms,
155
+ playableUrl: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.playable_url,
197
156
 
198
157
  subattachments: attachment.story_attachment.subattachments,
199
158
 
@@ -210,54 +169,22 @@ function formatExtensibleAttachment(attachment) {
210
169
  // width: "1280"
211
170
  // }
212
171
  //
213
- properties: attachment.story_attachment.properties.reduce(function(
214
- obj,
215
- cur
216
- ) {
172
+ properties: attachment.story_attachment.properties.reduce(function (obj, cur) {
217
173
  obj[cur.key] = cur.value.text;
218
174
  return obj;
219
- },
220
- {}),
175
+ }, {}),
221
176
 
222
177
  // Deprecated fields
223
178
  animatedImageSize: "", // @Legacy
224
179
  facebookUrl: "", // @Legacy
225
180
  styleList: "", // @Legacy
226
181
  target: "", // @Legacy
227
- thumbnailUrl:
228
- attachment.story_attachment.media == null
229
- ? null
230
- : attachment.story_attachment.media.animated_image == null &&
231
- attachment.story_attachment.media.image == null
232
- ? null
233
- : (
234
- attachment.story_attachment.media.animated_image ||
235
- attachment.story_attachment.media.image
236
- ).uri, // @Legacy
237
- thumbnailWidth:
238
- attachment.story_attachment.media == null
239
- ? null
240
- : attachment.story_attachment.media.animated_image == null &&
241
- attachment.story_attachment.media.image == null
242
- ? null
243
- : (
244
- attachment.story_attachment.media.animated_image ||
245
- attachment.story_attachment.media.image
246
- ).width, // @Legacy
247
- thumbnailHeight:
248
- attachment.story_attachment.media == null
249
- ? null
250
- : attachment.story_attachment.media.animated_image == null &&
251
- attachment.story_attachment.media.image == null
252
- ? null
253
- : (
254
- attachment.story_attachment.media.animated_image ||
255
- attachment.story_attachment.media.image
256
- ).height // @Legacy
182
+ thumbnailUrl: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).uri, // @Legacy
183
+ thumbnailWidth: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).width, // @Legacy
184
+ thumbnailHeight: attachment.story_attachment.media == null ? null : attachment.story_attachment.media.animated_image == null && attachment.story_attachment.media.image == null ? null : (attachment.story_attachment.media.animated_image || attachment.story_attachment.media.image).height // @Legacy
257
185
  };
258
- } else {
259
- return { error: "Don't know what to do with extensible_attachment." };
260
186
  }
187
+ else return { error: "Don't know what to do with extensible_attachment." };
261
188
  }
262
189
 
263
190
  function formatReactionsGraphQL(reaction) {
@@ -268,24 +195,18 @@ function formatReactionsGraphQL(reaction) {
268
195
  }
269
196
 
270
197
  function formatEventData(event) {
271
- if (event == null) {
272
- return {};
273
- }
198
+ if (event == null) return {};
274
199
 
275
200
  switch (event.__typename) {
276
201
  case "ThemeColorExtensibleMessageAdminText":
277
- return {
278
- color: event.theme_color
279
- };
202
+ return { color: event.theme_color };
280
203
  case "ThreadNicknameExtensibleMessageAdminText":
281
204
  return {
282
205
  nickname: event.nickname,
283
206
  participantID: event.participant_id
284
207
  };
285
208
  case "ThreadIconExtensibleMessageAdminText":
286
- return {
287
- threadIcon: event.thread_icon
288
- };
209
+ return { threadIcon: event.thread_icon };
289
210
  case "InstantGameUpdateExtensibleMessageAdminText":
290
211
  return {
291
212
  gameID: (event.game == null ? null : event.game.id),
@@ -295,9 +216,7 @@ function formatEventData(event) {
295
216
  instant_game_update_data: event.instant_game_update_data
296
217
  };
297
218
  case "GameScoreExtensibleMessageAdminText":
298
- return {
299
- game_type: event.game_type
300
- };
219
+ return { game_type: event.game_type };
301
220
  case "RtcCallLogExtensibleMessageAdminText":
302
221
  return {
303
222
  event: event.event,
@@ -345,19 +264,15 @@ function formatEventData(event) {
345
264
  case "LightweightEventDeleteExtensibleMessageAdminText":
346
265
  return {};
347
266
  default:
348
- return {
349
- error: "Don't know what to with event data type " + event.__typename
350
- };
267
+ return { error: "Don't know what to with event data type " + event.__typename };
351
268
  }
352
269
  }
353
270
 
354
271
  function formatMessagesGraphQLResponse(data) {
355
272
  var messageThread = data.o0.data.message_thread;
356
- var threadID = messageThread.thread_key.thread_fbid
357
- ? messageThread.thread_key.thread_fbid
358
- : messageThread.thread_key.other_user_id;
273
+ var threadID = messageThread.thread_key.thread_fbid ? messageThread.thread_key.thread_fbid : messageThread.thread_key.other_user_id;
359
274
 
360
- var messages = messageThread.messages.nodes.map(function(d) {
275
+ var messages = messageThread.messages.nodes.map(function (d) {
361
276
  switch (d.__typename) {
362
277
  case "UserMessage":
363
278
  // Give priority to stickers. They're seen as normal messages but we've
@@ -393,9 +308,7 @@ function formatMessagesGraphQLResponse(data) {
393
308
 
394
309
  var mentionsObj = {};
395
310
  if (d.message !== null) {
396
- d.message.ranges.forEach(e => {
397
- mentionsObj[e.entity.id] = d.message.text.substr(e.offset, e.length);
398
- });
311
+ d.message.ranges.forEach(e => mentionsObj[e.entity.id] = d.message.text.substr(e.offset, e.length));
399
312
  }
400
313
 
401
314
  return {
@@ -418,9 +331,7 @@ function formatMessagesGraphQLResponse(data) {
418
331
  isUnread: d.unread,
419
332
 
420
333
  // New
421
- messageReactions: d.message_reactions
422
- ? d.message_reactions.map(formatReactionsGraphQL)
423
- : null,
334
+ messageReactions: d.message_reactions ? d.message_reactions.map(formatReactionsGraphQL) : null,
424
335
  isSponsored: d.is_sponsored,
425
336
  snippet: d.snippet
426
337
  };
@@ -434,9 +345,7 @@ function formatMessagesGraphQLResponse(data) {
434
345
  timestamp: d.timestamp_precise,
435
346
  eventType: "change_thread_name",
436
347
  snippet: d.snippet,
437
- eventData: {
438
- threadName: d.thread_name
439
- },
348
+ eventData: { threadName: d.thread_name },
440
349
 
441
350
  // @Legacy
442
351
  author: d.message_sender.id,
@@ -453,26 +362,21 @@ function formatMessagesGraphQLResponse(data) {
453
362
  timestamp: d.timestamp_precise,
454
363
  eventType: "change_thread_image",
455
364
  snippet: d.snippet,
456
- eventData:
457
- d.image_with_metadata == null
458
- ? {} /* removed image */
459
- : {
460
- /* image added */
461
- threadImage: {
462
- attachmentID: d.image_with_metadata.legacy_attachment_id,
463
- width: d.image_with_metadata.original_dimensions.x,
464
- height: d.image_with_metadata.original_dimensions.y,
465
- url: d.image_with_metadata.preview.uri
466
- }
467
- },
365
+ eventData: d.image_with_metadata == null
366
+ ? {} /* removed image */
367
+ : {
368
+ /* image added */
369
+ threadImage: {
370
+ attachmentID: d.image_with_metadata.legacy_attachment_id,
371
+ width: d.image_with_metadata.original_dimensions.x,
372
+ height: d.image_with_metadata.original_dimensions.y,
373
+ url: d.image_with_metadata.preview.uri
374
+ }
375
+ },
468
376
 
469
377
  // @Legacy
470
378
  logMessageType: "log:thread-icon",
471
- logMessageData: {
472
- thread_icon: d.image_with_metadata
473
- ? d.image_with_metadata.preview.uri
474
- : null
475
- }
379
+ logMessageData: { thread_icon: d.image_with_metadata ? d.image_with_metadata.preview.uri : null }
476
380
  };
477
381
  case "ParticipantLeftMessage":
478
382
  return {
@@ -486,7 +390,7 @@ function formatMessagesGraphQLResponse(data) {
486
390
  snippet: d.snippet,
487
391
  eventData: {
488
392
  // Array of IDs.
489
- participantsRemoved: d.participants_removed.map(function(p) {
393
+ participantsRemoved: d.participants_removed.map(function (p) {
490
394
  return p.id;
491
395
  })
492
396
  },
@@ -494,7 +398,7 @@ function formatMessagesGraphQLResponse(data) {
494
398
  // @Legacy
495
399
  logMessageType: "log:unsubscribe",
496
400
  logMessageData: {
497
- leftParticipantFbId: d.participants_removed.map(function(p) {
401
+ leftParticipantFbId: d.participants_removed.map(function (p) {
498
402
  return p.id;
499
403
  })
500
404
  }
@@ -511,7 +415,7 @@ function formatMessagesGraphQLResponse(data) {
511
415
  snippet: d.snippet,
512
416
  eventData: {
513
417
  // Array of IDs.
514
- participantsAdded: d.participants_added.map(function(p) {
418
+ participantsAdded: d.participants_added.map(function (p) {
515
419
  return p.id;
516
420
  })
517
421
  },
@@ -519,7 +423,7 @@ function formatMessagesGraphQLResponse(data) {
519
423
  // @Legacy
520
424
  logMessageType: "log:subscribe",
521
425
  logMessageData: {
522
- addedParticipants: d.participants_added.map(function(p) {
426
+ addedParticipants: d.participants_added.map(function (p) {
523
427
  return p.id;
524
428
  })
525
429
  }
@@ -577,15 +481,10 @@ function formatMessagesGraphQLResponse(data) {
577
481
  return messages;
578
482
  }
579
483
 
580
- module.exports = function(defaultFuncs, api, ctx) {
581
- return function getThreadHistoryGraphQL(
582
- threadID,
583
- amount,
584
- timestamp,
585
- callback
586
- ) {
587
- var resolveFunc = function(){};
588
- var rejectFunc = function(){};
484
+ module.exports = function (defaultFuncs, api, ctx) {
485
+ return function getThreadHistoryGraphQL(threadID, amount, timestamp, callback) {
486
+ var resolveFunc = function () { };
487
+ var rejectFunc = function () { };
589
488
  var returnPromise = new Promise(function (resolve, reject) {
590
489
  resolveFunc = resolve;
591
490
  rejectFunc = reject;
@@ -593,9 +492,7 @@ module.exports = function(defaultFuncs, api, ctx) {
593
492
 
594
493
  if (!callback) {
595
494
  callback = function (err, data) {
596
- if (err) {
597
- return rejectFunc(err);
598
- }
495
+ if (err) return rejectFunc(err);
599
496
  resolveFunc(data);
600
497
  };
601
498
  }
@@ -622,21 +519,16 @@ module.exports = function(defaultFuncs, api, ctx) {
622
519
  defaultFuncs
623
520
  .post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
624
521
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
625
- .then(function(resData) {
626
- if (resData.error) {
627
- throw resData;
628
- }
522
+ .then(function (resData) {
523
+ if (resData.error) throw resData;
629
524
  // This returns us an array of things. The last one is the success /
630
525
  // failure one.
631
526
  // @TODO What do we do in this case?
632
- if (resData[resData.length - 1].error_results !== 0) {
633
- throw new Error("There was an error_result.");
634
- }
635
-
527
+ if (resData[resData.length - 1].error_results !== 0) throw new Error("There was an error_result.");
636
528
  callback(null, formatMessagesGraphQLResponse(resData[0]));
637
529
  })
638
- .catch(function(err) {
639
- log.error("getThreadHistoryGraphQL", err);
530
+ .catch(function (err) {
531
+ log.error("getThreadHistoryGraphQL", "Lỗi getThreadHistoryGraphQL Có Thể Do Bạn Spam Quá Nhiều, Hãy Thử Lại !");
640
532
  return callback(err);
641
533
  });
642
534