/** * 是否为事件消息 * @param {LarkMessageEvent} body */ export const getIsEventMsg = (body: LarkMessageEvent) => { return body?.header?.event_type === "im.message.receive_v1"; }; /** * 获取事件文本类型 * @param {LarkMessageEvent} body * @returns */ export const getMsgType = (body: LarkMessageEvent) => { return body?.event?.message?.message_type; }; /** * 获取对话流Id * @param {LarkMessageEvent} body * @returns */ export const getChatId = (body: LarkMessageEvent) => { return body?.event?.message?.chat_id; }; /** * 是否为Action消息 * @param {LarkUserAction} body */ export const getIsActionMsg = (body: LarkUserAction) => { return body?.action; }; /** * 获取Action类型 * @param {LarkUserAction} body * @returns {string} Action类型 */ export const getActionType = (body: LarkUserAction) => { return body?.action?.tag; };