feat: 打印message
Some checks failed
Egg CI/CD / deploy (push) Blocked by required conditions
Egg CI/CD / build-image (push) Has been cancelled

This commit is contained in:
zhaoyingbo 2024-05-17 12:52:19 +00:00
parent 38b8fc61ba
commit 7ea2e66d05

View File

@ -16,9 +16,9 @@ export const getMsgText = (body: LarkMessageEvent) => {
);
// 去掉@_user_1相关的内容例如 '@_user_1 测试' -> '测试'
const textWithoutAt = text.replace(/@_user_\d+/g, "");
// 去除空格和换行
const textWithoutSpace = textWithoutAt.replace(/[\s\n]/g, "");
return textWithoutSpace;
// // 去除空格和换行
// const textWithoutSpace = textWithoutAt.replace(/[\s\n]/g, "");
return textWithoutAt;
} catch (e) {
return "";
}
@ -64,6 +64,7 @@ const filterIllegalMsg = (body: LarkMessageEvent) => {
const manageCMDMsg = async (body: LarkMessageEvent) => {
const text = getMsgText(body);
console.log("🚀 ~ manageCMDMsg ~ text:", text);
const chatId = getChatId(body);
let msgContent = "";
if (text === "/id") {