|
|
@ -212,7 +212,10 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { |
|
|
|
Array.from(names).map((name) => |
|
|
|
Array.from(names).map((name) => |
|
|
|
loadCharacter(this.dataDir, name) |
|
|
|
loadCharacter(this.dataDir, name) |
|
|
|
.then<LoadedCharacterData>((c) => ({ name, success: true, originalData: c })) |
|
|
|
.then<LoadedCharacterData>((c) => ({ name, success: true, originalData: c })) |
|
|
|
.catch<ErrorCharacterData>((e) => ({ name, success: false, error: e })) |
|
|
|
.catch<ErrorCharacterData>((e) => { |
|
|
|
|
|
|
|
console.error(`While loading ${name}: `, e) |
|
|
|
|
|
|
|
return { name, success: false, error: e } |
|
|
|
|
|
|
|
}) |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -229,11 +232,6 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const loadedCharacters = await this.loadCharacters(neededCharacters); |
|
|
|
const loadedCharacters = await this.loadCharacters(neededCharacters); |
|
|
|
for (const char of loadedCharacters) { |
|
|
|
|
|
|
|
if (!char.success) { |
|
|
|
|
|
|
|
console.error(`While loading ${char.name}: `, char.error) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const characterMap = new Map<string, GameCharacterData>(); |
|
|
|
const characterMap = new Map<string, GameCharacterData>(); |
|
|
|
for (const character of loadedCharacters) { |
|
|
|
for (const character of loadedCharacters) { |
|
|
|
characterMap.set(character.name, character); |
|
|
|
characterMap.set(character.name, character); |
|
|
|