From eb0408fcd42252f66a032d35244c3768e5dec0a8 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Fri, 27 Sep 2024 02:33:41 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4sleep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/bot/actionMsg.ts | 3 --- routes/bot/index.ts | 3 --- 2 files changed, 6 deletions(-) diff --git a/routes/bot/actionMsg.ts b/routes/bot/actionMsg.ts index b63424d..925501f 100644 --- a/routes/bot/actionMsg.ts +++ b/routes/bot/actionMsg.ts @@ -1,5 +1,4 @@ import { getActionType } from "@egg/lark-msg-tool" -import { sleep } from "bun" import { Context } from "../../types" import groupAgent from "./groupAgent" @@ -32,8 +31,6 @@ const manageBtnClick = async (ctx: Context.Data): Promise => { * @param {Context.Data} ctx - 上下文数据 */ export const manageActionMsg = async (ctx: Context.Data) => { - // 在延迟0.5s返回成功后,再过0.5秒处理Action信息 - await sleep(1000) const actionType = getActionType(ctx.body) if (actionType === "button") manageBtnClick(ctx) if (actionType === "select_static") manageBtnClick(ctx) diff --git a/routes/bot/index.ts b/routes/bot/index.ts index 3a054d9..5e074ee 100644 --- a/routes/bot/index.ts +++ b/routes/bot/index.ts @@ -1,5 +1,4 @@ import { getIsActionMsg, getIsEventMsg } from "@egg/lark-msg-tool" -import { sleep } from "bun" import { Context } from "../../types" import { manageActionMsg } from "./actionMsg" @@ -29,8 +28,6 @@ export const manageBotReq = async (ctx: Context.Data): Promise => { // 处理Action消息 if (getIsActionMsg(body)) manageActionMsg(ctx) - // 模拟处理时间 - await sleep(500) // 返回成功响应 return ctx.genResp.ok() }