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

Method sendVideo

search/search.ts:584–595  ·  view source on GitHub ↗
(originalMsg: Api.Message, video: Api.Message, useSpoiler: boolean, caption?: string | null)

Source from the content-addressed store, hash-verified

582 }
583
584 private async sendVideo(originalMsg: Api.Message, video: Api.Message, useSpoiler: boolean, caption?: string | null) {
585 if (useSpoiler) {
586 await this.downloadAndUploadVideo(originalMsg, video, true, caption);
587 } else {
588 try {
589 await this.client.forwardMessages(originalMsg.peerId, { messages: [video.id], fromPeer: video.peerId });
590 } catch (forwardError: any) {
591 console.log(`转发失败,自动转为下载上传: ${forwardError.message}`);
592 await this.downloadAndUploadVideo(originalMsg, video, false, caption);
593 }
594 }
595 }
596
597 private async downloadAndUploadVideo(originalMsg: Api.Message, video: Api.Message, spoiler: boolean = false, caption?: string | null): Promise<void> {
598 const tempDir = path.join(process.cwd(), "temp");

Callers 1

findAndSendVideoMethod · 0.95

Calls 1

Tested by

no test coverage detected