diff --git a/controller/soupAgent/index.ts b/controller/soupAgent/index.ts index b46de31..bc4e369 100644 --- a/controller/soupAgent/index.ts +++ b/controller/soupAgent/index.ts @@ -176,11 +176,15 @@ const chat2Soup = async (ctx: Context) => { */ const agent = async (ctx: Context) => { const { - larkBody: { chatId }, + larkBody: { chatId, msgText }, } = ctx if (!chatId) return const activeGame = await db.soupGame.getActiveOneByChatId(chatId) if (!activeGame) return false + if (msgText === "结束游戏" || msgText === "停止游戏") { + startOrStopGame(ctx, false) + return true + } chat2Soup(ctx) return true } diff --git a/routes/bot/eventMsg.ts b/routes/bot/eventMsg.ts index 20e90cd..c317ba3 100644 --- a/routes/bot/eventMsg.ts +++ b/routes/bot/eventMsg.ts @@ -149,12 +149,8 @@ const manageIntent = async (ctx: Context) => { case 11: soupAgent.startOrStopGame(ctx, true, "manual") break - // 结束海龟汤游戏 - case 12: - soupAgent.startOrStopGame(ctx, false, "manual") - break // 通识回答 - case 13: + case 12: default: groupAgent.agent(ctx) break