UNPKG

@bot-shiki/koishi-plugin-werewolf

Version:
33 lines (32 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); const utils_1 = require("../utils"); class DoremyAction extends _1.ExpertAction { identity = 'doremy'; async callback() { const identities = []; await this.player.send((0, utils_1.t)('doremy-action')); await this.player.prompt((session, next, done) => { const content = session.content.trim(); if (content === 'Q') return done(); // FIXME if (/^\d+$/.test(content)) { identities.push(content); next(); } else { return next(); } }, this.game.options.timeout.doremy); utils_1.logger.debug('doremy identities: %o', identities); const nightmares = identities.map(i => this.game.getChar(i)); nightmares.forEach(c => c.nightmare = true); if (nightmares.length) { // TODO retsujitsu // await this.askAll(nightmares, 'confirm-nightmare') } } } exports.default = DoremyAction;