Spaces:
Runtime error
Runtime error
Update lineup_persistence.js
Browse files- lineup_persistence.js +8 -1
lineup_persistence.js
CHANGED
|
@@ -16,6 +16,7 @@ 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 {
|
|
@@ -25,7 +26,8 @@ function save() {
|
|
| 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) {
|
|
@@ -74,6 +76,10 @@ function load() {
|
|
| 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) {
|
|
@@ -91,5 +97,6 @@ module.exports = {
|
|
| 91 |
activeLineupMessages,
|
| 92 |
managerBoards,
|
| 93 |
guildCustomFormations,
|
|
|
|
| 94 |
save
|
| 95 |
};
|
|
|
|
| 16 |
let activeLineupMessages = new Map();
|
| 17 |
let managerBoards = new Map();
|
| 18 |
let guildCustomFormations = new Map();
|
| 19 |
+
let guildCustomFormationNames = new Map();
|
| 20 |
|
| 21 |
function save() {
|
| 22 |
try {
|
|
|
|
| 26 |
lineupOwners: Object.fromEntries(lineupOwners),
|
| 27 |
activeLineupMessages: Object.fromEntries(activeLineupMessages),
|
| 28 |
managerBoards: Object.fromEntries(managerBoards),
|
| 29 |
+
guildCustomFormations: Object.fromEntries(guildCustomFormations),
|
| 30 |
+
guildCustomFormationNames: Object.fromEntries(guildCustomFormationNames)
|
| 31 |
};
|
| 32 |
|
| 33 |
for (const [guildId, lineupMap] of guildLineups) {
|
|
|
|
| 76 |
if (data.guildCustomFormations) {
|
| 77 |
for (const [k, v] of Object.entries(data.guildCustomFormations)) guildCustomFormations.set(k, v);
|
| 78 |
}
|
| 79 |
+
|
| 80 |
+
if (data.guildCustomFormationNames) {
|
| 81 |
+
for (const [k, v] of Object.entries(data.guildCustomFormationNames)) guildCustomFormationNames.set(k, v);
|
| 82 |
+
}
|
| 83 |
|
| 84 |
console.log('[LINEUP PERSISTENCE] Data loaded successfully.');
|
| 85 |
} catch (e) {
|
|
|
|
| 97 |
activeLineupMessages,
|
| 98 |
managerBoards,
|
| 99 |
guildCustomFormations,
|
| 100 |
+
guildCustomFormationNames,
|
| 101 |
save
|
| 102 |
};
|