调价后的新价格写入报价单;多段段前的货物带到各段,协同群不再把体积里的星号吃掉。海运字段齐了先核对再查价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,8 +15,17 @@ function pickReplyReqId({ fromCaller, fromChat, lastAny }) {
|
||||
return String(lastAny || "").trim();
|
||||
}
|
||||
|
||||
// 含星号的尺寸或箱量。已在行内代码里的整段跳过,避免套两层。
|
||||
const STAR_TOKEN = /`[^`]*`|([A-Za-z0-9.]+(?:\s*\*\s*[A-Za-z0-9.]+)+)/g;
|
||||
|
||||
function showLiteralAsterisks(text) {
|
||||
// 企微 markdown 会吃掉星号:1.1*2.1*2.1 显示成 1.12.12.1。
|
||||
// 放进行内代码后,群里仍是星号。智能体若已经套过,这里不再套第二层。
|
||||
return String(text || "").replace(STAR_TOKEN, (full, token) => (token ? "`" + token + "`" : full));
|
||||
}
|
||||
|
||||
function buildGroupMessageFrame({ chatId, content, callbackReqId, reqId }) {
|
||||
const text = String(content || "");
|
||||
const text = showLiteralAsterisks(String(content || ""));
|
||||
const markdown = { content: text };
|
||||
if (callbackReqId) {
|
||||
return {
|
||||
@@ -42,4 +51,4 @@ function buildGroupMessageFrame({ chatId, content, callbackReqId, reqId }) {
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { buildGroupMessageFrame, pickReplyReqId };
|
||||
module.exports = { buildGroupMessageFrame, pickReplyReqId, showLiteralAsterisks };
|
||||
|
||||
Reference in New Issue
Block a user