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 }