MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / cleanNickname

Function cleanNickname

packages/parser/src/formats/qq-native-txt.ts:128–131  ·  view source on GitHub ↗

* 清理昵称中的前缀污染 * 例如:【管理员】张三 -> 张三

(nickname: string)

Source from the content-addressed store, hash-verified

126 * 例如:【管理员】张三 -> 张三
127 */
128function cleanNickname(nickname: string): string {
129 // 移除开头的【xxx】前缀(可能有多个)
130 return nickname.replace(/^(【[^】]*】\s*)+/, '').trim()
131}
132
133// ==================== 成员信息 ====================
134

Callers 1

parseTxtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected