| 329 | clear: `📖 <b>清理缓存命令帮助</b>\n\n<code>${mainPrefix}fadian clear</code> - 清理本地缓存并重新下载配置文件`, |
| 330 | }; |
| 331 | |
| 332 | const helpText = helpTexts[subCmd] || help_text; |
| 333 | await msg.edit({ text: helpText, parseMode: "html" }); |
| 334 | } |
| 335 | |
| 336 | private async clearCache(msg: Api.Message): Promise<void> { |
| 337 | try { |
| 338 | await msg.edit({ text: "🔄 清理缓存中...", parseMode: "html" }); |
| 339 | |
| 340 | // 清理本地缓存目录 |
| 341 | if (fs.existsSync(ASSET_PATH)) { |
| 342 | fs.rmSync(ASSET_PATH, { recursive: true, force: true }); |
| 343 | } |
| 344 | // 清理内存缓存 |
| 345 | configCache = {}; |
| 346 | lastUpdateCheck = 0; |
| 347 | |
| 348 | await msg.edit({ |
| 349 | text: "🧹 已清理缓存,下次使用时将重新下载配置", |