import { ApplicationCommandType, type CommandContext, CommandOptionType, SlashCommand, type SlashCreator } from "slash-create"; import { CharacterOptionTemplate, AbstractCharacterStatusCommand, type GameCharacterData, type LoadedCharacterData } from "./base.js"; export class CharacterStatusCommand extends AbstractCharacterStatusCommand { constructor(creator: SlashCreator) { super(creator, { name: "status", description: "Gets the status of the given character(s).", type: ApplicationCommandType.CHAT_INPUT, guildIDs: process.env.DEVELOPMENT_GUILD_ID, options: [ { ...CharacterOptionTemplate, name: "character", description: "The name of the character(s) to get the status of.", required: true, }, ] }); } async process(ctx: CommandContext, characters: Map): Promise { return characters.get("character")!.flatMap((x) => x.success ? [x] : []); } }