MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / buildMessageContent

Function buildMessageContent

packages/parser/src/formats/google-chat-takeout.ts:234–248  ·  view source on GitHub ↗
(message: GoogleChatMessage)

Source from the content-addressed store, hash-verified

232}
233
234function 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
250function detectMessageType(message: GoogleChatMessage): MessageType {
251 if (message.text?.trim()) return MessageType.TEXT

Callers 1

parseGoogleChatFunction · 0.85

Calls 2

buildQuotePrefixFunction · 0.85
getAttachmentNameFunction · 0.85

Tested by

no test coverage detected