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

Function extractPlatformId

packages/parser/src/formats/utils/telegram-utils.ts:87–91  ·  view source on GitHub ↗
(fromId: string | undefined)

Source from the content-addressed store, hash-verified

85 * 格式:user123456 → 123456
86 */
87export function extractPlatformId(fromId: string | undefined): string {
88 if (!fromId) return 'unknown'
89 // 移除 "user" / "channel" 等前缀,保留数字部分
90 return fromId.replace(/^(user|channel)/, '')
91}
92
93/**
94 * 检测消息类型

Callers 2

parseTelegramSingleFunction · 0.90
parseTelegramFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected