(message: GoogleChatMessage)
| 232 | } |
| 233 | |
| 234 | function buildMessageContent(message: GoogleChatMessage): string { |
| 235 | const parts: string[] = [] |
| 236 | const quote = buildQuotePrefix(message) |
| 237 | if (quote) parts.push(quote) |
| 238 | |
| 239 | const text = message.text?.trim() |
| 240 | if (text) parts.push(text) |
| 241 | |
| 242 | for (const attachment of message.attached_files ?? []) { |
| 243 | const name = getAttachmentName(attachment) |
| 244 | if (name) parts.push(`[附件] ${name}`) |
| 245 | } |
| 246 | |
| 247 | return parts.length > 0 ? parts.join('\n') : '[不支持的 Google Chat 消息]' |
| 248 | } |
| 249 | |
| 250 | function detectMessageType(message: GoogleChatMessage): MessageType { |
| 251 | if (message.text?.trim()) return MessageType.TEXT |
no test coverage detected