From 1d675b50a292f3666c123a601a21561299cd01a1 Mon Sep 17 00:00:00 2001 From: Shigma Date: Fri, 10 Jan 2025 15:58:52 +0800 Subject: [PATCH] fix(lark): different `` syntax for post and interactive --- adapters/lark/package.json | 2 +- adapters/lark/src/message.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/adapters/lark/package.json b/adapters/lark/package.json index e76bc8f0..1a0e5bc9 100644 --- a/adapters/lark/package.json +++ b/adapters/lark/package.json @@ -1,7 +1,7 @@ { "name": "@satorijs/adapter-lark", "description": "Lark (飞书) Adapter for Satorijs", - "version": "3.9.4", + "version": "3.9.5", "type": "module", "main": "lib/index.cjs", "types": "lib/index.d.ts", diff --git a/adapters/lark/src/message.ts b/adapters/lark/src/message.ts index 56f9c80f..11845f2f 100644 --- a/adapters/lark/src/message.ts +++ b/adapters/lark/src/message.ts @@ -206,10 +206,18 @@ export class LarkMessageEncoder extends MessageEnco if (type === 'text') { this.textContent += attrs.content } else if (type === 'at') { - if (attrs.type === 'all') { - this.textContent += `${attrs.name ?? '所有人'}` + if (this.card) { + if (attrs.type === 'all') { + this.textContent += `${attrs.name ?? '所有人'}` + } else { + this.textContent += `${attrs.name ?? ''}` + } } else { - this.textContent += `${attrs.name}` + if (attrs.type === 'all') { + this.textContent += `${attrs.name ?? '所有人'}` + } else { + this.textContent += `${attrs.name ?? ''}` + } } } else if (type === 'a') { await this.render(children)