|
|
|
@ -22,8 +22,6 @@ import { readFile } from 'fs/promises'; |
|
|
|
|
import { join } from 'path'; |
|
|
|
|
import { default as Sharp } from 'sharp'; |
|
|
|
|
|
|
|
|
|
const dataDir = '../data'; |
|
|
|
|
|
|
|
|
|
export const CharacterOptionTemplate = { |
|
|
|
|
name: 'character', |
|
|
|
|
description: 'The character(s) to operate on.', |
|
|
|
@ -212,7 +210,7 @@ export abstract class AbstractCharacterStatusCommand extends SlashCommand { |
|
|
|
|
async loadCharacters(names: Iterable<string>): Promise<GameCharacterData[]> { |
|
|
|
|
return Promise.all( |
|
|
|
|
Array.from(names).map((name) => |
|
|
|
|
loadCharacter(dataDir, name) |
|
|
|
|
loadCharacter(this.dataDir, name) |
|
|
|
|
.then<LoadedCharacterData>((c) => ({ name, success: true, originalData: c })) |
|
|
|
|
.catch<ErrorCharacterData>((e) => ({ name, success: false, error: e })) |
|
|
|
|
) |
|
|
|
|