Spaces:
Runtime error
Runtime error
Update lineup_persistence.js
Browse files- lineup_persistence.js +8 -1
lineup_persistence.js
CHANGED
|
@@ -15,6 +15,7 @@ let guildSelectedFormation = new Map();
|
|
| 15 |
let lineupOwners = new Map();
|
| 16 |
let activeLineupMessages = new Map();
|
| 17 |
let managerBoards = new Map();
|
|
|
|
| 18 |
|
| 19 |
function save() {
|
| 20 |
try {
|
|
@@ -23,7 +24,8 @@ function save() {
|
|
| 23 |
guildSelectedFormation: Object.fromEntries(guildSelectedFormation),
|
| 24 |
lineupOwners: Object.fromEntries(lineupOwners),
|
| 25 |
activeLineupMessages: Object.fromEntries(activeLineupMessages),
|
| 26 |
-
managerBoards: Object.fromEntries(managerBoards)
|
|
|
|
| 27 |
};
|
| 28 |
|
| 29 |
for (const [guildId, lineupMap] of guildLineups) {
|
|
@@ -68,6 +70,10 @@ function load() {
|
|
| 68 |
if (data.managerBoards) {
|
| 69 |
for (const [k, v] of Object.entries(data.managerBoards)) managerBoards.set(k, v);
|
| 70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
console.log('[LINEUP PERSISTENCE] Data loaded successfully.');
|
| 73 |
} catch (e) {
|
|
@@ -84,5 +90,6 @@ module.exports = {
|
|
| 84 |
lineupOwners,
|
| 85 |
activeLineupMessages,
|
| 86 |
managerBoards,
|
|
|
|
| 87 |
save
|
| 88 |
};
|
|
|
|
| 15 |
let lineupOwners = new Map();
|
| 16 |
let activeLineupMessages = new Map();
|
| 17 |
let managerBoards = new Map();
|
| 18 |
+
let guildCustomFormations = new Map();
|
| 19 |
|
| 20 |
function save() {
|
| 21 |
try {
|
|
|
|
| 24 |
guildSelectedFormation: Object.fromEntries(guildSelectedFormation),
|
| 25 |
lineupOwners: Object.fromEntries(lineupOwners),
|
| 26 |
activeLineupMessages: Object.fromEntries(activeLineupMessages),
|
| 27 |
+
managerBoards: Object.fromEntries(managerBoards),
|
| 28 |
+
guildCustomFormations: Object.fromEntries(guildCustomFormations)
|
| 29 |
};
|
| 30 |
|
| 31 |
for (const [guildId, lineupMap] of guildLineups) {
|
|
|
|
| 70 |
if (data.managerBoards) {
|
| 71 |
for (const [k, v] of Object.entries(data.managerBoards)) managerBoards.set(k, v);
|
| 72 |
}
|
| 73 |
+
|
| 74 |
+
if (data.guildCustomFormations) {
|
| 75 |
+
for (const [k, v] of Object.entries(data.guildCustomFormations)) guildCustomFormations.set(k, v);
|
| 76 |
+
}
|
| 77 |
|
| 78 |
console.log('[LINEUP PERSISTENCE] Data loaded successfully.');
|
| 79 |
} catch (e) {
|
|
|
|
| 90 |
lineupOwners,
|
| 91 |
activeLineupMessages,
|
| 92 |
managerBoards,
|
| 93 |
+
guildCustomFormations,
|
| 94 |
save
|
| 95 |
};
|