mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 20:03:13 +08:00
fix(adapters): drop HEIC mime, align Telegram error text, inline extractText
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user