This commit is contained in:
syuilo 2019-03-31 22:48:59 +09:00
parent 9826ce936c
commit bcdb735287
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 6 additions and 4 deletions

View file

@ -20,6 +20,8 @@ type Game = {
postId: string; postId: string;
}; };
const limitMinutes = 10;
export default class extends Module { export default class extends Module {
public readonly name = 'kazutori'; public readonly name = 'kazutori';
@ -61,7 +63,7 @@ export default class extends Module {
} }
const post = await this.ai.post({ const post = await this.ai.post({
text: serifs.kazutori.intro text: serifs.kazutori.intro(limitMinutes)
}); });
this.games.insertOne({ this.games.insertOne({
@ -140,8 +142,8 @@ export default class extends Module {
if (game == null) return; if (game == null) return;
// ゲーム開始から5分以上経過していたら // 制限時間が経過していたら
if (Date.now() - game.startedAt >= 1000 * 60 * 5) { if (Date.now() - game.startedAt >= 1000 * 60 * limitMinutes) {
this.finish(game); this.finish(game);
} }
} }

View file

@ -263,7 +263,7 @@ export default {
matakondo: 'また今度やりましょう!', matakondo: 'また今度やりましょう!',
intro: 'みなさん、数取りゲームしましょう!\n0~100の中で最も大きい数字を取った人が勝ちです。他の人と被ったらだめですよ\n制限時間は5分です。数字はこの投稿にリプライで送ってくださいね', intro: minutes => `みなさん、数取りゲームしましょう!\n0~100の中で最も大きい数字を取った人が勝ちです。他の人と被ったらだめですよ\n制限時間は${minutes}分です。数字はこの投稿にリプライで送ってくださいね!`,
finish: 'ゲームの結果発表です!', finish: 'ゲームの結果発表です!',