Skip to content

feat: add voice message transcription support - #110

Open
kky wants to merge 12 commits into
nanocoai:mainfrom
kky:main
Open

feat: add voice message transcription support#110
kky wants to merge 12 commits into
nanocoai:mainfrom
kky:main

Conversation

@kky

@kky kky commented Mar 22, 2026

Copy link
Copy Markdown

Summary

  • Telegram voice messages are now downloaded and transcribed when the /add-transcription skill is installed
  • Uses dynamic import('../transcription.js') — no compile-time dependency on the transcription module
  • Falls back gracefully with a helpful message when transcription is not available
  • Agent responses to voice messages begin with "You said: "

How it works

  • The message:voice handler downloads the audio file via Telegram Bot API (ctx.getFile() + file URL)
  • Dynamically imports transcribe() from src/transcription.ts (installed via /add-transcription)
  • If the module is missing (MODULE_NOT_FOUND), delivers a placeholder message suggesting the user run /add-transcription
  • If transcription fails at runtime, delivers a failure message
  • Uses @ts-ignore on the dynamic import since the module is optional

Tests

  • Test for graceful fallback when transcription skill is not installed
  • Test for successful transcription when skill is available (skips automatically when module not present)
  • All existing telegram tests continue to pass

How it was tested

  • Multiple clean install tests: fresh clone → add telegram → verify text works → add transcription → verify voice transcription works
  • Tested with both local whisper.cpp and OpenAI Whisper API backends
  • Tested on Linux (Ubuntu, aarch64)

kky and others added 12 commits March 21, 2026 16:53
Supports local whisper.cpp and OpenAI Whisper API backends.
Channels dynamically import transcribe() — no channel-specific dependencies.
Downloads and transcribes Telegram voice messages using the transcription
skill if installed. Falls back gracefully with a helpful message when
the skill is not present.
…for optional transcription import

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… add type annotations

The transcription skill merge resolved package.json conflicts with --theirs,
which dropped grammy. Updated the add-transcription SKILL.md to warn against
this pattern. Also added explicit `any` type annotations to telegram.ts
callbacks to fix strict-mode TS errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kky
kky requested a review from gavrielc as a code owner March 22, 2026 03:36
@gavrielc
gavrielc requested a review from gabi-simons as a code owner April 2, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant