alicezetion 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"nonce":170310209108537053,"last_updated":{"seconds":1692340452,"nanos":361008000}}
1
+ {"nonce":1696146174280555217,"last_updated":{"seconds":1692340746,"nanos":363140000}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alicezetion",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "Artificial labile intelligence cybernated existence",
5
5
  "scripts": {
6
6
  "test": "mocha",
@@ -27,40 +27,46 @@ function formatData(data) {
27
27
  return retObj;
28
28
  }
29
29
 
30
- module.exports = function (defaultFuncs, api, ctx) {
30
+ module.exports = function(defaultFuncs, api, ctx) {
31
31
  return function getUserInfo(id, callback) {
32
- var resolveFunc = function () { };
33
- var rejectFunc = function () { };
32
+ var resolveFunc = function(){};
33
+ var rejectFunc = function(){};
34
34
  var returnPromise = new Promise(function (resolve, reject) {
35
35
  resolveFunc = resolve;
36
36
  rejectFunc = reject;
37
37
  });
38
38
 
39
39
  if (!callback) {
40
- callback = function (err, userInfo) {
41
- if (err) return rejectFunc(err);
42
- resolveFunc(userInfo);
40
+ callback = function (err, friendList) {
41
+ if (err) {
42
+ return rejectFunc(err);
43
+ }
44
+ resolveFunc(friendList);
43
45
  };
44
46
  }
45
47
 
46
- if (utils.getType(id) !== "Array") id = [id];
48
+ if (utils.getType(id) !== "Array") {
49
+ id = [id];
50
+ }
47
51
 
48
52
  var form = {};
49
- id.map(function (v, i) {
53
+ id.map(function(v, i) {
50
54
  form["ids[" + i + "]"] = v;
51
55
  });
52
56
  defaultFuncs
53
57
  .post("https://www.facebook.com/chat/user_info/", ctx.jar, form)
54
58
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
55
- .then(function (resData) {
56
- if (resData.error) throw resData;
59
+ .then(function(resData) {
60
+ if (resData.error) {
61
+ throw resData;
62
+ }
57
63
  return callback(null, formatData(resData.payload.profiles));
58
64
  })
59
- .catch(function (err) {
60
- log.error("getUserInfo", "Can't get user info");
65
+ .catch(function(err) {
66
+ log.error("getUserInfo", err);
61
67
  return callback(err);
62
68
  });
63
69
 
64
70
  return returnPromise;
65
71
  };
66
- };
72
+ };