// Simplified mention handling for Qiaoqiao export type MentionTarget = { id: string; name: string; type: "user" | "chat"; }; export function extractMentionTargets(mentions: any): MentionTarget[] { // Simple implementation - can be expanded later if (!mentions || !Array.isArray(mentions)) return []; return mentions.map((m: any) => ({ id: m.id?.open_id || m.id?.user_id || m.id, name: m.name || "Unknown", type: "user" as const, })); } export function extractMessageBody(content: string, mentionKeys: string[]): string { let body = content; for (const key of mentionKeys) { body = body.replace(new RegExp(`@${key}`, "g"), ""); } return body.trim(); } export function isMentionForwardRequest(content: string): boolean { return content.includes("@forward"); } export function formatMentionForText(target: MentionTarget): string { return `@${target.id}`; } export function formatMentionForCard(target: MentionTarget): any { return { tag: "mention", user_id: target.id, name: target.name, }; } export function formatMentionAllForText(): string { return "@all"; } export function formatMentionAllForCard(): any { return { tag: "mention_all", }; } export function buildMentionedMessage(content: string, mentions: MentionTarget[]): string { return content; } export function buildMentionedCardContent(content: string, mentions: MentionTarget[]): any { return { content: content, mentions: mentions.map(formatMentionForCard), }; }