refactor(feishu): remove unused send helpers

This commit is contained in:
Vincent Koc
2026-06-18 11:02:00 +08:00
parent 4012edcd66
commit b4e5aa18b3
3 changed files with 0 additions and 50 deletions

View File

@@ -53,12 +53,6 @@ export class FeishuSecretRefUnavailableError extends Error {
}
}
export function isFeishuSecretRefUnavailableError(
error: unknown,
): error is FeishuSecretRefUnavailableError {
return error instanceof FeishuSecretRefUnavailableError;
}
function resolveFeishuSecretLike(params: {
value: unknown;
path: string;

View File

@@ -76,13 +76,6 @@ export function isMentionForwardRequest(event: FeishuMessageEvent, botOpenId?: s
return hasBotMention && hasOtherMention;
}
/**
* Format @mention for text message
*/
function formatMentionForText(target: MentionTarget): string {
return `<at user_id="${target.openId}">${target.name}</at>`;
}
/**
* Format @mention for card message (lark_md)
*/
@@ -90,18 +83,6 @@ function formatMentionForCard(target: MentionTarget): string {
return `<at id=${target.openId}></at>`;
}
/**
* Build complete message with @mentions (text format)
*/
export function buildMentionedMessage(targets: MentionTarget[], message: string): string {
if (targets.length === 0) {
return message;
}
const mentionParts = targets.map((t) => formatMentionForText(t));
return `${mentionParts.join(" ")} ${message}`;
}
/**
* Build card content with @mentions (Markdown format)
*/

View File

@@ -715,31 +715,6 @@ export async function editMessageFeishu(params: {
return { messageId, contentType: "post" };
}
export async function updateCardFeishu(params: {
cfg: ClawdbotConfig;
messageId: string;
card: Record<string, unknown>;
accountId?: string;
}): Promise<void> {
const { cfg, messageId, card, accountId } = params;
const account = resolveFeishuRuntimeAccount({ cfg, accountId });
if (!account.configured) {
throw new Error(`Feishu account "${account.accountId}" not configured`);
}
const client = createFeishuClient(account);
const content = JSON.stringify(card);
const response = await client.im.message.patch({
path: { message_id: messageId },
data: { content },
});
if (response.code !== 0) {
throw new Error(`Feishu card update failed: ${response.msg || `code ${response.code}`}`);
}
}
/**
* Build a Feishu interactive card with markdown content.
* Cards render markdown properly (code blocks, tables, links, etc.)