MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / sendFileSafe

Method sendFileSafe

src/runtime/adapters/telegram.ts:422–440  ·  view source on GitHub ↗

* Send a file to the Telegram chat.

(
    chatId: number,
    filePath: string,
    caption?: string,
  )

Source from the content-addressed store, hash-verified

420 * Send a file to the Telegram chat.
421 */
422 private async sendFileSafe(
423 chatId: number,
424 filePath: string,
425 caption?: string,
426 ): Promise<void> {
427 if (!this.bot) return;
428
429 try {
430 if (!fs.existsSync(filePath)) {
431 console.error(`[Telegram] File not found for sending: ${filePath}`);
432 return;
433 }
434 await this.bot.sendDocument(chatId, filePath, {
435 caption: caption || undefined,
436 });
437 } catch (err) {
438 console.error("[Telegram] Failed to send file:", err);
439 }
440 }
441}

Callers 1

handleTelegramMessageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected