From 517287eb5275bf571cdac11e3c4c92fcca7f3366 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Tue, 14 Jan 2025 09:30:51 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=A7=81=E8=81=8A=E5=92=8C=E6=AD=A3=E5=B8=B8=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/soupAgent/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controller/soupAgent/index.ts b/controller/soupAgent/index.ts index 8100683..7c2eaf2 100644 --- a/controller/soupAgent/index.ts +++ b/controller/soupAgent/index.ts @@ -33,14 +33,16 @@ const startOrStopGame = async ( } // 停止游戏 if (!value) { - // 没有进行中的游戏 - if (!activeGame) { + // 没有进行中的游戏,是私聊或者at机器人,回复停止游戏 + if (!activeGame && isP2POrAtBot(ctx)) { await larkService.message.replyCard( messageId, cardGender.genSuccessCard(SoupGameMessage.hasStopped) ) return } + // 没有进行中的游戏,且是正常对话,不响应 + if (!activeGame) return // 有进行中的游戏,关闭游戏 logger.info(`chatId: ${chatId} is closing the game`) const res = await db.soupGame.close(activeGame.id) @@ -193,7 +195,7 @@ const soupAgent = async (ctx: Context) => { startOrStopGame(ctx, true) return true } - if (msgText === "结束游戏" && isP2POrAtBot(ctx)) { + if (msgText === "结束游戏") { startOrStopGame(ctx, false) return true }