chatccc 0.2.101 → 0.2.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/feishu-api.ts +2 -1
package/package.json
CHANGED
package/src/feishu-api.ts
CHANGED
|
@@ -892,6 +892,7 @@ export async function sendRawCard(
|
|
|
892
892
|
chatId: string,
|
|
893
893
|
cardJson: string
|
|
894
894
|
): Promise<boolean> {
|
|
895
|
+
const safeJson = applyPrivacy(cardJson);
|
|
895
896
|
try {
|
|
896
897
|
const resp = await fetch(`${BASE_URL}/im/v1/messages?receive_id_type=chat_id`, {
|
|
897
898
|
method: "POST",
|
|
@@ -899,7 +900,7 @@ export async function sendRawCard(
|
|
|
899
900
|
Authorization: `Bearer ${token}`,
|
|
900
901
|
"Content-Type": "application/json",
|
|
901
902
|
},
|
|
902
|
-
body: JSON.stringify({ receive_id: chatId, msg_type: "interactive", content:
|
|
903
|
+
body: JSON.stringify({ receive_id: chatId, msg_type: "interactive", content: safeJson }),
|
|
903
904
|
});
|
|
904
905
|
const data = (await resp.json().catch(() => ({}))) as { code: number; msg?: string; data?: { message_id?: string } };
|
|
905
906
|
if (data.code !== 0) {
|