Fix one lingering-but-essential constant dataDir

main
Mari 7 months ago
parent 74d43b5fe6
commit 590eda8dc8
  1. 4
      src/commands/base.ts

@ -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 }))
)

Loading…
Cancel
Save