fix(adapters): drop HEIC mime, align Telegram error text, inline extractText

This commit is contained in:
程序员阿江(Relakkes)
2026-04-11 16:19:07 +08:00
parent 30b9370a43
commit 6bcbbc547f
4 changed files with 9 additions and 9 deletions
+2 -7
View File
@@ -767,12 +767,7 @@ async function handleServerMessage(chatId: string, msg: ServerMessage): Promise<
}
}
// ---------- extract message text ----------
function extractText(content: string, msgType: string): string | null {
const { text } = extractInboundPayload(content, msgType)
return text.trim() || null
}
// ---------- message helpers ----------
function isBotMentioned(mentions?: Array<{ id?: { open_id?: string } }>): boolean {
if (!mentions || !botOpenId) return false
@@ -813,7 +808,7 @@ async function handleMessage(data: any): Promise<void> {
if (chatType === 'p2p') {
if (!isAllowedUser('feishu', senderOpenId)) {
// 尝试配对
const pairText = extractText(content, msgType)
const pairText = extractInboundPayload(content, msgType).text.trim() || null
if (pairText) {
const success = tryPair(pairText.trim(), { userId: senderOpenId, displayName: 'Feishu User' }, 'feishu')
if (success) {