gamerbot-module 1.0.3 → 1.0.6
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.
|
@@ -23,11 +23,11 @@ export class ConfigData {
|
|
|
23
23
|
Object.keys(this).forEach((key) => {
|
|
24
24
|
if (key == "json_data")
|
|
25
25
|
return;
|
|
26
|
-
const value = Object.entries(this).find(([k, v]) =>
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const value = Object.entries(this).find(([k, v]) => {
|
|
27
|
+
if (k != key)
|
|
28
|
+
return false;
|
|
29
|
+
return JSON.stringify(v) != JSON.stringify(this.json_data[key]);
|
|
30
|
+
});
|
|
31
31
|
if (value)
|
|
32
32
|
changed_data[key] = value[1];
|
|
33
33
|
});
|
|
@@ -31,11 +31,11 @@ export class GuildData {
|
|
|
31
31
|
Object.keys(this).forEach((key) => {
|
|
32
32
|
if (key == "json_data")
|
|
33
33
|
return;
|
|
34
|
-
const value = Object.entries(this).find(([k, v]) =>
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
const value = Object.entries(this).find(([k, v]) => {
|
|
35
|
+
if (k != key)
|
|
36
|
+
return false;
|
|
37
|
+
return JSON.stringify(v) != JSON.stringify(this.json_data[key]);
|
|
38
|
+
});
|
|
39
39
|
if (value)
|
|
40
40
|
changed_data[key] = value[1];
|
|
41
41
|
});
|
|
@@ -17,7 +17,8 @@ export declare class PorfileData {
|
|
|
17
17
|
minecraftWhiteList: boolean;
|
|
18
18
|
minecraftUsername: string;
|
|
19
19
|
minecraftUuid: string;
|
|
20
|
-
|
|
20
|
+
old_messages: Array<string>;
|
|
21
|
+
hashed_email: string;
|
|
21
22
|
json_data: any;
|
|
22
23
|
constructor(json_data: any);
|
|
23
24
|
/**
|
|
@@ -21,7 +21,8 @@ export class PorfileData {
|
|
|
21
21
|
this.minecraftWhiteList = json_data.minecraftWhiteList;
|
|
22
22
|
this.minecraftUsername = json_data.minecraftUsername;
|
|
23
23
|
this.minecraftUuid = json_data.minecraftUuid;
|
|
24
|
-
this.
|
|
24
|
+
this.old_messages = json_data.old_messages;
|
|
25
|
+
this.hashed_email = json_data.hashed_email;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* Saves user data to database
|
|
@@ -33,11 +34,11 @@ export class PorfileData {
|
|
|
33
34
|
Object.keys(this).forEach((key) => {
|
|
34
35
|
if (key == "json_data")
|
|
35
36
|
return;
|
|
36
|
-
const value = Object.entries(this).find(([k, v]) =>
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const value = Object.entries(this).find(([k, v]) => {
|
|
38
|
+
if (k != key)
|
|
39
|
+
return false;
|
|
40
|
+
return JSON.stringify(v) != JSON.stringify(this.json_data[key]);
|
|
41
|
+
});
|
|
41
42
|
if (value)
|
|
42
43
|
changed_data[key] = value[1];
|
|
43
44
|
});
|
package/dist/classes/gamerbot.js
CHANGED
|
@@ -34,15 +34,20 @@ export class GamerBotAPI {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
static arraysEqual(a, b) {
|
|
37
|
-
// if the other array is a falsy value, return
|
|
38
|
-
if (!a)
|
|
39
|
-
return false;
|
|
40
|
-
// if the argument is the same array, we can be sure the contents are same as well
|
|
41
37
|
if (a === b)
|
|
42
38
|
return true;
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
if (a == null || b == null)
|
|
40
|
+
return false;
|
|
41
|
+
if (a.length !== b.length)
|
|
45
42
|
return false;
|
|
43
|
+
for (let i = 0; i < a.length; ++i) {
|
|
44
|
+
if (typeof a[i] === 'object' && typeof b[i] === 'object') {
|
|
45
|
+
if (!this.arraysEqual(Object.entries(a[i]), Object.entries(b[i])))
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
else if (a[i] !== b[i])
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
46
51
|
return true;
|
|
47
52
|
}
|
|
48
53
|
}
|