feat(group-agent): 修复Action消息返回
All checks were successful
Egg Server MIflow / build-image (push) Successful in 47s
All checks were successful
Egg Server MIflow / build-image (push) Successful in 47s
This commit is contained in:
parent
6cbc509f96
commit
757b0af2be
@ -10,11 +10,11 @@ const ACTION_MAP = {
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理按钮点击事件
|
||||
* 处理点击事件
|
||||
* @param {Context.Data} ctx - 上下文数据,包含body, larkService和logger
|
||||
* @returns {Promise<void>} 无返回值
|
||||
*/
|
||||
const manageBtnClick = async (ctx: Context.Data): Promise<void> => {
|
||||
const manageClick = async (ctx: Context.Data): Promise<void> => {
|
||||
const { body, logger } = ctx
|
||||
const { action } = body?.action?.value as {
|
||||
action: keyof typeof ACTION_MAP
|
||||
@ -30,9 +30,8 @@ const manageBtnClick = async (ctx: Context.Data): Promise<void> => {
|
||||
* 处理Action消息
|
||||
* @param {Context.Data} ctx - 上下文数据
|
||||
*/
|
||||
export const manageActionMsg = async (ctx: Context.Data) => {
|
||||
export const manageActionMsg = (ctx: Context.Data) => {
|
||||
const actionType = getActionType(ctx.body)
|
||||
if (actionType === "button") manageBtnClick(ctx)
|
||||
if (actionType === "select_static") manageBtnClick(ctx)
|
||||
return ctx.genResp.empty200()
|
||||
if (actionType === "button") manageClick(ctx)
|
||||
if (actionType === "select_static") manageClick(ctx)
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ export const manageBotReq = async (ctx: Context.Data): Promise<Response> => {
|
||||
// 处理Event消息
|
||||
if (getIsEventMsg(body)) manageEventMsg(ctx)
|
||||
// 处理Action消息
|
||||
if (getIsActionMsg(body)) return await manageActionMsg(ctx)
|
||||
if (getIsActionMsg(body)) manageActionMsg(ctx)
|
||||
|
||||
// 返回成功响应
|
||||
return ctx.genResp.ok()
|
||||
return ctx.genResp.empty200()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user