* 从文件名提取群名 * 返回不含扩展名的文件名
(filePath: string)
| 39 | * 返回不含扩展名的文件名 |
| 40 | */ |
| 41 | function extractNameFromFilePath(filePath: string): string { |
| 42 | const basename = path.basename(filePath) |
| 43 | // 移除 .json 扩展名 |
| 44 | const name = basename.replace(/\.json$/i, '') |
| 45 | return name || '未知群聊' |
| 46 | } |
| 47 | |
| 48 | // ==================== 特征定义 ==================== |
| 49 |