MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / handleExport

Method handleExport

search/search.ts:353–364  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

351 }
352
353 private async handleExport(msg: Api.Message) {
354 if (this.config.channelList.length === 0) {
355 await msg.edit({ text: "没有可导出的频道。" });
356 return;
357 }
358 const backupContent = this.config.channelList.map((c) => c.handle).join("\n");
359 const backupFilePath = path.join(process.cwd(), "temp", "so_channels_backup.txt");
360 await fs.mkdir(path.dirname(backupFilePath), { recursive: true });
361 await fs.writeFile(backupFilePath, backupContent);
362 await this.client.sendFile(msg.chatId!, { file: backupFilePath, caption: `✅ 您的频道源已导出。`, replyTo: msg });
363 await fs.unlink(backupFilePath);
364 }
365
366 private async handleImport(msg: Api.Message) {
367 const replied = await safeGetReplyMessage(msg);

Callers 1

handleMethod · 0.95

Calls 1

editMethod · 0.45

Tested by

no test coverage detected