This commit is contained in:
parent
dc9f4e33dd
commit
eb0408fcd4
@ -1,5 +1,4 @@
|
|||||||
import { getActionType } from "@egg/lark-msg-tool"
|
import { getActionType } from "@egg/lark-msg-tool"
|
||||||
import { sleep } from "bun"
|
|
||||||
|
|
||||||
import { Context } from "../../types"
|
import { Context } from "../../types"
|
||||||
import groupAgent from "./groupAgent"
|
import groupAgent from "./groupAgent"
|
||||||
@ -32,8 +31,6 @@ const manageBtnClick = async (ctx: Context.Data): Promise<void> => {
|
|||||||
* @param {Context.Data} ctx - 上下文数据
|
* @param {Context.Data} ctx - 上下文数据
|
||||||
*/
|
*/
|
||||||
export const manageActionMsg = async (ctx: Context.Data) => {
|
export const manageActionMsg = async (ctx: Context.Data) => {
|
||||||
// 在延迟0.5s返回成功后,再过0.5秒处理Action信息
|
|
||||||
await sleep(1000)
|
|
||||||
const actionType = getActionType(ctx.body)
|
const actionType = getActionType(ctx.body)
|
||||||
if (actionType === "button") manageBtnClick(ctx)
|
if (actionType === "button") manageBtnClick(ctx)
|
||||||
if (actionType === "select_static") manageBtnClick(ctx)
|
if (actionType === "select_static") manageBtnClick(ctx)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { getIsActionMsg, getIsEventMsg } from "@egg/lark-msg-tool"
|
import { getIsActionMsg, getIsEventMsg } from "@egg/lark-msg-tool"
|
||||||
import { sleep } from "bun"
|
|
||||||
|
|
||||||
import { Context } from "../../types"
|
import { Context } from "../../types"
|
||||||
import { manageActionMsg } from "./actionMsg"
|
import { manageActionMsg } from "./actionMsg"
|
||||||
@ -29,8 +28,6 @@ export const manageBotReq = async (ctx: Context.Data): Promise<Response> => {
|
|||||||
// 处理Action消息
|
// 处理Action消息
|
||||||
if (getIsActionMsg(body)) manageActionMsg(ctx)
|
if (getIsActionMsg(body)) manageActionMsg(ctx)
|
||||||
|
|
||||||
// 模拟处理时间
|
|
||||||
await sleep(500)
|
|
||||||
// 返回成功响应
|
// 返回成功响应
|
||||||
return ctx.genResp.ok()
|
return ctx.genResp.ok()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user